From a2e982df6e9c43c44cba0ad49dc87aad5bc23d28 Mon Sep 17 00:00:00 2001 From: Chika Date: Fri, 15 Apr 2022 14:59:01 +0300 Subject: [PATCH] merge release/dyn-1068_filter-types-leasing-obj --- .../Effects/reactions/otherReactions.ts | 32 +++++++++++++++---- .../query/options/main_options.graphql | 7 ++++ 2 files changed, 33 insertions(+), 6 deletions(-) diff --git a/src/client/stores/CalculationStore/Effects/reactions/otherReactions.ts b/src/client/stores/CalculationStore/Effects/reactions/otherReactions.ts index 67ded24..16e8399 100644 --- a/src/client/stores/CalculationStore/Effects/reactions/otherReactions.ts +++ b/src/client/stores/CalculationStore/Effects/reactions/otherReactions.ts @@ -1142,10 +1142,28 @@ const reactionEffects: IReactionEffect[] = [ calculationStore => ({ expression: () => { - const { product, leasingPeriod, deliveryTime } = calculationStore.values; - return { product_evo_id: product, leasingPeriod, deliveryTime }; + const { + product, + leasingPeriod, + deliveryTime, + firstPaymentPerc, + lastPaymentPerc, + } = calculationStore.values; + return { + product_evo_id: product, + leasingPeriod, + deliveryTime, + firstPaymentPerc, + lastPaymentPerc, + }; }, - effect: ({ product_evo_id, leasingPeriod, deliveryTime }) => { + effect: ({ + product_evo_id, + leasingPeriod, + deliveryTime, + firstPaymentPerc, + lastPaymentPerc, + }) => { if (product_evo_id && leasingPeriod && deliveryTime) { const product = calculationStore.getOption('selectProduct', { evo_id: product_evo_id, @@ -1154,11 +1172,13 @@ const reactionEffects: IReactionEffect[] = [ const tarif = calculationStore.options.selectTarif?.find( x => x.evo_baseproductid === product.evo_baseproductid && - x.evo_min_period && x.evo_min_period <= leasingPeriod && - x.evo_max_period && x.evo_max_period >= leasingPeriod && - x.evo_delivery_time?.includes(deliveryTime), + x.evo_delivery_time?.includes(deliveryTime) && + x.evo_min_first_payment <= firstPaymentPerc && + x.evo_max_first_payment >= firstPaymentPerc && + x.evo_min_last_payment <= lastPaymentPerc && + x.evo_max_last_payment >= lastPaymentPerc, ); calculationStore.setValue('tarif', tarif?.evo_tarifid); } 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 5cc0c55..e902441 100644 --- a/src/core/services/CrmService/graphql/query/options/main_options.graphql +++ b/src/core/services/CrmService/graphql/query/options/main_options.graphql @@ -172,6 +172,13 @@ query GetMainOptions( evo_leasingobject_typeid } evo_delivery_time + evo_graphtype_exception + evo_seasons_type_exception + evo_min_decreasing_perc + evo_min_first_payment + evo_max_first_payment + evo_min_last_payment + evo_max_last_payment } selectRate: evo_rates( statecode: $statecode