ui design for schedule

This commit is contained in:
Marshal
2026-06-09 23:25:52 +00:00
parent 5774d7db9d
commit 257428be18
19 changed files with 2088 additions and 408 deletions

View File

@@ -105,6 +105,22 @@ describe('containerPlacement.util', () => {
expect(placements[2]?.sequenceNo).toBe(2);
});
it('never shares a wagon between a 40ft and a 20ft when the 40ft comes first', () => {
// Regression: a 40ft (2 TEU) must occupy its own wagon and never pair with a 20ft.
const units40 = makeUnits('40GP', 40, 1);
const units20 = makeUnits('20GP', 20, 2);
const units = [...units40, ...units20];
const slots = [1, 2, 3, 4];
const placements = autoFillPlacements(units, slots);
expect(placements).toHaveLength(3);
// 40ft alone on slot 1
expect(placements[0]?.sequenceNo).toBe(1);
// both 20ft together on slot 2 — NOT on slot 1 with the 40ft
expect(placements[1]?.sequenceNo).toBe(2);
expect(placements[2]?.sequenceNo).toBe(2);
});
it('falls back to last slot when running out of slots', () => {
const units = makeUnits('20GP', 20, 6);
const slots = [1, 2]; // Only 2 slots available