mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-08-29 15:18:11 +00:00
implement self-healing for freight payment milestones and enhance contract change request visibility
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user