Get policy header¶
PolicyHeaderService is the facade over the Policy Header API client. It returns the header for a policy and trims the associations list for external users.
| Field | Value |
|---|---|
| Operation ID | OP-12 |
| Trigger | IPolicyHeaderService.GetHeader call |
| Inputs | Policy number, optional customer id, optional user type code |
| Outputs | PolicyHeader |
| Primary components | PolicyHeaderService.GetHeader, PolicyHeaderService.GetRelationships |
| Entry point | src/BolMiddleware/Services/Headers/Policy/PolicyHeaderService.cs |
Steps¶
- Call the Policy Header API client with the policy number and an external-user flag that is true when the customer id is greater than zero.
- When the flag is true and a header came back, switch on the user type code (BR-BOLMIDDLEWARE-013):
POLCY: replace the associations with those from a second header lookup for the customer id.AGNCY: keep only associations that contain a policy whoseAgencyIdequals the customer id.- Any other code: leave the associations unchanged.
- Return the header.
- On exception: log the error through
ISaifLogServiceand return a defaultPolicyHeader(BR-BOLMIDDLEWARE-021). GetRelationships(policyNumber)returns the list of policy associations from the same API and follows the same logging behavior.
Process flow¶
The following diagram visualizes this operation's control flow.
flowchart TD
Start([GetHeader]) --> S1[Call Policy Header API with external flag]
S1 --> D1{Customer id above zero?}
D1 -->|No| EndOk([Return header])
D1 -->|Yes| D2{User type code?}
D2 -->|POLCY| S2[Replace associations from customer id lookup]
D2 -->|AGNCY| S3[Keep associations with matching AgencyId]
D2 -->|Other| EndOk
S2 --> EndOk
S3 --> EndOk
S1 -->|Exception| EndErr([Log and return default])
Failure and edge-case behavior¶
- A failed API call yields an empty header rather than an error, so the page cannot distinguish an outage from a missing policy.
- The
POLCYbranch makes a second API call; the customer id and type code come from the web context, not the identity.
Related documentation¶
- Index
- Overview
- Architecture
- Dependencies
- Configuration
- Operations and processes
- Business rules
- Security and authorization
- Service registration
- API reference
Sources¶
- src/BolMiddleware/Services/Headers/Policy/PolicyHeaderService.cs
- src/BolMiddleware/Services/Headers/Policy/IPolicyHeaderService.cs