mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-08-26 18:42:49 +00:00
Reject lease start/end and monthly payment on PURCHASE acquisitions (create and update, validated against the resulting record). Add asset_acquisitions.item_name column + migration. Enforce warehouse/yard/zone capacity on bulk receive and apply capacity-counter deltas on save. Adds acquisition-guard spec. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
24 lines
757 B
TypeScript
24 lines
757 B
TypeScript
import { MigrationInterface, QueryRunner } from 'typeorm';
|
|
|
|
/**
|
|
* Acquisitions describe WHAT was acquired (vehicle, parts, equipment…) — the
|
|
* vehicle link is optional and only for acquisitions that ARE a fleet vehicle.
|
|
*/
|
|
export class AddAcquisitionItemName2470000000000 implements MigrationInterface {
|
|
name = 'AddAcquisitionItemName2470000000000';
|
|
|
|
public async up(queryRunner: QueryRunner): Promise<void> {
|
|
await queryRunner.query(`
|
|
ALTER TABLE freight.asset_acquisitions
|
|
ADD COLUMN IF NOT EXISTS item_name varchar(200)
|
|
`);
|
|
}
|
|
|
|
public async down(queryRunner: QueryRunner): Promise<void> {
|
|
await queryRunner.query(`
|
|
ALTER TABLE freight.asset_acquisitions
|
|
DROP COLUMN IF EXISTS item_name
|
|
`);
|
|
}
|
|
}
|