feat(freight): offer built-train wagons per boarding yard on multi-yard consists

This commit is contained in:
Marshal
2026-08-18 08:27:18 +00:00
parent 1ca7776143
commit c723b660e2
33 changed files with 1234 additions and 231 deletions

View File

@@ -43,6 +43,16 @@ export type WagonStock = {
remainingByTypeId: Map<string, number>;
/** Wagon-type code per id, for human-readable shortfall messages. */
codesByTypeId: Map<string, string>;
/**
* Multi-yard consist only: yardId → (wagonTypeId → count) for the wagons
* standing at that yard. A train whose wagons are split across yards can
* only offer, at each boarding yard, the wagons physically standing there —
* a wagon waiting in Mojo is not bookable from Dire, and one picked up at
* Dire is not re-offered at Mojo. Absent (undefined) when every wagon sits
* in one yard, which keeps single-yard trains on the original whole-train
* math.
*/
byYardId?: Map<string, Map<string, number>>;
};
export type FlexPlanResult = {