mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-08-26 18:42:49 +00:00
Adding ticket generation and booking for staff employees logic
This commit is contained in:
@@ -24,9 +24,9 @@ test("BC-11 ✅ travelMinutesToStop drives each stop's estimated arrival indepen
|
||||
name: "E2E Check-in Cutoff Route",
|
||||
effectiveFrom: "2020-01-01T00:00:00Z",
|
||||
stops: [
|
||||
{ stationId: STATIONS.A, sequence: 1 },
|
||||
{ stationId: STATIONS.B, sequence: 2, travelMinutesToStop: 60 },
|
||||
{ stationId: STATIONS.C, sequence: 3, travelMinutesToStop: 40 },
|
||||
{ stationId: STATIONS.A, sequence: 1, distanceKm: 0 },
|
||||
{ stationId: STATIONS.B, sequence: 2, travelMinutesToStop: 60, distanceKm: 60 },
|
||||
{ stationId: STATIONS.C, sequence: 3, travelMinutesToStop: 40, distanceKm: 100 },
|
||||
],
|
||||
},
|
||||
});
|
||||
|
||||
@@ -71,7 +71,15 @@ test("BC-10 ✅ a schedule with a past departure is rejected by the API (past-da
|
||||
const arr = new Date(dep.getTime() + 4 * 3600e3);
|
||||
const okRes = await request.post(`${API_URL}/schedules`, {
|
||||
headers: auth(),
|
||||
data: { trainId: UI_IDS.train, routeId: ROUTE_ID, departureAt: dep.toISOString(), arrivalAt: arr.toISOString() },
|
||||
// ROUTE_ID has no route coach template, so createSchedule needs an explicit coach or it 400s
|
||||
// on the "zero coaches assigned" guard (see schedules.service.ts).
|
||||
data: {
|
||||
trainId: UI_IDS.train,
|
||||
routeId: ROUTE_ID,
|
||||
departureAt: dep.toISOString(),
|
||||
arrivalAt: arr.toISOString(),
|
||||
coachIds: [UI_IDS.coach],
|
||||
},
|
||||
});
|
||||
expect(okRes.ok()).toBeTruthy();
|
||||
const sched = (await okRes.json())?.data ?? {};
|
||||
|
||||
Reference in New Issue
Block a user