implement self-healing for freight payment milestones and enhance contract change request visibility

This commit is contained in:
Marshal
2026-07-07 07:45:59 +00:00
parent 05b13e84a8
commit 05d71eb6da
8 changed files with 124 additions and 9 deletions

View File

@@ -567,6 +567,21 @@ export class ContractsService {
);
}
// Surface the staff "request changes" note so the portal can show the
// customer what to fix. Degrade to null on lookup failure — a missing note
// must never 500 a contract fetch.
if (contract.status === 'CHANGES_REQUESTED') {
try {
const note = await this.contractsRepository.findLatestReviewNote(
contract.id,
'CHANGES_REQUESTED',
);
contract.latestChangeRequestNote = note?.body ?? null;
} catch {
contract.latestChangeRequestNote = null;
}
}
return contract;
}