mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-08-29 22:18:12 +00:00
export flow and fix intercity issue
This commit is contained in:
@@ -189,6 +189,29 @@ export const trainSchedulingService = {
|
||||
|
||||
// Cargo-aware day pool (matching wagons + open train capacity). `containers`
|
||||
// is serialized as a JSON string param (the server parses it).
|
||||
// Export train picker for a booking's shipment day; cargo params cover bare
|
||||
// instances whose cargo only exists on the form so far.
|
||||
getExportTrains: async (
|
||||
bookingId: string,
|
||||
date: string,
|
||||
cargo?: { containerSizes?: string[]; cargoTypeCode?: string; wagons?: number },
|
||||
): Promise<Freight.ExportTrainOption[]> => {
|
||||
const response = await client.get<Freight.ExportTrainOption[]>(
|
||||
`/bookings/${bookingId}/export-trains`,
|
||||
{
|
||||
params: {
|
||||
date,
|
||||
...(cargo?.containerSizes?.length
|
||||
? { containerSizes: cargo.containerSizes.join(",") }
|
||||
: {}),
|
||||
...(cargo?.cargoTypeCode ? { cargoTypeCode: cargo.cargoTypeCode } : {}),
|
||||
...(cargo?.wagons ? { wagons: cargo.wagons } : {}),
|
||||
},
|
||||
},
|
||||
);
|
||||
return unwrap(response.data);
|
||||
},
|
||||
|
||||
getAvailableDaysForCargo: async (
|
||||
query: Freight.AvailableDaysForCargoQuery,
|
||||
): Promise<string[]> => {
|
||||
|
||||
Reference in New Issue
Block a user