mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-08-26 18:42:49 +00:00
@@ -95,7 +95,7 @@ export class ReportsService {
|
||||
where: { departureAt: { gte: dateFrom, lte: dateTo } },
|
||||
include: {
|
||||
coachAssignments: { include: { coach: { include: { seats: true } } } },
|
||||
bookings: { include: { seats: true } },
|
||||
bookings: { include: { seats: { where: { scheduleId: schedule.id } } } },
|
||||
},
|
||||
});
|
||||
|
||||
@@ -212,6 +212,7 @@ export class ReportsService {
|
||||
where: { status: { in: ['CONFIRMED', 'BOARDED'] } },
|
||||
include: {
|
||||
seats: {
|
||||
where: { scheduleId },
|
||||
include: {
|
||||
seat: { include: { coach: { include: { coachType: true } } } },
|
||||
},
|
||||
|
||||
@@ -9,10 +9,7 @@ import { formatDateTime } from '@/lib/utils';
|
||||
|
||||
interface ScheduleOption { id: string; label: string; }
|
||||
|
||||
interface ScheduleOption { id: string; label: string; }
|
||||
|
||||
interface PassengersReport {
|
||||
schedule: { id: string; trainName: string; origin: string; destination: string; departureAt: string; arrivalAt: string; };
|
||||
schedule: { id: string; trainName: string; origin: string; destination: string; departureAt: string; arrivalAt: string; };
|
||||
summary: { totalSeats: number; totalPassengers: number; occupancyRate: number };
|
||||
byCoach: { coachNumber: string; coachType: string; totalSeats: number; booked: number; occupancyRate: number }[];
|
||||
|
||||
Reference in New Issue
Block a user