mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-08-26 18:42:49 +00:00
Merge pull request #769 from Tria-plc/freight/feature/user_management_UI
Freight/feature/user management UI
This commit is contained in:
@@ -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();
|
||||
}
|
||||
|
||||
@@ -35,14 +35,14 @@ const EDR_TRUCK_FLEET: ReadonlyArray<readonly [string, string]> = [
|
||||
const TWENTY_FT_SEQS = new Set<number>();
|
||||
|
||||
/**
|
||||
* 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.`,
|
||||
];
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user