Skip to content

Compare and locate affiliate associations

This operation documents how Equality helpers onclsAffiliate,clsPolicyAffiliateBase,clsCorporateOfficerExemption, and the collection helper methods fulfills the policy-affiliate behavior described for SAIF.Business.Policy.Affiliate.

Field Value
Operation ID OP-013
Trigger A caller checks equality, tests collection membership, removes an item, or formats an identity string for affiliate-related business objects.
Inputs Affiliate or association objects plus comparison keys
Outputs Boolean result, located item, removal, hash code, or display text
Primary components Equality helpers on clsAffiliate, clsPolicyAffiliateBase, clsCorporateOfficerExemption, and the collection helper methods
Entry point Business\SAIF.Business.Policy.Affiliate\clsPolicyAffiliateBase.vb

Steps

  1. For policy-affiliate objects, compare policy number, affiliate ID, and effective date as the full identity (BR-AFF-017).
  2. For standalone affiliates, compare SSN only; for corporate officer exemptions, compare exemption sequence number only.
  3. Use the collection helper methods (Contains, ContainsDeleted, Remove, and Where) to scan existing and deleted lists for a matching item.
  4. When the nested affiliate object no longer matches the association key, refresh it through the affiliate retrieve path before returning it (BR-AFF-020, SQL-001).

Process flow

The following diagram shows the per-type identity comparison, collection-helper scanning, and the stale-affiliate refresh branch.

flowchart TD
  Start(["Caller compares, locates, or removes<br>an affiliate-related object"]) --> TypeCheck{"Object type?"}
  TypeCheck -->|"clsPolicyAffiliateBase-derived"| ThreePart["Compare PolicyNumber + AffiliateID + EffectiveDate"]
  TypeCheck -->|"clsAffiliate"| SsnOnly["Compare AffiliateSSN only"]
  TypeCheck -->|"clsCorporateOfficerExemption"| SeqOnly["Compare CorporateOfficerExempSeqNum only"]
  ThreePart --> Helpers["Use Contains / ContainsDeleted / Remove / Where<br>to scan live and deleted lists"]
  SsnOnly --> Helpers
  SeqOnly --> Helpers
  Helpers --> StaleCheck{"Nested affiliate key<br>still matches association?"}
  StaleCheck -->|No| Refresh["Refresh via affiliate retrieve path SQL-001"]
  StaleCheck -->|Yes| Cached["Return cached nested affiliate"]
  Refresh --> Result(["Return comparison/location result"])
  Cached --> Result

Failure and edge-case behavior

  • Collection membership checks are linear scans over the in-memory lists.

Sources

  • Business\SAIF.Business.Policy.Affiliate\clsPolicyAffiliateBase.vb