fix: ( excess-baggage ) pay in the selected method's currency and record settlement

This commit is contained in:
Abubeker Yasin
2026-08-17 15:33:43 +03:00
parent 41080c1650
commit fa16087a4a
10 changed files with 1522 additions and 28 deletions

View File

@@ -8,6 +8,7 @@ import {
UseGuards,
} from "@nestjs/common";
import { ApiOperation, ApiTags } from "@nestjs/swagger";
import { PaymentReferenceType } from "@edr/types";
import { ServiceAuthGuard } from "../../common/guards/service-auth.guard";
import {
PaymentEventDto,
@@ -51,6 +52,12 @@ export class InternalPaymentsController {
async billQuery(
@Body() request: BillQueryRequestDto,
): Promise<BillQueryResponseDto> {
// Routed on referenceType: the passenger app issues CBE bills for bookings AND for excess
// baggage charges, and they live in different tables. Treating every referenceId as a
// bookingId would report a perfectly payable baggage bill as NOT_FOUND to the teller.
if (request.referenceType === PaymentReferenceType.EXCESS_BAGGAGE) {
return this.paymentsService.billQueryExcessBaggage(request.referenceId);
}
return this.paymentsService.billQuery(request.referenceId);
}
}