export flow and fix intercity issue

This commit is contained in:
Marshal
2026-07-30 13:11:35 +00:00
parent 9208050cb5
commit e80aac877f
19 changed files with 486 additions and 27 deletions

View File

@@ -217,10 +217,20 @@ export class IntercityService {
// board a train that is full only on other legs.
const leg = budget.legForYards(booking.originYardId, booking.destinationYardId);
if (!budget.fits(need, leg)) {
// Offer the part that DOES fit the leg (split-on-payment): customer is
// notified with a pay window for the fitting wagons; the remainder can
// be re-booked on a later train. Budget is consumed by the offer so the
// next booking in this pass sees the reduced room.
const offered = await this.bookingBatchService.offerIntercityPartial(
booking,
scheduleId,
budget,
);
rejected.push({
bookingId,
reason:
'Does not fit the remaining wagon/weight/length capacity for this train',
reason: offered
? 'Does not fit whole — a partial offer for the wagons that fit was sent to the customer'
: 'Does not fit the remaining wagon/weight/length capacity for this train',
});
continue;
}