Dashboard enhancement

This commit is contained in:
Hagernesh
2026-06-19 10:55:03 +00:00
parent f32d3d76e3
commit e40318c847
20 changed files with 563 additions and 28 deletions

View File

@@ -0,0 +1,37 @@
import { MigrationInterface, QueryRunner, TableColumn } from 'typeorm';
/**
* Import pickup branch on warehouse_inventory:
* - release_order_reference: DO / release order number sent to the customer
* - delivered_at: when the goods were handed over (proof of delivery)
*
* Idempotent: the shared dev DB may already carry some of these columns
* (added by another checkout), so only add what is missing.
*/
export class AddImportPickupDeliveryColumns1791000000002 implements MigrationInterface {
private readonly table = 'freight.warehouse_inventory';
public async up(queryRunner: QueryRunner): Promise<void> {
if (!(await queryRunner.hasColumn(this.table, 'release_order_reference'))) {
await queryRunner.addColumn(
this.table,
new TableColumn({ name: 'release_order_reference', type: 'varchar', length: '100', isNullable: true }),
);
}
if (!(await queryRunner.hasColumn(this.table, 'delivered_at'))) {
await queryRunner.addColumn(
this.table,
new TableColumn({ name: 'delivered_at', type: 'timestamptz', isNullable: true }),
);
}
}
public async down(queryRunner: QueryRunner): Promise<void> {
if (await queryRunner.hasColumn(this.table, 'release_order_reference')) {
await queryRunner.dropColumn(this.table, 'release_order_reference');
}
if (await queryRunner.hasColumn(this.table, 'delivered_at')) {
await queryRunner.dropColumn(this.table, 'delivered_at');
}
}
}