Merge pull request #1461 from Tria-plc/freight_feature/usermanagement

feat(contracts): implement staff cancellation of contracts with reaso…
This commit is contained in:
marshal
2026-08-29 14:36:08 +03:00
committed by GitHub
13 changed files with 352 additions and 5 deletions

View File

@@ -151,6 +151,14 @@ export function useContractMutations(contractId: string) {
onError: (error) => toast.error(extractErrorMessage(error, "Failed to reject contract")),
});
const cancelByStaff = useMutation({
mutationFn: (reason: string) =>
contractsService.cancelByStaff(contractId, reason),
onSuccess: (data) => onSuccess(data, "Contract cancelled"),
onError: (error) =>
toast.error(extractErrorMessage(error, "Failed to cancel contract")),
});
const suspend = useMutation({
mutationFn: (reason: string) => contractsService.suspend(contractId, reason),
onSuccess: (data) => onSuccess(data, "Contract suspended"),
@@ -269,6 +277,7 @@ export function useContractMutations(contractId: string) {
updateDocument,
requestChanges,
reject,
cancelByStaff,
suspend,
resume,
approveStep,