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¶
- First access to the
PolicyListproperty triggers aSelect CaseonUserType.UserType. Agent→GetPolicyListForAgentexecutes SQL-VP-036 — SQL Server stored procedurecp_get_agent_online_policy_list(parameters@AgentNum,@ForAgency).PolicyHolder→ iteratesPolicyDataForUser.AffiliatedPolicyCollection(Oracle,pk72846_view_policy.getpolicyaffiliatelistviaclsAffiliatedPolicyCollection) and builds the list directly from in-memory affiliated-policy data.- No additional SQL Server query is issued for this branch.
LossControl→GetPolicyListForSafetyConsultantexecutes SQL-VP-035 — SQL Server stored procedurecp_claimprofile_get_sc_book(parameter@losscontrol).Group→GetPolicyListforGroupexecutes SQL-VP-034 — SQL Server stored procedurecp_claimprofile_get_group_policy_list(parameters@GroupKeyCode,@SpecificChapterCode,@rptDate).Auditor→GetPolicyListForFeeAuditorexecutes 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.- Outcome:
List(Of strPolicyList)cached inm_PolicyListfor the life of theclsPolicySecurityinstance.
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
clsPolicySecurityinstance; 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.*
Related documentation¶
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