Adding ticket generation and booking for staff employees logic

This commit is contained in:
Muluhabt
2026-07-25 11:20:47 +03:00
parent 7320c359d1
commit 2a0fd9bda5
29 changed files with 2659 additions and 74 deletions

View File

@@ -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 ?? {};