Skip to content

Commit

Permalink
don't offer dates for recipe history, only timestamps
Browse files Browse the repository at this point in the history
  • Loading branch information
barneyb committed Jun 10, 2024
1 parent e29448a commit 48b90b4
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,26 +4,17 @@
import graphql.kickstart.tools.GraphQLResolver;
import org.springframework.stereotype.Component;

import java.time.LocalDate;
import java.time.OffsetDateTime;
import java.time.ZoneOffset;

@Component
public class PlannedRecipeHistoryResolver implements GraphQLResolver<PlannedRecipeHistory> {

public LocalDate plannedDate(PlannedRecipeHistory history) {
return plannedAt(history).toLocalDate();
}

public OffsetDateTime plannedAt(PlannedRecipeHistory history) {
return history.getPlannedAt()
.atOffset(ZoneOffset.UTC);
}

public LocalDate doneDate(PlannedRecipeHistory history) {
return doneAt(history).toLocalDate();
}

public OffsetDateTime doneAt(PlannedRecipeHistory history) {
return history.getDoneAt()
.atOffset(ZoneOffset.UTC);
Expand Down
2 changes: 0 additions & 2 deletions src/main/resources/graphqls/library.graphqls
Original file line number Diff line number Diff line change
Expand Up @@ -197,9 +197,7 @@ type PlannedRecipeHistory implements Node {
owner: User!
status: PlanItemStatus!
plannedAt: DateTime!
plannedDate: Date!
doneAt: DateTime!
doneDate: Date!
rating: Rating
ratingInt: PositiveInt
notes: String
Expand Down

0 comments on commit 48b90b4

Please sign in to comment.