Expose SiteEvent status in Event list API call
At the moment the Event list API call (/api/v1/events/
) returns a list of SiteID integers for each Event. We need to expose the SiteEvent status so that the Hub will know whether a user opted out of an event.
Simplest way to do this is to change the output from a list of ints to a list of dicts.
i.e. from
{
"id": 235,
"program_id": 6,
"scheduled_notification_time": "2020-07-14T16:56:03Z",
"start": "2020-07-21T02:30:00Z",
"end": "2020-07-21T03:30:00Z",
"status": "far",
"sites": [
167,
170
]
}
to:
{
"id": 235,
"program_id": 6,
"scheduled_notification_time": "2020-07-14T16:56:03Z",
"start": "2020-07-21T02:30:00Z",
"end": "2020-07-21T03:30:00Z",
"status": "far",
"sites": [
{ "id": 167, "status": "completed"}
{ "id": 170, "status": "cancelled"}
]
}