Skip to content
Closed
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
Aggregate pattern applied to Location class
Modified the location class and added an update class to reflect changes in updates.
  • Loading branch information
IrvinTan authored Jul 25, 2021
commit 5250a28ea9f2d06d18cdb2f5073973994cb6e28b
8 changes: 5 additions & 3 deletions app/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,7 @@ class Location(BaseModel):
country_population: int = None
province: str = ""
county: str = ""
last_updated: str # TODO use datetime.datetime type.
coordinates: Dict
latest: Latest
timelines: Timelines = {}


class LocationResponse(BaseModel):
Expand All @@ -90,3 +87,8 @@ class LocationsResponse(BaseModel):

latest: Latest
locations: List[Location] = []

class Updated(BaseModel):
last_updated: str # TODO use datetime.datetime type.
latest: Latest
timelines: Timelines = {}