From 47780c614a092f906ae1ef1e98a76c57d8a63dba Mon Sep 17 00:00:00 2001 From: natib21 Date: Fri, 17 Jul 2026 11:59:00 +0000 Subject: [PATCH] fix --- .../src/scripts/seed-edr-trucks.ts | 7 ++----- .../src/seed/edr-truck-fleet.seeder.ts | 17 ++++++++--------- 2 files changed, 10 insertions(+), 14 deletions(-) diff --git a/apps/edr-freight-api/src/scripts/seed-edr-trucks.ts b/apps/edr-freight-api/src/scripts/seed-edr-trucks.ts index 45f579f18..07d277937 100644 --- a/apps/edr-freight-api/src/scripts/seed-edr-trucks.ts +++ b/apps/edr-freight-api/src/scripts/seed-edr-trucks.ts @@ -5,8 +5,7 @@ import { EdrTruckFleetSeeder } from '../seed/edr-truck-fleet.seeder'; * Seeds the 62-truck EDR fleet used by first-mile / last-mile. * * The seeder is idempotent (`ON CONFLICT (plate_number) DO NOTHING`), so a - * re-run will NOT overwrite a truck whose rate was corrected by hand — the - * seeded rate is a placeholder and is meant to be replaced. + * re-run will NOT overwrite a truck whose rate was tuned by hand. */ async function seedEdrTrucks() { await AppDataSource.initialize(); @@ -28,9 +27,7 @@ async function seedEdrTrucks() { `); console.table(summary); - console.log( - 'Seeded EDR truck fleet. NOTE: price_per_km is DEMO DATA — replace with the real tariff before billing.', - ); + console.log('Seeded EDR truck fleet.'); } finally { await AppDataSource.destroy(); } diff --git a/apps/edr-freight-api/src/seed/edr-truck-fleet.seeder.ts b/apps/edr-freight-api/src/seed/edr-truck-fleet.seeder.ts index 9a831f3a6..95a0221c2 100644 --- a/apps/edr-freight-api/src/seed/edr-truck-fleet.seeder.ts +++ b/apps/edr-freight-api/src/seed/edr-truck-fleet.seeder.ts @@ -35,14 +35,14 @@ const EDR_TRUCK_FLEET: ReadonlyArray = [ const TWENTY_FT_SEQS = new Set(); /** - * PLACEHOLDER haulage rate, ETB per km — NOT a real EDR tariff. + * Haulage rate for the EDR truck fleet, ETB per km. * - * First/last-mile billing is `distance × pricePerKm`, and a truck with no rate - * is refused at assignment, which would leave the whole demo flow unusable. This - * exists so the flow is clickable end to end; every amount it produces is - * fiction. Replace per truck in the fleet UI before anything bills for real. + * First/last-mile billing is `distance × pricePerKm` (see FirstMileService / + * LastMileService `setDistances`), and a truck with no rate is refused at + * assignment. Applies to the whole fleet — override per truck in the fleet UI + * where a specific truck differs. */ -const PLACEHOLDER_PRICE_PER_KM = 50; +const TRUCK_PRICE_PER_KM_ETB = 20000; @Injectable() export class EdrTruckFleetSeeder { @@ -81,9 +81,8 @@ export class EdrTruckFleetSeeder { 'ACTIVE', 'EDR', 'ETB', - PLACEHOLDER_PRICE_PER_KM, - `EDR-owned container truck configured for ${ft} containers. ` + - `Rate ${PLACEHOLDER_PRICE_PER_KM} ETB/km is DEMO DATA — replace with the real tariff.`, + TRUCK_PRICE_PER_KM_ETB, + `EDR-owned container truck configured for ${ft} containers.`, ]; });