mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-09-07 22:25:42 +00:00
- Removed maxWagonsPerTrain from WagonType entity and related DTOs. - Updated containerWagonsForLines function to calculate required wagons based on container lines more accurately. - Added unit tests for containerWagonsForLines to ensure correct calculations. - Adjusted related services and scripts to reflect the removal of maxWagonsPerTrain. - Enhanced booking and contract components to use new status labels for better user experience. - Implemented validation for unique container numbers in shipment forms.
28 lines
988 B
TypeScript
28 lines
988 B
TypeScript
import { MigrationInterface, QueryRunner } from 'typeorm';
|
|
|
|
/**
|
|
* Adds locomotives.overage_tolerance_tons / overage_tolerance_meters: an
|
|
* optional per-locomotive deviation allowance above max_pull_weight_tons /
|
|
* max_train_length_meters. Nullable, defaults to no tolerance so existing
|
|
* strict-cap behavior is unchanged until staff sets a value.
|
|
*/
|
|
export class AddLocomotiveOverageTolerance2040000000000
|
|
implements MigrationInterface
|
|
{
|
|
public async up(queryRunner: QueryRunner): Promise<void> {
|
|
await queryRunner.query(`
|
|
ALTER TABLE freight.locomotives
|
|
ADD COLUMN IF NOT EXISTS overage_tolerance_tons NUMERIC(10, 3),
|
|
ADD COLUMN IF NOT EXISTS overage_tolerance_meters NUMERIC(10, 3);
|
|
`);
|
|
}
|
|
|
|
public async down(queryRunner: QueryRunner): Promise<void> {
|
|
await queryRunner.query(`
|
|
ALTER TABLE freight.locomotives
|
|
DROP COLUMN IF EXISTS overage_tolerance_tons,
|
|
DROP COLUMN IF EXISTS overage_tolerance_meters;
|
|
`);
|
|
}
|
|
}
|