CR NEPS Module
This page explains how NEPS supports Caution Report flow.
This flow checked against current code in intt-portal and mvp2-data-service.
API Endpoints
GET /data/neps/get-building-idPOST /data/neps/import-fence-dataGET /data/neps/get-building-latlongGET /data/neps/update-point-coordinate
Bottom line
NEPS Module in CR flow not separate ticket engine. It acts as geospatial helper.
Main CR-side use today:
- convert pinned
lat+longinto building candidates - support area/building selection during CR creation
- maintain polygon and point-coordinate data used by lookup
Main CR use
Portal CR create page calls:
GET /data/neps/get-building-id
Trigger points confirmed in code:
- after user pins map location
- when user clicks generate building ID from manual
latandlong
So NEPS helps fill building-related context before CR create submitted.
Runtime flow for building lookup
| Step | What system does |
|---|---|
| user chooses location | map pin or manual lat/long |
| portal calls NEPS lookup | data/neps/get-building-id |
| backend validates input | both lat and long required |
| backend finds matching polygon | searches area polygons covering point |
| backend adds sibling building candidates | loads other area data under same parent |
| backend returns building list | each item has buildingId, longitude, latitude |
| portal uses result | updates building choices and last-layer input |
What happens if lookup fails
If no polygon matches given coordinates, backend throws exact business message:
"Given Lat/Long doesn't match to any building polygon. Please provide the building ID manually."
Portal handles this case and warns user, then allows manual building selection path.
Important meaning:
- NEPS lookup helpful
- not mandatory when polygon match missing
Other NEPS endpoints confirmed
NEPS module also exposes:
POST /data/neps/import-fence-dataGET /data/neps/get-building-latlongGET /data/neps/update-point-coordinate
Business meaning:
import-fence-dataloads building boundary JSON into polygon storageget-building-latlongresolves coordinate from building IDupdate-point-coordinaterecalculates point coordinate from stored polygon midpoint
These look admin or maintenance oriented, not normal CR end-user flow.
What backend returns
Lookup response item shape confirmed:
buildingIdlongitudelatitude
Backend builds this from AreaData.coordinate.
Important implementation nuance
NEPS code exists in both:
mvp2-data-servicemvp3-ticket-service
But current CR portal flow shown in repo calls:
data/neps/get-building-id
So for current CR documentation, mvp2-data-service path is direct confirmed path.
Flowchart verdict
NEPS Module flowchart useful, but safest code-backed reading:
- NEPS in CR context = geospatial building resolver plus polygon maintenance
- not separate CR status or ticket lifecycle
- main user-facing value = helping map location become building selection
Code references
intt-portal/src/app/components/pages/main-modules/cr/cr-create/cr-create.component.tsmvp2-data-service/src/modules/neps/neps.controller.tsmvp2-data-service/src/modules/neps/neps.service.tsmvp2-data-service/src/modules/neps/neps-response.model.ts