mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-08-27 22:30:55 +00:00
- Removed the field from and related components. - Updated to reflect the removal of the reopen delay input field. - Modified to include new train number fields: and . - Added interface to manage active schedules with trade direction. - Introduced interface to track wagon shortages in bookings. - Updated logic to ensure consistent UI state representation. - Created migrations to drop the column and add and columns to the table. - Added tests for the new booking window display logic and wagon planning functionality.
35 lines
1.3 KiB
TypeScript
35 lines
1.3 KiB
TypeScript
/**
|
|
* Booking-window timings sourced from the train_scheduling_global_rules singleton,
|
|
* with hardcoded fallbacks when the row is missing (see TrainSchedulingService.getWindowConfig).
|
|
*/
|
|
export interface BookingWindowConfig {
|
|
/** Days before departure the single import booking-window day falls on. */
|
|
importWindowLeadDays: number;
|
|
/** Hours before departure an export booking becomes acceptable (FCFS). */
|
|
exportBookingLeadHours: number;
|
|
/** Local (Africa/Addis_Ababa) hour at which the import window opens each day. */
|
|
windowOpenHour: number;
|
|
/**
|
|
* Local (Africa/Addis_Ababa) hour the booking desk shuts for the day: once a
|
|
* cycle's reopen would fall at/after this hour, the window pauses and resumes
|
|
* next morning at windowOpenHour. Equal to windowOpenHour ⇒ 24-hour desk.
|
|
*/
|
|
windowCloseHour: number;
|
|
windowDurationHours: number;
|
|
/** Max staff document-review time after the window closes. */
|
|
docReviewMinutes: number;
|
|
paymentWindowMinutes: number;
|
|
}
|
|
|
|
/** Window phase lifecycle for the one-booking-day import cycle. NULL on legacy/DOMESTIC schedules. */
|
|
export const WINDOW_PHASES = [
|
|
'PRE_WINDOW',
|
|
'OPEN',
|
|
'DOC_REVIEW',
|
|
'PAYMENT',
|
|
'CLOSED_FOR_DAY',
|
|
'DONE',
|
|
] as const;
|
|
|
|
export type WindowPhase = (typeof WINDOW_PHASES)[number];
|