CR Update Rules
This page explains how a Caution Report can be updated and which validations are applied.
API Endpoints
PUT /data/caution-report/update/:id
Purpose
CR update lets users change report data such as:
- area data
- severity
- diagnosis code
- attachments
The update flow is conditional and validation-heavy.
Business meaning
Area, severity, and diagnosis updates each trigger their own validation path, and some status combinations block certain changes.
Flow summary
| Step | Business meaning |
|---|---|
| load existing CR | target CR must exist |
| if area data present, validate area hierarchy | area changes are checked |
| if status is Return, some area changes are allowed | area replacement depends on current status |
| if severity update present, validate severity LOV | severity changes are controlled |
| if status is Return/Closed/Cancel, reject some severity changes | not all statuses allow priority change |
| recalculate ETTR/ETTA if needed | SLA dates may move |
| if diagnosis code update present, validate diagnosis and workgroup | diagnosis changes require mapping |
| save system note | update action creates note trail |
| update master record | local CR record changes are saved |
| update attachments if present | attachments are handled afterward |
| write success audit | update is finalized |
Implementation note
This matches the current implementation:
- backend verifies existing CR first
- area validation runs when area data is present
- severity and diagnosis updates are handled separately
- workgroup must exist for diagnosis changes
- a system-generated CR note is created during update
- attachments are updated after master record update
Code refs:
mvp2-data-service/src/modules/caution-report/caution-report.controller.ts:166intt-portal/src/app/components/pages/main-modules/cr/cr-details/cr-details.component.ts:2975mvp2-data-service/src/modules/caution-report/caution-report.service.ts:159
What users should know
- update is not a free-form edit path
- business status can affect whether some changes are allowed
- diagnosis updates may change workgroup behavior
- note and audit trail are part of a successful update