process/insurance: add fingap.policyType validation
This commit is contained in:
parent
b90bfc74d9
commit
0952ce12ee
@ -1,3 +1,4 @@
|
||||
/* eslint-disable complexity */
|
||||
/* eslint-disable sonarjs/cognitive-complexity */
|
||||
/* eslint-disable zod/require-strict */
|
||||
import type { ValidationContext } from '../types';
|
||||
@ -109,6 +110,14 @@ export function createValidationSchema({ apolloClient }: ValidationContext) {
|
||||
});
|
||||
}
|
||||
|
||||
if (fingap.insuranceCompany && !fingap.insTerm) {
|
||||
ctx.addIssue({
|
||||
code: z.ZodIssueCode.custom,
|
||||
message: `Укажите срок страхования ${fingap.policyType}`,
|
||||
path: ['insurance'],
|
||||
});
|
||||
}
|
||||
|
||||
if (
|
||||
!leasingWithoutKasko &&
|
||||
!insDecentral &&
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user