---
title: SAIF.Business.Policy.Agency operations and processes
summary: Business and technical operations supported by SAIF.Business.Policy.Agency.
status: draft
owner: Technical Writer
last_reviewed: 2026-07-31
library: SAIF.Business.Policy.Agency
reference_type: package
---

# SAIF.Business.Policy.Agency operations and processes

This page catalogs the reusable retrieval, classification, and aggregation operations implemented by `SAIF.Business.Policy.Agency`. Detailed step-by-step behavior lives in the operation pages under `operations/`.

## Operation catalog
| Operation | Intent | Trigger | Inputs | Outputs | Rules | Tables | SQL |
| --- | --- | --- | --- | --- | --- | --- | --- |
| [Retrieve an agency by sequence number](operations/retrieve-an-agency-by-sequence-number.md) | Load one agency record. | A caller requests an agency by key. | `IDataPortalInfo`, agency sequence number | `clsAgency` | [BR-001](business-rules.md#br-001-missing-key-retrieval-returns-a-default-object), [BR-002](business-rules.md#br-002-agency-sequence-number-is-required), [BR-024](business-rules.md#br-024-the-library-is-retrieve-only), [BR-025](business-rules.md#br-025-identity-keys-are-agency-seq-contract-seq-and-agent-number) | [AGENCY](database-tables.md#agency) | [SQL-001](sql/SQL-001-retrieve-agency-by-sequence-number.md) |
| [Retrieve a set of agencies](operations/retrieve-a-set-of-agencies.md) | Load agencies by FEID and/or contract type criteria. | A caller requests all agencies, FEID-matched agencies, or agencies with selected contract types. | `IDataPortalInfo`, optional FEID, optional contract types | `clsAgencyCollection` | [BR-003](business-rules.md#br-003-agency-feid-filters-agency-collections), [BR-004](business-rules.md#br-004-contract-type-filters-use-correlated-contract-existence), [BR-005](business-rules.md#br-005-empty-collection-criteria-returns-every-agency), [BR-024](business-rules.md#br-024-the-library-is-retrieve-only) | [AGENCY](database-tables.md#agency), [AGENCY_CONTRACT](database-tables.md#agency_contract) | [SQL-002](sql/SQL-002-search-agencies-by-feid-and-contract-types.md) |
| [Bulk-load producers for a set of agencies](operations/bulk-load-producers-for-a-set-of-agencies.md) | Populate child producer collections in one pass. | A caller has already loaded an agency collection and wants producer children. | `clsAgencyCollection` | Populated `Producers` collections | [BR-006](business-rules.md#br-006-bulk-loaders-discard-orphan-child-rows), [BR-007](business-rules.md#br-007-bulk-loaders-replace-n-plus-1-child-retrieval), [BR-023](business-rules.md#br-023-producer-agencies-are-detected-when-agency-sequence-number-equals-agent-number) | [AGENT](database-tables.md#agent) | [SQL-009](sql/SQL-009-retrieve-producers.md) |
| [Bulk-load contracts for a set of agencies](operations/bulk-load-contracts-for-a-set-of-agencies.md) | Populate child contract collections in one pass. | A caller has already loaded an agency collection and wants contract children. | `clsAgencyCollection` | Populated `Contracts` collections | [BR-006](business-rules.md#br-006-bulk-loaders-discard-orphan-child-rows), [BR-007](business-rules.md#br-007-bulk-loaders-replace-n-plus-1-child-retrieval), [BR-010](business-rules.md#br-010-agency-contract-collection-scope-depends-on-agency-sequence-number) | [AGENCY_CONTRACT](database-tables.md#agency_contract) | [SQL-004](sql/SQL-004-retrieve-agency-contracts.md) |
| [Determine an agency's contract type on a date](operations/determine-an-agencys-contract-type-on-a-date.md) | Pick the first active contract classification. | A caller reads `clsAgency.ContractType(inDate)`. | Agency contract collection, as-of date | `AgencyContractTypes` value | [BR-008](business-rules.md#br-008-active-status-uses-effective-and-expiration-windows), [BR-009](business-rules.md#br-009-missing-active-contracts-mean-unassigned-contract-type) | [AGENCY_CONTRACT](database-tables.md#agency_contract) | [SQL-004](sql/SQL-004-retrieve-agency-contracts.md) |
| [Retrieve agency contracts](operations/retrieve-agency-contracts.md) | Load one contract or a contract collection. | A caller requests a keyed contract or the contracts for an agency. | `IDataPortalInfo`, contract key and/or agency key | `clsAgencyContract` or `clsAgencyContractCollection` | [BR-001](business-rules.md#br-001-missing-key-retrieval-returns-a-default-object), [BR-010](business-rules.md#br-010-agency-contract-collection-scope-depends-on-agency-sequence-number), [BR-011](business-rules.md#br-011-agency-contract-and-commission-codes-map-to-fixed-domain-values), [BR-024](business-rules.md#br-024-the-library-is-retrieve-only), [BR-025](business-rules.md#br-025-identity-keys-are-agency-seq-contract-seq-and-agent-number) | [AGENCY_CONTRACT](database-tables.md#agency_contract) | [SQL-003](sql/SQL-003-retrieve-agency-contract-by-sequence-number.md), [SQL-004](sql/SQL-004-retrieve-agency-contracts.md) |
| [Classify a contract](operations/classify-a-contract.md) | Translate contract and commission codes. | A caller inspects `clsAgencyContract` classification properties or conversion helpers. | Contract type code, commission GL code, or enum value | Domain enum, code, or Boolean result | [BR-011](business-rules.md#br-011-agency-contract-and-commission-codes-map-to-fixed-domain-values), [BR-012](business-rules.md#br-012-unknown-contract-or-commission-codes-become-unassigned), [BR-013](business-rules.md#br-013-producer-commission-contracts-require-gl-code-agt), [BR-014](business-rules.md#br-014-unmapped-enum-to-code-conversions-raise-exceptions) | N/A | N/A |
| [Retrieve agency offices](operations/retrieve-agency-offices.md) | Load one office or the offices for an agency. | A caller requests a keyed office or all offices for an agency. | `IDataPortalInfo`, office number and/or agency sequence number | `clsAgencyOffice` or `clsAgencyOfficeCollection` | [BR-001](business-rules.md#br-001-missing-key-retrieval-returns-a-default-object), [BR-015](business-rules.md#br-015-agency-office-retrieval-requires-non-lov-excluded-office-rows), [BR-016](business-rules.md#br-016-agency-office-number-is-required), [BR-024](business-rules.md#br-024-the-library-is-retrieve-only), [BR-025](business-rules.md#br-025-identity-keys-are-agency-seq-contract-seq-and-agent-number) | [AGENT](database-tables.md#agent) | [SQL-005](sql/SQL-005-retrieve-agency-office-by-agent-number.md), [SQL-006](sql/SQL-006-retrieve-agency-offices-for-an-agency.md) |
| [Retrieve producers](operations/retrieve-producers.md) | Load one producer or a producer collection. | A caller requests a keyed producer or the producers for an agency. | `IDataPortalInfo`, agent number and/or agency sequence number | `clsProducer` or `clsProducerCollection` | [BR-001](business-rules.md#br-001-missing-key-retrieval-returns-a-default-object), [BR-008](business-rules.md#br-008-active-status-uses-effective-and-expiration-windows), [BR-023](business-rules.md#br-023-producer-agencies-are-detected-when-agency-sequence-number-equals-agent-number), [BR-024](business-rules.md#br-024-the-library-is-retrieve-only), [BR-025](business-rules.md#br-025-identity-keys-are-agency-seq-contract-seq-and-agent-number) | [AGENT](database-tables.md#agent) | [SQL-007](sql/SQL-007-retrieve-producer-by-agent-number.md), [SQL-009](sql/SQL-009-retrieve-producers.md) |
| [Look up the agent of record for a policy](operations/look-up-the-agent-of-record-for-a-policy.md) | Resolve the policy's agent number through a scalar query. | A caller invokes `clsProducer.GetAgent`. | `IDataPortalInfo`, policy number | Decimal agent number | [BR-017](business-rules.md#br-017-agent-of-record-is-read-from-policyagent_num) | [POLICY](database-tables.md#policy) | [SQL-008](sql/SQL-008-retrieve-agent-of-record-for-a-policy.md) |
| [Evaluate agency status predicates](operations/evaluate-agency-status-predicates.md) | Derive agency flags and display values from loaded state. | A caller reads `clsAgency` Boolean or display properties. | Agency state, optional as-of date | Boolean flags and formatted names | [BR-008](business-rules.md#br-008-active-status-uses-effective-and-expiration-windows), [BR-018](business-rules.md#br-018-yn-flags-convert-through-framework-boolean-helpers), [BR-019](business-rules.md#br-019-special-agency-sequence-numbers-identify-saif-and-not-yet-appointed-agencies), [BR-020](business-rules.md#br-020-agency-and-producer-display-names-are-title-cased-and-abbreviated-consistently) | [AGENCY](database-tables.md#agency) | N/A |
| [Determine agency eligibility for an office](operations/determine-agency-eligibility-for-an-office.md) | Reject regional-office use of service-center-only agencies. | A caller invokes `clsAgency.IsValidForOffice`. | Agency contract collection, effective date, regional-office flag | Boolean result | [BR-008](business-rules.md#br-008-active-status-uses-effective-and-expiration-windows), [BR-021](business-rules.md#br-021-regional-office-eligibility-rejects-service-center-only-appointments) | [AGENCY_CONTRACT](database-tables.md#agency_contract) | [SQL-004](sql/SQL-004-retrieve-agency-contracts.md) |
| [Determine producer-commission eligibility](operations/determine-producer-commission-eligibility.md) | Check for active producer-commission contracts. | A caller invokes the agency or collection producer-commission helpers. | Agency or agency collection, as-of date | Boolean result or filtered agency collection | [BR-008](business-rules.md#br-008-active-status-uses-effective-and-expiration-windows), [BR-013](business-rules.md#br-013-producer-commission-contracts-require-gl-code-agt) | [AGENCY_CONTRACT](database-tables.md#agency_contract) | [SQL-004](sql/SQL-004-retrieve-agency-contracts.md) |
| [Aggregate active offices across agencies](operations/aggregate-active-offices-across-agencies.md) | Build one detached office collection from many agencies. | A caller invokes `clsAgencyCollection.ActiveAgencyOffices`. | Agency collection, as-of date | `clsAgencyOfficeCollection` | [BR-008](business-rules.md#br-008-active-status-uses-effective-and-expiration-windows), [BR-022](business-rules.md#br-022-active-office-aggregation-clones-offices-without-data-portal-context) | [AGENT](database-tables.md#agent) | [SQL-006](sql/SQL-006-retrieve-agency-offices-for-an-agency.md) |

## Process flow diagram
The following diagram shows the main retrieve and aggregation paths across the library.

```mermaid
flowchart TD
  Start([Caller request]) --> Choice{Requested behavior}
  Choice --> Agencies[Retrieve agencies]
  Choice --> Contracts[Retrieve one or more contracts]
  Choice --> Offices[Retrieve offices]
  Choice --> Producers[Retrieve producers]
  Choice --> Agent[Lookup agent of record]
  Agencies --> Bulk[Optional bulk child loading]
  Bulk --> ContractsBulk[RetrieveContracts]
  Bulk --> ProducersBulk[RetrieveProducers]
  Offices --> Eval[Optional active-office aggregation]
  Producers --> Eval
  Contracts --> Eval
  Agent --> Oracle[(Oracle)]
  ContractsBulk --> Oracle
  ProducersBulk --> Oracle
  Offices --> Oracle
  Producers --> Oracle
  Agencies --> Oracle
```

## Related documentation
- [Index](index.md)
- [Overview](overview.md)
- [Architecture](architecture.md)
- [Dependencies](dependencies.md)
- [Business rules](business-rules.md)
- [Database tables](database-tables.md)
- [SQL catalog](sql/index.md)
- [API reference](api/index.md)
- [Configuration](configuration.md)

## Sources
- `Business\SAIF.Business.Policy.Agency\clsAgency.vb`
- `Business\SAIF.Business.Policy.Agency\clsAgencyCollection.vb`
- `Business\SAIF.Business.Policy.Agency\clsAgencyContract.vb`
- `Business\SAIF.Business.Policy.Agency\clsAgencyContractCollection.vb`
- `Business\SAIF.Business.Policy.Agency\clsAgencyOffice.vb`
- `Business\SAIF.Business.Policy.Agency\clsAgencyOfficeCollection.vb`
- `Business\SAIF.Business.Policy.Agency\clsProducer.vb`
- `Business\SAIF.Business.Policy.Agency\clsProducerCollection.vb`
