enhance booking and contract notification systems

- Added detailed logging for socket connection events in useBookingWindowSocket.
- Introduced new notification types for contract status and schedule updates.
- Updated notification visuals to include new icons for contract status.
- Enhanced notification href resolution for contract status and schedule updates.
- Implemented booking lifecycle notifier service for customer and staff notifications.
- Created contract notifier service for managing contract lifecycle notifications.
- Added end-to-end tests for booking window socket functionality.
This commit is contained in:
Marshal
2026-07-06 21:03:08 +00:00
parent 8bd00ea78a
commit 05b13e84a8
38 changed files with 1450 additions and 95 deletions

View File

@@ -438,6 +438,13 @@ export interface IBooking extends BaseEntity {
contractReference?: string | null;
trainId?: string | null;
status: BookingStatus;
/**
* Operational status of the assigned train (DRAFT/SCHEDULED/DISPATCHED/
* ARRIVED), joined on booking detail. The booking status stays IN_TRANSIT
* from dispatch until delivery, so the portal stepper reads arrival from
* here.
*/
trainScheduleStatus?: TrainScheduleStatus | string | null;
/** ONE_TIME for normal bookings; GENERAL_CONTRACT for umbrella contracts. */
bookingType?: BookingType;
/** General contracts only: when ordering closes (null until active / for one-time). */

View File

@@ -33,6 +33,8 @@ export enum NotificationType {
CLEARANCE_DECISION = "CLEARANCE_DECISION",
DOCUMENT_ACTION = "DOCUMENT_ACTION",
BOOKING_STATUS = "BOOKING_STATUS",
CONTRACT_STATUS = "CONTRACT_STATUS",
SCHEDULE_UPDATE = "SCHEDULE_UPDATE",
INVOICE_ISSUED = "INVOICE_ISSUED",
// Backoffice-facing (staff)
REQUEST_SUBMITTED = "REQUEST_SUBMITTED",
@@ -87,6 +89,8 @@ export interface NotificationRecipients {
companyProfileId?: string;
/** Backoffice: all current employees of this organization. */
organizationId?: string;
/** Backoffice: every current employee across all organizations. */
allBackoffice?: boolean;
}
/** Input any subsystem passes to `NotificationInboxService.notify(...)`. */