---
title: clsPolicyPreferredWorker
summary: API reference for clsPolicyPreferredWorker.
status: draft
owner: Technical Writer
last_reviewed: 2026-07-31
library: SAIF.Business.Policy.Affiliate
reference_type: package
---

# clsPolicyPreferredWorker

Concrete policy-affiliate object for affiliate type `2`, with lazy eligibility enrichment from the preferred-worker table.

## Purpose
- Represent one preferred-worker association for a policy period.
- Load preferred-worker eligibility only when the related properties are accessed.

## Context
- Namespace: `SAIF.Business.Policy.Affiliate`
- Assembly/package: `SAIF.Business.Policy.Affiliate`

## Public members
| Member | Signature | Purpose |
| --- | --- | --- |
| PreferredWorkerID | `Public ReadOnly Property PreferredWorkerID() As String` | Identifier of the preferred-worker record that qualifies this person during the association period. Reading it triggers the one-time eligibility lookup shared by all four eligibility properties; an empty string means no qualifying `PREFERRED_WORKER` row exists and the lookup will not be retried. |
| ContractTypeCode | `Public ReadOnly Property ContractTypeCode() As String` | Kind of preferred-worker contract in force for the person during the association period, drawn from the same one-time eligibility lookup; an empty string signals that no qualifying eligibility row was found rather than a blank contract type. |
| EligibilityEffectiveDate | `Public ReadOnly Property EligibilityEffectiveDate() As Date` | Start of the qualifying preferred-worker eligibility period. Only an eligibility row whose window covers both the association effective date and its cancel date qualifies, and when several do, the earliest-effective one is taken; a `Date.MinValue` result means no row qualified. |
| EligibilityExpirationDate | `Public ReadOnly Property EligibilityExpirationDate() As Date` | End of the qualifying preferred-worker eligibility period, from the same lookup. Open-ended eligibility rows carry no expiration in the source, and a `Date.MinValue` result also arises when nothing qualified, so callers should read it together with `PreferredWorkerID`. |
| GetPolicyPreferredWorker | `Public Shared Function GetPolicyPreferredWorker(ByVal inDataportal As IDataPortalInfo, ByVal inAffiliateID As String, ByVal inPolicyNumber As Decimal, ByVal inEffectiveDate As Date) As clsPolicyPreferredWorker` | Loads one preferred-worker attachment identified by policy, SSN, and effective date, hydrating the person from the same joined row and admitting only type-`2` association rows; a key that matches nothing yields a defaults-only object, and eligibility data stays unread until a caller asks for it. |

## Inherited public members

Members in this table whose Origin is `SAIF.Framework.Core` were retrieved from that library's documentation via the Legends CLI; the Origin column identifies the originating class for each member.

