process/insurance: add fingap.insured validation

This commit is contained in:
vchikalkin 2023-06-06 18:30:00 +03:00
parent 4a65a39ba3
commit 4fd5c3602e

View File

@ -91,6 +91,16 @@ export function createValidationSchema({ apolloClient }: ValidationContext) {
}
});
const { fingap } = insurance.values;
if (fingap.insuranceCompany && !fingap.insured) {
ctx.addIssue({
code: z.ZodIssueCode.custom,
message: `Укажите плательщика ${fingap.policyType}`,
path: ['insurance'],
});
}
if (
!leasingWithoutKasko &&
!insDecentral &&