enhance train scheduling and booking management

This commit is contained in:
Marshal
2026-07-07 21:38:45 +00:00
parent 8addfdf3e2
commit 87a95b37bf
13 changed files with 656 additions and 28 deletions

View File

@@ -0,0 +1,29 @@
import { MigrationInterface, QueryRunner } from 'typeorm';
/**
* Adds bookings.consolidation_resume_status: the status a booking parked in
* PENDING_CONSOLIDATION returns to once it pairs with a wagon partner.
*
* Direct customer bookings leave it NULL (they resume to SUBMITTED, unchanged).
* Contract-drawdown bookings (GL shipments) set it to the status
* createUnderContract would otherwise have used (OPERATION_REQUEST_PENDING or
* AWAITING_DOCUMENTS), so pairing resumes them into the contract-booking flow
* instead of wrongly moving them to SUBMITTED.
*/
export class AddConsolidationResumeStatus2010000000000
implements MigrationInterface
{
public async up(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(`
ALTER TABLE freight.bookings
ADD COLUMN IF NOT EXISTS consolidation_resume_status VARCHAR(40);
`);
}
public async down(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(`
ALTER TABLE freight.bookings
DROP COLUMN IF EXISTS consolidation_resume_status;
`);
}
}