Skip to content

Commit

Permalink
Extend notifications to include behovsanlop. (#320)
Browse files Browse the repository at this point in the history
  • Loading branch information
jonasbrunvoll authored Aug 14, 2024
1 parent 11f12cd commit 94660fd
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/page-modules/assistant/server/journey-planner/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -397,6 +397,11 @@ export function createJourneyApi(
: {}),
}
: null,
toEstimatedCall: leg.toEstimatedCall?.notices.length
? {
notices: mapAndFilterNotices(leg.toEstimatedCall.notices),
}
: null,

interchangeTo: leg.interchangeTo?.toServiceJourney?.id
? {
Expand All @@ -415,6 +420,7 @@ export function createJourneyApi(
...(leg.serviceJourney?.notices || []),
...(leg.serviceJourney?.journeyPattern?.notices || []),
...(leg.fromEstimatedCall?.notices || []),
...(leg.toEstimatedCall?.notices || []),
]),
situations: mapSituations(leg.situations),
serviceJourneyEstimatedCalls: leg.serviceJourneyEstimatedCalls.map(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,11 @@ query TripsWithDetails(
}
cancellation
}
toEstimatedCall {
notices {
...notice
}
}
interchangeTo {
guaranteed
maximumWaitTime
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,11 @@ query ViaTripsWithDetails(
}
cancellation
}
toEstimatedCall {
notices {
...notice
}
}
interchangeTo {
guaranteed
maximumWaitTime
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,11 @@ export const tripPatternWithDetailsSchema = z.object({
cancellation: z.boolean(),
})
.nullable(),
toEstimatedCall: z
.object({
notices: z.array(noticeSchema),
})
.nullable(),
interchangeTo: z
.object({
guaranteed: z.boolean(),
Expand Down

0 comments on commit 94660fd

Please sign in to comment.