mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-09-09 02:28:18 +00:00
contrat nad booking modification
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user