The shared user claim API supports the regular third-party and body-insurance flows. A third-party claim can be created only by the party opposite the recorded `expert.decision.guiltyPartyId`, after the blame case is `COMPLETED` and both parties have accepted and supplied signature files. Both identities must be present and distinct, and the guilty ID must match one of them. An unresolved decision does not grant either party claim creation. Body-insurance claims belong to the first party of the completed blame case.
`helpers/blame-claim-eligibility.ts` supplies the same eligibility rule to claim creation and the viewer's blame-list/detail guidance. An existing claim remains viewable by both parties, but only the beneficiary receives `CONTINUE_CLAIM`. Claim details include `canAct`; read-only viewers receive no owner action guidance. The user UI sends those viewers to the evaluation screen and hides signing, objections, and invoice-upload controls. An unrelated actor cannot create or mutate the claim.
New regular claims store the beneficiary in both `owner.userId` and `damagedPartyUserId`, as the in-person flows already do. `owner.clientId` and `owner.userClientKey` still identify the paying insurer (the guilty party's insurer for third-party claims). No existing database rows are rewritten.
For historical regular claims whose owner is the guilty party, mutation authorization resolves the beneficiary from the linked blame decision rather than granting owner access. Phone-linked user identities remain supported. When the source is unavailable, an explicit `damagedPartyUserId` is authoritative. Snapshot membership alone cannot establish liability because historical and in-person claims have different owner conventions; an ambiguous linked claim is rejected. Standalone legacy claims with neither a linked blame nor snapshot parties retain owner access.
The specialized expert/registrar creation and capture workflows retain their existing role and initiator checks, including the reorganized flows that create a claim before blame completion. The user creation rule is not imposed on those specialized endpoints.
The user UI stores one active identity. Successful OTP or expert login clears the previous party's token, active case IDs, per-case claim caches, Redux case state, and query data. A legacy browser containing both token keys must log in again. Creation requests are deduplicated per identity and blame case, and a rejected request cannot enable the claim-entry button or borrow an unrelated claim ID. Responses arriving after an account switch cannot overwrite the new account's active claim.
Regression coverage: `claim-beneficiary-access.spec.ts`, `request-management.user-progress.spec.ts`, and `ui-user/scripts/test-claim-session.cjs`. Run `npm test -- --runInBand` in `api` and `npm run test:ui` in each UI repository.
Reviewed the API controller surface, both frontend source trees (including expert-panel server proxies), runtime service references, API scripts, and workflow/role documentation. This cleanup starts from the working tree containing the claim-beneficiary authorization fixes; it preserves those fixes.
## Signature follow-up
Ordinary users now get the same fresh case status on both the final page and the older waiting-for-signature URL. While waiting, the case is refreshed every 10 seconds and on window focus. The page explicitly says that their signature is recorded and the other party is still required. After the other signature arrives, server-provided nextAction and claimCreation determine the new message and allowed action. Only the beneficiary sees claim creation. Existing expert declaration behavior is retained.
The silent refresh button was removed. A background refresh failure retains the last successful case, explains that it is the last known status, and offers a retry with a loading state. Initial failures still show the full retry screen. Long declarations can scroll on small screens.
- 215 unreachable service methods, including their private helper chains and unused database wrappers. Reachability includes controllers, other services, lifecycle hooks, decorated methods, scripts, callbacks, and conservative handling of dynamic property references.
- 35 orphaned TypeScript files: old DTOs, response types, unused PDF helpers, examples, barrels, and an obsolete JSON pipe.
- Three empty database providers, their unused injections, unused private configuration/price-drop fields, and three retired controllers. Persistent collection registrations and schemas still used by active or blame-expert paths remain.
- The unused frontend claim-picker component, its sort helper, and its unversioned claimable-list client method; the unused legacy Fanavaran client method was also removed.
No database migration, document rewrite, or collection deletion is performed.
## Deliberately retained
- Every V1–V6 screen flow. The current V1 user screens call V2 APIs; UI flow versions and API prefixes are different concepts. V1-specific limits and historical workflow repair remain.
- Both unversioned and V2 blame-expert controllers, the entire blame-expert service, and its reachable legacy helpers, media and historical models.
- The unversioned GET /claim-request-management/car-other-part catalog, GET /expert-claim/imageRequired/:id, GET /expert-claim/stream/:id/voice, and POST /expert-initiated-blame/add-accident-fields/:requestId, because frontend clients/server proxies still reference them. Their guards, roles and responses are unchanged.
- Versioned expert-initiated and registrar APIs, all V3/V4/V5/V6 creation/review/approval/link workflows, role onboarding, inquiries, lookup caching, AI, current Fanavaran stages, uploads, reports, and background retry/maintenance jobs.
- Deprecated report routes that still have frontend callers, and Fanavaran preview query parameters retained for compatibility. A deprecation label by itself was not treated as proof of disuse.
- Historical data/status fallbacks reachable from current endpoints. “Legacy data” is not the same as an unused endpoint.
The remaining large services implement active workflows and Fanavaran mappings; they were not split or rewritten during this cleanup.
## Verification
A structural comparison against the pre-cleanup working tree found identical executable method structure for all 1,336 retained controller/service methods. Formatting, imports and unused constructor dependencies changed; retained method logic did not.
The public route/access contract in test/contracts/api-routes.json was captured from the pre-cleanup controllers after excluding the explicitly retired routes. src/core/api-route-contract.spec.ts checks all 381 remaining routes against live Nest metadata, including controller and method guards and role restrictions. Update this contract deliberately when changing the public API.
Regression coverage includes active claim eligibility, cross-tenant/reviewer authorization, V4/V5 transitions, optional documents, captures/AI, licensing inquiries, Fanavaran stage fields, and pricing. Tests solely exercising removed legacy endpoints were retired; equivalent active V2 safeguards remain tested. Constructor mocks use named dependencies where removals changed argument positions.
The UI status tests cover polling, completion, beneficiary-only actions, initial/background errors and retries. Local browser checks use mocked case responses on the real pages at 320px, 390px and 1366px; they exercise automatic completion and refresh error recovery.
Final checks: 77 API suites / 486 tests passed; API production build passed; both frontend regression suites passed; user UI production build passed. The UI detector reported no findings. Blame-expert source files were not modified.
## Controller audit
Every controller was included. Counts are HTTP routes, including hidden routes.
<pclass="note">The unversioned routes below have been retired. Current filing uses <code>v2/registrar/blame-request-management/</code>. See <ahref="legacy-api-cleanup.md">the retirement audit</a>.</p>
<pclass="note">Historical reference only — these handlers are no longer registered.</p>
<table>
<tr><thstyle="width:70px">Method</th><th>Route</th><th>What it does</th></tr>
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.