mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-08-29 22:18:12 +00:00
fix issue and add consolidation
This commit is contained in:
@@ -2831,7 +2831,6 @@ export class BookingBatchService implements OnModuleInit {
|
||||
wagonTypeIds: string[] = [],
|
||||
): Promise<boolean> {
|
||||
if (!this.isSplitEligible(booking, isPair)) return false;
|
||||
const wagonDims = await this.loadWagonDims();
|
||||
// PER_TON bulk partials are sized on ONE concrete wagon type at the
|
||||
// cargo's per-wagon cap — sizing on the first type's raw 70T rating
|
||||
// offered tonnage the wagons could never carry (Perishable caps at
|
||||
@@ -2846,6 +2845,7 @@ export class BookingBatchService implements OnModuleInit {
|
||||
booking.freightType === "BULK" &&
|
||||
!perItemBulk &&
|
||||
wagonTypeIds.length > 0;
|
||||
const wagonDims = cappedBulk ? await this.loadWagonDims() : null;
|
||||
const target = candidates
|
||||
.map((c) => {
|
||||
const leg = c.budget.legOf(booking.originYardId, booking.destinationYardId);
|
||||
@@ -2856,7 +2856,7 @@ export class BookingBatchService implements OnModuleInit {
|
||||
// them NW5" into an offer for 16 — the customer pays for 16 and the
|
||||
// other 4 leave as the usual remainder booking, instead of paying for
|
||||
// 20 and stalling at allocation on wagon 17.
|
||||
if (cappedBulk) {
|
||||
if (cappedBulk && wagonDims) {
|
||||
const best = this.allowedDimsWithTypes(booking, wagonDims)
|
||||
.filter((o): o is { wagonTypeId: string; dims: PerWagonDims } =>
|
||||
o.wagonTypeId != null,
|
||||
|
||||
Reference in New Issue
Block a user