Enhance booking and signature functionalities

- Updated MySignaturePage title to Signature
This commit is contained in:
Marshal
2026-08-01 22:03:18 +00:00
parent ea9df9abbe
commit 53d8655dc3
26 changed files with 1050 additions and 19 deletions

View File

@@ -155,12 +155,17 @@ export class IntercityService {
return {
...this.mapBooking(booking, need),
need,
wagonBreakdown: capacity?.breakdownFor(booking) ?? [],
fits: Boolean(need && capacity && leg && capacity.budget.fits(need, leg)),
};
}),
accepted: accepted.map((booking) => {
const need = capacity?.needFor(booking) ?? null;
return { ...this.mapBooking(booking, need), need };
return {
...this.mapBooking(booking, need),
need,
wagonBreakdown: capacity?.breakdownFor(booking) ?? [],
};
}),
};
}
@@ -200,7 +205,9 @@ export class IntercityService {
where: { id: bookingId },
relations: {
bookingContainers: { containerType: true },
cargoType: true,
// wagonTypes drives the break-bulk items-per-wagon fit — the accept
// check must size the booking exactly as the candidate list did.
cargoType: { wagonTypes: true },
},
});
if (!booking) {
@@ -326,6 +333,10 @@ export class IntercityService {
.leftJoinAndSelect('booking.bookingContainers', 'bookingContainer')
.leftJoinAndSelect('bookingContainer.containerType', 'containerType')
.leftJoinAndSelect('booking.cargoType', 'cargoType')
// The allowed wagon-type list is what sizes a break-bulk (PER_ITEM)
// booking: without it `bulkItemsFitFor` reads no items-per-wagon fit and
// the wagon count silently degrades to tonnage-only.
.leftJoinAndSelect('cargoType.wagonTypes', 'cargoWagonType')
.leftJoinAndSelect('booking.originYard', 'originYard')
.leftJoinAndSelect('booking.destinationYard', 'destinationYard')
.where(`booking.trade_direction = 'DOMESTIC'`)
@@ -355,6 +366,10 @@ export class IntercityService {
.leftJoinAndSelect('booking.bookingContainers', 'bookingContainer')
.leftJoinAndSelect('bookingContainer.containerType', 'containerType')
.leftJoinAndSelect('booking.cargoType', 'cargoType')
// The allowed wagon-type list is what sizes a break-bulk (PER_ITEM)
// booking: without it `bulkItemsFitFor` reads no items-per-wagon fit and
// the wagon count silently degrades to tonnage-only.
.leftJoinAndSelect('cargoType.wagonTypes', 'cargoWagonType')
.leftJoinAndSelect('booking.originYard', 'originYard')
.leftJoinAndSelect('booking.destinationYard', 'destinationYard')
.where(`booking.trade_direction = 'DOMESTIC'`)