mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-09-02 23:13:40 +00:00
Merge pull request #435 from Tria-plc/freight/feature/first_mile_invoice
Freight/feature/first mile invoice
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
import { MigrationInterface, QueryRunner } from "typeorm";
|
||||
|
||||
/**
|
||||
* Container number carried by each vehicle on a last-mile delivery. Auto-filled
|
||||
* from the booking's container number when present, else entered by the operator
|
||||
* at assignment time.
|
||||
*/
|
||||
export class AddLastMileAssignmentContainerNumber1890000000009
|
||||
implements MigrationInterface
|
||||
{
|
||||
name = "AddLastMileAssignmentContainerNumber1890000000009";
|
||||
|
||||
public async up(queryRunner: QueryRunner): Promise<void> {
|
||||
await queryRunner.query(`
|
||||
ALTER TABLE freight.last_mile_vehicle_assignments
|
||||
ADD COLUMN IF NOT EXISTS container_number varchar
|
||||
`);
|
||||
}
|
||||
|
||||
public async down(queryRunner: QueryRunner): Promise<void> {
|
||||
await queryRunner.query(`
|
||||
ALTER TABLE freight.last_mile_vehicle_assignments
|
||||
DROP COLUMN IF EXISTS container_number
|
||||
`);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
import { MigrationInterface, QueryRunner } from "typeorm";
|
||||
|
||||
/**
|
||||
* Per-vehicle actual distance on a last-mile delivery. A booking served by
|
||||
* several trucks records each truck's km; the record's total (last_mile.exact_km)
|
||||
* is their sum and drives the invoice.
|
||||
*/
|
||||
export class AddLastMileAssignmentDistance1890000000010
|
||||
implements MigrationInterface
|
||||
{
|
||||
name = "AddLastMileAssignmentDistance1890000000010";
|
||||
|
||||
public async up(queryRunner: QueryRunner): Promise<void> {
|
||||
await queryRunner.query(`
|
||||
ALTER TABLE freight.last_mile_vehicle_assignments
|
||||
ADD COLUMN IF NOT EXISTS distance_km numeric(10,2)
|
||||
`);
|
||||
}
|
||||
|
||||
public async down(queryRunner: QueryRunner): Promise<void> {
|
||||
await queryRunner.query(`
|
||||
ALTER TABLE freight.last_mile_vehicle_assignments
|
||||
DROP COLUMN IF EXISTS distance_km
|
||||
`);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user