Files
edr-platform/apps/edr-freight-api/src/migrations/3200000000000-AddScheduleWindowRuleCustom.ts
Marshal e68bdb7a1a Enhance overview and train scheduling features
- Updated OverviewContractsTabPanel to include a new donut chart for freight type distribution.
- Modified OverviewOperationsTabPanel to improve data visualization with additional charts and refactored data handling.
- Introduced CreateScheduleWindowFields component for configuring booking windows in train scheduling.
- Added new API endpoints for allocation candidates and booking allocation in trainScheduling.service.
- Enhanced BookingRequestsPage to support allocation of paid bookings with a modal for selecting alternative dates.
- Updated QUERY_KEYS and URLS constants to accommodate new operations and features.
- Improved type definitions for overview and train scheduling to support new functionalities.
2026-08-03 21:06:59 +00:00

29 lines
1.1 KiB
TypeScript

import { MigrationInterface, QueryRunner } from 'typeorm';
/**
* Marks a train schedule whose booking-window rule was configured by staff at
* creation rather than inherited from the live global rules.
*
* Without this flag `restampPendingWindows` — which re-derives EVERY still
* PRE_WINDOW schedule from the current global config after a global-rules edit —
* would silently overwrite those hand-picked settings, which is precisely what
* the per-schedule configuration exists to prevent.
*
* Defaults false, so every existing schedule keeps following the global rules.
*/
export class AddScheduleWindowRuleCustom3200000000000 implements MigrationInterface {
name = 'AddScheduleWindowRuleCustom3200000000000';
public async up(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(
`ALTER TABLE "freight"."train_schedules" ADD COLUMN IF NOT EXISTS "window_rule_custom" boolean NOT NULL DEFAULT false`,
);
}
public async down(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(
`ALTER TABLE "freight"."train_schedules" DROP COLUMN IF EXISTS "window_rule_custom"`,
);
}
}