Debit card enrollment¶
clsDebitCardEnrollmentRequest tracks a payee's request to receive payments on a prepaid debit card, and is one of the two child objects a clsPaymentPreference can wrap (see Payment preference selection). Only workers are eligible for debit-card payment per BR-EFT-02; active enrollments are the default retrieval scope per BR-EFT-06.
| Field | Value |
|---|---|
| Operation ID | OP-EFT-04 |
| Trigger | Caller calls NewDebitCardEnrollmentRequest, or retrieves via CardholderIDNum or EnrollRequestSeqNum |
| Inputs | Cardholder ID number, customer ID, participant ID (optional — auto-assigned if omitted), enrollment status/date |
| Outputs | Persisted/updated DEBIT_CARD_ENROLLMENT_REQUEST row; the object is reset to a "new" state after delete rather than marked old |
| Primary components | clsDebitCardEnrollmentRequest.BeforeCreate/Insert/Retrieve/Update/AfterDelete, GetParticipantIDForCardHolderID; clsDebitCardEnrollmentRequestCollection |
| Entry point | Business\SAIF.Business.Payment.EFT\clsDebitCardEnrollmentRequest.vb, Business\SAIF.Business.Payment.EFT\clsDebitCardEnrollmentRequestCollection.vb |
Steps¶
- Create a new enrollment request.
NewDebitCardEnrollmentRequestfetches the next sequence value (SQL-003, DUAL) and stamps create date/user. - Auto-assign a participant ID if not supplied. If the caller has not set
ParticipantIDbefore insert,GetParticipantIDForCardHolderIDlooks up the participant ID associated with the givenCardholderIDNum(SQL-012) and assigns it automatically — the caller is not required to know or supply the participant ID up front. - Validate before save. Registered rules require non-blank
CardholderIDNum,CustomerID,ParticipantID(after auto-assignment), and valid create-audit fields; eligibility (AllowDebitCard) is enforced by the calling context per BR-EFT-02, not by this class directly. - Insert.
BeforeInsert/AfterInsertexecutesINSERT INTO DEBIT_CARD_ENROLLMENT_REQUEST (...)(SQL-043, DEBIT_CARD_ENROLLMENT_REQUEST). - The insert parameter builder contains a duplicate
AddParm("CardholderIDNum", ...)call — redundant but harmless since the same value is bound both times.* - On failure (
RowsAffected <> 1): adds anInsertErrormessage (BR-EFT-05). - Retrieve by CardholderIDNum or EnrollRequestSeqNum. Single-record retrieval selects the full row by whichever key is supplied (SQL-080, DEBIT_CARD_ENROLLMENT_REQUEST).
- Collection retrieval excludes terminated enrollments by default.
clsDebitCardEnrollmentRequestCollection's default retrieval filters out enrollment rows whose status indicates termination unless the caller explicitly requests an unfiltered (all-statuses) retrieval (SQL-044, DEBIT_CARD_ENROLLMENT_REQUEST, BR-EFT-06). - Update.
BeforeUpdate/AfterUpdateexecutes a full-columnUPDATE DEBIT_CARD_ENROLLMENT_REQUESTkeyed onEnrollRequestSeqNum(SQL-091, DEBIT_CARD_ENROLLMENT_REQUEST). - On failure (
RowsAffected <> 1): adds anUpdateErrormessage (BR-EFT-05). - Delete.
BeforeDelete/AfterDeleteperforms a physicalDELETEon the row. Unlike most objects in this library,AfterDeletecallsMarkNew()rather thanMarkOld()— meaning the object instance is left in a state where a subsequentSave()would attempt to re-insert it (rather than being treated as a fully discarded, "old" object).*
Process flow¶
flowchart TD
Start([Caller creates or retrieves<br>a debit-card enrollment]) --> New{New enrollment?}
New -->|Yes| Seq[Fetch DEBIT_CARD_ENROLLMENT_SEQ.NEXTVAL]
New -->|No| Retrieve[Retrieve by CardholderIDNum<br>or EnrollRequestSeqNum]
Seq --> PIDSet{ParticipantID set?}
PIDSet -->|No| Lookup[GetParticipantIDForCardHolderID]
PIDSet -->|Yes| Validate
Lookup --> Validate{IsValid?}
Validate -->|No| Fail([Broken rules returned])
Validate -->|Yes| Insert[INSERT DEBIT_CARD_ENROLLMENT_REQUEST]
Retrieve --> Action{Caller action?}
Action -->|Update| Update[UPDATE row]
Action -->|Delete| Delete[DELETE row; MarkNew]
Insert --> Rows{RowsAffected = 1?}
Update --> Rows
Delete --> Rows
Rows -->|No| Err([InsertError/UpdateError added])
Rows -->|Yes| Done([Save/Delete returns ErrorCount = 0])
Failure and edge-case behavior¶
- Debit-card eligibility (BR-EFT-02) is not enforced inside
clsDebitCardEnrollmentRequestitself — a non-worker payee's enrollment could be persisted if the calling context does not checkAllowDebitCardfirst.* - Default collection retrievals silently exclude terminated enrollments; callers needing full history must explicitly request the unfiltered variant (BR-EFT-06).
AfterDeletecallingMarkNew()instead of the conventionalMarkOld()is inconsistent with sibling classes in this library and could allow an accidental re-insert ifSave()is called again on the same instance after delete.*- The duplicate
CardholderIDNumparameter binding in the insert builder is redundant but does not change behavior since both bindings use the same value.*
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.
Sources¶
Business\SAIF.Business.Payment.EFT\clsDebitCardEnrollmentRequest.vbBusiness\SAIF.Business.Payment.EFT\clsDebitCardEnrollmentRequestCollection.vb