Skip to main content

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

StepBusiness meaning
load existing CRtarget CR must exist
if area data present, validate area hierarchyarea changes are checked
if status is Return, some area changes are allowedarea replacement depends on current status
if severity update present, validate severity LOVseverity changes are controlled
if status is Return/Closed/Cancel, reject some severity changesnot all statuses allow priority change
recalculate ETTR/ETTA if neededSLA dates may move
if diagnosis code update present, validate diagnosis and workgroupdiagnosis changes require mapping
save system noteupdate action creates note trail
update master recordlocal CR record changes are saved
update attachments if presentattachments are handled afterward
write success auditupdate 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:166
  • intt-portal/src/app/components/pages/main-modules/cr/cr-details/cr-details.component.ts:2975
  • mvp2-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