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

contrat nad booking modification
This commit is contained in:
marshal
2026-07-20 15:25:51 +03:00
committed by GitHub
55 changed files with 1210 additions and 1373 deletions

View File

@@ -219,12 +219,54 @@ export interface IContractDocumentDraft {
articles: IContractDocumentArticle[];
code: string | null;
name: string | null;
/** True once the document may no longer be edited/regenerated. */
/** True when THIS caller may not edit — the inverse of `editableByMe`. */
locked: boolean;
/**
* Whether the requesting user is the approver whose turn it is. The document
* stays editable through the whole approval chain, but only by the approver
* currently holding it, so editability is caller-dependent.
*/
editableByMe: boolean;
/** Role holding editing rights right now, for "locked because…" messaging. */
nextApproverRole: string | null;
generatedAt: string | null;
status: ContractStatus;
}
/** One recorded change within a contract-document revision. */
export type IContractDocumentChange =
| { kind: 'ARTICLE_ADDED'; articleId: string; title: string }
| { kind: 'ARTICLE_REMOVED'; articleId: string; title: string }
| {
kind: 'ARTICLE_RENAMED';
articleId: string;
title: string;
fromTitle: string;
}
| { kind: 'ARTICLE_BODY_CHANGED'; articleId: string; title: string }
| {
kind: 'ARTICLE_REORDERED';
articleId: string;
title: string;
fromOrder: number;
toOrder: number;
}
| { kind: 'DOCUMENT_TITLE_CHANGED'; title: string; fromTitle: string | null }
| { kind: 'WHEREAS_CHANGED'; added: number; removed: number };
/** An audit entry for one edit to a contract's document. */
export interface IContractDocumentRevision {
id: string;
contractId: string;
actorId: string | null;
/** The approval step's required role at the time of the edit. */
actorRole: string | null;
stepId: string | null;
summary: string | null;
changes: IContractDocumentChange[];
createdAt: string;
}
export type ContractApprovalStepStatus =
| "PENDING"
| "APPROVED"