mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-08-30 06:28:12 +00:00
Passenger report updates
This commit is contained in:
@@ -311,7 +311,17 @@ export class ReportsService {
|
||||
booking: { status: { in: ['CONFIRMED', 'BOARDED'] } },
|
||||
},
|
||||
include: {
|
||||
booking: { select: { bookingRef: true, status: true, originStationId: true, destinationStationId: true } },
|
||||
booking: {
|
||||
select: {
|
||||
bookingRef: true,
|
||||
status: true,
|
||||
originStationId: true,
|
||||
destinationStationId: true,
|
||||
totalMinor: true,
|
||||
currency: true,
|
||||
_count: { select: { seats: true } },
|
||||
},
|
||||
},
|
||||
seat: { include: { coach: { select: { number: true, coachType: { select: { name: true } } } } } },
|
||||
},
|
||||
orderBy: [{ seat: { coach: { number: 'asc' } } }],
|
||||
@@ -339,6 +349,9 @@ export class ReportsService {
|
||||
coachType: (bs.seat?.coach as any)?.coachType?.name ?? null,
|
||||
origin: bs.booking.originStationId ? (stationMap.get(bs.booking.originStationId) ?? null) : null,
|
||||
destination: bs.booking.destinationStationId ? (stationMap.get(bs.booking.destinationStationId) ?? null) : null,
|
||||
amountPaidMinor: bs.booking.totalMinor,
|
||||
currency: bs.booking.currency ?? 'ETB',
|
||||
isGroupBooking: (bs.booking._count?.seats ?? 0) > 1,
|
||||
}));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user