Skip to content

Build the current user's book of business

Lazily builds and caches the list of policies the current user is entitled to see, using a different data source per user type.

Field Value
Operation ID OP-VP-003
Trigger First access to the clsPolicySecurity.PolicyList property
Inputs Current clsUserType and its associated agent/group/loss-control/auditor identifiers
Outputs List(Of strPolicyList) (policy number, name, formatted "number - name" string), cached in m_PolicyList
Primary components clsPolicySecurity.PolicyList, GetPolicyListForAgent, GetPolicyListforGroup, GetPolicyListForSafetyConsultant, GetPolicyListForFeeAuditor
Entry point SAIF.Business.View.Policy\clsPolicySecurity.vb

Steps

  1. First access to the PolicyList property triggers a Select Case on UserType.UserType.
  2. Agent → GetPolicyListForAgent executes SQL-VP-036 — SQL Server stored procedure cp_get_agent_online_policy_list (parameters @AgentNum, @ForAgency).
  3. PolicyHolder → iterates PolicyDataForUser.AffiliatedPolicyCollection (Oracle, pk72846_view_policy.getpolicyaffiliatelist via clsAffiliatedPolicyCollection) and builds the list directly from in-memory affiliated-policy data.
  4. No additional SQL Server query is issued for this branch.
  5. LossControl → GetPolicyListForSafetyConsultant executes SQL-VP-035 — SQL Server stored procedure cp_claimprofile_get_sc_book (parameter @losscontrol).
  6. Group → GetPolicyListforGroup executes SQL-VP-034 — SQL Server stored procedure cp_claimprofile_get_group_policy_list (parameters @GroupKeyCode, @SpecificChapterCode, @rptDate).
  7. Auditor → GetPolicyListForFeeAuditor executes SQL-VP-038 — inline Oracle SQL joining PA_AUDIT, PA_AUDITOR, and POLICY by vendor number, excluding not-yet-expired cancelled/completed audits, ordered by policy number.
  8. Outcome: List(Of strPolicyList) cached in m_PolicyList for the life of the clsPolicySecurity instance.

Process flow

flowchart TD
    Start([PolicyList accessed]) --> Branch{UserType?}
    Branch -->|Agent| Agent[GetPolicyListForAgent: SQL-VP-036]
    Branch -->|PolicyHolder| PH[Iterate AffiliatedPolicyCollection in memory]
    Branch -->|LossControl| LC[GetPolicyListForSafetyConsultant: SQL-VP-035]
    Branch -->|Group| Group[GetPolicyListforGroup: SQL-VP-034]
    Branch -->|Auditor| Auditor[GetPolicyListForFeeAuditor: SQL-VP-038]
    Agent --> Cache[Cache result in m_PolicyList]
    PH --> Cache
    LC --> Cache
    Group --> Cache
    Auditor --> Cache
    Cache --> EndOk([List Of strPolicyList returned])

Failure and edge-case behavior

  • The result is cached for the lifetime of the clsPolicySecurity instance; subsequent property accesses do not re-query.
  • User types not covered by the branches above (e.g. SaifEmployee, MCO, MedProv, Bookkeeper) are not documented as producing a book-of-business list via this property in the analyzed source.*

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

  • SAIF.Business.View.Policy\clsPolicySecurity.vb