mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-08-26 18:42:49 +00:00
baseLiters
This commit is contained in:
@@ -118,6 +118,19 @@ describe('RateChangeRequestsService', () => {
|
||||
expect(request.payload).toEqual({ destinationYardId: 'yard-c' });
|
||||
});
|
||||
|
||||
it('carries baseLiters — a switch to PER_LITER keeps its billing base', async () => {
|
||||
const { service } = build({
|
||||
rate: liveRate({ rateUnit: 'PER_WAGON', baseLiters: null }),
|
||||
});
|
||||
|
||||
const request = await service.submit({
|
||||
rateId: 'rate-1',
|
||||
update: { rateUnit: 'PER_LITER', baseLiters: 3 },
|
||||
});
|
||||
|
||||
expect(request.payload).toEqual({ rateUnit: 'PER_LITER', baseLiters: 3 });
|
||||
});
|
||||
|
||||
it('rejects a no-op — 100 posted against a live 100.0000 is not a change', async () => {
|
||||
const { service } = build();
|
||||
await expect(
|
||||
|
||||
@@ -42,6 +42,10 @@ const DIFFABLE_FIELDS = [
|
||||
// LIVE last-mile rate would diff to "nothing changed".
|
||||
'minKm',
|
||||
'maxKm',
|
||||
// PER_LITER fuel surcharge billing base. Missing here, a switch to PER_LITER
|
||||
// dropped the submitted liters and validation failed with "needs a base
|
||||
// liters amount" even though the payload carried one.
|
||||
'baseLiters',
|
||||
] as const;
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user