From 566ea42220b91047acda0e1b7ca335c56599a857 Mon Sep 17 00:00:00 2001 From: Chika Date: Tue, 27 Sep 2022 16:14:06 +0300 Subject: [PATCH] preparedValues: new insuranceBonusLoss --- .../Effects/actions/calculate/prepareData.ts | 8 ++++++++ .../services/CoreService/types/Calculation/prepared.ts | 1 + .../CrmService/graphql/query/options/main_options.graphql | 1 + src/core/services/CrmService/graphql/schema.graphql | 5 +++++ src/core/services/CrmService/types/entities.ts | 1 + 5 files changed, 16 insertions(+) diff --git a/src/client/stores/CalculationStore/Effects/actions/calculate/prepareData.ts b/src/client/stores/CalculationStore/Effects/actions/calculate/prepareData.ts index d6e4111..be1f8c2 100644 --- a/src/client/stores/CalculationStore/Effects/actions/calculate/prepareData.ts +++ b/src/client/stores/CalculationStore/Effects/actions/calculate/prepareData.ts @@ -210,6 +210,14 @@ export default function (this: ICalculationStore): PreparedData { (plPriceRub - discountRub - importProgramSum + values.addEquipmentPrice); } + preparedValues.insuranceBonusLoss = + ((selectLeasingWithoutKasko?.evo_loss_kv || 0) * + (plPriceRub - + discountRub - + importProgramSum + + values.addEquipmentPrice)) / + 100; + preparedValues.insuranceKaskoNmper = (preparedValues.nmperInsurance || 0) >= 16 ? ((preparedValues.insuranceKasko || 0) * diff --git a/src/core/services/CoreService/types/Calculation/prepared.ts b/src/core/services/CoreService/types/Calculation/prepared.ts index 5c6ba2e..fcbea32 100644 --- a/src/core/services/CoreService/types/Calculation/prepared.ts +++ b/src/core/services/CoreService/types/Calculation/prepared.ts @@ -1,4 +1,5 @@ export interface PreparedValues { + insuranceBonusLoss?: number; insuranceEvoKasko?: number; extraBonusSumColumn?: number; importProgramSum?: number; 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 833e6c0..949d88d 100644 --- a/src/core/services/CrmService/graphql/query/options/main_options.graphql +++ b/src/core/services/CrmService/graphql/query/options/main_options.graphql @@ -310,5 +310,6 @@ query GetMainOptions( evo_visible_calc evo_min_price evo_max_price + evo_loss_kv } } diff --git a/src/core/services/CrmService/graphql/schema.graphql b/src/core/services/CrmService/graphql/schema.graphql index 66ebcd0..4eaf8c3 100644 --- a/src/core/services/CrmService/graphql/schema.graphql +++ b/src/core/services/CrmService/graphql/schema.graphql @@ -342,6 +342,7 @@ type evo_debtwork_contract { evo_termination_com_lawyer: String evo_termination_lawyer_systemuserid: Uuid evo_termination_lawyer_systemuseridData: systemuser + evo_termination_notice_date: DateTime evo_termination_reason_terms: Int evo_termination_reason_terms_doc: String evo_termination_reason_terms_text: String @@ -554,6 +555,7 @@ type evo_addproduct_type { evo_helpcard_type: Int evo_id: String evo_leasingobject_types(statecode: Int): [evo_leasingobject_type] + evo_loss_kv: Decimal evo_max_age: Int evo_max_period: Decimal evo_max_price: Decimal @@ -612,6 +614,7 @@ type evo_graph { evo_cost_price_telematics_withoutnds_sum: Decimal evo_cost_telematics_sum: Decimal evo_cost_telematics_withoutnds_sum: Decimal + evo_graf_date_approve: DateTime evo_graphid: Uuid evo_name: String evo_nds: Decimal @@ -792,6 +795,7 @@ type evo_leasingobject { evo_color: String evo_contractid: Uuid evo_create_contract_purchase: Boolean + evo_date_withdrawal: DateTime evo_delivery_time: Int evo_driving_axle: String evo_ecological_class: Int @@ -1203,6 +1207,7 @@ type quote { evo_lessor_bank_detailsid: Uuid evo_loan_appraisalid: Uuid evo_logid: Uuid + evo_loss_kv: Decimal evo_max_mass: Decimal evo_max_price_change: Decimal evo_max_speed: Decimal diff --git a/src/core/services/CrmService/types/entities.ts b/src/core/services/CrmService/types/entities.ts index c9572d0..0ecabf9 100644 --- a/src/core/services/CrmService/types/entities.ts +++ b/src/core/services/CrmService/types/entities.ts @@ -437,6 +437,7 @@ export interface IEvoTarif extends BaseEntity { evo_margin_min?: number; evo_min_price?: number; evo_max_price?: number; + evo_loss_kv?: number; } export interface IEvoRate extends BaseEntity {