Implement clearance-first booking flow and completion process for customs contracts

This commit is contained in:
Marshal
2026-07-10 21:51:59 +00:00
parent 9ed473c309
commit 1121e9ce82
19 changed files with 482 additions and 106 deletions

View File

@@ -141,6 +141,22 @@ export class BookingNotifierService {
this.inApp(b, 'Payment window expired', msg);
}
/**
* Every train on the booking's chosen day filled up (or no further train runs)
* before the waiting list reached this booking — it expired unplaced. HIGH so
* the customer hears about it by email/SMS and rebooks another day.
*/
expiredNoCapacity(b: Booking): void {
const msg =
`Booking ${b.reference ?? b.id} could not be placed: every train for your selected day ` +
`is full and no other train is scheduled that day. The booking has expired — ` +
`please rebook for another day. No re-approval is needed.`;
void this.notifyContact(b, msg, 'EXPIRED (NO CAPACITY)');
this.inApp(b, 'No capacity — booking expired', msg, {
priority: NotificationPriority.HIGH,
});
}
scheduleFull(b: Booking): void {
this.logger.warn(
`SCHEDULE FULL — ${this.ref(b)} could not be placed; change schedule, pick another day, or cancel.`,