mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-08-27 00:52:50 +00:00
feat(freight): surface scheduling clock and gate pay during drain
This commit is contained in:
@@ -3680,23 +3680,24 @@ export class BookingBatchService implements OnModuleInit {
|
||||
// (provider query errored / payment still in flight) means we could not
|
||||
// confirm "not paid" — never expire on unknown; the next settle tick
|
||||
// asks again.
|
||||
if (reason === "payment" && (fresh?.paymentDeadline ?? booking.paymentDeadline)) {
|
||||
const reconcile = await this.billing.reconcilePayable(booking.id);
|
||||
if (reconcile.paid) {
|
||||
this.logger.log(
|
||||
`[BATCH] expire skipped for ${booking.reference} — gateway ` +
|
||||
`reconcile found a settled payment; payment.succeeded will allocate it`,
|
||||
);
|
||||
return;
|
||||
}
|
||||
if (reconcile.unverifiable) {
|
||||
this.logger.warn(
|
||||
`[BATCH] expire deferred for ${booking.reference} — settlement ` +
|
||||
`unverifiable at the gateway; retrying next settle tick`,
|
||||
);
|
||||
return;
|
||||
}
|
||||
}
|
||||
// TODO: CBE has no reconcile endpoint yet — re-enable once available.
|
||||
// if (reason === "payment" && (fresh?.paymentDeadline ?? booking.paymentDeadline)) {
|
||||
// const reconcile = await this.billing.reconcilePayable(booking.id);
|
||||
// if (reconcile.paid) {
|
||||
// this.logger.log(
|
||||
// `[BATCH] expire skipped for ${booking.reference} — gateway ` +
|
||||
// `reconcile found a settled payment; payment.succeeded will allocate it`,
|
||||
// );
|
||||
// return;
|
||||
// }
|
||||
// if (reconcile.unverifiable) {
|
||||
// this.logger.warn(
|
||||
// `[BATCH] expire deferred for ${booking.reference} — settlement ` +
|
||||
// `unverifiable at the gateway; retrying next settle tick`,
|
||||
// );
|
||||
// return;
|
||||
// }
|
||||
// }
|
||||
}
|
||||
const freedScheduleId = booking.trainScheduleId;
|
||||
await this.bookingsRepository.update(booking.id, {
|
||||
|
||||
Reference in New Issue
Block a user