-
Notifications
You must be signed in to change notification settings - Fork 0
PEACH Integration
This living document is the single home for all design work that connects the Permit Connect Navigator Service (PCNS) to the Permitting Exchange, Aggregation & Collection Hub (PEACH). Each integration feature is documented within the Design Modules section.
- Guiding Principles
-
Design Modules
-
Process Event Set Parsing
- Background & Goals
- Executive Level Changes
- Architecture
- Detailed Design
- Error Handling
- (reserved for future features)
-
Process Event Set Parsing
- Configuration & Deployment
- Risks & Mitigations
- Open Questions & Future Work
- Authoritative Data - PEACH remains the single source of truth for permit information; PCNS only transforms for display.
- Server Side Transformation - All PEACH payloads are handled in the PCNS backend.
- Minimise Coupling - Future PEACH contract changes are isolated to a single service.
- Stateless Frontend - The UI never calls PEACH directly, preventing CORS, auth, and version issues.
- Extensibility - Each integration capability (e.g., Process Events, Record Linkage) lives in its own section under this hub document.
-
Adhere to Existing Convetntions - Use existing PCNS API architectural conventions (Router → Controller → Services) and reuse the established
axiospattern for third party API calls.
PCNS must display up-to-date permit lifecycle information drawn from PEACH Process Event Sets. A Process Event Set groups all application process codes (e.g., Pre-Application, Referral, Decision) for a single permit record.
The goals of this design are:
- Automate tracker updates so that staff are not manually reconciling data.
- Parse the raw PIES payload into a minimal object that the PCNS front-end can consume efficiently.
- No PEACH calls from the browser. Introduce a dedicated PeachProcessEventService in the PCNS back-end.
-
New PCNS Endpoint -
GET peach/process/:recordIdwith optionalsystem_idquery param. -
Parser - Converts raw
ProcessEventSetto a compact summary DTO for the UI.
graph LR
UI["PCNS UI"] <-- GET peach/process-events --> Router["PeachProcessEvent Router"]
Router <--> Controller["PeachProcessEvent Controller"]
Controller <--> Service["PeachProcessEvent Service"]
Service <-- "HTTP GET /process-events" --> PEACH["PEACH API"]
Flow description - The UI requests data from PCNS. The backend fetches from PEACH, parses, and returns DTO to the UI.
| Method | Path | Purpose |
|---|---|---|
GET |
peach/process/:recordId |
Authenticate and validate params / query. Return parsed process event summary for a given record. Accepts optional system_id to disambiguate 409 conflicts. |
-
system_id- optional string; recommended for clients that already know their LoB source system identifier.
-
200 OK- Body containsProcessEventSummaryDTO. -
404 Not Found- Record not found in PEACH DB. -
409 Conflict- Multiple records sharerecord_id; client must retry withsystem_id.
ProcessEventController.getProcessEventSet(req, res)
- Invoke
peachProcessEventService.fetchProcessEvents(recordId, systemId?). - Parse service call result and return DTO.
- Handle and map PEACH error codes to PCNS error schema.
Input: Raw ProcessEventSet payload from PEACH.
Output: ProcessEventSummary DTO
Rules/Steps:
- Sort process events in process event set by
event.start_datetime || event.start_dateand/orevent.end_datetime || event.end_dateif applicable. - TODO: More logic/sorting for isolating/setting most recent/accurate process event beyond dates will likely be needed.
- “Current stage and status” is the "last/assigned" event in the sorted/transformed list.
- Build ts object to reflect defined type to be passed to UI (TODO: type not yet formalized).
type ProcessEventsSummary {
recordId: string;
systemId: string;
stage: string;
status: string;
statusLastVerified: string;
stageLastVerified: string;
}Isolate PEACH api calls.
fetchProcessEvents(recordId, systemId?) - Returns raw ProcessEventSet JSON from PEACH, using axios.
No relational changes.
- Replace existing tracker data source with a call to
/records/:recordId/events. - Display Current Phase/Stage/Status in Tracker UI.
- Render timeline/tracker (component already exists - new design coming).
-
PEACH 409 - Controller forwards as 409; If applicable, UI prompts user to retry with specific
system_id. - Network / 5xx - Controller responds 503.
-
PEACH_API_BASE_URL- e.g.https://<PEACH_API_URL_TBD>/api/v1. -
PEACH_CLIENT_ID/PEACH_CLIENT_SECRET- Injected by OpenShift secret.
- PEACH schema drift - Mitigated by single parsing service; update parser only.
- Rate limiting - Adopt conservative polling, (optional) implement a cache.
- Do we need to persist any data in PCNS DB?
- Should we utilize an in memory cache to hold commonly fetched PEACH data and expose a
POST peach/process/:recordId/refreshor some kind of cronjob/scheduling for refreshing cache? - Confirm final UI tracker/timeline design.
Table of Contents
-
Software Design
-
Developer Resources
-
Product Roadmap