diff --git a/apps/edr-passenger-api/src/modules/reports/reports.controller.ts b/apps/edr-passenger-api/src/modules/reports/reports.controller.ts index 5c1d69c51..a4da5b208 100644 --- a/apps/edr-passenger-api/src/modules/reports/reports.controller.ts +++ b/apps/edr-passenger-api/src/modules/reports/reports.controller.ts @@ -18,8 +18,8 @@ export class ReportsController { return this.service.generateReport(dto); } - @Get('occupancy') - @ApiOperation({ summary: 'Occupancy report for a specific schedule' }) + @Get('passengers') + @ApiOperation({ summary: 'Passengers report for a specific schedule' }) getOccupancyReport(@Query('scheduleId') scheduleId: string) { return this.service.getOccupancyBySchedule(scheduleId); } diff --git a/apps/edr-passenger-web/portal/src/app/booking/seats/page.tsx b/apps/edr-passenger-web/portal/src/app/booking/seats/page.tsx index b38e3aee9..0af9d90bc 100644 --- a/apps/edr-passenger-web/portal/src/app/booking/seats/page.tsx +++ b/apps/edr-passenger-web/portal/src/app/booking/seats/page.tsx @@ -949,10 +949,9 @@ export default function SeatsPage() { return; } - // No fare change — but for package bookings still sync the tier price to the - // actual berth fare (handles the case where the first seat picked matches the - // stored price but we still want it explicitly confirmed). - if (isPackageBooking && packageId && newFare !== packageTierPriceMinor) { + // No fare change — for package bookings still sync the tier price to the + // actual berth fare so the correct amount is always stored. + if (isPackageBooking && packageId) { setPackageContext( packageId, priceTierId ?? '', @@ -962,6 +961,8 @@ export default function SeatsPage() { packageDepartureStationName ?? undefined, ); } + } else if (isPackageBooking && packageId) { + // newFare is null (seat class data unavailable) — leave stored price as-is. } commitSeatAssignment(seatId); diff --git a/apps/edr-passenger-web/portal/src/app/packages/[id]/page.tsx b/apps/edr-passenger-web/portal/src/app/packages/[id]/page.tsx index 067d93a1b..2c5123def 100644 --- a/apps/edr-passenger-web/portal/src/app/packages/[id]/page.tsx +++ b/apps/edr-passenger-web/portal/src/app/packages/[id]/page.tsx @@ -401,7 +401,6 @@ const PKG_CHILDREN_PER_ADULT = 5; function PassengerCountModal({ tier, - minPriceMinor, onClose, onConfirm, loading, @@ -410,7 +409,6 @@ function PassengerCountModal({ stations, }: { tier: PriceTier; - minPriceMinor: number; onClose: () => void; onConfirm: (adultCount: number, childCount: number, departureStationId: string, departureStationName: string) => void; loading: boolean; @@ -423,11 +421,9 @@ function PassengerCountModal({ const [departureStationId, setDepartureStationId] = useState(''); const [showStationError, setShowStationError] = useState(false); const remaining = tier.availableSeats - tier.bookedSeats; - // First child per adult travels free (no seat); additional children pay full adult fare const freeChildren = Math.min(childCount, adultCount); const paidChildren = Math.max(0, childCount - adultCount); - // Only paid children need seats; free children share with an adult - const totalMinor = (adultCount * minPriceMinor + paidChildren * minPriceMinor) * priceMultiplier; + const totalMinor = (adultCount * tier.priceMinor + paidChildren * tier.priceMinor) * priceMultiplier; return ( <> @@ -444,7 +440,7 @@ function PassengerCountModal({
Coach type
{tier.seatClass?.coachType?.name ?? tier.label.trim()}
-{remaining} seats remaining · from {formatPrice(minPriceMinor * priceMultiplier, tier.currency)} per adult · 1st child per adult free (no seat)
+{remaining} seats remaining · from {formatPrice(tier.priceMinor * priceMultiplier, tier.currency)} per adult · 1st child per adult free (no seat)