diff --git a/pkg/ctdf/servicealert.go b/pkg/ctdf/servicealert.go index 45bbcb10..d6315831 100644 --- a/pkg/ctdf/servicealert.go +++ b/pkg/ctdf/servicealert.go @@ -25,12 +25,15 @@ type ServiceAlert struct { type ServiceAlertType string const ( - ServiceAlertTypeInformation ServiceAlertType = "Information" - ServiceAlertTypeWarning = "Warning" - ServiceAlertTypeStopClosed = "StopClosed" - ServiceAlertTypeServiceSuspended = "ServiceSuspended" - ServiceAlertTypeDisruption = "Disruption" - ServiceAlertTypePlanned = "Planned" + ServiceAlertTypeInformation ServiceAlertType = "Information" + ServiceAlertTypeWarning = "Warning" + ServiceAlertTypeStopClosed = "StopClosed" + ServiceAlertTypeServiceSuspended = "ServiceSuspended" + ServiceAlertTypeServicePartSuspended = "ServicePartSuspended" + ServiceAlertTypeSeverDelays = "SeverDelays" + ServiceAlertTypeDelays = "Delays" + ServiceAlertTypeMinorDelays = "MinorDelays" + ServiceAlertTypePlanned = "Planned" ) func (a *ServiceAlert) IsValid(checkTime time.Time) bool { diff --git a/pkg/realtime/tflarrivals/modedisruptiontracker.go b/pkg/realtime/tflarrivals/modedisruptiontracker.go index 27807f98..f96f62b4 100644 --- a/pkg/realtime/tflarrivals/modedisruptiontracker.go +++ b/pkg/realtime/tflarrivals/modedisruptiontracker.go @@ -253,10 +253,16 @@ func (d *ModeDisruptionTracker) GetLineStatuses() { var serviceAlertType ctdf.ServiceAlertType switch lineStatusUpdate.StatusSeverityDescription { - case "Closed", "Suspended", "Part Suspended", "Part Closure", "Planned Closure", "Part Closed", "Service Closed": + case "Closed", "Suspended", "Planned Closure", "Service Closed": serviceAlertType = ctdf.ServiceAlertTypeServiceSuspended - case "Severe Delays", "Reduced Service", "Minor Delays": - serviceAlertType = ctdf.ServiceAlertTypeDisruption + case "Part Suspended", "Part Closure", "Part Closed": + serviceAlertType = ctdf.ServiceAlertTypeServicePartSuspended + case "Severe Delays": + serviceAlertType = ctdf.ServiceAlertTypeSeverDelays + case "Reduced Service": + serviceAlertType = ctdf.ServiceAlertTypeDelays + case "Minor Delays": + serviceAlertType = ctdf.ServiceAlertTypeMinorDelays case "Bus Service", "Exit Only", "Change of frequency", "Diverted", "Not Running", "Issues Reported": serviceAlertType = ctdf.ServiceAlertTypeWarning case "No Step Free Access", "Information":