process/recalc: fix firstPaymentPerc validation

This commit is contained in:
vchikalkin 2024-01-23 16:58:48 +03:00
parent 175cb63515
commit ac14a86c33

View File

@ -154,9 +154,8 @@ export function createValidationSchema({ apolloClient }: ValidationContext) {
});
if (
quote?.evo_approved_first_payment &&
quote.evo_percent_subsidy &&
firstPaymentPerc < quote.evo_approved_first_payment + quote.evo_percent_subsidy
firstPaymentPerc <
(quote?.evo_approved_first_payment || 0) + (quote?.evo_percent_subsidy || 0)
) {
ctx.addIssue({
code: z.ZodIssueCode.custom,