From 5250a28ea9f2d06d18cdb2f5073973994cb6e28b Mon Sep 17 00:00:00 2001 From: IrvinTan <73722805+IrvinTan@users.noreply.github.com> Date: Sat, 24 Jul 2021 22:17:59 -0400 Subject: [PATCH] Aggregate pattern applied to Location class Modified the location class and added an update class to reflect changes in updates. --- app/models.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/app/models.py b/app/models.py index 497a4b83..c5d43207 100644 --- a/app/models.py +++ b/app/models.py @@ -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): @@ -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 = {}