clsPolicyData¶
clsPolicyData is the aggregate root for the library's policy-view model. Callers enter through GetPolicyData and receive a read-only projection loaded from Oracle procedure pk73094_policy_data.getpolicy, then navigate to lazily populated child objects such as agency, address, periods, service team, trading-as names, and association headers. The type also applies demo-user masking, derives display values such as market type and current-period selection, and tolerates failures in secondary detail reads so the primary retrieve can still succeed.
Purpose¶
- Retrieve the policy header projection after validating the policy number before the Oracle read begins (BR-VP-001).
- Expose the library's central read model so callers can navigate to agency, address, periods, team-assignment, trading-as, and association data from one object.
- Enforce read-time presentation rules such as demo masking, market-type mapping, future-cancel-date gating, current/renewal period selection, and login-date semantics (BR-VP-010, BR-VP-016, BR-VP-017, BR-VP-018, BR-VP-023).
- Preserve overall retrieval success when optional detail reads fail, leaving those secondary fields unset instead of failing the header object (BR-VP-026).
Context¶
- Namespace:
SAIF.Business.View.Policy - Assembly/package:
SAIF.Business.View.Policy(embedded)
Public members¶
| Member | Signature | Purpose |
|---|---|---|
GetPolicyData |
Public Shared Function GetPolicyData(ByVal inCriteria As Criteria) As clsPolicyData |
Rehydrates a policy view using a prebuilt criteria object when a caller needs to preserve an existing portal context or access-level selection. |
GetPolicyData |
Public Shared Function GetPolicyData(ByVal inDataportal As IDataPortalInfo, ByVal inPolicyNum As Decimal) As clsPolicyData |
Primary factory entry point for policy-header retrieval using the default SAIF-employee access level. |
GetPolicyData |
Public Shared Function GetPolicyData(ByVal inDataportal As IDataPortalInfo, ByVal inPolicyNumbers As IEnumerable(Of Decimal)) As List(Of clsPolicyData) |
Expands a set of policy numbers into individually retrieved aggregate roots for batch consumers that still need one object per policy. |
GetPolicyData |
Public Shared Function GetPolicyData(ByVal inDataportal As IDataPortalInfo, ByVal inPolicyNum As Decimal, ByVal inUserAccessLevel As UserAccessLevels) As clsPolicyData |
Retrieves the aggregate with an explicit caller access level so downstream masking and affiliate/association behavior match the requesting user type. |
GetPolicyAddress |
Public Shared Function GetPolicyAddress(ByVal inDataPortalInfo As IDataPortalInfo, ByVal inPolicyNumber As Decimal) As clsPolicyAddress |
Returns the mailing-address projection associated with the policy header without forcing callers to construct clsPolicyAddress directly. |
GetPolicyClaimAddress |
Public Shared Function GetPolicyClaimAddress(ByVal inDataPortalInfo As IDataPortalInfo, ByVal inPolicyNumber As Decimal, ByVal inGetMailAddrFlag As clsPolicyAddress.YesNoFlag) As clsPolicyAddress |
Returns the claim-address projection, optionally falling back to mailing-address data when claim-specific address data is absent. |
DEFAULT_USER_ACCESS_LEVEL |
Public Const DEFAULT_USER_ACCESS_LEVEL As UserAccessLevels = UserAccessLevels.SAIFEmployee |
Sets the baseline access context used when callers do not supply a user type, which in turn controls masking and related retrieval choices. |
ASSIGNED_RISK_MARKET_TYPE |
Public Const ASSIGNED_RISK_MARKET_TYPE As String = "ARP" |
Encodes the non-voluntary market code used by IsAssignedRisk and MarketTypeDescription when mapping retrieved policy data (BR-VP-016). |
VOLUNTARY_MARKET_TYPE |
Public Const VOLUNTARY_MARKET_TYPE As String = "VOL" |
Encodes the voluntary market code that maps to the voluntary display branch in MarketTypeDescription (BR-VP-016). |
Agency |
Public ReadOnly Property Agency() As clsAgency |
Lazily retrieves and caches the agency-of-record snapshot for the current policy so callers can navigate agency identity and contact data on demand. |
PolicyPeriods |
Public ReadOnly Property PolicyPeriods() As clsPolicyPeriodCollection |
Lazily materializes the ordered period collection that drives current-period and renewal-period selection (BR-VP-018). |
TeamAssignmentCollection |
Public ReadOnly Property TeamAssignmentCollection() As clsTeamAssignmentCollection |
Lazily loads the service-team roster used both for display and for loss-control authorization checks elsewhere in the library. |
Associations |
Public ReadOnly Property Associations() As IEnumerable(Of PolicyAssociation) |
Lazily returns the current policy-association model that supersedes the obsolete affiliate API and includes the source policy when loaded through this property. |
TradingAsCollection |
Public ReadOnly Property TradingAsCollection() As clsTradingAsCollection* |
Exposes the policy's DBA names as a child collection for consumers that need alternate operating names alongside the policy header.* |
HasWaiver |
Public ReadOnly Property HasWaiver() As Boolean |
Triggers the one-time waiver-count lookup and reports whether the policy currently has a third-party waiver record. |
IsDemoUser |
Public ReadOnly Property IsDemoUser() As Boolean |
Identifies the access levels that must receive masked names, addresses, identifiers, and related contact fields (BR-VP-010). |
CurrentPolicyPeriod |
Public ReadOnly Property CurrentPolicyPeriod() As clsPolicyPeriod |
Returns the currently open period, or the first period when no open period is present, using the status-selection rules encoded in the period collection (BR-VP-018). |
LatestPolicyPeriodInfoPagePrinted |
Public ReadOnly Property LatestPolicyPeriodInfoPagePrinted() As clsPolicyPeriod |
Selects the renewal period with a printed information page, otherwise the current period, for callers that need the most relevant issued term. |
FutureCancelDate |
Public ReadOnly Property FutureCancelDate() As Date |
Returns a future cancellation date only when the policy is in pending-cancellation status; all other statuses surface Date.MinValue (BR-VP-017). |
MaxPolicyholderLoginDate |
Public ReadOnly Property MaxPolicyholderLoginDate As Date |
Scans external Business Online accounts for the policy and suppresses dates on or before 2000-01-01 as "never logged on" (BR-VP-023). |
Additional read-only properties |
150+ additional read-only properties |
Provide the remaining policy identifiers, status codes, dates, agency snapshot fields, financial indicators, login descriptors, and obsolete affiliate-era accessors; several obsolete members direct callers to use Associations instead of the legacy affiliate model. |
Behavioral notes¶
BeforeRetrievesendsapolicynumto Oracle procedurepk73094_policy_data.getpolicy, andValidPolicyNumblocks the call when the policy number is not greater than zero (BR-VP-001).- The object follows a lazy-read pattern:
Agency,Address,ClaimAddress,PolicyPeriods,TeamAssignmentCollection,Associations, and several detail-backed fields each load on first access rather than during the initial header retrieve. - Demo access levels mask policyholder name, legal name, FEIN, group name, address-related children, agency data, and team-member data through
clsConstants.DataMaskingConstants(BR-VP-010). MarketTypeDescription,IsAssignedRisk, andIsVoluntaryall derive from the retrieved market code, mappingVOLto voluntary and every other code to assigned risk (BR-VP-016).FutureCancelDateonly executes its cancellation lookup when the converted policy status is pending cancellation (BR-VP-017).GetCurrentPolicyPeriodprefers periods whoseisCurrentPolicyPeriodflag is true, andGetLatestPolicyPeriodInfoPagePrintedprefers renewal periods with printed information pages before falling back to the current period (BR-VP-018).MaxPolicyholderLoginDatetreats 2000-01-01 and earlier as "never logged on" even when the proxy returns a concrete date (BR-VP-023).LazyRead(LazyReadRequest.PolicyDetail)catches and suppresses exceptions, so missing detail data does not invalidate the header object (BR-VP-026).- Affiliate-related properties remain compiled but are marked
<Obsolete("Use data from the Associations property instead.")>, indicating the associations model has replaced the legacy affiliate API.
Constraints and usage notes¶
- This library is read-only: the criteria object returns empty create/insert/update/delete SQL, consistent with BR-VP-027.
UserAccessLevelis not cosmetic; it drives masking behavior and also influences affiliate/association retrieval paths for external users.- Consumers that need complete child data must touch each child property explicitly; loading the aggregate root alone does not eagerly hydrate related objects.
- Obsolete affiliate members should be avoided for new consumers in favor of
Associationsand the newer association-type model.
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/clsPolicyData.vb