add goverment booking

This commit is contained in:
Marshal
2026-07-31 00:41:51 +00:00
parent 34e4a7d13f
commit 65f18b4796
35 changed files with 913 additions and 88 deletions

View File

@@ -659,6 +659,22 @@ export const api = {
() => TRAIN_SCHEDULING_INVALIDATIONS,
),
switchGovernmentBooking: endpoint<
{ id: string; governmentBookingId: string; removeBookingIds: string[] },
TrainScheduleDetail
>(
"train-scheduling",
"switch-government-booking",
({ id, governmentBookingId, removeBookingIds }) =>
trainSchedulingService.switchGovernmentBooking(
id,
governmentBookingId,
removeBookingIds,
),
undefined,
() => TRAIN_SCHEDULING_INVALIDATIONS,
),
setLoadingStatus: endpoint<
{ id: string; bookingIds: string[]; loadingStatus: LoadingStatus },
TrainScheduleDetail

View File

@@ -114,6 +114,7 @@ export interface ContractView {
savedSignature?: {
signerDisplayName: string;
signatureImageUrl?: string | null;
stampImageUrl?: string | null;
} | null;
}

View File

@@ -6,11 +6,14 @@ const SIGNATURE_URL = "/me/signature";
export interface SavedSignature {
signerDisplayName: string;
signatureImageUrl?: string | null;
stampImageUrl?: string | null;
}
export interface SaveSignaturePayload {
signerDisplayName: string;
signatureImageBase64: string;
/** Omit to keep the existing saved stamp. */
stampImageBase64?: string;
}
export const signaturesService = {

View File

@@ -367,6 +367,18 @@ export const trainSchedulingService = {
return unwrap(response.data);
},
switchGovernmentBooking: async (
scheduleId: string,
governmentBookingId: string,
removeBookingIds: string[],
): Promise<TrainScheduleDetail> => {
const response = await client.post<TrainScheduleDetail>(
URL_CONSTANTS.TRAIN_SCHEDULING.SWITCH_GOVERNMENT_BOOKING(scheduleId),
{ governmentBookingId, removeBookingIds },
);
return unwrap(response.data);
},
pinWagons: async (
scheduleId: string,
payload: PinWagonsPayload,