feat(contracts): implement staff cancellation of contracts with reason and notification

This commit is contained in:
Marshal
2026-08-29 11:31:13 +00:00
parent 978f1889c6
commit 6ac41cf078
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,