Skip to content

Commit 127d290

Browse files
committed
Add another timetable for a route in seed2
So it is possible to create conflicts, when trying to make two timetables of same route be valid at same time.
1 parent d1902e7 commit 127d290

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

test-db-manager/src/seed2.ts

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,14 @@ const seedDb = async () => {
4949
stopLabels: reverse(stopLabels),
5050
});
5151

52+
// route 641, direction 1, for next year
53+
const jp3 = 'f39b556c-e1bf-4a4f-a757-6845c72768df';
54+
const jpRef3 = buildJourneyPatternRefDeep(jp3, {
55+
journeyPatternRefBase: { type_of_line: 'stopping_bus_service' },
56+
stopBase: {},
57+
stopLabels,
58+
});
59+
5260
const blockBase = {
5361
vehicle_type_id: vehicleTypes[0].vehicle_type_id,
5462
};
@@ -108,11 +116,31 @@ const seedDb = async () => {
108116
},
109117
});
110118

119+
const vsf3 = buildVehicleScheduleFrameDeep({
120+
vehicleScheduleFrameBase: {
121+
label: '641 next year',
122+
priority: Priority.Standard,
123+
validity_start: DateTime.now().plus({ year: 1 }).startOf('year'),
124+
validity_end: DateTime.now().plus({ year: 1 }).endOf('year'),
125+
},
126+
vehicleServiceByDayType: {
127+
[MON_FRI_DAY_TYPE]: {
128+
...defaultVehicleServiceByDayTypeParams,
129+
journeyPatternRefList: [jpRef3],
130+
startTime: Duration.fromISO('PT5H15M'),
131+
hastusStopLabels,
132+
blockBase,
133+
},
134+
},
135+
});
136+
111137
const timetablesResources = mergeTimetablesResources([
112138
flattenJourneyPatternRef(jpRef1),
113139
flattenJourneyPatternRef(jpRef2),
140+
flattenJourneyPatternRef(jpRef3),
114141
flattenVehicleScheduleFrame(vsf1),
115142
flattenVehicleScheduleFrame(vsf2),
143+
flattenVehicleScheduleFrame(vsf3),
116144
]);
117145

118146
await seedTimetables(timetablesResources);

0 commit comments

Comments
 (0)