forked from Yara724/api
fix(fanavaran): require vehicle review and recover submitted base claims
Require approved vehicle classification before new base submissions. Allow a first review for existing base claims without damage or expertise, preserve remote IDs, and resume deferred damage submission. Keep approved submitted classifications locked and compare stage IDs and review snapshots when saving.
This commit is contained in:
@@ -43,3 +43,12 @@ The same tab also supports [expert editing of accident and assessment fields](fa
|
||||
Base claim, damage case, attachments, and expertise writes enforce the persisted approval. Automatic stages are deferred with a skip reason; manual stages return `409` with code `FANAVARAN_VEHICLE_REVIEW_REQUIRED`. Read-only previews remain available for diagnosis.
|
||||
|
||||
Once Fanavaran has created the base claim, the review is immutable in the panel because changing it would make the local snapshot disagree with data already written remotely.
|
||||
|
||||
|
||||
## Recovery for previously submitted base claims
|
||||
|
||||
New base submissions (automatic and manual) require vehicle approval. Existing base claims are reused without another POST.
|
||||
|
||||
A case whose base was already submitted without vehicle approval may receive its first approval while `dmgCaseId` and `expertiseId` are absent. This uses the normal authorized review endpoint and active lookup/relationship validation. Approval preserves the existing base IDs and resumes damage submission when selected parts exist. The update compares the current review and stage IDs atomically so a competing approval or submission requires refresh.
|
||||
|
||||
An approved classification stays locked after base submission. Recovery does not rewrite the remote base payload. Base and damage use-type derivation can refer to different parties, so recovery does not impose equality between their use-type fields.
|
||||
|
||||
Reference in New Issue
Block a user