mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-08-29 02:30:55 +00:00
feat(rates): last-mile rate rules with bulk per-ton-km and container distance bands
- rates: min_km/max_km columns, PER_TON_KM unit, ETB|USD currency for last mile - extend UQ_rates_pattern with band start; overlap + shape validation - shared last-mile charge resolver; approve-dialog price estimate endpoint - delivery-fee invoice prices via rules, falls back to vehicle price/km - backoffice: last-mile rate form (mode, container type, band, currency)
This commit is contained in:
@@ -177,8 +177,14 @@ export class ContractPricingService {
|
||||
}
|
||||
}
|
||||
if (contract.lastMileDeliveryAddress) {
|
||||
// New-style last-mile rates (PER_TON_KM / distance-banded PER_KM) are
|
||||
// priced operationally per job, not as a single contract unit price.
|
||||
const lm = liveRates.find(
|
||||
(r) => r.rateType === 'LAST_MILE' && r.currency === 'USD',
|
||||
(r) =>
|
||||
r.rateType === 'LAST_MILE' &&
|
||||
r.currency === 'USD' &&
|
||||
r.rateUnit !== 'PER_TON_KM' &&
|
||||
r.minKm == null,
|
||||
);
|
||||
if (lm && Number(lm.rateValue) > 0) {
|
||||
lineItems.push({
|
||||
|
||||
Reference in New Issue
Block a user