mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-08-30 01:48:12 +00:00
Pre-declaration Djibouti GL assignee request flow
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
import { MigrationInterface, QueryRunner } from 'typeorm';
|
||||
|
||||
/**
|
||||
* Transit-assignee handshake on the SHIPMENT, not the contract.
|
||||
*
|
||||
* Clearance runs per booking now, so the ask GL Ethiopia raises before filing a
|
||||
* customs declaration ("who handles this shipment in Djibouti?") and Djibouti's
|
||||
* answer belong on the booking. The contract-cycle columns added by
|
||||
* 2950000000000 stay for the legacy contract-level cycles.
|
||||
*/
|
||||
export class AddBookingTransitAssignee3010000000000 implements MigrationInterface {
|
||||
public async up(queryRunner: QueryRunner): Promise<void> {
|
||||
await queryRunner.query(`
|
||||
ALTER TABLE freight.bookings
|
||||
ADD COLUMN IF NOT EXISTS transit_assignee_requested_at timestamptz NULL,
|
||||
ADD COLUMN IF NOT EXISTS transit_assignee_request_note text NULL,
|
||||
ADD COLUMN IF NOT EXISTS transit_assignee_name text NULL,
|
||||
ADD COLUMN IF NOT EXISTS transit_assignee_assigned_at timestamptz NULL
|
||||
`);
|
||||
}
|
||||
|
||||
public async down(queryRunner: QueryRunner): Promise<void> {
|
||||
await queryRunner.query(`
|
||||
ALTER TABLE freight.bookings
|
||||
DROP COLUMN IF EXISTS transit_assignee_requested_at,
|
||||
DROP COLUMN IF EXISTS transit_assignee_request_note,
|
||||
DROP COLUMN IF EXISTS transit_assignee_name,
|
||||
DROP COLUMN IF EXISTS transit_assignee_assigned_at
|
||||
`);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
import { MigrationInterface, QueryRunner } from 'typeorm';
|
||||
|
||||
/**
|
||||
* A contract's `created_at` is the DRAFT row's insert time, not when the
|
||||
* customer actually submitted it for review — a DRAFT can sit edited for days
|
||||
* first. `submitted_at` is stamped by ContractTransitionService.submit /
|
||||
* confirmSubmit so the history UI can show a real submission time.
|
||||
*/
|
||||
export class AddContractSubmittedAt3020000000000 implements MigrationInterface {
|
||||
name = 'AddContractSubmittedAt3020000000000';
|
||||
|
||||
public async up(queryRunner: QueryRunner): Promise<void> {
|
||||
await queryRunner.query(
|
||||
`ALTER TABLE freight.contracts ADD COLUMN IF NOT EXISTS submitted_at timestamptz;`,
|
||||
);
|
||||
}
|
||||
|
||||
public async down(queryRunner: QueryRunner): Promise<void> {
|
||||
await queryRunner.query(
|
||||
`ALTER TABLE freight.contracts DROP COLUMN IF EXISTS submitted_at;`,
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user