add lashing surcharge for cargo types with hasLashing flag

add lashing surcharge for cargo types with hasLashing flag
This commit is contained in:
Marshal
2026-07-17 23:25:53 +00:00
parent 6467173c76
commit 3a1a08b1e1
59 changed files with 1919 additions and 140 deletions

View File

@@ -234,13 +234,17 @@ describe('TrainSchedulingService', () => {
destinationStationId: 'yard-destination',
});
// Availability rows now report what the BOUNDED plan actually uses per
// type (never more than stock, so no shortfall on the rows themselves);
// the shortage is carried by the deferred bookings' own shortage rows.
expect(result.fleetAvailability?.length).toBeGreaterThan(0);
expect(result.fleetAvailability?.[0]?.shortfall).toBeGreaterThan(0);
expect(
result.fleetAvailability?.every((row) => row.needed <= row.available),
).toBe(true);
expect(result.deferredBookings?.length).toBeGreaterThan(0);
expect(result.deferredBookings?.[0]?.reason).toContain('short');
expect(result.summary.wagonsNeeded).toBeLessThan(30);
expect(result.warnings.some((w) => w.includes('Fleet shortage') || w.includes('deferred'))).toBe(
true,
);
expect(result.warnings.some((w) => w.includes('deferred'))).toBe(true);
});
it('computes slot-based preview for Group A', async () => {