merge release/dyn-2294_okved-elt

This commit is contained in:
vchikalkin 2023-01-25 10:11:43 +03:00
parent f1ee187636
commit ba426351b6
3 changed files with 29 additions and 1 deletions

View File

@ -16,6 +16,29 @@ export const requiredFields: ElementsNames[] = [
'radioInfuranceOPF',
];
const okvedCondition: ValidationCondition = calculationStore => {
const lead = calculationStore.getOption('selectLead');
const opportunity = calculationStore.getOption('selectOpportunity');
const okved =
lead?.accountidData?.evo_okved || opportunity?.accountidData?.evo_okved;
if (
okved &&
['71.1', '77.3', '49.4', '49.32', '49.39', '47.91.2', '47.99.1'].some(
code => okved.startsWith(code),
)
) {
return {
isValid: false,
message:
'По данному ОКВЭД Контрагента возможен только индивидуальный запрос тарифов КАСКО/ОСАГО. Просьба обратиться на адрес strakhovka@evoleasing.ru ',
};
}
return {
isValid: true,
};
};
export const conditions: Partial<Record<ElementsNames, ValidationCondition>> = {
selectLeaseObjectType: calculationStore => {
const leaseObjectType = calculationStore.getOption('selectLeaseObjectType');
@ -122,6 +145,8 @@ export const conditions: Partial<Record<ElementsNames, ValidationCondition>> = {
isValid: true,
};
},
selectOpportunity: okvedCondition,
selectLead: okvedCondition,
};
export const resetFields: ElementsNames[] = [

View File

@ -13,6 +13,7 @@ query GetOwnerOptions($statecode: Int, $domainname: String) {
evo_region_fias_id
evo_city_fias_id
}
evo_okved
}
evo_inn
link
@ -33,6 +34,7 @@ query GetOwnerOptions($statecode: Int, $domainname: String) {
evo_region_fias_id
evo_city_fias_id
}
evo_okved
}
link
}

View File

@ -63,6 +63,7 @@ export interface IAccount extends BaseEntity {
evo_legal_region_calc?: boolean;
evo_osago_with_kasko?: boolean;
evo_evokasko_access?: boolean;
evo_okved?: string;
}
export interface ISalonProvider extends IAccount {