fix conflict

This commit is contained in:
yaschalew
2026-06-22 14:23:43 +03:00
145 changed files with 8199 additions and 9399 deletions

View File

@@ -2,9 +2,9 @@ import { MigrationInterface, QueryRunner, Table, TableColumn } from 'typeorm';
/**
* Batch 5 warehouse allocation rules, storage/demurrage fee rules,
* and demurrage lifecycle timestamps on inventory.
* and demurrage lifecycle timestamps on inventory. Idempotent.
*/
export class AddWarehouseAllocationAndFeeRules1790000000000 implements MigrationInterface {
export class AddWarehouseAllocationAndFeeRules1791000000000 implements MigrationInterface {
public async up(queryRunner: QueryRunner): Promise<void> {
await queryRunner.createTable(
new Table({

View File

@@ -1,7 +1,7 @@
import { MigrationInterface, QueryRunner, Table } from 'typeorm';
/** Batch 6 — warehouse fee invoices + invoice items. */
export class AddWarehouseFeeInvoices1790000000001 implements MigrationInterface {
/** Batch 6 — warehouse fee invoices + invoice items. Idempotent (createTable ifNotExists). */
export class AddWarehouseFeeInvoices1791000000001 implements MigrationInterface {
public async up(queryRunner: QueryRunner): Promise<void> {
await queryRunner.createTable(
new Table({

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');
}
}
}

View File

@@ -0,0 +1,27 @@
import { MigrationInterface, QueryRunner, TableColumn } from 'typeorm';
/**
* Batch 8 — train-arrival unload landing state on warehouse_inventory:
* - unloaded_at: when the goods were unloaded off the arrived train (before storage/inspection)
*
* The `status` column is a free varchar, so the new 'UNLOADED' value needs no schema change.
* Idempotent: the shared dev DB may already carry this column (added by another checkout).
*/
export class AddInventoryUnloadedAt1791000000003 implements MigrationInterface {
private readonly table = 'freight.warehouse_inventory';
public async up(queryRunner: QueryRunner): Promise<void> {
if (!(await queryRunner.hasColumn(this.table, 'unloaded_at'))) {
await queryRunner.addColumn(
this.table,
new TableColumn({ name: 'unloaded_at', type: 'timestamptz', isNullable: true }),
);
}
}
public async down(queryRunner: QueryRunner): Promise<void> {
if (await queryRunner.hasColumn(this.table, 'unloaded_at')) {
await queryRunner.dropColumn(this.table, 'unloaded_at');
}
}
}