mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-08-30 00:38:11 +00:00
export flow and fix intercity issue
This commit is contained in:
@@ -765,8 +765,26 @@ export class BookingsController {
|
||||
async exportTrainsForBooking(
|
||||
@Param("id", ParseUUIDPipe) id: string,
|
||||
@Query("date") date: string,
|
||||
// Bare contract instances carry no cargo yet — the completion form sends
|
||||
// what the customer is entering so per-type space reflects THEIR cargo.
|
||||
@Query("containerTypeIds") containerTypeIds?: string,
|
||||
@Query("containerSizes") containerSizes?: string,
|
||||
@Query("cargoTypeId") cargoTypeId?: string,
|
||||
@Query("cargoTypeCode") cargoTypeCode?: string,
|
||||
@Query("wagons") wagons?: string,
|
||||
) {
|
||||
return this.transitionService.exportTrainsForBooking(id, date);
|
||||
const parsedWagons = Number(wagons);
|
||||
return this.transitionService.exportTrainsForBooking(id, date, {
|
||||
containerTypeIds: containerTypeIds
|
||||
? containerTypeIds.split(",").filter(Boolean)
|
||||
: undefined,
|
||||
containerSizes: containerSizes
|
||||
? containerSizes.split(",").filter(Boolean)
|
||||
: undefined,
|
||||
cargoTypeId: cargoTypeId || undefined,
|
||||
cargoTypeCode: cargoTypeCode || undefined,
|
||||
wagons: Number.isFinite(parsedWagons) && parsedWagons > 0 ? parsedWagons : undefined,
|
||||
});
|
||||
}
|
||||
|
||||
@Post(":id/operation/review")
|
||||
|
||||
Reference in New Issue
Block a user