mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-09-08 01:55:41 +00:00
fix issues
This commit is contained in:
@@ -91,6 +91,7 @@ import type {
|
||||
TrainScheduleFilters,
|
||||
TrainScheduleListFilters,
|
||||
TrainScheduleListResponse,
|
||||
ReduceScheduleCloseOffsetPayload,
|
||||
UpdateScheduleWindowRulePayload,
|
||||
TrainSchedulePreviewPayload,
|
||||
TrainSchedulePreviewResponse,
|
||||
@@ -713,6 +714,18 @@ export const api = {
|
||||
() => TRAIN_SCHEDULING_INVALIDATIONS,
|
||||
),
|
||||
|
||||
reduceScheduleCloseOffset: endpoint<
|
||||
{ id: string; payload: ReduceScheduleCloseOffsetPayload },
|
||||
TrainScheduleDetail
|
||||
>(
|
||||
"train-scheduling",
|
||||
"reduce-schedule-close-offset",
|
||||
({ id, payload }) =>
|
||||
trainSchedulingService.reduceScheduleCloseOffset(id, payload),
|
||||
undefined,
|
||||
() => TRAIN_SCHEDULING_INVALIDATIONS,
|
||||
),
|
||||
|
||||
updateScheduleDate: endpoint<
|
||||
{ id: string; scheduleDate: string },
|
||||
TrainScheduleDetail
|
||||
@@ -3220,6 +3233,18 @@ export const api = {
|
||||
bookingsService.reviewOperation(id, decision, { note }),
|
||||
),
|
||||
|
||||
rescheduleOperation: endpoint<
|
||||
{
|
||||
id: string;
|
||||
scheduledDate: string;
|
||||
trainScheduleId?: string;
|
||||
note?: string;
|
||||
},
|
||||
BookingDetail
|
||||
>("bookings", "rescheduleOperation", ({ id, ...payload }) =>
|
||||
bookingsService.rescheduleOperation(id, payload),
|
||||
),
|
||||
|
||||
proceedToOperation: endpoint<
|
||||
{ id: string; scheduledDate: string },
|
||||
BookingDetail
|
||||
|
||||
@@ -358,6 +358,16 @@ export const bookingsService = {
|
||||
proceedToOperation: (id: string, scheduledDate: string) =>
|
||||
postBooking<BookingDetail>(B.CLEARANCE_PROCEED(id), { scheduledDate }),
|
||||
|
||||
/**
|
||||
* Operations changes the shipment day (and, for export rail, the train) of a
|
||||
* pending operation request on the customer's behalf — the booking stays at
|
||||
* OPERATION_REQUEST_PENDING for the normal accept.
|
||||
*/
|
||||
rescheduleOperation: (
|
||||
id: string,
|
||||
payload: { scheduledDate: string; trainScheduleId?: string; note?: string },
|
||||
) => postBooking<BookingDetail>(B.OPERATION_RESCHEDULE(id), payload),
|
||||
|
||||
generateContract: (id: string) =>
|
||||
postBooking<BookingDetail>(B.CONTRACT_GENERATE(id)),
|
||||
|
||||
|
||||
@@ -36,6 +36,7 @@ import type {
|
||||
MarshallingStop,
|
||||
ScheduleMergePreview,
|
||||
TrainScheduleDetail,
|
||||
ReduceScheduleCloseOffsetPayload,
|
||||
UpdateScheduleWindowRulePayload,
|
||||
TrainScheduleFilters,
|
||||
TrainScheduleListFilters,
|
||||
@@ -307,6 +308,17 @@ export const trainSchedulingService = {
|
||||
return unwrap(response.data);
|
||||
},
|
||||
|
||||
reduceScheduleCloseOffset: async (
|
||||
scheduleId: string,
|
||||
payload: ReduceScheduleCloseOffsetPayload,
|
||||
): Promise<TrainScheduleDetail> => {
|
||||
const response = await client.patch<TrainScheduleDetail>(
|
||||
URL_CONSTANTS.TRAIN_SCHEDULING.CLOSE_OFFSET(scheduleId),
|
||||
payload,
|
||||
);
|
||||
return unwrap(response.data);
|
||||
},
|
||||
|
||||
updateScheduleDate: async (
|
||||
scheduleId: string,
|
||||
scheduleDate: string,
|
||||
|
||||
Reference in New Issue
Block a user