contrat nad booking modification

This commit is contained in:
Marshal
2026-07-20 12:24:58 +00:00
parent eb532399d9
commit b90afadfba
55 changed files with 1210 additions and 1373 deletions

View File

@@ -196,6 +196,14 @@ export const contractsService = {
return unwrap(response.data) as Freight.IContractDocumentDraft;
},
/** Audit trail of edits to this contract's document, newest first. */
getContractDocumentRevisions: async (
id: string,
): Promise<Freight.IContractDocumentRevision[]> => {
const response = await client.get(C.CONTRACT_DOCUMENT_REVISIONS(id));
return unwrap(response.data) as Freight.IContractDocumentRevision[];
},
/** Save this contract's edited document articles (never touches the templates). */
updateContractDocument: async (
id: string,
@@ -214,18 +222,12 @@ export const contractsService = {
reject: (id: string, reason: string) =>
postContract<Freight.IContract>(C.STAFF_REJECT(id), { reason }),
approveStep: ({
id,
stepId,
requiredRole,
}: {
id: string;
stepId: string;
requiredRole: string;
}) =>
postContract<Freight.IContract>(C.APPROVE_STEP(id, stepId), {
requiredRole,
}),
/**
* Approve the next pending step. The server resolves the step's required role
* and authorizes against it — the client never declares its own role.
*/
approveStep: ({ id, stepId }: { id: string; stepId: string }) =>
postContract<Freight.IContract>(C.APPROVE_STEP(id, stepId)),
rejectStep: ({
id,