mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-09-07 13:05:44 +00:00
@@ -95,7 +95,7 @@ export class ReportsService {
|
|||||||
where: { departureAt: { gte: dateFrom, lte: dateTo } },
|
where: { departureAt: { gte: dateFrom, lte: dateTo } },
|
||||||
include: {
|
include: {
|
||||||
coachAssignments: { include: { coach: { include: { seats: true } } } },
|
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'] } },
|
where: { status: { in: ['CONFIRMED', 'BOARDED'] } },
|
||||||
include: {
|
include: {
|
||||||
seats: {
|
seats: {
|
||||||
|
where: { scheduleId },
|
||||||
include: {
|
include: {
|
||||||
seat: { include: { coach: { include: { coachType: true } } } },
|
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 ScheduleOption { id: string; label: string; }
|
|
||||||
|
|
||||||
interface PassengersReport {
|
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; };
|
schedule: { id: string; trainName: string; origin: string; destination: string; departureAt: string; arrivalAt: string; };
|
||||||
summary: { totalSeats: number; totalPassengers: number; occupancyRate: number };
|
summary: { totalSeats: number; totalPassengers: number; occupancyRate: number };
|
||||||
byCoach: { coachNumber: string; coachType: string; totalSeats: number; booked: number; occupancyRate: number }[];
|
byCoach: { coachNumber: string; coachType: string; totalSeats: number; booked: number; occupancyRate: number }[];
|
||||||
|
|||||||
Reference in New Issue
Block a user