CR GOTH Create
This page explains the GOTH-sourced Caution Report creation path.
This flow was checked against the current code in mvp2-data-service and mvp3-caution-report-queue-service.
API Endpoints
POST /data/caution-report/goth/create
Bottom line
The GOTH Create CR flowchart is mostly correct and it represents a genuinely different create path from normal CR creation.
GOTH creation is:
- a separate public endpoint
- queue-driven through a dedicated RabbitMQ message
- validated and mapped from GOTH payload fields
- duplicate-checked before create
- saved as a CR with
source = GOTH - followed by GOTH and TMF-related downstream handling
What starts the flow
The entry point is:
POST /data/caution-report/goth/create
Unlike normal CR creation, this route is marked @Public() and does not attach creator identity from the current portal session.
Instead, creator context comes from the GOTH payload itself through heroAgent.
Input shape confirmed from code
The GOTH payload includes fields such as:
gothTicketNosourcecreationDateheroAgent.nameheroAgent.staffIdcustomerNamecustomerContactNocustomerEmaillatitudelongitudesymptomreasonOfUrgencyattachmentcommentduplicateFlag
Main runtime flow
| Step | What the system does |
|---|---|
| Accept public request | controller receives goth/create request |
| Clone attachments | prepares attachment array |
| Send RabbitMQ command | sends create-goth-caution-report |
| Validate payload | worker validates required fields, datetime, hero agent, coordinates, and attachments |
| Resolve area | derives area data from latitude and longitude |
| Resolve severity | maps GOTH urgency input to CR severity configuration |
| Resolve diagnosis | maps GOTH symptom input to diagnosis code and impacted element |
| Prepare CR status | starts the CR in In-Progress |
| Run duplicate check | checks nearby matching CRs unless duplicateFlag is already true |
| Return duplicate response if needed | returns duplicate CR details instead of creating a new CR |
| Build CR record | creates CR data with GOTH ticket and agent fields |
| Assign workgroup | maps diagnosis to a workgroup such as ENCC or SAO |
| Generate CR ticket number | creates the internal Antrix CR ticket number |
| Resolve nearby FDC | derives cabinetId from nearby FDC data when possible |
| Save CR | writes the new caution report |
| Save note and metadata | stores creation note, LOVs, and area data |
| Save attachments | stores GOTH attachments if present |
| Try TMF dispatch path | attempts GOTH-to-TMF downstream handling |
| Fallback to Manual Assign if needed | updates CR status LOV to Manual Assign when downstream dispatch fails |
| Dispatch back to GOTH | performs GOTH-side follow-up dispatch when building data is available |
| Return final response | returns success or a duplicate/error response |
What makes GOTH create different from normal CR create
| Normal CR create | GOTH create |
|---|---|
| authenticated portal route | public integration route |
uses logged-in user staffId | uses heroAgent.staffId from payload |
sends create-caution-report | sends create-goth-caution-report |
| standard portal form model | external GOTH payload model |
| generic create response | can return duplicate-specific response |
Duplicate handling
This is one of the most important GOTH-specific behaviors.
The worker checks for nearby duplicate CRs based on:
- latitude and longitude
- system module alarm rules
- mapped impacted element
- created date window
If a duplicate is found and duplicateFlag is false, the flow returns a Duplicate CR response instead of creating a new CR.
That response includes details such as:
- existing Antrix ticket number
- GOTH ticket id
- building id
- latitude and longitude
- symptom
- urgency reason
Confirmed stored GOTH fields
When the worker builds the CR, it stores GOTH-specific fields such as:
sourcegothTicketIdgothAgentNamegothStaffIdgothCreatedDate
This is why GOTH-created CRs later show different creator/source information in the detail response.
Notes and attachments
The worker writes a creation note in this format:
Created GOTH Caution Report: <crTicketNo>|<gothTicketId>
If attachments are included:
- they are saved into CR storage
- empty descriptions are not allowed later in the downstream TMF path
- attachment sync errors are logged as failures
Downstream behavior after create
After the CR is created, the flow does more than just stop at the database save.
The worker attempts downstream handling that includes:
- GOTH-to-TMF dispatch logic
- TMF attachment upload when dispatch succeeds
- fallback of CR status LOV to
Manual Assignwhen TMF dispatch fails - GOTH-side follow-up dispatch when building data exists
So the business meaning is:
- GOTH create is a create-plus-handoff path
- downstream success can affect whether the CR continues automatically or needs manual follow-up
Flowchart verdict
The GOTH Create CR flowchart is reliable for the main business path.
The most important code-confirmed points are:
- it is a separate public route
- duplicate detection is built into the create flow
- the CR is created using mapped GOTH fields, not the normal portal user payload
- downstream TMF/GOTH handling is part of the overall flow
- failed downstream dispatch can move the CR into
Manual Assignrather than fully failing the entire create
That last point is the main nuance worth keeping visible in the docs.
Code references
mvp2-data-service/src/modules/caution-report/caution-report.controller.tsmvp3-caution-report-queue-service/src/modules/caution-report/caution-report.controller.tsmvp3-caution-report-queue-service/src/modules/caution-report/caution-report.service.tsmvp2-data-service/src/modules/caution-report/caution-report.dto.tsmvp2-data-service/src/modules/caution-report/caution-report-response.model.ts