mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-08-30 05:18:11 +00:00
Implement contract document download functionality and enhance clearance review status checks
- Added methods to assert clearance reviewable, finalizable, and uploadable statuses in the ContractClearanceService. - Introduced a new endpoint in ContractsController for downloading contract PDFs. - Implemented download functionality in the contracts service for both backoffice and portal applications. - Updated UI components to include download buttons for contract PDFs in relevant pages. - Enhanced contract request and view pages to support contract document downloads.
This commit is contained in:
@@ -345,6 +345,14 @@ export class ContractTransitionService {
|
||||
return { view, html, signatures: view.signatures };
|
||||
}
|
||||
|
||||
/** Lazy-generate (or refresh) the stored contract PDF and stream it for download. */
|
||||
async streamContractPdf(contractId: string) {
|
||||
const contract = await this.contractsService.findById(contractId);
|
||||
const { view } = await this.documentViewModelBuilder.build(contractId);
|
||||
const record = await this.upsertContractPdf(contractId, contract.reference, view);
|
||||
return this.filesService.streamById(record.id);
|
||||
}
|
||||
|
||||
/**
|
||||
* Rebuild the stored `contract` PDF from the current aggregate (now including
|
||||
* the latest signatures) so the downloaded/viewed file matches the live HTML
|
||||
|
||||
Reference in New Issue
Block a user