fix: recover saved photo uploads and lower car-body description minimum

Read saved document status from maps and plain objects, acknowledge verified document retries without replacing stored images, and preserve upload authorization and resend behavior. Lower the car-body narrative minimum to 30 characters with Persian errors and boundary regression coverage.
This commit is contained in:
SepehrYahyaee
2026-11-21 12:35:49 +03:30
parent 8f15040080
commit e33f5736a2
12 changed files with 202 additions and 29 deletions
@@ -23,3 +23,20 @@ describe("RequestManagementService CAR_BODY insurer client", () => {
});
});
});
describe("CAR_BODY description minimum", () => {
const service = Object.create(RequestManagementService.prototype) as any;
it.each([30, 31, 99, 100])("accepts %s trimmed characters", length => {
expect(() => service.assertCarBodyDescriptionMinimum("CAR_BODY", ` ${"ش".repeat(length)} `)).not.toThrow();
});
it.each([undefined, "", " ", "ش".repeat(29), ` ${"ش".repeat(29)} `])("rejects a short description with a Persian 30-character message", description => {
expect(() => service.assertCarBodyDescriptionMinimum("CAR_BODY", description)).toThrow("شرح حادثه باید حداقل ۳۰ کاراکتر باشد.");
});
it("preserves optional third-party descriptions", () => {
expect(() => service.assertCarBodyDescriptionMinimum("THIRD_PARTY", "")).not.toThrow();
});
});