Category change limit maintenance¶
A category change limit is a per-employee maximum dollar amount the employee may authorize when changing a claim's reserve cost category. Unlike business function limits, category change limits are not split by business process — the collection is loaded once per employee, regardless of reserves or payments scope, as part of Claim authority initialization and persisted as part of Claim authority save.
| Field | Value |
|---|---|
| Operation ID | OP-004 |
| Trigger | clsClaimEmpCatChangeLimitCollection.GetClaimEmpCatChangeLimits (retrieve); Add(emplid) (new row); collection or aggregate Save() (persist) |
| Inputs | EmployeeEmplid, ClaimCostCategoryCode, ClaimAuthPurposeCode, MaxChangeAmount, ExpDate, AuthorizedByEmplid |
| Outputs | Populated clsClaimEmpCatChangeLimitCollection; persisted insert/update/delete of CL_CLAIM_EMP_CAT_CHANGE_LIMIT rows; broken-rule errors on validation failure |
| Primary components | clsClaimEmpCatChangeLimitCollection.GetClaimEmpCatChangeLimits, clsClaimEmpCatChangeLimit (CRUD lifecycle and business rules) |
| Entry point | Business\SAIF.Business.Claim.Authority\clsClaimEmpCatChangeLimitCollection.vb, Business\SAIF.Business.Claim.Authority\clsClaimEmpCatChangeLimit.vb |
Steps¶
- Retrieve the collection.
GetClaimEmpCatChangeLimits(dpi, emplid)builds aCriteriaand retrieves every category-change-limit row for the employee, filtered only byEmployeeEmplid(SQL-017, CL_CLAIM_EMP_CAT_CHANGE_LIMIT). - A single-object retrieve variant of the same filter also exists on
clsClaimEmpCatChangeLimititself (SQL-016, CL_CLAIM_EMP_CAT_CHANGE_LIMIT), but no caller of it was found within this library; the collection retrieve is the path actually exercised fromclsClaimAuthority.Create.* - Add a new limit row.
Add(emplid)callsclsClaimEmpCatChangeLimit.NewClaimEmpCatChangeLimit, which allocates a sequence value viaCL_CLM_EMP_CAT_CHG_LIM_SEQ.NEXTVAL(SQL-002) and defaults the new row's acting employee and zero amount.* - Set the maximum change amount. Editing
MaxChangeAmountmarks the row dirty and runsValidAmountMin— the amount must be greater than zero (BR-008). - On failure: error "Maximum limit must be greater than zero."
- Set the expiration date. Editing
ExpDaterunsValidExpDate— an empty expiration date is allowed, but a populated one may not be in the past (BR-009). - On failure: error "Expiration date may not be in the past."
- Check the grantable amount against the acting employee's own category ceiling.
ValidAuthorizeAmountruns whenever the row is dirty andIsSecurityOverrideis not set, delegating toclsClaimAuthority.CanAuthorizeCategory(categoryCode, authPurposeCode, maxChangeAmount)(BR-010). See Authorization amount and approval-type checks. - On failure: error "You are not authorized to grant this amount."
- Reject duplicate category/approval-type combinations.
DuplicateCategoryCoderuns wheneverClaimCostCategoryCodechanges and the row is not deleted; it scans sibling (non-deleted, non-self) rows in the same collection for a matchingClaimCostCategoryCode+ClaimAuthPurposeCodepair (BR-013). This check is purely in-memory and issues no SQL. - On failure: error "May not have multiple rows with the same Category and Approval Type."
- Check the approval type against the acting employee's own category ceiling.
ValidAuthorizeCategoryApprovalTyperuns wheneverClaimAuthPurposeCodechanges andIsSecurityOverrideis not set, delegating toclsClaimAuthority.CanAuthorizeCategoryApprovalType(categoryCode, authPurposeCode)(BR-011). See Authorization amount and approval-type checks. - On failure: error "You are not authorized to grant this Approval Type."
- Persist on save. Claim authority save step 6 first stamps
AuthorizedByEmplidon every dirty row, then cascadesSave(): - New row: insert binds all fields including the sequence-allocated key (SQL-005, CL_CLAIM_EMP_CAT_CHANGE_LIMIT).
- On a rows-affected value other than
1: error "Insert Failed".
- On a rows-affected value other than
- Changed row: update binds the same fields plus the key and
UpdateNum(SQL-020, CL_CLAIM_EMP_CAT_CHANGE_LIMIT).- On a rows-affected value other than
1: DB contention error.
- On a rows-affected value other than
- Removed row: delete binds the sequence key and
UpdateNum(SQL-023, CL_CLAIM_EMP_CAT_CHANGE_LIMIT).- On a rows-affected value other than
1: DB contention error.
- On a rows-affected value other than
Process flow¶
The following diagram visualizes retrieval, in-memory editing, and save for a category change limit row.
flowchart TD
Start([Load or add a category limit row]) --> Retrieve[Retrieve category change<br>limits for employee]
Retrieve --> Edit[Caller edits MaxChangeAmount,<br>ExpDate, category/purpose codes]
Edit --> Rules{Rules pass?}
Rules -->|Amount <= 0| ErrAmt([Amount error])
Rules -->|Expired date| ErrExp([Expiration error])
Rules -->|Amount exceeds own category ceiling| ErrAuth([Own-ceiling error])
Rules -->|Duplicate category/purpose| ErrDup([Duplicate error])
Rules -->|Approval type exceeds own category ceiling| ErrAppr([Approval-type error])
Rules -->|All pass| Save[Save cascades from<br>Claim authority save]
Save --> Rows{RowsAffected = 1?}
Rows -->|Yes| Done([Row persisted])
Rows -->|No| Contention([Insert/DB contention error added])
Failure and edge-case behavior¶
IsSecurityOverridebypasses both the amount ceiling (BR-010) and the approval-type ceiling (BR-011) checks, but is forced toFalsein production.- The duplicate-category-code check (BR-013) shares the same
RuleDataidentifier as the business-function-limit duplicate check (clsClaimEmpBusFuncLimitColl01) even though it is defined on a different class; this appears to be a copy-paste artifact in the source rather than an intentional shared rule.* - The single-object retrieve on
clsClaimEmpCatChangeLimit(SQL-016) has no known caller in this library; it may be dead code or reserved for a consumer outside this codebase.**
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¶
Business\SAIF.Business.Claim.Authority\clsClaimEmpCatChangeLimit.vbBusiness\SAIF.Business.Claim.Authority\clsClaimEmpCatChangeLimitCollection.vb