Files
yara724api/docs/v6-call-center-workflow.md
T

46 lines
4.5 KiB
Markdown

# V6 call-center workflow and inquiry recovery
The call-center operator performs the caller's inquiry once, for both `CAR_BODY` and `THIRD_PARTY`. Plate and VIN use the same subsequent workflow. These are API workflow rules; `skipInitialFormStep` by itself is not proof of successful inquiry.
## Root cause and correction
The backend previously skipped `FIRST_INITIAL_FORM` after video **only for third-party** cases. Car-body cases therefore returned to inquiry even with fully stored operator results. The operator endpoints also stored a success-history event without marking the inquiry workflow step complete. The earlier frontend video fix followed the response correctly, but could not correct the car-body response.
After a successful operator inquiry, the API records `FIRST_INITIAL_FORM` as complete without advancing past the caller's required introduction/video. Failed or partially populated inquiries do not enable link sending. After video both case types advance to `FIRST_LOCATION`. The second party's independent inquiry is never skipped.
Authorized user reads and operator detail reads repair older cases stuck at `FIRST_INITIAL_FORM` when the stored operator success event and insurer/client association establish completion. Video evidence or completed video is required to advance to location; otherwise recovery returns to video. Stopped, cancelled, completed and locked cases are not repaired. Later narrative, second-party and signature steps are not rewound. No inquiry is rerun as part of recovery.
The user UI also rechecks a bookmarked V6 first-party inquiry page and replaces it with the remaining accident-type, video or narrative page when the API confirms the first inquiry is complete. Operator and second-party inquiry forms retain their normal behavior.
V6 SMS links retain `/v6/` for the initial caller link, second-party invitation, signature notices and claim-ready notice. Other flows retain their existing URL version.
## Expected paths
| Stage | Car-body | Third-party |
| --- | --- | --- |
| Operator | Create → plate/VIN inquiry → review → send link | Same |
| Caller login | Accident-type form | Video (confession already established) |
| First-party collection | Video → location → voice → description/accident fields | Video → location → voice → description |
| Next | Single-party signature | Invite second party → their inquiry → their location/voice/description |
| Completion | Accept signature → blame completed | Both accept signatures → blame completed |
| Rejection | Stop case | Stop case |
| Claim | Existing claim-creation authorization and required payment data | Existing claim-creation authorization; damaged party only |
Skipping repeat blame inquiry does not waive claim-stage IBAN, payment details, documents or insurer eligibility. Existing claim-stage validation remains in place.
## Verification and production QA
Backend regressions exercise both products and both inquiry entry points, first login/resume, accident-type/video, narrative, second-party invitation/required inquiry boundary, signatures/completion/rejection, recovery, authorization, failed inquiry, repeated links, operator detail and preserved SMS versions. External inquiry calls and SMS delivery are mocked. In the third-party scenario the external second-party inquiry itself is represented by its completed workflow boundary; existing inquiry-specific tests cover its provider contracts.
Run:
```bash
npm test -- --runInBand call-center-v6-workflow.spec file-maker-blame-v4-workflow.spec
```
Frontend navigation regressions are included in `ui-user`'s `npm run test:ui`.
For production QA, use separate test users for caller and damaged party. Run one case of each type with plate inquiry, and VIN if enabled. Reload at video, location, voice, description, waiting/signing and completed states; reopen from the case list; revisit an old inquiry URL; resend the operator link. Confirm no repeated caller inquiry and no skipped video. For third-party, verify the second party still provides their inquiry, only the damaged party can proceed to claim, and both signatures are required. Confirm SMS links stay on v6. Test inquiry failure before sending a link and a rejected signature. Provider availability, actual SMS delivery and browser/device media capture still require environment QA.
Deploy both the API correction and the user UI recovery. No environment changes, bulk database migration or manual status edits are required; eligible old records recover on authorized reads.