Skip to main content

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

StepBusiness meaning
validate JWT and CASLcaller must have CR create permission
clone attachments, area data, LOV arraysmutable request data is prepared
set staffId from authenticated usercreator context is attached
send create-caution-report command to RabbitMQcreate is handed to downstream worker flow
handle queue or downstream errorbad request is returned if create path fails
return downstream create resultsuccessful 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
  • staffId is set from the logged-in user
  • the create call sends create-caution-report through RabbitMQ

Code refs:

  • mvp2-data-service/src/modules/caution-report/caution-report.controller.ts:119
  • intt-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