CR List and Detail
This page explains how users view Caution Reports in list form and open one report in detail view.
API Endpoints
GET /data/caution-report/allGET /data/caution-report/by-id/:id
Purpose
List and detail flows let users:
- find relevant CRs
- filter them by business criteria
- open one CR for deeper review
- see current status, work order, note, and activity context
CR list flow
Business meaning
List flow is not a simple table read. It applies role-aware filtering, date and status filtering, workgroup restrictions, and search-driven narrowing before returning paginated rows.
Flow summary
| Step | Business meaning |
|---|---|
| prepare page and limit | pagination starts |
| check admin vs non-admin | role affects workgroup restrictions |
| if NOC user, force allowed workgroups | CR visibility is narrowed |
| build base filter | standard query filter is built |
| apply scope, priority, date, source, creator, area, status filters | main list filtering happens |
| collect matching CR ids | filter narrowing can happen before final query |
| query paginated rows and total count | page result is fetched |
| map response rows | UI-facing response is built |
Implementation note
This matches the current implementation:
- portal uses
GET data/caution-report/all - backend applies workgroup rules for non-admin and NOC users
- backend returns paginated rows plus total
- export path also exists separately
Code refs:
intt-portal/src/app/components/pages/main-modules/cr/cr.component.ts:429intt-portal/src/app/components/pages/main-modules/cr/cr.component.ts:621mvp2-data-service/src/modules/caution-report/caution-report.controller.ts:246mvp2-data-service/src/modules/caution-report/caution-report.service.ts:691
CR detail flow
Business meaning
Detail flow loads one CR, enforces access rules, refreshes some derived state, and returns a richer response than the list page.
Flow summary
| Step | Business meaning |
|---|---|
| load user workgroups | access scope is prepared |
| load CR by id | detail record is fetched |
| apply LOB and NOC access checks | unauthorized users are blocked |
| read latest TMF activity status | current downstream state is considered |
| update local TMF status if needed | local record can be refreshed |
| resolve CR status LOV | current CR status is derived |
| calculate aging if still active | open CRs get derived aging |
| refresh closure data from latest note if needed | terminal-state data can be corrected |
| load creator user unless source is GOTH | detail response is enriched |
Implementation note
This matches the current implementation:
- portal opens
GET data/caution-report/by-id/:id - backend enforces LOB and NOC restrictions
- backend recalculates aging for non-closed/non-cancelled CRs
- backend can refresh closure remark data from latest note
Code refs:
intt-portal/src/app/components/pages/main-modules/cr/cr-details/cr-details.component.ts:734mvp2-data-service/src/modules/caution-report/caution-report.controller.ts:281mvp2-data-service/src/modules/caution-report/caution-report.service.ts:811