merge branch release/dyn-4710

This commit is contained in:
vchikalkin 2024-09-05 17:36:38 +03:00
parent bf0b5c9907
commit 62417b88ba
3 changed files with 22 additions and 3 deletions

View File

@ -330,7 +330,11 @@ export function common({ store, apolloClient }: ProcessContext) {
query: CRMTypes.GetInsuranceCompaniesDocument,
});
if (evo_leasingobject_type?.evo_id === '9' && maxSpeed < 20) {
if (
evo_leasingobject_type?.evo_id &&
['9', '6', '10'].includes(evo_leasingobject_type.evo_id) &&
maxSpeed < 20
) {
const otherInsuranceCompany = accounts?.find(
(x) => x?.evo_type_ins_policy === null && x.label?.includes('ПРОЧИЕ')
);

View File

@ -256,7 +256,7 @@ export function createValidationSchema({ apolloClient }: ValidationContext) {
if (
evo_leasingobject_type?.evo_id &&
['9'].includes(evo_leasingobject_type?.evo_id) &&
['9', '6', '10'].includes(evo_leasingobject_type?.evo_id) &&
maxSpeed < 20 &&
insurance.values.osago.insured === 100_000_001
) {

View File

@ -383,8 +383,23 @@ export function createValidationSchema(context: ValidationContext) {
sumFieldName: 'tbxDealerRewardSumm',
});
let evo_broker_accountid: string | null = null;
if (dealerPerson) {
const {
data: { dealer_person },
} = await apolloClient.query({
query: CRMTypes.GetDealerPersonDocument,
variables: {
dealerPersonId: dealerPerson,
},
});
evo_broker_accountid = dealer_person?.evo_broker_accountid || null;
}
await validateRewardSum({
agentid: dealerBroker,
agentid: dealerBroker || evo_broker_accountid,
conditionId: dealerBrokerRewardCondition,
sum: dealerBrokerRewardSumm,
sumFieldName: 'tbxDealerBrokerRewardSumm',