Skip to content

Commit

Permalink
Add missing ID on DailyStandUpType->Project
Browse files Browse the repository at this point in the history
  • Loading branch information
thenav56 committed Aug 27, 2024
1 parent 226ebb3 commit 47b537f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
9 changes: 7 additions & 2 deletions apps/standup/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ class DailyStandUpProjectStatUserType:
user_obj: strawberry.Private[User]
date: strawberry.Private[datetime.date]

id: strawberry.ID
id: strawberry.ID # TODO: Use key for auto computed IDs
last_active_date: datetime.date

@strawberry.field(deprecation_reason="Use user.display_picture instead")
Expand All @@ -61,6 +61,7 @@ async def work_from_home(self, info: Info) -> JournalWorkFromHomeTypeEnum | None

@strawberry.type
class DailyStandUpProjectStatType:
id: strawberry.ID
project_obj: strawberry.Private[Project]
date: strawberry.Private[datetime.date]

Expand Down Expand Up @@ -139,4 +140,8 @@ async def quote(self, info: Info) -> QuoteType | None:
async def project_stat(self, info: Info, pk: strawberry.ID) -> DailyStandUpProjectStatType | None:
project = await ProjectType.get_queryset(None, None, info).filter(pk=pk).afirst()
if project:
return DailyStandUpProjectStatType(project_obj=project, date=self.date)
return DailyStandUpProjectStatType(
id=strawberry.ID(f"{project.pk}-{self.date.isoformat()}"),
project_obj=project,
date=self.date,
)
1 change: 1 addition & 0 deletions schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,7 @@ type ContractorTypeCountList {
scalar CustomErrorType

type DailyStandUpProjectStatType {
id: ID!
lastWorkingDate: Date!
activityFromDate: Date!
project: ProjectType!
Expand Down

0 comments on commit 47b537f

Please sign in to comment.