make a contrat template

This commit is contained in:
Marshal
2026-07-09 21:13:07 +00:00
parent e4429592d3
commit 3443b79644
26 changed files with 3243 additions and 41 deletions

View File

@@ -17,6 +17,21 @@ export interface ContractSignatureView {
signatureImageUrl?: string | null;
}
/**
* DB-backed contract template (freight.contract_templates) attached to the
* view model when an active template matches the contract's direction/freight
* pair. The renderer turns its articles into numbered clauses and switches to
* the dedicated edr-dynamic.hbs layout; absent, the legacy generic layout with
* code-defined clause packs is used.
*/
export interface ContractDynamicTemplateView {
code: string;
name: string;
documentTitle: string;
whereasClauses: string[];
articles: Array<{ id: string; title: string; body: string; order: number }>;
}
export interface ContractViewModel {
bookingId: string;
reference: string;
@@ -65,6 +80,7 @@ export interface ContractViewModel {
hasContractDocument: boolean;
hasCustomerSignature: boolean;
hasStaffSignature: boolean;
dynamicTemplate?: ContractDynamicTemplateView;
}
@Injectable()