| Member | Signature | Purpose | Origin |
| --- | --- | --- | --- |
| Affiliate | `Public ReadOnly Property Affiliate() As clsAffiliate` | Person standing behind the association. The child is normally hydrated from the same joined row as the association, so reading it costs nothing; if the cached child no longer matches the association's SSN it is discarded and re-fetched so callers never see a person that belongs to a different association. | `SAIF.Business.Policy.Affiliate` — `clsPolicyAffiliateBase` |
| BusinessSequenceNumber | `Public ReadOnly Property BusinessSequenceNumber() As Decimal` | Sequence number of the underlying `BUSINESS_AFFILIATE` row, carried through so callers can tie the association back to its exact source row; it takes no part in association identity, which is the policy/SSN/effective-date triple. | `SAIF.Business.Policy.Affiliate` — `clsPolicyAffiliateBase` |
| AffiliateID | `Public ReadOnly Property AffiliateID() As String` | SSN of the person attached to the policy: one of the three values that identify the association, the join key to `AFFILIATE`, and the key used to hydrate and refresh the nested `Affiliate` child. | `SAIF.Business.Policy.Affiliate` — `clsPolicyAffiliateBase` |
| CancelDate | `Public ReadOnly Property CancelDate() As Date` | Date the person's attachment to the policy ended. An unset value means the attachment is still open, which is how window queries and the `Active` filters treat it, and it is also the upper bound the preferred-worker eligibility lookup must cover. | `SAIF.Business.Policy.Affiliate` — `clsPolicyAffiliateBase` |
| CreateDate | `Public ReadOnly Property CreateDate() As Date` | Audit stamp for when the association row was created — distinct from the person's own creation stamp on `Affiliate`, since attaching an existing person to a policy creates a new association only. | `SAIF.Business.Policy.Affiliate` — `clsPolicyAffiliateBase` |
| CreateUser | `Public ReadOnly Property CreateUser() As String` | Audit stamp naming the user or process that attached the person to the policy, used when tracing who added an interested party or preferred worker. | `SAIF.Business.Policy.Affiliate` — `clsPolicyAffiliateBase` |
| EffectiveDate | `Public ReadOnly Property EffectiveDate() As Date` | Date the person's attachment to the policy began: the third component of association identity, the value window queries compare against the requested end date, and a date the preferred-worker eligibility row must cover. | `SAIF.Business.Policy.Affiliate` — `clsPolicyAffiliateBase` |
| PolicyNumber | `Public ReadOnly Property PolicyNumber() As Decimal` | Policy the person is attached to: the first component of association identity and the filter every collection retrieval binds, so one person appears once per policy period they participate in. | `SAIF.Business.Policy.Affiliate` — `clsPolicyAffiliateBase` |
| UpdateDate | `Public ReadOnly Property UpdateDate() As Date` | Audit stamp for the most recent change to the association row, letting callers see when an attachment was last amended (for example when a cancel date was added) without inspecting the person record. | `SAIF.Business.Policy.Affiliate` — `clsPolicyAffiliateBase` |
| UpdateUser | `Public ReadOnly Property UpdateUser() As String` | Audit stamp naming the user or process that last amended the association, paired with `UpdateDate` when tracing changes to a person's role or period on the policy. | `SAIF.Business.Policy.Affiliate` — `clsPolicyAffiliateBase` |
| IsValid | `Public Overrides ReadOnly Property IsValid() As Boolean` | Passes the framework's validation verdict straight through — this hierarchy registers no rules of its own, so an association is valid whenever the BOF base considers it valid, and the nested `Affiliate` child's state does not affect the result. | `SAIF.Business.Policy.Affiliate` — `clsPolicyAffiliateBase` |
| IsDirty | `Public Overrides ReadOnly Property IsDirty() As Boolean` | Passes the framework's change-tracking verdict straight through; because the nested `Affiliate` child is not consulted, edits made to the child person do not mark the association dirty. | `SAIF.Business.Policy.Affiliate` — `clsPolicyAffiliateBase` |
| IsCancelDateNull | `Public Function IsCancelDateNull() As Boolean` | Separates an association that is still open from one cancelled on a real date — a distinction `CancelDate` alone cannot express, and the same one the date-window SQL encodes with `nvl` when deciding which associations overlap a requested period. | `SAIF.Business.Policy.Affiliate` — `clsPolicyAffiliateBase` |
| IsAffiliateTypeCodeNull | `Public Function IsAffiliateTypeCodeNull() As Boolean` | Reports that the loaded row carries no affiliate type discriminator, meaning the person's role on the policy (`1` interested party, `2` preferred worker) is unclassified in the source data. | `SAIF.Business.Policy.Affiliate` — `clsPolicyAffiliateBase` |
| Equals | `Public Overloads Shared Function Equals(ByVal objA As Object, ByVal objB As Object) As Boolean` | Type-safe comparison for call sites holding loosely typed references: matches only when both operands are policy-affiliate associations agreeing on policy, SSN, and effective date; a non-association operand fails rather than raising. | `SAIF.Business.Policy.Affiliate` — `clsPolicyAffiliateBase` |
| Equals | `Public Overloads Overrides Function Equals(ByVal inObject As Object) As Boolean` | Makes framework collection searches that pass boxed objects resolve associations by the three-part key, while refusing to match objects of any other type. | `SAIF.Business.Policy.Affiliate` — `clsPolicyAffiliateBase` |
| Equals | `Public Overloads Function Equals(ByVal inPolicyNumber As Decimal, ByVal inAffiliateID As String, ByVal inEffectiveDate As Date) As Boolean` | Tests this association against a caller-supplied key without needing a comparison object, which is how the collections locate or remove a specific person-on-a-policy-period from loose key values. | `SAIF.Business.Policy.Affiliate` — `clsPolicyAffiliateBase` |
| Equals | `Public Overloads Function Equals(ByVal inObject As clsPolicyAffiliateBase) As Boolean` | Treats two associations as the same attachment only when policy, SSN, and effective date all agree, so the same person on a different policy or a different policy period remains a distinct association. | `SAIF.Business.Policy.Affiliate` — `clsPolicyAffiliateBase` |
| GetHashCode | `Public Overrides Function GetHashCode() As Integer` | Hashes on the SSN alone even though equality uses all three key parts; every association for one person therefore shares a hash bucket, which stays correct but degrades hashed lookups for people attached to many policies or periods. | `SAIF.Business.Policy.Affiliate` — `clsPolicyAffiliateBase` |
| ToString | `Public Overrides Function ToString() As String` | Renders the full association key as `AffiliateID,PolicyNumber,EffectiveDate`, giving diagnostics and state dumps a value that identifies the specific attachment rather than just the person. | `SAIF.Business.Policy.Affiliate` — `clsPolicyAffiliateBase` |
| Rules | `Property Rules As clsRulesManager` | Exposes the BOF rules manager for inherited validation behavior. | `SAIF.Framework.Core` — `clsBusinessBase` |
| BeginEdit | `Sub BeginEdit()` | Starts an edit session so callers can stage in-memory changes before applying or cancelling them. | `SAIF.Framework.Core` — `clsBusinessBase` |
| CancelEdit | `Sub CancelEdit()` | Reverts the current edit session through the BOF edit-level mechanism. | `SAIF.Framework.Core` — `clsBusinessBase` |
| ApplyEdit | `Sub ApplyEdit()` | Commits the current edit session in memory before any save orchestration occurs. | `SAIF.Framework.Core` — `clsBusinessBase` |
| Error | `ReadOnly Property Error As String` | Surfaces the current object-level validation error text to data-binding consumers. | `SAIF.Framework.Core` — `clsBusinessBase` |
| Item(columnName) | `ReadOnly Property Item(columnName As String) As String` | Returns column-specific validation error text through `IDataErrorInfo`. | `SAIF.Framework.Core` — `clsBusinessBase` |
| DumpState | `Sub DumpState()` | Emits framework state diagnostics for troubleshooting object state. | `SAIF.Framework.Core` — `clsBusinessBase` |
| AllowCache | `Property AllowCache() As Boolean` | Controls whether the framework may cache the business object instance. | `SAIF.Framework.Core` — `clsBusinessBase` |

## Behavioral notes
- Preferred-worker eligibility fields are populated lazily through [BR-AFF-010](../../../../../business-rules.md#br-aff-010-eligibility-rows-must-cover-both-effective-and-cancel-dates) to [BR-AFF-012](../../../../../business-rules.md#br-aff-012-missing-eligibility-returns-sentinel-values) once a related property is read.

## Constraints and usage notes
- The library exposes read-only retrieval behavior; no type in this package can persist changes through live criteria SQL.

> **Note:** Inherited-member descriptions attributed to `SAIF.Framework.Core` in the Origin column were retrieved from that library's documentation via the Legends CLI and should be reverified if the dependency version changes.

## Sources
- `Business\SAIF.Business.Policy.Affiliate\clsPolicyPreferredWorker.vb`
