mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-09-07 17:45:42 +00:00
Implement clearance-first booking flow and completion process for customs contracts
This commit is contained in:
@@ -214,6 +214,27 @@ export function useContractMutations(contractId: string) {
|
||||
onError: () => toast.error("Failed to create booking"),
|
||||
});
|
||||
|
||||
const completeBooking = useMutation({
|
||||
mutationFn: ({
|
||||
bookingId,
|
||||
payload,
|
||||
}: {
|
||||
bookingId: string;
|
||||
payload: Freight.CreateBookingUnderContractDto;
|
||||
}) =>
|
||||
contractsService.completeBookingUnderContract(
|
||||
contractId,
|
||||
bookingId,
|
||||
payload,
|
||||
),
|
||||
onSuccess: () => {
|
||||
toast.success("Booking completed");
|
||||
void invalidateContractDetail(qc, contractId);
|
||||
},
|
||||
onError: (e: Error) =>
|
||||
toast.error(e.message || "Failed to complete booking"),
|
||||
});
|
||||
|
||||
const isPending =
|
||||
staffAccept.isPending ||
|
||||
requestChanges.isPending ||
|
||||
@@ -233,6 +254,7 @@ export function useContractMutations(contractId: string) {
|
||||
generateContract,
|
||||
signContract,
|
||||
createBooking,
|
||||
completeBooking,
|
||||
isPending,
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user