---
title: "SAIF.Business.Policy.Core architecture"
summary: "Architectural responsibilities, boundaries, and interactions."
status: draft
owner: Technical Writer
last_reviewed: 2026-07-31
library: SAIF.Business.Policy.Core
reference_type: package
---

# SAIF.Business.Policy.Core architecture

SAIF.Business.Policy.Core sits in the BOF business layer and owns the canonical policy aggregate. It combines BOF business objects, collection wrappers, masking-aware materialization, and Oracle procedure calls so callers can treat modern WCIS and legacy policy data as one coherent domain surface.

## Responsibilities
- Model policy, period, location, contact, status, team-assignment, and prior-coverage data.
- Coordinate BOF retrieval and persistence lifecycles for writable entities.
- Bridge to Oracle procedures for premium, billing, governing-class, and logging logic outside this repository.
- Apply masking behavior during object materialization when callers set `MaskData`.

## Component boundaries
- `clsPolicy` / `clsPolicyCollection`: policy-root retrieval and affiliated/account collections.
- `clsPolicyPeriodBase`, `clsPolicyPeriod`, `clsLegacyPolicyPeriod`, `clsPolicyPeriodBaseCollection`: unified WCIS and legacy policy-period behavior.
- Location/contact types: address and location retrieval with masking and filters.
- Supporting code-table entities: county, entity type, offices, status codes, team functions, prior coverage, and WCIS employees.
- `WCISInquiry` / `clsWCISInterfacer`: application-layer query and logging facades.

## Interaction model
- BOF business objects contribute `CreateSQL`, `RetrieveSQL`, `InsertSQL`, `UpdateSQL`, and `DeleteSQL` fragments to the data portal.†
- Policy-period retrieval is the main architectural seam: callers see one merged timeline even though modern and legacy data come from different sources.
- Oracle procedures provide several premium and billing behaviors that repository VB code only invokes**.

## Architecture diagram
The following diagram shows the main policy aggregate and its Oracle dependencies.

```mermaid
flowchart TD
    Caller[Calling application] --> Policy[clsPolicy]
    Policy --> Periods[clsPolicyPeriodBaseCollection]
    Periods --> Modern[clsPolicyPeriod]
    Periods --> Legacy[clsLegacyPolicyPeriod]
    Policy --> Locations[Location and contact types]
    Caller --> Inquiry[WCISInquiry]
    Policy --> BOF[BOF data portal]
    Inquiry --> Oracle[(Oracle tables and procedures)]
    BOF --> Oracle
```

## Sequence diagram
The following diagram shows masked policy retrieval followed by premium resolution.

```mermaid
sequenceDiagram
    participant Client
    participant Policy as clsPolicy
    participant Portal as BOF portal†
    participant Oracle
    Client->>Policy: GetPolicy(dpi, policyNumber, maskData)
    Policy->>Portal: RetrieveObject(criteria)
    Portal->>Oracle: Execute retrieval SQL
    Oracle-->>Portal: Data row
    Portal-->>Policy: Populated object
    Client->>Oracle: Resolve premium query or procedure call
    Oracle-->>Client: Premium result
```

## Design constraints
- Not every entity is writable; consumers must check per-type capability.
- Premium and billing behavior depends on Oracle procedure logic outside repository VB source**.
- Masking is applied during `Fill`, so each participating type must honor `MaskData` consistently.*

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

> **Note:** Statements marked with `†` are derived from dependency library
> documentation via the Legends CLI.

> **Note:** Statements marked with * were inferred from code structure, naming conventions, or
> contextual evidence where direct confirmation was not available in source artifacts. Statements
> marked with ** could not be confirmed; treat as unknown until verified.

## Sources
- `Business\SAIF.Business.Policy.Core\clsPolicy.vb`
- `Business\SAIF.Business.Policy.Core\clsPolicyPeriodBase.vb`
- `Business\SAIF.Business.Policy.Core\clsPolicyPeriod.vb`
- `Business\SAIF.Business.Policy.Core\clsLegacyPolicyPeriod.vb`
- `Business\SAIF.Business.Policy.Core\WCISInquiry.vb`
- `Business\SAIF.Business.Policy.Core\clsWCISInterfacer.vb`
