---
title: Determine agency eligibility for an office
summary: Reject regional-office use of service-center-only agencies.
status: draft
owner: Technical Writer
last_reviewed: 2026-07-31
library: SAIF.Business.Policy.Agency
reference_type: package
operation_id: OP-012
trigger: A caller checks whether an agency is valid for a regional office.
---

# Determine agency eligibility for an office

This operation inspects the active agency contracts for a requested date and rejects regional-office use when the leading active contract is service-center-only.

| Field | Value |
| --- | --- |
| **Operation ID** | OP-012 |
| **Trigger** | A caller invokes `clsAgency.IsValidForOffice(inEffectiveDate, inIsRegionalOffice)`. |
| **Inputs** | Agency state, effective date, regional-office flag |
| **Outputs** | Boolean result |
| **Primary components** | `clsAgency.IsValidForOffice`, `clsAgency.Contracts`, `clsAgencyContractCollection.Active` |
| **Entry point** | `Business\SAIF.Business.Policy.Agency\clsAgency.vb` |

## Steps
1. If the caller is not evaluating a regional office, return `True` immediately.
2. Ensure the agency's `Contracts` collection is available, lazily loading it through [SQL-004](../sql/SQL-004-retrieve-agency-contracts.md) against [AGENCY_CONTRACT](../database-tables.md#agency_contract) when necessary.
3. Filter the contract collection to rows active on the requested date ([BR-008](../business-rules.md#br-008-active-status-uses-effective-and-expiration-windows)).
4. Inspect the first active contract and reject the office when its contract type is `ServiceCenterOnlyAppointment` ([BR-021](../business-rules.md#br-021-regional-office-eligibility-rejects-service-center-only-appointments)).
5. Otherwise return `True`.

## Process flow

The following diagram visualizes office-eligibility evaluation.

```mermaid
flowchart TD
  Start([IsValidForOffice]) --> Regional{Regional office?}
  Regional -->|No| Yes[Return True]
  Regional -->|Yes| Load[Load active contracts]
  Load --> Serv{First active contract is service-center-only?}
  Serv -->|Yes| No[Return False]
  Serv -->|No| Yes
```

## Failure and edge-case behavior
- The method's result depends on the first active contract in the loaded collection.

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

## Sources
- `Business\SAIF.Business.Policy.Agency\clsAgency.vb`
- `Business\SAIF.Business.Policy.Agency\clsAgencyContractCollection.vb`
