mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-08-27 13:10:56 +00:00
- Implemented migration to release stuck assigned locomotives. - Added schedule window phases to train schedules. - Created booking batch offers table for partial capacity bookings. - Developed BookingSplitService to handle partial booking offers and splits. - Introduced BookingWindowService to manage booking window lifecycle and transitions. - Added BookingBatchOffer entity to represent offers made during booking splits. - Enhanced locomotive options with warnings for scheduling. - Created UpcomingWindowsSection component to display upcoming booking windows.
32 lines
1.5 KiB
TypeScript
32 lines
1.5 KiB
TypeScript
import { MigrationInterface, QueryRunner } from "typeorm";
|
|
|
|
export class AddBookingWindowGlobalRules1861000000000 implements MigrationInterface {
|
|
name = "AddBookingWindowGlobalRules1861000000000";
|
|
|
|
public async up(queryRunner: QueryRunner): Promise<void> {
|
|
await queryRunner.query(`
|
|
ALTER TABLE freight.train_scheduling_global_rules
|
|
ADD COLUMN import_window_lead_days integer NOT NULL DEFAULT 3,
|
|
ADD COLUMN export_booking_lead_hours integer NOT NULL DEFAULT 24,
|
|
ADD COLUMN window_open_hour integer NOT NULL DEFAULT 8,
|
|
ADD COLUMN window_duration_hours numeric(4, 2) NOT NULL DEFAULT 3,
|
|
ADD COLUMN doc_review_minutes integer NOT NULL DEFAULT 30,
|
|
ADD COLUMN payment_window_minutes integer NOT NULL DEFAULT 60,
|
|
ADD COLUMN reopen_delay_minutes integer NOT NULL DEFAULT 90;
|
|
`);
|
|
}
|
|
|
|
public async down(queryRunner: QueryRunner): Promise<void> {
|
|
await queryRunner.query(`
|
|
ALTER TABLE freight.train_scheduling_global_rules
|
|
DROP COLUMN IF EXISTS import_window_lead_days,
|
|
DROP COLUMN IF EXISTS export_booking_lead_hours,
|
|
DROP COLUMN IF EXISTS window_open_hour,
|
|
DROP COLUMN IF EXISTS window_duration_hours,
|
|
DROP COLUMN IF EXISTS doc_review_minutes,
|
|
DROP COLUMN IF EXISTS payment_window_minutes,
|
|
DROP COLUMN IF EXISTS reopen_delay_minutes;
|
|
`);
|
|
}
|
|
}
|