Handle travaux
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
nemunaire 2024-03-15 12:51:19 +01:00
parent a4f0dfe82d
commit f1fdfd7100

View File

@ -118,30 +118,35 @@ func declareTrafficRoutes(router *gin.RouterGroup) {
}
}
icr := effectGradation(disruption.Severity.Effect)
if icr > slug {
slug = icr
switch disruption.Severity.Effect {
case navitia.JourneyStatusUnknownEffect:
pgt.Slug = "critique"
case navitia.EffectNoService:
pgt.Slug = "critique"
case navitia.JourneyStatusReducedService:
pgt.Slug = "alerte"
case navitia.JourneyStatusSignificantDelay:
pgt.Slug = "alerte"
case navitia.JourneyStatusDetour:
pgt.Slug = "normal_trav"
case navitia.JourneyStatusAdditionalService:
pgt.Slug = "normal_trav"
case navitia.JourneyStatusOtherEffect:
pgt.Slug = "normal_trav"
case navitia.JourneyStatusStopMoved:
pgt.Slug = "normal_trav"
default:
pgt.Slug = "normal"
if disruption.Cause == "travaux" {
pgt.Slug = "normal_trav"
} else {
icr := effectGradation(disruption.Severity.Effect)
if icr > slug {
slug = icr
switch disruption.Severity.Effect {
case navitia.JourneyStatusUnknownEffect:
pgt.Slug = "critique"
case navitia.EffectNoService:
pgt.Slug = "critique"
case navitia.JourneyStatusReducedService:
pgt.Slug = "alerte"
case navitia.JourneyStatusSignificantDelay:
pgt.Slug = "alerte"
case navitia.JourneyStatusDetour:
pgt.Slug = "alerte"
case navitia.JourneyStatusAdditionalService:
pgt.Slug = "alerte"
case navitia.JourneyStatusOtherEffect:
pgt.Slug = "alerte"
case navitia.JourneyStatusStopMoved:
pgt.Slug = "alerte"
default:
pgt.Slug = "normal"
}
}
}
}
if pgt.Title == "" {