merge release/dyn-604_insurance-one-year-policies
This commit is contained in:
parent
c00d31fa21
commit
0c347a57fc
@ -128,6 +128,58 @@ const customConditions: TElements<ValidationCondition> = {
|
||||
'Первый платеж с учетом субсидии получается отрицательный, увеличьте первый платеж',
|
||||
};
|
||||
},
|
||||
// TODO: temp (move to tableInsurance validation)
|
||||
tbxLeasingPeriod: calculationStore => {
|
||||
const { recalcWithRevision, leasingPeriod } = calculationStore.values;
|
||||
const quote = calculationStore.getOption('selectQuote');
|
||||
const kaskoRowIndex = calculationStore.tables.tableInsurance.rows.findIndex(
|
||||
x => x.policyType?.value === 'КАСКО',
|
||||
);
|
||||
|
||||
const kaskoValues = calculationStore.getTableRowValues(
|
||||
'tableInsurance',
|
||||
kaskoRowIndex,
|
||||
'value',
|
||||
);
|
||||
|
||||
const kaskoInsTerm = kaskoValues.insTerm;
|
||||
|
||||
if (
|
||||
recalcWithRevision &&
|
||||
quote?.evo_one_year_insurance &&
|
||||
leasingPeriod > 16 &&
|
||||
kaskoInsTerm !== 100000000
|
||||
) {
|
||||
calculationStore.setTableRow(
|
||||
'tableInsurance',
|
||||
kaskoRowIndex,
|
||||
false,
|
||||
)({
|
||||
insTerm: {
|
||||
validation: false,
|
||||
},
|
||||
});
|
||||
return {
|
||||
isValid: false,
|
||||
message:
|
||||
'Невозможно включить страховку на весь срок для однолетнего полиса',
|
||||
};
|
||||
} else {
|
||||
calculationStore.setTableRow(
|
||||
'tableInsurance',
|
||||
kaskoRowIndex,
|
||||
false,
|
||||
)({
|
||||
insTerm: {
|
||||
validation: true,
|
||||
},
|
||||
});
|
||||
|
||||
return {
|
||||
isValid: true,
|
||||
};
|
||||
}
|
||||
},
|
||||
};
|
||||
|
||||
const elementsValidations: TElements<any> = {
|
||||
|
||||
@ -20,4 +20,5 @@ evo_legal_townid
|
||||
link
|
||||
evo_req_telematic
|
||||
evo_req_telematic_accept
|
||||
evo_one_year_insurance
|
||||
`;
|
||||
|
||||
@ -101,6 +101,7 @@ export interface IQuote {
|
||||
evo_accept_control_addproduct_typeid?: string;
|
||||
evo_req_telematic?: number;
|
||||
evo_req_telematic_accept?: number;
|
||||
evo_one_year_insurance?: boolean;
|
||||
}
|
||||
|
||||
export interface IEvoGraph {
|
||||
|
||||
Reference in New Issue
Block a user