feat: ( payments ) add merchant-order and booking/PNR payment status lookups

This commit is contained in:
Abubeker Yasin
2026-07-18 09:55:09 +03:00
parent 718c384a06
commit 85de05cb40
5 changed files with 231 additions and 3 deletions

View File

@@ -133,6 +133,33 @@ export class PaymentsController {
return this.service.getIntentByBookingId(bookingId);
}
@Get("status/:bookingRefOrId")
@SetMetadata("isPublic", true)
@ApiOperation({
summary: "Get payment status by booking id or booking reference (PNR)",
description:
"Accepts either a booking UUID or a booking reference / PNR (e.g. EDR-20240001), " +
"resolves it to the booking, and returns the authoritative payment status pulled from " +
"the payment microservice.",
})
getStatusByBookingRefOrId(@Param("bookingRefOrId") bookingRefOrId: string) {
return this.service.getIntentByBookingRefOrId(bookingRefOrId);
}
@Get("diagnostic/:bookingRefOrId")
@SetMetadata("isPublic", true)
@ApiOperation({
summary:
"Get { db, provider } by booking id or booking reference (PNR) — diagnostic",
description:
"Accepts a booking UUID or a booking reference / PNR (e.g. EDR-20240001), resolves it to " +
"the booking, and returns { db, provider }: the payment service's stored intent row and a " +
"live provider status query, side by side. Pure read — does not reconcile the booking.",
})
getPaymentDiagnostic(@Param("bookingRefOrId") bookingRefOrId: string) {
return this.service.getPaymentDiagnosticByBookingRefOrId(bookingRefOrId);
}
@Post(":bookingId/confirm")
@SetMetadata("isPublic", true)
@ApiOperation({