Files
yara724-api/docs/user-blame-progress-contract.md

3.0 KiB

User signing and claim-start guidance

The user UI v1 calls /v2/blame-request-management. Both its list and detail responses now include a viewer-specific nextAction. This is computed from the existing case, the viewer's party confirmation, and the existing claim. It does not change persisted statuses, signatures, ownership, or workflow transitions.

nextAction User interface behavior
SIGN Open the signing screen.
WAIT_FOR_OTHER_SIGNATURE Confirm that the viewer signed, explain the remaining signature, and refresh the case while waiting.
CREATE_CLAIM Show “آماده ثبت درخواست خسارت” and a “ثبت درخواست خسارت” action.
CONTINUE_CLAIM Open the claim list for the existing claim.
VIEW_RESULT Show the completed or stopped result; do not offer unauthorized claim creation.
null Continue the existing information-collection/review routing.

The detail response also includes userSide. claimCreation retains hasClaim and shouldGuideToCreateClaim, with claimRequestId when a claim exists. Third-party creation still requires completed blame, both accepted confirmations, and the damaged party as viewer. Body-insurance creation retains its single-party eligibility rule. A completed blame case means the user can start loss assessment; it does not mean compensation has already been approved for payment.

User details expose only the viewer's party. The frontend must use this guidance rather than count signatures from that partial array. Signing acknowledgements use requestId, not _id. After a successful signature, the frontend refreshes the detail and invalidates case lists before presenting the next action.

When the second-party description returns workflow.currentStep = WAITING_FOR_SIGNATURES, route directly to signing. Cases waiting for an expert continue to use the review-waiting screen. Reopening the waiting screen also checks the current case and redirects to signing or completion when appropriate.

List response size

partyIdentities is server-side filter material. It is removed after identity filtering, sorting, and pagination from these response boundaries:

  • User/initiator blame list: GET /v2/blame-request-management.
  • User/initiator claim list: GET /v2/claim-request-management/requests.
  • Expert claim queues, including field experts, file makers, and file reviewers, through ExpertClaimService.paginateClaimListV2.

The blame list uses an explicit response field list instead of spreading Mongo documents, so internal revision values and initiator IDs are not returned. Claim lists retain the IDs, status, workflow, lock, vehicle, and role-specific fields consumed by the two frontends. Detail, reporting, and integration payloads retain the evidence and inquiry data needed by their callers. Identity filtering continues to run on internal rows before the public response is constructed.

Regression coverage is in request-management.user-progress.spec.ts, public-list-response.spec.ts, and the user UI's test-blame-progress.cjs.