From 450eb18f248fdb8037d55e608a40cd6394397cd2 Mon Sep 17 00:00:00 2001 From: Chika Date: Thu, 29 Sep 2022 15:39:13 +0300 Subject: [PATCH] =?UTF-8?q?Min=20=D0=BF=D0=B5=D1=80=D0=B2=D1=8B=D0=B9=20?= =?UTF-8?q?=D0=BF=D0=BB=D0=B0=D1=82=D0=B5=D0=B6,=20%=20-=20(evo=5Faddprodu?= =?UTF-8?q?ct=5Ftype.evo=5Fmin=5Ffirst=5Fpayment=5Fperc)=20=D0=BC=D0=B5?= =?UTF-8?q?=D0=BD=D1=8C=D1=88=D0=B5=20=D0=B8=D0=BB=D0=B8=20=D1=80=D0=B0?= =?UTF-8?q?=D0=B2=D0=BD=D0=BE=20=D0=B7=D0=BD=D0=B0=D1=87=D0=B5=D0=BD=D0=B8?= =?UTF-8?q?=D1=8E=20=D0=B8=D0=B7=20=D0=BF=D0=BE=D0=BB=D1=8F=20"=D0=9F?= =?UTF-8?q?=D0=B5=D1=80=D0=B2=D1=8B=D0=B9=20=D0=BF=D0=BB=D0=B0=D1=82=D0=B5?= =?UTF-8?q?=D0=B6,=20%"=20(tbxFirstPaymentPerc)=20Max=20=D0=BF=D0=B5=D1=80?= =?UTF-8?q?=D0=B2=D1=8B=D0=B9=20=D0=BF=D0=BB=D0=B0=D1=82=D0=B5=D0=B6,=20%?= =?UTF-8?q?=20-=20(evo=5Faddproduct=5Ftype.evo=5Fmax=5Ffirst=5Fpayment=5Fp?= =?UTF-8?q?erc)=20=D0=B1=D0=BE=D0=BB=D1=8C=D1=88=D0=B5=20=D0=B8=D0=BB?= =?UTF-8?q?=D0=B8=20=D1=80=D0=B0=D0=B2=D0=BD=D0=BE=20=D0=B7=D0=BD=D0=B0?= =?UTF-8?q?=D1=87=D0=B5=D0=BD=D0=B8=D1=8E=20=D0=B8=D0=B7=20=D0=BF=D0=BE?= =?UTF-8?q?=D0=BB=D1=8F=20"=D0=9F=D0=B5=D1=80=D0=B2=D1=8B=D0=B9=20=D0=BF?= =?UTF-8?q?=D0=BB=D0=B0=D1=82=D0=B5=D0=B6,=20%"=20(tbxFirstPaymentPerc)=20?= =?UTF-8?q?=D0=9F=D0=BE=20=D1=81=D0=B2=D1=8F=D0=B7=D0=B8=20evo=5Fevo=5Fadd?= =?UTF-8?q?product=5Ftype=5Fevo=5Fmodel=20=D0=9D=D0=95=20=D1=81=D0=B2?= =?UTF-8?q?=D1=8F=D0=B7=D0=B0=D0=BD=D0=B0=20=D1=81=20=D0=BA=D0=B0=D1=80?= =?UTF-8?q?=D1=82=D0=BE=D1=87=D0=BA=D0=BE=D0=B9=20=D0=9C=D0=BE=D0=B4=D0=B5?= =?UTF-8?q?=D0=BB=D1=8C=20=D0=BF=D1=80=D0=B5=D0=B4=D0=BC=D0=B5=D1=82=D0=B0?= =?UTF-8?q?=20=D0=BB=D0=B8=D1=89=D0=B8=D0=BD=D0=B3=D0=B0=20(evo=5Fmodel),?= =?UTF-8?q?=20=D1=83=D0=BA=D0=B0=D0=B7=D0=B0=D0=BD=D0=BD=D0=BE=D0=B9=20?= =?UTF-8?q?=D0=B2=20=D0=BF=D0=BE=D0=BB=D0=B5=20"=D0=9C=D0=BE=D0=B4=D0=B5?= =?UTF-8?q?=D0=BB=D1=8C"=20(selectModel)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Effects/reactions/otherReactions.ts | 20 ++++++++++-- .../query/options/main_options.graphql | 5 +++ .../CrmService/graphql/schema.graphql | 31 +++++++++++++++++++ .../services/CrmService/types/entities.ts | 9 ++++-- 4 files changed, 59 insertions(+), 6 deletions(-) diff --git a/src/client/stores/CalculationStore/Effects/reactions/otherReactions.ts b/src/client/stores/CalculationStore/Effects/reactions/otherReactions.ts index c66d32f..fbe74b2 100644 --- a/src/client/stores/CalculationStore/Effects/reactions/otherReactions.ts +++ b/src/client/stores/CalculationStore/Effects/reactions/otherReactions.ts @@ -836,8 +836,13 @@ const reactionEffects: IReactionEffect[] = [ //@ts-ignore const importProgramSum: number = calculationStore.importProgramSum(); - const { leasingPeriod, leaseObjectType, addEquipmentPrice } = - calculationStore.values; + const { + leasingPeriod, + leaseObjectType, + addEquipmentPrice, + firstPaymentPerc, + model, + } = calculationStore.values; return { leasingPeriod, leaseObjectType, @@ -845,6 +850,8 @@ const reactionEffects: IReactionEffect[] = [ discountRub, addEquipmentPrice, importProgramSum, + firstPaymentPerc, + modelId: model, }; }, effect: ({ @@ -854,6 +861,8 @@ const reactionEffects: IReactionEffect[] = [ discountRub = 0, addEquipmentPrice = 0, importProgramSum = 0, + firstPaymentPerc = 0, + modelId, }) => { calculationStore.setFilter('selectLeasingWithoutKasko', options => options.filter( @@ -871,7 +880,12 @@ const reactionEffects: IReactionEffect[] = [ x.evo_leasingobject_types?.find( x => x.evo_leasingobject_typeid === leaseObjectType, ) && - x.evo_visible_calc, + x.evo_visible_calc && + x.evo_min_first_payment_perc && + x.evo_min_first_payment_perc <= firstPaymentPerc && + x.evo_max_first_payment_perc && + x.evo_max_first_payment_perc >= firstPaymentPerc && + !x.evo_models?.map(x => x.evo_modelid).includes(modelId), ), ); }, diff --git a/src/core/services/CrmService/graphql/query/options/main_options.graphql b/src/core/services/CrmService/graphql/query/options/main_options.graphql index 949d88d..d0bc4db 100644 --- a/src/core/services/CrmService/graphql/query/options/main_options.graphql +++ b/src/core/services/CrmService/graphql/query/options/main_options.graphql @@ -311,5 +311,10 @@ query GetMainOptions( evo_min_price evo_max_price evo_loss_kv + evo_min_first_payment_perc + evo_max_first_payment_perc + evo_models { + evo_modelid + } } } diff --git a/src/core/services/CrmService/graphql/schema.graphql b/src/core/services/CrmService/graphql/schema.graphql index 4eaf8c3..a9da930 100644 --- a/src/core/services/CrmService/graphql/schema.graphql +++ b/src/core/services/CrmService/graphql/schema.graphql @@ -405,6 +405,7 @@ type account { evo_div_12month: Boolean evo_documents(evo_documenttypeid_param: GuidParamInput, latestversion: Boolean = true): [evo_document] evo_economic_security_systemuserid: Uuid + evo_edos: [evo_edo] evo_employee_count: Int evo_fingap_number_rules: Int evo_fin_department_accountid: Uuid @@ -557,11 +558,14 @@ type evo_addproduct_type { evo_leasingobject_types(statecode: Int): [evo_leasingobject_type] evo_loss_kv: Decimal evo_max_age: Int + evo_max_first_payment_perc: Decimal evo_max_period: Decimal evo_max_price: Decimal evo_min_age: Int + evo_min_first_payment_perc: Decimal evo_min_period: Decimal evo_min_price: Decimal + evo_models: [evo_model] evo_name: String evo_nsib_limit: Decimal evo_planpayments(statecode: Int): [evo_planpayment] @@ -665,6 +669,7 @@ type evo_insurance_period { evo_invoice_date: DateTime evo_kasko_price: Decimal evo_leasingobjectid: Uuid + evo_loss_kv: Decimal evo_mobile_discount: Boolean evo_mobile_discount_factor: Decimal evo_mobile_discount_rub: Decimal @@ -2586,6 +2591,7 @@ type email { regardingobjectid_evo_list: Uuid regardingobjectid_incident: Uuid regardingobjectid_opportunity: Uuid + statecode: Int statuscode: Int subject: String templateid: Uuid @@ -2743,6 +2749,31 @@ type team { toObjectString: String } +type evo_edo { + createdon: DateTime + evo_accountid: Uuid + evo_accountidData: account + evo_activation_status: Int + evo_activation_statusname: String + evo_box_edoid: Uuid + evo_box_edoidData: evo_edo + evo_box_id: String + evo_box_name: String + evo_documentid: Uuid + evo_edoid: Uuid + evo_edo_status: Int + evo_edo_statusname: String + evo_edo_type: Int + evo_edo_typeename: String + evo_invite_crm_status: Int + evo_invite_crm_statusname: String + evo_name: String + evo_statuscodeid: Uuid + evo_statuscodeidData: evo_statuscode + modifiedon: DateTime + toObjectString: String +} + type evo_insurance_policy { createdon: DateTime evo_accountid: Uuid diff --git a/src/core/services/CrmService/types/entities.ts b/src/core/services/CrmService/types/entities.ts index 0ecabf9..df372ed 100644 --- a/src/core/services/CrmService/types/entities.ts +++ b/src/core/services/CrmService/types/entities.ts @@ -403,6 +403,12 @@ export interface IEvoAddproductType extends BaseEntity { evo_type_calc_cerebellum?: number; evo_addproduct_types?: IEvoAddproductType[]; evo_evokasko_calc_type?: number; + evo_min_price?: number; + evo_max_price?: number; + evo_loss_kv?: number; + evo_min_first_payment_perc?: number; + evo_max_first_payment_perc?: number; + evo_models?: IEvoModel; } export interface IEvoTarif extends BaseEntity { @@ -435,9 +441,6 @@ export interface IEvoTarif extends BaseEntity { evo_delivery_time?: number[]; evo_cut_irr_with_bonus_coefficient?: number; evo_margin_min?: number; - evo_min_price?: number; - evo_max_price?: number; - evo_loss_kv?: number; } export interface IEvoRate extends BaseEntity {