---
title: Auditor assignment override management
summary: Maintains premium auditors, zip-code routing assignments, and policy-specific default or exclusion overrides.
status: draft
owner: SAIF Doc Gen
last_reviewed: 2026-07-30
library: SAIF.Business.External.Users
reference_type: package
operation_id: OP-EU-04
trigger: Caller creates, retrieves, updates, or resolves auditors, auditor zip assignments, or audit assignment overrides.
---

# Auditor assignment override management

This operation merges the premium-auditor maintenance classes into one domain view. It covers auditor master rows, the zip-code-to-auditor map, and policy-level override rows that can force or prohibit specific auditor assignments during premium-audit routing.

| Field | Value |
| --- | --- |
| **Operation ID** | OP-EU-04 |
| **Trigger** | Auditor maintenance, override maintenance, or default-auditor resolution for a policy |
| **Inputs** | Auditor ID or user ID, vendor number, assign/filter/schedule/reviewer flags, policy number, zip code, default auditor ID, do-not-assign auditor ID, audit type |
| **Outputs** | Persisted auditor-domain rows and resolved default auditor object |
| **Primary components** | `clsAuditor`, `clsAuditorCollection`, `clsAuditAssignmentOverride`, `clsAuditorZipCode`, `clsAuditorZipCodeCollection` |
| **Entry point** | `Business\SAIF.Business.External.Users\clsAuditor.vb` |

## Steps

1. **Create a new auditor identifier before insert.** `clsAuditor` uses a scalar create request that reads the next `PA_AUDITOR_ID` surrogate as `MAX(PA_AUDITOR_ID) + 1` ([SQL-001](../sql/SQL-001-saif-business-external-users.md), [PA_AUDITOR](../database-tables.md#pa_auditor)).
2. **Insert, retrieve, or update the auditor master row.** The auditor object persists its assign/filter/schedule/reviewer flags, contact fields, user ID, and vendor number through the `PA_AUDITOR` CRUD statements ([SQL-003](../sql/SQL-003-saif-business-external-users.md), [SQL-011](../sql/SQL-011-saif-business-external-users.md), [SQL-043](../sql/SQL-043-saif-business-external-users.md), [PA_AUDITOR](../database-tables.md#pa_auditor)).
3. **Load filtered auditor collections for assignment scenarios.** `clsAuditorCollection` retrieves all auditors or narrows the list by vendor number plus assignable, filterable, schedulable, or reviewer flags ([SQL-012](../sql/SQL-012-saif-business-external-users.md), [PA_AUDITOR](../database-tables.md#pa_auditor)).
4. **Load or create a policy override row.** `clsAuditAssignmentOverride` retrieves `PA_ASSIGN_OVERRIDE` by policy number, or creates a new in-memory row seeded with the target policy number ([SQL-010](../sql/SQL-010-saif-business-external-users.md), [PA_ASSIGN_OVERRIDE](../database-tables.md#pa_assign_override)).
5. **Validate whether the policy can carry an override.** `ValidAuditablePolicy` rejects leasing-member, state-agency, or HCW policies by inspecting the loaded policy data before save.
6. **Validate the chosen auditors for the override row.**
   - `ValidDefaultAuditorId` requires the default auditor to exist and be assignable.
   - `ValidDoNotAssignAuditorId` requires the excluded auditor to exist and be assignable.
   - `ValidAuditors` rejects the same auditor ID in both fields ([BR-EU-03](../business-rules.md#br-eu-03-audit-assignment-auditor-distinctness)).
7. **Insert or update the override row.** The override object persists the selected default and do-not-assign auditor IDs, keyed by policy number ([SQL-002](../sql/SQL-002-saif-business-external-users.md), [SQL-042](../sql/SQL-042-saif-business-external-users.md), [PA_ASSIGN_OVERRIDE](../database-tables.md#pa_assign_override)).
8. **Maintain the auditor zip-code map.** `clsAuditorZipCode` inserts, retrieves, updates, and deletes `PA_AUDITOR_ZIP_CODE` rows keyed by auditor ID and zip code ([SQL-004](../sql/SQL-004-saif-business-external-users.md), [SQL-013](../sql/SQL-013-saif-business-external-users.md), [SQL-044](../sql/SQL-044-saif-business-external-users.md), [SQL-052](../sql/SQL-052-saif-business-external-users.md), [PA_AUDITOR_ZIP_CODE](../database-tables.md#pa_auditor_zip_code)).
   - Update uses the original auditor ID and zip code as the key so the row can be moved to a new pairing.
9. **Validate zip-code assignments before save.** The zip-code object requires the referenced auditor to exist, requires that auditor to be assignable, and requires the zip code to resolve through `clsZipCode`.
10. **Resolve the default auditor for a policy.** `GetDefaultAuditorForPolicy` uses a special NCCI path when the audit type is `NCCITEST`; otherwise it loads the policy override and either returns the override auditor or falls back to the first auditor mapped to the policy zip code.
11. **Return the resolved auditor object.** The final lookup reloads the chosen `PA_AUDITOR` row by ID so callers receive the full auditor object ([SQL-011](../sql/SQL-011-saif-business-external-users.md), [PA_AUDITOR](../database-tables.md#pa_auditor)).

## Process flow

The following diagram visualizes this operation's control flow.

```mermaid
flowchart TD
    Start([Auditor-domain request]) --> Kind{What is being managed?}
    Kind -->|Auditor master| Auditor[Create or load auditor]
    Kind -->|Policy override| Override[Load policy override]
    Kind -->|Zip assignment| Zip[Load or create auditor zip assignment]
    Auditor --> SaveAuditor[Save auditor row]
    Override --> ValidateOverride[Validate policy and auditors]
    ValidateOverride --> SaveOverride[Save override row]
    Zip --> ValidateZip[Validate auditor and zip code]
    ValidateZip --> SaveZip[Save zip assignment row]
    SaveAuditor --> Done([Return saved or resolved auditor data])
    SaveOverride --> Done
    SaveZip --> Done
```

## Failure and edge-case behavior

- Leasing-member, state-agency, and HCW policies fail override validation before any `PA_ASSIGN_OVERRIDE` write occurs.
- The override cannot use the same auditor in both the default and do-not-assign fields ([BR-EU-03](../business-rules.md#br-eu-03-audit-assignment-auditor-distinctness)).
- Zip-code updates can fail when the new auditor is not assignable or the zip code does not resolve through `clsZipCode`.
- Default-auditor resolution falls back to zip-code routing only when no explicit override default exists.

## Related documentation
- [Operations and processes](../operations-processes.md)
- [Business rules](../business-rules.md)
- [SQL catalog](../sql/index.md)
- [Database tables](../database-tables.md)

## Sources
- `Business\SAIF.Business.External.Users\clsAuditAssignmentOverride.vb`
- `Business\SAIF.Business.External.Users\clsAuditor.vb`
- `Business\SAIF.Business.External.Users\clsAuditorCollection.vb`
- `Business\SAIF.Business.External.Users\clsAuditorZipCode.vb`
- `Business\SAIF.Business.External.Users\clsAuditorZipCodeCollection.vb`
- `Business\SAIF.Business.External.Users\clsZipCode.vb`
