Determine an agency's contract type on a date¶
This operation derives an agency-level contract classification by filtering the agency's loaded contracts to those active on a requested date and returning the first surviving contract type.
| Field | Value |
|---|---|
| Operation ID | OP-005 |
| Trigger | A caller invokes clsAgency.ContractType(inDate). |
| Inputs | clsAgency, as-of date |
| Outputs | AgencyContractTypes value |
| Primary components | clsAgency.ContractType, clsAgency.Contracts, clsAgencyContractCollection.Active |
| Entry point | Business\SAIF.Business.Policy.Agency\clsAgency.vb |
Steps¶
- Ensure the agency's
Contractscollection is available, lazily loading it through Retrieve agency contracts when necessary. - Filter the contracts to those active on the requested date (BR-008).
- If at least one active contract remains, return the first contract's domain contract type.
- If no active contract remains, return
AgencyContractTypes.Unassigned(BR-009). - When lazy loading is required, the contract retrieve executes SQL-004 against AGENCY_CONTRACT.
Process flow¶
The following diagram visualizes the contract-type decision.
flowchart TD
Start([ContractType]) --> Load[Ensure contracts loaded]
Load --> Filter[Filter active contracts]
Filter --> Any{Any active contract?}
Any -->|Yes| First[Return first contract type]
Any -->|No| Unassigned[Return Unassigned]
Failure and edge-case behavior¶
- The operation depends on the ordering of the loaded contract collection when multiple active contracts exist on the same date.
Related documentation¶
Sources¶
Business\SAIF.Business.Policy.Agency\clsAgency.vbBusiness\SAIF.Business.Policy.Agency\clsAgencyContractCollection.vb