CR Creation
This page explains how a Caution Report is created.
API Endpoints
POST /data/caution-report/create
Purpose
CR creation prepares a new caution report from portal input, attaches user context, and hands the create request to the queue-driven backend path.
Business meaning
At business level, creation means:
- user enters new CR information in the portal
- attachments, area data, and LOV selections are prepared
- creator identity is attached from the logged-in user
- the create request is sent to the backend worker path
- the caller receives either a downstream create result or an error
Flow summary
| Step | Business meaning |
|---|---|
| validate JWT and CASL | caller must have CR create permission |
| clone attachments, area data, LOV arrays | mutable request data is prepared |
set staffId from authenticated user | creator context is attached |
send create-caution-report command to RabbitMQ | create is handed to downstream worker flow |
| handle queue or downstream error | bad request is returned if create path fails |
| return downstream create result | successful create response is returned |
Implementation note
This matches the current implementation:
- controller route exists at
POST /data/caution-report/create - request arrays are cloned before send
staffIdis set from the logged-in user- the create call sends
create-caution-reportthrough RabbitMQ
Code refs:
mvp2-data-service/src/modules/caution-report/caution-report.controller.ts:119intt-portal/src/app/components/pages/main-modules/cr/cr-create/cr-create.component.ts:1919
What users should know
- create is not just a local form save
- the final result depends on downstream processing
- attachments and area data are part of the create payload
- user identity is taken from the authenticated session, not typed manually