feat: enhance contract detail page with document grouping and clearance modal

- Added functionality to group contract documents into categories: Contract, Profile, and Clearance.
- Implemented a modal for uploading and managing clearance documents.
- Created a new ActionNeededSection component to display pending customer actions.
- Introduced deriveActionItems function to generate actionable items based on contract and booking statuses.
- Developed ContractClearancePanel for handling clearance document uploads and reviews.
- Added support for ad-hoc document uploads in the clearance panel.
This commit is contained in:
Marshal
2026-06-28 15:25:22 +00:00
parent da533a488d
commit 2de1c2e7be
8 changed files with 921 additions and 494 deletions

View File

@@ -294,7 +294,15 @@ export class ContractClearanceService {
note?: string,
): Promise<Contract> {
const contract = await this.contractsService.findById(contractId);
if (contract.status !== 'CLEARANCE_UNDER_REVIEW') {
// Reviewing is allowed both while the batch is UNDER_REVIEW and after it has
// dropped back to AWAITING_CLEARANCE_DOCUMENTS — querying one document flips
// the contract to "awaiting" (the customer must re-upload), but the reviewer
// may still be working through the rest of the batch. Restricting to
// UNDER_REVIEW only would 409 every review after the first query.
if (
contract.status !== 'CLEARANCE_UNDER_REVIEW' &&
contract.status !== 'AWAITING_CLEARANCE_DOCUMENTS'
) {
throw new ConflictException(
`Cannot review clearance documents on status "${contract.status}".`,
);