diff --git a/apps/edr-passenger-api/prisma/seed.ts b/apps/edr-passenger-api/prisma/seed.ts index 9aff71529..f29815996 100644 --- a/apps/edr-passenger-api/prisma/seed.ts +++ b/apps/edr-passenger-api/prisma/seed.ts @@ -311,31 +311,12 @@ async function seedTrips() { }); } - // Stop times: one TripStopTime per station per schedule - const stationCodes = ['SBT', 'LEB', 'BSH', 'MOJ', 'ADM', 'MTE', 'MIS', 'BIK', 'DRE', 'ADG', 'AYS', 'DAW', 'ALS', 'HOL', 'NAG']; - const stopTimeRows = []; - for (const schedule of createdSchedules) { - const dep = new Date(schedule.departureAt); - for (let i = 0; i < stationCodes.length; i++) { - const stationId = `station-${stationCodes[i].toLowerCase()}`; - const offsetMs = i * 60 * 60 * 1000; // ~1 hour between stops - stopTimeRows.push({ - scheduleId: schedule.id, - stationId, - sequence: i + 1, - plannedArrivalAt: i === 0 ? null : new Date(dep.getTime() + offsetMs), - plannedDepartureAt: i === stationCodes.length - 1 ? null : new Date(dep.getTime() + offsetMs), - }); - } - } - await Promise.all([ ...coachAssignments.map(ca => prisma.coachAssignment.create({ data: ca })), ...liveStatuses.map(ls => prisma.tripLiveStatus.create({ data: ls })), - prisma.tripStopTime.createMany({ data: stopTimeRows }), ]); - - console.log(` ✅ Train with ${createdSchedules.length} upcoming trips and stop times created`); + + console.log(` ✅ Train with ${createdSchedules.length} upcoming trips created`); } async function seedFareRules() {