Zip code routing lookup¶
This operation reads the premium-audit zip-code routing view backed by PA_ZIP_CODE, COUNTY, and OFFICE_CODE. It returns the routing object used by auditor-assignment validation and other location-based decisions.
| Field | Value |
|---|---|
| Operation ID | OP-EU-08 |
| Trigger | Caller needs routing details for a postal zip code |
| Inputs | Zip code |
| Outputs | Populated clsZipCode object or an empty lookup object |
| Primary components | clsZipCode.GetZipCode |
| Entry point | Business\SAIF.Business.External.Users\clsZipCode.vb |
Steps¶
- Build the retrieve request for the supplied zip code.
BeforeRetrieveappendswhere zip_code = :ZipCodeto the lookup SQL and binds the five-character zip code parameter (SQL-037, PA_ZIP_CODE). - Read the routing projection from the joined tables. The SQL selects the zip row, county, office, and audit-office descriptions, using
NVL(z.audit_office_code, c.office_code)so county office routing fills in when no audit-office code is stored (SQL-037, PA_ZIP_CODE, COUNTY, OFFICE_CODE). - Hydrate the lookup object when a row exists.
Loadcopies zip code, state, county, office, audit-office, and policy-region values into the business object. - Return an empty object when no row matches.
AfterRetrievecreates a freshclsZipCodeinstead of throwing when the data reader is empty.
Process flow¶
The following diagram visualizes this operation's control flow.
flowchart TD
Start([Zip lookup request]) --> Query[Query routing tables by zip code]
Query --> Match{Row found?}
Match -->|Yes| Fill[Populate routing object]
Match -->|No| Empty[Create empty lookup object]
Fill --> Done([Return zip routing result])
Empty --> Done
Failure and edge-case behavior¶
- Missing routing data does not raise a persistence error; callers receive an empty object.
- The object prefers the audit-office code when present and falls back to the county office code otherwise.
Related documentation¶
Sources¶
Business\SAIF.Business.External.Users\clsZipCode.vb