mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-08-28 13:40:57 +00:00
add wagon allocation snapshot to train schedules
This commit is contained in:
@@ -1191,9 +1191,11 @@ export class BookingBatchService implements OnModuleInit {
|
||||
maxWagons: number | null,
|
||||
): BatchBoardSchedule["capacity"] {
|
||||
const allocated = items.filter((i) => i.state === "ALLOCATED");
|
||||
const committed = items.filter(
|
||||
(i) => i.state === "ALLOCATED" || i.state === "SELECTED_FOR_BATCH",
|
||||
);
|
||||
// Every booking still targeting this train holds gross weight — including
|
||||
// PAID ones waiting for wagon allocation (WAITING) and post-dispatch
|
||||
// catch-all states. Counting only ALLOCATED + SELECTED_FOR_BATCH zeroed the
|
||||
// board's weight the moment customers paid. Only EXPIRED released its hold.
|
||||
const committed = items.filter((i) => i.state !== "EXPIRED");
|
||||
const caps = loco
|
||||
? trainHardCaps({
|
||||
maxPullWeightTons: Number(loco.maxPullWeightTons),
|
||||
|
||||
Reference in New Issue
Block a user