---
title: Retrieve supporting policy aggregates
summary: Loads policy periods, agency, addresses, team assignments, trading-as names, and non-employer accounts.
status: draft
owner: SAIF Doc Gen
last_reviewed: 2026-07-31
library: SAIF.Business.View.Policy
reference_type: package
operation_id: OP-09
trigger: A caller invokes one of the shared factory methods on a supporting business object
---

# Retrieve supporting policy aggregates

A complete policy view needs more than the header. This operation covers the supporting aggregates that each consuming screen assembles around it. They are grouped together because they all follow the same shape: a shared factory method builds criteria, the retrieve hook adds parameters and a result cursor, and the after-retrieve hook fills the object and marks it clean.

| Field | Value |
| --- | --- |
| **Operation ID** | OP-09 |
| **Trigger** | A caller invokes one of the shared factory methods on a supporting business object |
| **Inputs** | `IDataPortalInfo` plus the key for the aggregate being loaded |
| **Outputs** | A populated business object or collection, marked clean |
| **Primary components** | `clsPolicyPeriodCollection`, `clsAgency`, `clsPolicyAddress`, `clsTeamAssignmentCollection`, `clsTradingAsCollection`, `clsNonEmployerAccount` |
| **Entry point** | `Business/SAIF.Business.View.Policy/clsPolicyPeriodCollection.vb` |

## Steps

1. Call the shared factory method on the target type, supplying the data portal information and the key for the aggregate.
   - Policy periods take a policy number and an optional count of most-recent periods to return ([SQL-008](../sql/SQL-008-policy-periods.md)).
   - Agency takes a policy number ([SQL-002](../sql/SQL-002-agency-retrieval.md)).
   - Addresses take either a policy number with address and contact types ([SQL-005](../sql/SQL-005-policy-address-by-type.md)) or a location sequence number ([SQL-006](../sql/SQL-006-policy-address-by-location.md)).
   - Team assignments take a policy number ([SQL-009](../sql/SQL-009-team-assignments.md)).
   - Trading-as records take either a policy number ([SQL-011](../sql/SQL-011-trading-as-by-policy.md), [TRADING_AS](../database-tables.md#trading-as)) or a single sequence number ([SQL-010](../sql/SQL-010-trading-as-by-seq-num.md)).
   - Non-employer accounts take an account number ([SQL-004](../sql/SQL-004-non-employer-account.md), [NON_EMPR_ACCT](../database-tables.md#non-empr-acct)).
2. Let the framework drive the retrieve lifecycle: the before-retrieve hook builds the request and adds parameters, and the after-retrieve hook fills the object and marks it clean.†
3. Enrich the loaded aggregate where the type requires a second read:
   - A policy period resolves its employer-liability limits on demand ([SQL-023](../sql/SQL-023-employer-liability-limits.md)).
   - An address resolves the officer of notice on demand, joining [BUSINESS_AFFILIATE](../database-tables.md#business-affiliate) to [AFFILIATE](../database-tables.md#affiliate) ([SQL-012](../sql/SQL-012-officer-of-notice.md)).
   - A team assignment resolves the assignee's e-mail address through the system-user lookup ([SQL-025](../sql/SQL-025-system-user-email-lookup.md)); a legacy path targeting a procedure that could not be located also remains in the source ([SQL-024](../sql/SQL-024-external-client-lookup-legacy.md)).
4. Validate the loaded object where a rule applies.
   - A non-employer account with an account number of zero reports itself invalid ([BR-010](../business-rules.md#br-010-a-non-employer-account-requires-a-non-zero-account-number)).
5. Note the two authorization dependencies that these aggregates create:
   - The loss-control team assignment loaded here is what the authorization check compares the user identifier against ([BR-007](../business-rules.md#br-007-loss-control-consultants-see-only-policies-they-are-assigned-to)).
   - Demo users receive masked identity data in team assignments ([BR-012](../business-rules.md#br-012-demo-access-levels-are-treated-as-a-distinct-user-population)).

## Process flow

The following diagram visualizes this operation's control flow.

```mermaid
flowchart TD
    Start([Supporting aggregate requested]) --> F[Shared factory builds Criteria]
    F --> B[BeforeRetrieve adds parameters<br>and result cursor]
    B --> X[(Stored procedure or inline SELECT)]
    X --> A[AfterRetrieve fills the object<br>and marks it clean]
    A --> E{Second read needed?}
    E -->|Yes| Enr[Resolve limits, officer of notice,<br>or e-mail address]
    E -->|No| V[Evaluate validation rules]
    Enr --> V
    V --> Ok([Populated aggregate])
```

## Failure and edge-case behavior

- A key with no matching row yields an empty collection or an object that reports itself invalid, rather than an exception ([BR-010](../business-rules.md#br-010-a-non-employer-account-requires-a-non-zero-account-number)).
- The legacy e-mail lookup targets a procedure that was not located, so that path may be dead ([SQL-024](../sql/SQL-024-external-client-lookup-legacy.md)).
- Each enrichment is a separate round trip, so a screen that shows limits, officer of notice, and e-mail addresses issues several additional calls.

> **Note:** Statements marked with `†` are derived from dependency library
> documentation via the Legends CLI. Statements marked with `*` were inferred
> from code structure or contextual evidence. Statements marked with `**` could
> not be confirmed; treat as unknown until verified.

## Related documentation

- [Operations and processes](../operations-processes.md)
- [Business rules](../business-rules.md)
- [SQL catalog](../sql/index.md)
- [Database tables](../database-tables.md)
- [Procedures](../procedures/index.md)
- [Security and authorization](../security-authorization.md)
- [API reference](../api/index.md)

## Sources

- `Business/SAIF.Business.View.Policy/clsPolicyPeriodCollection.vb`
- `Business/SAIF.Business.View.Policy/clsPolicyPeriod.vb`
- `Business/SAIF.Business.View.Policy/clsAgency.vb`
- `Business/SAIF.Business.View.Policy/clsPolicyAddress.vb`
- `Business/SAIF.Business.View.Policy/clsTeamAssignmentCollection.vb`
- `Business/SAIF.Business.View.Policy/clsTeamAssignment.vb`
- `Business/SAIF.Business.View.Policy/clsTradingAs.vb`
- `Business/SAIF.Business.View.Policy/clsTradingAsCollection.vb`
- `Business/SAIF.Business.View.Policy/clsNonEmployerAccount.vb`
