Skip to content

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 against AGENCY_CONTRACT when necessary.
  3. Filter the contract collection to rows active on the requested date (BR-008).
  4. Inspect the first active contract and reject the office when its contract type is ServiceCenterOnlyAppointment (BR-021).
  5. Otherwise return True.

Process flow

The following diagram visualizes office-eligibility evaluation.

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.

Sources

  • Business\SAIF.Business.Policy.Agency\clsAgency.vb
  • Business\SAIF.Business.Policy.Agency\clsAgencyContractCollection.vb