Beneficiary management¶
Beneficiary management is primarily an API-backed retrieval and validation flow. The collection retrieves worker beneficiary contacts from CCClaimDataApi, materializes each contact into clsBeneficiary, and lazy-loads related eligibility periods, claim-person addresses, and guardian data when those child properties are accessed. The class still exposes Save(), but the current implementation returns success without issuing a persistence request.
| Field | Value |
|---|---|
| Operation ID | OP-PER-06 |
| Trigger | Caller requests beneficiaries for a worker, optionally scoped to a claim, then reads child details or validates the beneficiary object |
| Inputs | WorkerID; optional ClaimID; OnlyActiveClaim; contact payload fields from CCClaimDataApi; optional edits to demographic, relationship, date, tax ID, address, guardian, and award-eligibility fields |
| Outputs | clsBeneficiaryCollection; hydrated clsBeneficiary objects; lazy-loaded award eligibility and claim-person addresses; rule errors and warnings; Save()/savechild() currently return True without persistence |
| Primary components | clsBeneficiaryCollection.GetBeneficiariesForWorker, clsBeneficiaryCollection.BeforeRetrieve, clsBeneficiary.Load, clsBeneficiary.AwardEligibility, clsBeneficiary.Addresses, clsBeneficiary.Save |
| Entry point | Business\SAIF.Business.Claim.Person\clsBeneficiaryCollection.vb |
Steps¶
- Retrieve beneficiary contacts for the worker.
clsBeneficiaryCollection.BeforeRetrieveformats theCCClaimDataApiroutev1/GeneralWorkerData/Contacts/{WorkerID}?onlyActiveClaim={OnlyActiveClaim}and requests claim-contact data for the worker. - Materialize each returned beneficiary contact.
AfterRetrieveiteratesclaimContacts(0).Data.Beneficiary.Beneficiary, creates aclsBeneficiaryfor each contact, loads the contact fields, optionally preserves the caller-suppliedClaimID, copies the responseClaimIDonto the object, and adds the child to the collection. - Map contact data into beneficiary state.
clsBeneficiary.Fillcopies birth and death dates, email, gender, phones, tax ID, dependent type, worker and person identifiers, termination date, active flag, name components, and update date from the API contact, and it loads a guardian object immediately when the contact already contains guardian data. - Lazy-load child eligibility and address details when requested.
- Accessing
AwardEligibilityretrieves the beneficiary's period rows through the local eligibility collection operation (SQL-005, CL_AWARD_ELIGIBILITY). - Accessing
Addressesretrieves claim-person addresses only whenClaimID <> 0, then assigns home, mailing, and payment-specific error prefixes based on address code. - Validate required identity, relationship, and date fields. The beneficiary rules require a last name, require orphan-coded beneficiaries to carry the child relationship code, reject future-dated birth or death values, require a birth date when an eligibility end date exists, and require death dates to be later than birth dates (BR-PER-015, BR-PER-016, BR-PER-017, BR-PER-018).
- Validate certificate, gender, tax ID, and fatal-benefit prerequisites. The rules reject future-dated birth-certificate receipt dates, allow only
M,F, orUgender codes, require nine-digit tax IDs when a value is present, and require a recorded worker death date when the claim injury date is on or after10/23/1999(BR-PER-019, BR-PER-020, BR-PER-021, BR-PER-022). - Raise non-blocking warnings for payment-address and death-date changes. The object warns when both a special payment address and a guardian payment address exist, and it warns when the beneficiary death date has been modified because the current eligibility period may need review (BR-PER-023, BR-PER-024).
- Validate higher-education and orphan combinations. Higher education is only accepted when orphan code
2is present, and the rule set also checks higher-education status for twice-orphaned child beneficiaries (BR-PER-025, BR-PER-026). - Return save success without persisting beneficiary changes. Both
Save()andsavechild()callSaveBeneficiary(), andSaveBeneficiary()immediately returnsTruewithout building a portal request or API request. - Report aggregate dirty state from related child objects.
clsBeneficiary.IsDirtyreturnsTruewhen the beneficiary itself is dirty or whenAwardEligibility,Addresses, orGuardianreport pending changes.
Process flow¶
The following diagram visualizes this operation's control flow.
flowchart TD
Start([Request beneficiaries for a worker]) --> Api[Call worker contacts API]
Api --> Load[Load each beneficiary contact]
Load --> Child{Child details accessed?}
Child -->|Award eligibility| Elig[Load eligibility periods]
Child -->|Addresses| Addr[Load claim-person addresses]
Child -->|No| Validate[Run beneficiary rules when checked]
Elig --> Validate
Addr --> Validate
Validate --> Save{Caller invokes Save?}
Save -->|No| Done([Return loaded beneficiary state])
Save -->|Yes| NoOp[SaveBeneficiary returns True]
NoOp --> Done
Failure and edge-case behavior¶
Addressesare never loaded whenClaimIDis zero, because the getter short-circuits before calling the address collection.- Guardian data is only instantiated during
Fillwhen the incoming contact already contains a guardian object. Save()andsavechild()do not persist beneficiary edits, so callers must not treat aTrueresult as confirmation of database or API writes.IsDirtyforces evaluation ofAwardEligibility,Addresses, andGuardian, so child getters can affect dirty-state checks by loading related objects.- The commented-out primary-tax-ID uniqueness rule is not active and is not enforced by this operation.
Related documentation¶
Sources¶
Business\SAIF.Business.Claim.Person\clsBeneficiary.vbBusiness\SAIF.Business.Claim.Person\clsBeneficiaryCollection.vbBusiness\SAIF.Business.Claim.Person\CCClaimDataApi\clsBeneficiaryAddress.vbBusiness\SAIF.Business.Claim.Person\CCClaimDataApi\Dto\BeneficiaryData.vb