Bus Alerts
Closed this issue · 0 comments
Goal
This feature will allow users to view all active alerts for the TCAT bus service. We will add a button in the About Us view that shows all active alerts (third screenshot). On the Route Options page, if any routes are affected by an active alert, we will show an indication on this page (views still in progress). The endpoint is written and active, see the copied specs below.
Tasks
Integrate with /alerts endpoint.
Some of the specs are vague, so please update the README on ithaca-transit-backend if possible.
Note: They may not currently be any active messages. If so, do your best to imitate the endpoint form and create dummy data.
- Completed
Create BusAlertsViewController to show alerts
This will be accessible from the InformationViewController. It should push in the navigation controller.
- Completed
Add logic to scan through available routes to see if any are affected by active alerts.
There may be the potential issue of an alert saying a certain route is out of service. Our backend will automatically suggest different routes, and they won't appear in the available routes. This means we technically can't catch when an active alert is affecting the results. We could potentially scan through the alert message to see if any route numbers appear, but this isn't ideal. We just may not be able to catch this scenario, but worth thinking about.
- Completed
Create view to indicate active bus warnings.
- Completed
Current Designs
Initial Concepts. To be finalized on Zeplin soon.
Endpoint
Copied from backend's README. Update any helpful changes you can make on their repo!
/alerts • (GET)
Description: Return a list of official TCAT alerts/messages. A list should be included in the app, and periodically updated every so often. All fields are optional.
The date, time, and daysOfWeek fields can specify an alert that takes place for example from 10 pm March 4 (fromDate) to 12 pm April 10 (toDate) on Weekdays (daysOfWeek) from 1 pm (fromTime) to 11 pm (toTime).
Returns: [Alert]
class Alert
Name | Type | Description |
---|---|---|
id | Int | The ID number of the alert. |
message | String | The message of the alert. |
fromDate | String | The first date that the alert begins taking effect. UTC-formatted date string (e.g. “2018-04-10T04:00:00.000Z”) |
toDate | String | The last date that the alert begins taking effect. UTC-formatted date string (e.g. “2018-04-10T04:00:00.000Z”) |
fromTime | String | The start time during the date range that the alert is in effect. UTC-formatted date string (e.g. “2018-04-10T04:00:00.000Z”) |
toTime | String | The start time during the date range that the alert is in effect. UTC-formatted date string (e.g. “2018-04-10T04:00:00.000Z”) |
priority | Int | Priority of the alert, from 0 (highest) to 3 (lowest). Potential Return Values: [0, 1, 2, 3] |
daysOfWeek | String | A String enum representing a day of the week: Potential Return Values: ["Every day”, “Weekend”, “Weekdays”, “Monday”, “Tuesday”, “Wednesday”, “Thursday”, “Friday”, “Saturday”, “Sunday”, “”] |
routes | [Int] | A list of route numbers affected by alert. |
signs | [Int] | A list of ??? affected by the alert. |
channelMessages | [{ ChannelId: Int? Message: String? }] | A list of ChannelMessage objects. Improve description. |