expert codes

This commit is contained in:
2026-11-09 17:29:35 +03:30
parent 6775635a81
commit f49e6b704b
5 changed files with 396 additions and 122 deletions
@@ -104,4 +104,29 @@ describe("Fanavaran assigned ClaimExpertId resolution", () => {
}),
).rejects.toBeInstanceOf(BadRequestException);
});
it("preview soft-resolve returns null plus a concrete warning instead of throwing", async () => {
const management = serviceWithStaff({});
await expect(
(management as any).resolveFanavaranBaseClaimExpertId(
{
type: BlameRequestType.THIRD_PARTY,
expert: { assignedExpertId: "missing" },
},
null,
{ required: false },
),
).resolves.toBeNull();
const soft = await (management as any).tryResolveFanavaranBaseClaimExpertId(
{
type: BlameRequestType.THIRD_PARTY,
expert: { assignedExpertId: "missing" },
},
);
expect(soft.claimExpertId).toBeNull();
expect(soft.code).toBe("FANAVARAN_CLAIM_EXPERT_ID_MISSING");
expect(soft.message).toMatch(/ThirdPartyClaimExpertId/);
expect(soft.candidatesTried).toEqual(["missing"]);
});
});