Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app/apple_fetch.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def json(self):


class AppleLocation(BaseModel):
date_published: int = Field(alias="datePublished")
date_published: int | None = Field(default=None, alias="datePublished")
payload: str
description: str
id: str
Expand Down
2 changes: 1 addition & 1 deletion app/dtos.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class Report(BaseModel):
class EnrichedReport(Report):
device_id: str
timestamp: int
date_published: int
date_published: int | None = None
description: str


Expand Down
2 changes: 1 addition & 1 deletion app/report.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ def create_reports(locations: list[AppleLocation], devices: list[BeamerDevice]):
**report.model_dump(),
device_id=device.id,
timestamp=timestamp,
date_published=location.date_published,
date_published=location.date_published if location.date_published is not None else timestamp,
description=location.description,
)
device.report = enriched_report
Expand Down
Loading