fix: support manual accident addresses and expose final Fanavaran completion

Accept and persist address-only locations across user and expert flows, preserve workflow authorization, and include addresses in reports and Fanavaran review. Expose persisted final submission completion so the expert panel can prevent repeat sends.
This commit is contained in:
SepehrYahyaee
2026-11-21 09:45:13 +03:30
parent b63525c863
commit c6022a1646
15 changed files with 244 additions and 25 deletions
@@ -12,6 +12,7 @@ describe("fanavaranClaimReferences", () => {
expertiseId: 22,
}),
).toEqual({
submissionCompleted: true,
claimId: 987654,
claimNo: 123456,
dmgCaseId: 11,
@@ -40,6 +41,7 @@ describe("fanavaranClaimReferences", () => {
},
}),
).toEqual({
submissionCompleted: true,
claimId: 100,
claimNo: 101,
dmgCaseId: 102,
@@ -64,11 +66,30 @@ describe("fanavaranClaimReferences", () => {
expertiseId: 22,
}),
).toEqual({
submissionCompleted: true,
claimId: 987654,
expertiseId: 22,
});
});
it("keeps partial stage codes retryable", () => {
expect(fanavaranClaimReferences({ status: ClaimCaseStatus.COMPLETED, claimId: 1, dmgCaseId: 2 }))
.not.toHaveProperty("submissionCompleted");
});
it("exposes final acceptance independently of local workflow status", () => {
expect(fanavaranClaimReferences({ status: ClaimCaseStatus.EXPERT_REVIEWING, expertiseId: 22 }))
.toEqual({ submissionCompleted: true });
expect(fanavaranClaimReferences({
status: ClaimCaseStatus.COMPLETED,
fanavaranSync: { expertise: { status: "success" } },
})).toEqual({ submissionCompleted: true });
expect(fanavaranClaimReferences({
status: ClaimCaseStatus.COMPLETED,
fanavaranSync: { expertise: { status: "failed" } },
})).toBeUndefined();
});
it("returns undefined before the claim is completed", () => {
expect(
fanavaranClaimReferences({