forked from Yara724/api
52 lines
2.9 KiB
Markdown
52 lines
2.9 KiB
Markdown
# Sheba is entered once per claim
|
|
|
|
| UI flow | Bank information is collected at |
|
|
| --- | --- |
|
|
| v1, user-created, third-party or car-body | Claim other-parts/bank-information step |
|
|
| v2, field expert | Claim other-parts/bank-information step |
|
|
| v3, field expert | Damaged party's inquiry: first party for car-body, second party for third-party |
|
|
| v4/v5, file maker and reviewer | File maker's damaged-party inquiry; reviewer reuses the claim's bank information |
|
|
| v6, call centre and user | User's claim other-parts/bank-information step; call centre never collects Sheba |
|
|
|
|
The v1/v6 initial-form endpoints do not persist a Sheba. The shared inquiry UI
|
|
previously requested it for v1, and then requested it again during the claim.
|
|
It now asks only on inquiry endpoints that actually validate and save it.
|
|
|
|
At the claim step, the UI fetches the current claim before showing bank inputs.
|
|
It requests only missing fields, reuses an already uploaded green card, and
|
|
shows a Persian confirmation when Sheba is already available. A failed or
|
|
pending fetch does not display empty bank fields. Values are not copied between
|
|
cases or kept in browser storage. User-facing bank values remain masked.
|
|
|
|
The claim snapshot adds `bankInformation.shebaProvided` and
|
|
`bankInformation.ownerNationalCodeProvided`. These booleans let the UI reuse
|
|
saved data without receiving unmasked account numbers. The owner national code
|
|
can come from the linked blame's vehicle-owner participant.
|
|
|
|
`selectOtherPartsV2` accepts omitted bank fields when the claim already has
|
|
them. It normalizes IR-prefixed and digits-only Sheba consistently and validates
|
|
new or changed bank details. It retains beneficiary authorization and rejects
|
|
another owner's saved account. Unchanged saved bank details do not trigger a
|
|
second inquiry. Explicit replacement remains available during expert resend;
|
|
an ordinary parts submission cannot silently replace an existing account.
|
|
|
|
The expert panel renders one claim-entry form for the damaged vehicle rather
|
|
than independent forms for both vehicles. It passes saved bank details into
|
|
that form. The expert claim-completion service also recognizes an IR-prefixed
|
|
saved Sheba when advancing the workflow.
|
|
|
|
No database migration is required. A Sheba entered into an old initial form and
|
|
discarded by the old endpoint cannot be recovered; those cases still need it
|
|
once at the claim step.
|
|
|
|
## Regression checks
|
|
|
|
- API: `npm test -- --runInBand claim-bank-information.spec.ts claim-beneficiary-access.spec.ts`
|
|
- User UI: `node scripts/test-claim-bank-information.cjs` (also run by `npm run test:ui`)
|
|
- Expert UI: `node scripts/test-claim-bank-information.cjs` (also run by `npm run test:ui`)
|
|
|
|
Tests cover every flow/role/party/case-type collection combination, saved and
|
|
missing values, stale/loading/error states, legacy aliases and formats,
|
|
resends, vehicle-owner mismatches, masked responses and the single expert
|
|
claim-entry form. HTTP and database dependencies are mocked.
|