From 9e33e1f70a36b5028e80186c04fb97a39f738edc Mon Sep 17 00:00:00 2001 From: vchikalkin Date: Wed, 1 Feb 2023 17:53:04 +0300 Subject: [PATCH] graphql: share more queries --- .../Calculation/addons/currency-addon.tsx | 17 +- apps/web/apollo.config.js | 9 +- apps/web/graphql/crm.query.graphql | 132 +++++++- apps/web/graphql/crm.types.ts | 310 +++++++----------- .../process/configurator/reactions/filters.ts | 2 +- apps/web/process/fingap/get-kp-data.ts | 10 +- .../process/init/get-data/get-main-data.js | 42 +-- .../lead-opportunity/reactions/common.ts | 65 +--- .../leasing-object/reactions/common.ts | 63 +--- apps/web/process/price/reactions/computed.ts | 36 +- apps/web/process/subsidy/reactions.ts | 24 +- .../supplier-agent/lib/create-reactions.ts | 58 +--- .../lib/fill-agents-from-lead.ts | 81 ++--- .../supplier-agent/reactions/agents.ts | 131 +++----- .../supplier-agent/reactions/leaseback.ts | 24 +- .../supplier-agent/reactions/supplier.ts | 36 +- 16 files changed, 398 insertions(+), 642 deletions(-) diff --git a/apps/web/Components/Calculation/addons/currency-addon.tsx b/apps/web/Components/Calculation/addons/currency-addon.tsx index afdab0f..3b4cbc4 100644 --- a/apps/web/Components/Calculation/addons/currency-addon.tsx +++ b/apps/web/Components/Calculation/addons/currency-addon.tsx @@ -1,25 +1,14 @@ -import { gql, useQuery } from '@apollo/client'; -import type * as CRMTypes from 'graphql/crm.types'; +import { useQuery } from '@apollo/client'; +import * as CRMTypes from 'graphql/crm.types'; import { observer } from 'mobx-react-lite'; import { useStore } from 'stores/hooks'; -const QUERY_GET_CURRENCY_SYMBOL = gql` - query GetCurrencySymbol($currencyid: Uuid!) { - transactioncurrency(transactioncurrencyid: $currencyid) { - currencysymbol - } - } -`; - const CurrencyAddon = observer(() => { const { $calculation } = useStore(); const currencyid = $calculation.element('selectSupplierCurrency').getValue(); - const { data } = useQuery< - CRMTypes.GetCurrencySymbolQuery, - CRMTypes.GetCurrencySymbolQueryVariables - >(QUERY_GET_CURRENCY_SYMBOL, { + const { data } = useQuery(CRMTypes.GetTransactionCurrencyDocument, { variables: { currencyid: currencyid!, }, diff --git a/apps/web/apollo.config.js b/apps/web/apollo.config.js index 7988f3b..7984bf1 100644 --- a/apps/web/apollo.config.js +++ b/apps/web/apollo.config.js @@ -5,7 +5,12 @@ module.exports = { name: 'crmgraphql', localSchemaFile: `${__dirname}/graphql/crm.schema.graphql`, }, - excludes: ['**/graphql/**/*'], - includes: ['**/pages/**/*', '**/process/**/*', '**/Components/**/*'], + excludes: ['**/graphql/**/*.schema.graphql', '**/graphql/**/*.types.graphql'], + includes: [ + '**/pages/**/*', + '**/process/**/*', + '**/Components/**/*', + '**/graphql/**/*.query.graphql', + ], }, }; diff --git a/apps/web/graphql/crm.query.graphql b/apps/web/graphql/crm.query.graphql index 50e19e7..9a0c718 100644 --- a/apps/web/graphql/crm.query.graphql +++ b/apps/web/graphql/crm.query.graphql @@ -8,6 +8,52 @@ query GetTransactionCurrencies { } } +query GetTransactionCurrency($currencyid: Uuid!) { + transactioncurrency(transactioncurrencyid: $currencyid) { + currencysymbol + isocurrencycode + } +} + +query GetCurrencyChanges($currentDate: DateTime) { + evo_currencychanges(statecode: 0, evo_coursedate_param: { eq: $currentDate }) { + evo_currencychange + evo_ref_transactioncurrency + } +} + +query GetLead($leadid: Uuid!) { + lead(leadid: $leadid) { + evo_agent_accountid + evo_double_agent_accountid + evo_broker_accountid + evo_fin_department_accountid + evo_opportunityidData { + label: name + value: opportunityid + } + } +} + +query GetOpportunity($opportunityid: Uuid!) { + opportunity(opportunityid: $opportunityid) { + evo_leadid + } +} + +query GetQuotesByLead($leadid: Uuid!) { + quotes(evo_leadid: $leadid) { + label: evo_quotename + value: quoteid + } +} + +query GetQuote($quoteId: Uuid!) { + quote(quoteId: $quoteId) { + evo_baseproductid + } +} + query GetTarifs($currentDate: DateTime) { evo_tarifs( statecode: 0 @@ -66,8 +112,20 @@ query GetProduct($productId: Uuid!) { } } +query GetSubsidies($currentDate: DateTime) { + evo_subsidies( + statecode: 0 + evo_datefrom_param: { lte: $currentDate } + evo_dateto_param: { gte: $currentDate } + ) { + label: evo_name + value: evo_subsidyid + evo_subsidy_type + } +} + query GetSubsidy($subsidyId: Uuid!) { - subsidy: evo_subsidy(evo_subsidyid: $subsidyId) { + evo_subsidy(evo_subsidyid: $subsidyId) { evo_leasingobject_types { evo_leasingobject_typeid } @@ -80,6 +138,9 @@ query GetSubsidy($subsidyId: Uuid!) { evo_models { evo_modelid } + evo_subsidy_summ + evo_percent_subsidy + evo_max_subsidy_summ } } @@ -100,6 +161,20 @@ query GetImportProgram($importProgramId: Uuid!) { } } +query GetRegions { + evo_regions { + label: evo_name + value: evo_regionid + } +} + +query GetGPSBrands { + evo_gps_brands(statecode: 0) { + label: evo_name + value: evo_gps_brandid + } +} + query GetLeaseObjectTypes { evo_leasingobject_types(statecode: 0) { label: evo_name @@ -108,6 +183,12 @@ query GetLeaseObjectTypes { } } +query GetLeaseObjectType($leaseObjectTypeId: Uuid!) { + leaseObjectType: evo_leasingobject_type(evo_leasingobject_typeid: $leaseObjectTypeId) { + evo_vehicle_type + } +} + query GetBrands { evo_brands(statecode: 0) { label: evo_name @@ -117,6 +198,22 @@ query GetBrands { } } +query GetModels($brandId: Uuid!) { + evo_models(statecode: 0, evo_brandid: $brandId) { + label: evo_name + value: evo_modelid + evo_modelid + evo_vehicle_type + } +} + +query GetConfigurations($modelId: Uuid) { + evo_equipments(statecode: 0, evo_modelid: $modelId) { + label: evo_name + value: evo_equipmentid + } +} + query GetDealers { dealers: accounts(evo_account_type: [100000001], statecode: 0, evo_legal_form: 100000001) { label: name @@ -125,6 +222,13 @@ query GetDealers { } } +query GetDealer($dealerId: Uuid!) { + dealer: account(accountid: $dealerId) { + evo_return_leasing_dealer + evo_broker_accountid + } +} + query GetDealerPersons($dealerId: Uuid!) { dealerPersons: salon_providers(statecode: 0, salonaccountid: $dealerId) { label: name @@ -142,14 +246,28 @@ query GetAgent($agentid: Uuid!) { } } -query GetDealerReturnLeasing($dealerId: Uuid!) { - dealer: account(accountid: $dealerId) { - evo_return_leasing_dealer +query GetRewardConditions($agentid: Uuid!, $currentDate: DateTime) { + evo_reward_conditions( + evo_agent_accountid: $agentid + evo_datefrom_param: { lte: $currentDate } + evo_dateto_param: { gte: $currentDate } + statecode: 0 + evo_agency_agreementid_param: { has: true } + ) { + label: evo_name + value: evo_reward_conditionid + evo_reward_summ } } -query GetQuote($quoteId: Uuid!) { - quote(quoteId: $quoteId) { - evo_baseproductid +query GetRewardCondition($conditionId: Uuid!) { + evo_reward_condition(evo_reward_conditionid: $conditionId) { + evo_reward_summ + evo_reduce_reward + evo_min_reward_summ + evo_agency_agreementidData { + evo_required_reward + evo_reward_without_other_agent + } } } diff --git a/apps/web/graphql/crm.types.ts b/apps/web/graphql/crm.types.ts index 3057ea0..09284e8 100644 --- a/apps/web/graphql/crm.types.ts +++ b/apps/web/graphql/crm.types.ts @@ -116,18 +116,53 @@ export type ActivitypartyInput = { partyid_systemuser?: InputMaybe; }; -export type GetCurrencySymbolQueryVariables = Exact<{ - currencyid: Scalars['Uuid']; -}>; - - -export type GetCurrencySymbolQuery = { __typename?: 'Query', transactioncurrency: { __typename?: 'transactioncurrency', currencysymbol: string | null } | null }; - export type GetTransactionCurrenciesQueryVariables = Exact<{ [key: string]: never; }>; export type GetTransactionCurrenciesQuery = { __typename?: 'Query', transactioncurrencies: Array<{ __typename?: 'transactioncurrency', transactioncurrencyid: string | null, isocurrencycode: string | null, currencysymbol: string | null, label: string | null, value: string | null } | null> | null }; +export type GetTransactionCurrencyQueryVariables = Exact<{ + currencyid: Scalars['Uuid']; +}>; + + +export type GetTransactionCurrencyQuery = { __typename?: 'Query', transactioncurrency: { __typename?: 'transactioncurrency', currencysymbol: string | null, isocurrencycode: string | null } | null }; + +export type GetCurrencyChangesQueryVariables = Exact<{ + currentDate: InputMaybe; +}>; + + +export type GetCurrencyChangesQuery = { __typename?: 'Query', evo_currencychanges: Array<{ __typename?: 'evo_currencychange', evo_currencychange: number | null, evo_ref_transactioncurrency: string | null } | null> | null }; + +export type GetLeadQueryVariables = Exact<{ + leadid: Scalars['Uuid']; +}>; + + +export type GetLeadQuery = { __typename?: 'Query', lead: { __typename?: 'lead', evo_agent_accountid: string | null, evo_double_agent_accountid: string | null, evo_broker_accountid: string | null, evo_fin_department_accountid: string | null, evo_opportunityidData: { __typename?: 'opportunity', label: string | null, value: string | null } | null } | null }; + +export type GetOpportunityQueryVariables = Exact<{ + opportunityid: Scalars['Uuid']; +}>; + + +export type GetOpportunityQuery = { __typename?: 'Query', opportunity: { __typename?: 'opportunity', evo_leadid: string | null } | null }; + +export type GetQuotesByLeadQueryVariables = Exact<{ + leadid: Scalars['Uuid']; +}>; + + +export type GetQuotesByLeadQuery = { __typename?: 'Query', quotes: Array<{ __typename?: 'quote', label: string | null, value: string | null } | null> | null }; + +export type GetQuoteQueryVariables = Exact<{ + quoteId: Scalars['Uuid']; +}>; + + +export type GetQuoteQuery = { __typename?: 'Query', quote: { __typename?: 'quote', evo_baseproductid: string | null } | null }; + export type GetTarifsQueryVariables = Exact<{ currentDate: InputMaybe; }>; @@ -156,12 +191,19 @@ export type GetProductQueryVariables = Exact<{ export type GetProductQuery = { __typename?: 'Query', evo_baseproduct: { __typename?: 'evo_baseproduct', evo_calculation_method: Array | null, evo_leasingobject_types: Array<{ __typename?: 'evo_leasingobject_type', evo_leasingobject_typeid: string | null } | null> | null, evo_baseproducts: Array<{ __typename?: 'evo_baseproduct', evo_baseproductid: string | null } | null> | null, evo_brands: Array<{ __typename?: 'evo_brand', evo_brandid: string | null } | null> | null } | null }; +export type GetSubsidiesQueryVariables = Exact<{ + currentDate: InputMaybe; +}>; + + +export type GetSubsidiesQuery = { __typename?: 'Query', evo_subsidies: Array<{ __typename?: 'evo_subsidy', evo_subsidy_type: number | null, label: string | null, value: string | null } | null> | null }; + export type GetSubsidyQueryVariables = Exact<{ subsidyId: Scalars['Uuid']; }>; -export type GetSubsidyQuery = { __typename?: 'Query', subsidy: { __typename?: 'evo_subsidy', evo_leasingobject_types: Array<{ __typename?: 'evo_leasingobject_type', evo_leasingobject_typeid: string | null } | null> | null, accounts: Array<{ __typename?: 'account', accountid: string | null } | null> | null, evo_brands: Array<{ __typename?: 'evo_brand', evo_brandid: string | null } | null> | null, evo_models: Array<{ __typename?: 'evo_model', evo_modelid: string | null } | null> | null } | null }; +export type GetSubsidyQuery = { __typename?: 'Query', evo_subsidy: { __typename?: 'evo_subsidy', evo_subsidy_summ: number | null, evo_percent_subsidy: number | null, evo_max_subsidy_summ: number | null, evo_leasingobject_types: Array<{ __typename?: 'evo_leasingobject_type', evo_leasingobject_typeid: string | null } | null> | null, accounts: Array<{ __typename?: 'account', accountid: string | null } | null> | null, evo_brands: Array<{ __typename?: 'evo_brand', evo_brandid: string | null } | null> | null, evo_models: Array<{ __typename?: 'evo_model', evo_modelid: string | null } | null> | null } | null }; export type GetImportProgramQueryVariables = Exact<{ importProgramId: Scalars['Uuid']; @@ -170,21 +212,59 @@ export type GetImportProgramQueryVariables = Exact<{ export type GetImportProgramQuery = { __typename?: 'Query', importProgram: { __typename?: 'evo_subsidy', evo_leasingobject_types: Array<{ __typename?: 'evo_leasingobject_type', evo_leasingobject_typeid: string | null } | null> | null, accounts: Array<{ __typename?: 'account', accountid: string | null } | null> | null, evo_brands: Array<{ __typename?: 'evo_brand', evo_brandid: string | null } | null> | null, evo_models: Array<{ __typename?: 'evo_model', evo_modelid: string | null } | null> | null } | null }; +export type GetRegionsQueryVariables = Exact<{ [key: string]: never; }>; + + +export type GetRegionsQuery = { __typename?: 'Query', evo_regions: Array<{ __typename?: 'evo_region', label: string | null, value: string | null } | null> | null }; + +export type GetGpsBrandsQueryVariables = Exact<{ [key: string]: never; }>; + + +export type GetGpsBrandsQuery = { __typename?: 'Query', evo_gps_brands: Array<{ __typename?: 'evo_gps_brand', label: string | null, value: string | null } | null> | null }; + export type GetLeaseObjectTypesQueryVariables = Exact<{ [key: string]: never; }>; export type GetLeaseObjectTypesQuery = { __typename?: 'Query', evo_leasingobject_types: Array<{ __typename?: 'evo_leasingobject_type', evo_leasingobject_typeid: string | null, label: string | null, value: string | null } | null> | null }; +export type GetLeaseObjectTypeQueryVariables = Exact<{ + leaseObjectTypeId: Scalars['Uuid']; +}>; + + +export type GetLeaseObjectTypeQuery = { __typename?: 'Query', leaseObjectType: { __typename?: 'evo_leasingobject_type', evo_vehicle_type: Array | null } | null }; + export type GetBrandsQueryVariables = Exact<{ [key: string]: never; }>; export type GetBrandsQuery = { __typename?: 'Query', evo_brands: Array<{ __typename?: 'evo_brand', evo_brandid: string | null, evo_vehicle_type: Array | null, label: string | null, value: string | null } | null> | null }; +export type GetModelsQueryVariables = Exact<{ + brandId: Scalars['Uuid']; +}>; + + +export type GetModelsQuery = { __typename?: 'Query', evo_models: Array<{ __typename?: 'evo_model', evo_modelid: string | null, evo_vehicle_type: number | null, label: string | null, value: string | null } | null> | null }; + +export type GetConfigurationsQueryVariables = Exact<{ + modelId: InputMaybe; +}>; + + +export type GetConfigurationsQuery = { __typename?: 'Query', evo_equipments: Array<{ __typename?: 'evo_equipment', label: string | null, value: string | null } | null> | null }; + export type GetDealersQueryVariables = Exact<{ [key: string]: never; }>; export type GetDealersQuery = { __typename?: 'Query', dealers: Array<{ __typename?: 'account', accountid: string | null, label: string | null, value: string | null } | null> | null }; +export type GetDealerQueryVariables = Exact<{ + dealerId: Scalars['Uuid']; +}>; + + +export type GetDealerQuery = { __typename?: 'Query', dealer: { __typename?: 'account', evo_return_leasing_dealer: boolean | null, evo_broker_accountid: string | null } | null }; + export type GetDealerPersonsQueryVariables = Exact<{ dealerId: Scalars['Uuid']; }>; @@ -199,26 +279,27 @@ export type GetAgentQueryVariables = Exact<{ export type GetAgentQuery = { __typename?: 'Query', agent: { __typename?: 'account', label: string | null, value: string | null } | null }; -export type GetDealerReturnLeasingQueryVariables = Exact<{ - dealerId: Scalars['Uuid']; +export type GetRewardConditionsQueryVariables = Exact<{ + agentid: Scalars['Uuid']; + currentDate: InputMaybe; }>; -export type GetDealerReturnLeasingQuery = { __typename?: 'Query', dealer: { __typename?: 'account', evo_return_leasing_dealer: boolean | null } | null }; +export type GetRewardConditionsQuery = { __typename?: 'Query', evo_reward_conditions: Array<{ __typename?: 'evo_reward_condition', evo_reward_summ: number | null, label: string | null, value: string | null } | null> | null }; -export type GetQuoteQueryVariables = Exact<{ +export type GetRewardConditionQueryVariables = Exact<{ + conditionId: Scalars['Uuid']; +}>; + + +export type GetRewardConditionQuery = { __typename?: 'Query', evo_reward_condition: { __typename?: 'evo_reward_condition', evo_reward_summ: number | null, evo_reduce_reward: boolean | null, evo_min_reward_summ: number | null, evo_agency_agreementidData: { __typename?: 'evo_agency_agreement', evo_required_reward: boolean | null, evo_reward_without_other_agent: boolean | null } | null } | null }; + +export type GetFingapDataFromQuoteQueryVariables = Exact<{ quoteId: Scalars['Uuid']; }>; -export type GetQuoteQuery = { __typename?: 'Query', quote: { __typename?: 'quote', evo_baseproductid: string | null } | null }; - -export type GetRisksDataFromQuoteQueryVariables = Exact<{ - quoteId: Scalars['Uuid']; -}>; - - -export type GetRisksDataFromQuoteQuery = { __typename?: 'Query', quote: { __typename?: 'quote', evo_fingap_accountid: string | null, evo_fingap_payer: number | null, evo_fingap_period: number | null, evo_product_risks: Array<{ __typename?: 'evo_product_risk', evo_addproduct_typeid: string | null } | null> | null } | null }; +export type GetFingapDataFromQuoteQuery = { __typename?: 'Query', quote: { __typename?: 'quote', evo_fingap_accountid: string | null, evo_fingap_payer: number | null, evo_fingap_period: number | null, evo_product_risks: Array<{ __typename?: 'evo_product_risk', evo_addproduct_typeid: string | null } | null> | null } | null }; export type GetFinGapAddProductTypesQueryVariables = Exact<{ currentDate: InputMaybe; @@ -234,23 +315,6 @@ export type GetInsuranceDataQueryVariables = Exact<{ export type GetInsuranceDataQuery = { __typename?: 'Query', osago: Array<{ __typename?: 'account', value: string | null, label: string | null } | null> | null, kasko: Array<{ __typename?: 'account', value: string | null, label: string | null } | null> | null, fingap: Array<{ __typename?: 'account', value: string | null, label: string | null } | null> | null }; -export type GetGpsBrandsQueryVariables = Exact<{ [key: string]: never; }>; - - -export type GetGpsBrandsQuery = { __typename?: 'Query', selectGPSBrand: Array<{ __typename?: 'evo_gps_brand', label: string | null, value: string | null } | null> | null }; - -export type GetSubsidiesQueryVariables = Exact<{ - currentDate: InputMaybe; -}>; - - -export type GetSubsidiesQuery = { __typename?: 'Query', evo_subsidies: Array<{ __typename?: 'evo_subsidy', evo_subsidy_type: number | null, label: string | null, value: string | null } | null> | null }; - -export type GetRegionsQueryVariables = Exact<{ [key: string]: never; }>; - - -export type GetRegionsQuery = { __typename?: 'Query', evo_regions: Array<{ __typename?: 'evo_region', label: string | null, value: string | null } | null> | null }; - export type GetAddproductTypesQueryVariables = Exact<{ currentDate: InputMaybe; }>; @@ -265,27 +329,6 @@ export type GetOwnerDataQueryVariables = Exact<{ export type GetOwnerDataQuery = { __typename?: 'Query', selectLead: Array<{ __typename?: 'lead', label: string | null, value: string | null } | null> | null, selectOpportunity: Array<{ __typename?: 'opportunity', label: string | null, value: string | null } | null> | null }; -export type GetOpportunityByLeadQueryVariables = Exact<{ - leadid: Scalars['Uuid']; -}>; - - -export type GetOpportunityByLeadQuery = { __typename?: 'Query', lead: { __typename?: 'lead', evo_opportunityidData: { __typename?: 'opportunity', label: string | null, value: string | null } | null } | null }; - -export type GetLeadidByOpportunityQueryVariables = Exact<{ - opportunityid: Scalars['Uuid']; -}>; - - -export type GetLeadidByOpportunityQuery = { __typename?: 'Query', opportunity: { __typename?: 'opportunity', evo_leadid: string | null } | null }; - -export type GetQuotesByLeadQueryVariables = Exact<{ - leadid: Scalars['Uuid']; -}>; - - -export type GetQuotesByLeadQuery = { __typename?: 'Query', quotes: Array<{ __typename?: 'quote', label: string | null, value: string | null } | null> | null }; - export type GetLeadUrlQueryVariables = Exact<{ id: Scalars['Uuid']; }>; @@ -314,27 +357,6 @@ export type GetLeasingObjectDataFromQuoteQueryVariables = Exact<{ export type GetLeasingObjectDataFromQuoteQuery = { __typename?: 'Query', quote: { __typename?: 'quote', evo_brandid: string | null, evo_modelid: string | null, evo_equipmentid: string | null, evo_leasingobject_typeid: string | null } | null }; -export type GetModelsQueryVariables = Exact<{ - brandid: Scalars['Uuid']; -}>; - - -export type GetModelsQuery = { __typename?: 'Query', evo_models: Array<{ __typename?: 'evo_model', evo_modelid: string | null, evo_vehicle_type: number | null, label: string | null, value: string | null } | null> | null }; - -export type GetLeaseObjectTypeQueryVariables = Exact<{ - leaseObjectTypeId: Scalars['Uuid']; -}>; - - -export type GetLeaseObjectTypeQuery = { __typename?: 'Query', leaseObjectType: { __typename?: 'evo_leasingobject_type', evo_vehicle_type: Array | null } | null }; - -export type GetConfigurationsQueryVariables = Exact<{ - modelId: InputMaybe; -}>; - - -export type GetConfigurationsQuery = { __typename?: 'Query', evo_equipments: Array<{ __typename?: 'evo_equipment', label: string | null, value: string | null } | null> | null }; - export type GetLeasingWithoutKaskoOptionsQueryVariables = Exact<{ currentDate: InputMaybe; }>; @@ -349,27 +371,6 @@ export type GetPaymentsDataFromQuoteQueryVariables = Exact<{ export type GetPaymentsDataFromQuoteQuery = { __typename?: 'Query', quote: { __typename?: 'quote', evo_period: number | null, evo_accept_period: number | null, evo_first_payment_perc: number | null, evo_last_payment_perc: number | null, evo_graph_type: number | null, evo_payments_decrease_perc: number | null, evo_seasons_type: number | null, evo_high_season: number | null, evo_graphs: Array<{ __typename?: 'evo_graph', createdon: string | null, evo_sumpay_withnds: number | null, evo_planpayments: Array<{ __typename?: 'evo_planpayment', evo_payment_ratio: number | null } | null> | null } | null> | null } | null }; -export type GetCurrencyChangesQueryVariables = Exact<{ - currentDate: InputMaybe; -}>; - - -export type GetCurrencyChangesQuery = { __typename?: 'Query', evo_currencychanges: Array<{ __typename?: 'evo_currencychange', evo_currencychange: number | null, evo_ref_transactioncurrency: string | null } | null> | null }; - -export type GetCurrencyIsoCodeQueryVariables = Exact<{ - id: Scalars['Uuid']; -}>; - - -export type GetCurrencyIsoCodeQuery = { __typename?: 'Query', transactioncurrency: { __typename?: 'transactioncurrency', isocurrencycode: string | null } | null }; - -export type GetImportProgramSubsidyQueryVariables = Exact<{ - importProgramId: Scalars['Uuid']; -}>; - - -export type GetImportProgramSubsidyQuery = { __typename?: 'Query', importProgram: { __typename?: 'evo_subsidy', evo_subsidy_summ: number | null, evo_percent_subsidy: number | null, evo_max_subsidy_summ: number | null } | null }; - export type GetRewardRulesQueryVariables = Exact<{ conditionId: Scalars['Uuid']; }>; @@ -384,117 +385,44 @@ export type GetAgentsDataFromQuoteQueryVariables = Exact<{ export type GetAgentsDataFromQuoteQuery = { __typename?: 'Query', quote: { __typename?: 'quote', evo_supplier_accountid: string | null, evo_dealer_person_accountid: string | null, evo_dealer_reward_conditionid: string | null, evo_dealer_reward_total: number | null, evo_dealer_reward_summ: number | null, evo_dealer_broker_accountid: string | null, evo_dealer_broker_reward_conditionid: string | null, evo_dealer_broker_reward_total: number | null, evo_dealer_broker_reward_summ: number | null, evo_agent_accountid: string | null, evo_agent_reward_conditionid: string | null, evo_agent_reward_total: number | null, evo_agent_reward_summ: number | null, evo_double_agent_accountid: string | null, evo_double_agent_reward_conditionid: string | null, evo_double_agent_reward_total: number | null, evo_double_agent_reward_summ: number | null, evo_broker_accountid: string | null, evo_broker_reward_conditionid: string | null, evo_broker_reward_total: number | null, evo_broker_reward_summ: number | null, evo_fin_department_accountid: string | null, evo_fin_department_reward_conditionid: string | null, evo_fin_department_reward_total: number | null, evo_fin_department_reward_summ: number | null } | null }; -export type GetRewardConditionsQueryVariables = Exact<{ - agentid: Scalars['Uuid']; - currentDate: InputMaybe; -}>; - -export type GetRewardConditionsQuery = { __typename?: 'Query', evo_reward_conditions: Array<{ __typename?: 'evo_reward_condition', evo_reward_summ: number | null, label: string | null, value: string | null } | null> | null }; - -export type GetRewardSummQueryVariables = Exact<{ - conditionId: Scalars['Uuid']; -}>; - - -export type GetRewardSummQuery = { __typename?: 'Query', evo_reward_condition: { __typename?: 'evo_reward_condition', evo_reward_summ: number | null } | null }; - -export type GetRewardConditionQueryVariables = Exact<{ - conditionId: Scalars['Uuid']; -}>; - - -export type GetRewardConditionQuery = { __typename?: 'Query', evo_reward_condition: { __typename?: 'evo_reward_condition', evo_reward_summ: number | null, evo_reduce_reward: boolean | null, evo_min_reward_summ: number | null, evo_agency_agreementidData: { __typename?: 'evo_agency_agreement', evo_required_reward: boolean | null } | null } | null }; - -export type GetAgentAccountIdFromLeadQueryVariables = Exact<{ - leadid: Scalars['Uuid']; -}>; - - -export type GetAgentAccountIdFromLeadQuery = { __typename?: 'Query', lead: { __typename?: 'lead', agentid: string | null } | null }; - -export type GetDoubleAgentAccountIdQueryVariables = Exact<{ - leadid: Scalars['Uuid']; -}>; - - -export type GetDoubleAgentAccountIdQuery = { __typename?: 'Query', lead: { __typename?: 'lead', agentid: string | null } | null }; - -export type GetBrokerAccountIdQueryVariables = Exact<{ - leadid: Scalars['Uuid']; -}>; - - -export type GetBrokerAccountIdQuery = { __typename?: 'Query', lead: { __typename?: 'lead', agentid: string | null } | null }; - -export type GetFinDepartmentAccountIdQueryVariables = Exact<{ - leadid: Scalars['Uuid']; -}>; - - -export type GetFinDepartmentAccountIdQuery = { __typename?: 'Query', lead: { __typename?: 'lead', agentid: string | null } | null }; - -export type GetRewardWithoutOtherAgentQueryVariables = Exact<{ - conditionId: Scalars['Uuid']; -}>; - - -export type GetRewardWithoutOtherAgentQuery = { __typename?: 'Query', evo_reward_condition: { __typename?: 'evo_reward_condition', evo_agency_agreementidData: { __typename?: 'evo_agency_agreement', evo_reward_without_other_agent: boolean | null } | null } | null }; - -export type GetBrokerAccountIdFromDealerQueryVariables = Exact<{ - dealerId: Scalars['Uuid']; -}>; - - -export type GetBrokerAccountIdFromDealerQuery = { __typename?: 'Query', dealer: { __typename?: 'account', evo_broker_accountid: string | null } | null }; - - -export const GetCurrencySymbolDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetCurrencySymbol"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"currencyid"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"Uuid"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"transactioncurrency"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"transactioncurrencyid"},"value":{"kind":"Variable","name":{"kind":"Name","value":"currencyid"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"currencysymbol"}}]}}]}}]} as unknown as DocumentNode; export const GetTransactionCurrenciesDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetTransactionCurrencies"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"transactioncurrencies"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"label"},"name":{"kind":"Name","value":"currencyname"}},{"kind":"Field","alias":{"kind":"Name","value":"value"},"name":{"kind":"Name","value":"transactioncurrencyid"}},{"kind":"Field","name":{"kind":"Name","value":"transactioncurrencyid"}},{"kind":"Field","name":{"kind":"Name","value":"isocurrencycode"}},{"kind":"Field","name":{"kind":"Name","value":"currencysymbol"}}]}}]}}]} as unknown as DocumentNode; +export const GetTransactionCurrencyDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetTransactionCurrency"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"currencyid"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"Uuid"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"transactioncurrency"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"transactioncurrencyid"},"value":{"kind":"Variable","name":{"kind":"Name","value":"currencyid"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"currencysymbol"}},{"kind":"Field","name":{"kind":"Name","value":"isocurrencycode"}}]}}]}}]} as unknown as DocumentNode; +export const GetCurrencyChangesDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetCurrencyChanges"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"currentDate"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"DateTime"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"evo_currencychanges"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"statecode"},"value":{"kind":"IntValue","value":"0"}},{"kind":"Argument","name":{"kind":"Name","value":"evo_coursedate_param"},"value":{"kind":"ObjectValue","fields":[{"kind":"ObjectField","name":{"kind":"Name","value":"eq"},"value":{"kind":"Variable","name":{"kind":"Name","value":"currentDate"}}}]}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"evo_currencychange"}},{"kind":"Field","name":{"kind":"Name","value":"evo_ref_transactioncurrency"}}]}}]}}]} as unknown as DocumentNode; +export const GetLeadDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetLead"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"leadid"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"Uuid"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"lead"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"leadid"},"value":{"kind":"Variable","name":{"kind":"Name","value":"leadid"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"evo_agent_accountid"}},{"kind":"Field","name":{"kind":"Name","value":"evo_double_agent_accountid"}},{"kind":"Field","name":{"kind":"Name","value":"evo_broker_accountid"}},{"kind":"Field","name":{"kind":"Name","value":"evo_fin_department_accountid"}},{"kind":"Field","name":{"kind":"Name","value":"evo_opportunityidData"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"label"},"name":{"kind":"Name","value":"name"}},{"kind":"Field","alias":{"kind":"Name","value":"value"},"name":{"kind":"Name","value":"opportunityid"}}]}}]}}]}}]} as unknown as DocumentNode; +export const GetOpportunityDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetOpportunity"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"opportunityid"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"Uuid"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"opportunity"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"opportunityid"},"value":{"kind":"Variable","name":{"kind":"Name","value":"opportunityid"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"evo_leadid"}}]}}]}}]} as unknown as DocumentNode; +export const GetQuotesByLeadDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetQuotesByLead"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"leadid"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"Uuid"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"quotes"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"evo_leadid"},"value":{"kind":"Variable","name":{"kind":"Name","value":"leadid"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"label"},"name":{"kind":"Name","value":"evo_quotename"}},{"kind":"Field","alias":{"kind":"Name","value":"value"},"name":{"kind":"Name","value":"quoteid"}}]}}]}}]} as unknown as DocumentNode; +export const GetQuoteDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetQuote"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"quoteId"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"Uuid"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"quote"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"quoteId"},"value":{"kind":"Variable","name":{"kind":"Name","value":"quoteId"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"evo_baseproductid"}}]}}]}}]} as unknown as DocumentNode; export const GetTarifsDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetTarifs"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"currentDate"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"DateTime"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"evo_tarifs"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"statecode"},"value":{"kind":"IntValue","value":"0"}},{"kind":"Argument","name":{"kind":"Name","value":"evo_datefrom_param"},"value":{"kind":"ObjectValue","fields":[{"kind":"ObjectField","name":{"kind":"Name","value":"lte"},"value":{"kind":"Variable","name":{"kind":"Name","value":"currentDate"}}}]}},{"kind":"Argument","name":{"kind":"Name","value":"evo_dateto_param"},"value":{"kind":"ObjectValue","fields":[{"kind":"ObjectField","name":{"kind":"Name","value":"gte"},"value":{"kind":"Variable","name":{"kind":"Name","value":"currentDate"}}}]}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"label"},"name":{"kind":"Name","value":"evo_name"}},{"kind":"Field","alias":{"kind":"Name","value":"value"},"name":{"kind":"Name","value":"evo_tarifid"}},{"kind":"Field","name":{"kind":"Name","value":"evo_tarifid"}},{"kind":"Field","name":{"kind":"Name","value":"evo_baseproductid"}},{"kind":"Field","name":{"kind":"Name","value":"evo_min_period"}},{"kind":"Field","name":{"kind":"Name","value":"evo_max_period"}},{"kind":"Field","name":{"kind":"Name","value":"evo_delivery_time"}},{"kind":"Field","name":{"kind":"Name","value":"evo_min_first_payment"}},{"kind":"Field","name":{"kind":"Name","value":"evo_max_first_payment"}},{"kind":"Field","name":{"kind":"Name","value":"evo_min_last_payment"}},{"kind":"Field","name":{"kind":"Name","value":"evo_max_last_payment"}},{"kind":"Field","name":{"kind":"Name","value":"evo_used"}}]}}]}}]} as unknown as DocumentNode; export const GetTarifDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetTarif"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"tarifId"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"Uuid"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"evo_tarif"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"evo_tarifid"},"value":{"kind":"Variable","name":{"kind":"Name","value":"tarifId"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"evo_irr"}},{"kind":"Field","name":{"kind":"Name","value":"evo_graphtype_exception"}},{"kind":"Field","name":{"kind":"Name","value":"evo_seasons_type_exception"}},{"kind":"Field","name":{"kind":"Name","value":"evo_min_decreasing_perc"}}]}}]}}]} as unknown as DocumentNode; export const GetProductsDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetProducts"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"currentDate"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"DateTime"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"evo_baseproducts"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"statecode"},"value":{"kind":"IntValue","value":"0"}},{"kind":"Argument","name":{"kind":"Name","value":"evo_relation"},"value":{"kind":"ListValue","values":[{"kind":"IntValue","value":"100000000"}]}},{"kind":"Argument","name":{"kind":"Name","value":"evo_datefrom_param"},"value":{"kind":"ObjectValue","fields":[{"kind":"ObjectField","name":{"kind":"Name","value":"lte"},"value":{"kind":"Variable","name":{"kind":"Name","value":"currentDate"}}}]}},{"kind":"Argument","name":{"kind":"Name","value":"evo_dateto_param"},"value":{"kind":"ObjectValue","fields":[{"kind":"ObjectField","name":{"kind":"Name","value":"gte"},"value":{"kind":"Variable","name":{"kind":"Name","value":"currentDate"}}}]}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"label"},"name":{"kind":"Name","value":"evo_name"}},{"kind":"Field","alias":{"kind":"Name","value":"value"},"name":{"kind":"Name","value":"evo_baseproductid"}},{"kind":"Field","name":{"kind":"Name","value":"evo_baseproductid"}}]}}]}}]} as unknown as DocumentNode; export const GetProductDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetProduct"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"productId"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"Uuid"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"evo_baseproduct"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"evo_baseproductid"},"value":{"kind":"Variable","name":{"kind":"Name","value":"productId"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"evo_leasingobject_types"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"evo_leasingobject_typeid"}}]}},{"kind":"Field","name":{"kind":"Name","value":"evo_calculation_method"}},{"kind":"Field","name":{"kind":"Name","value":"evo_baseproducts"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"evo_baseproductid"}}]}},{"kind":"Field","name":{"kind":"Name","value":"evo_brands"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"evo_brandid"}}]}}]}}]}}]} as unknown as DocumentNode; -export const GetSubsidyDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetSubsidy"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"subsidyId"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"Uuid"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"subsidy"},"name":{"kind":"Name","value":"evo_subsidy"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"evo_subsidyid"},"value":{"kind":"Variable","name":{"kind":"Name","value":"subsidyId"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"evo_leasingobject_types"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"evo_leasingobject_typeid"}}]}},{"kind":"Field","name":{"kind":"Name","value":"accounts"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"accountid"}}]}},{"kind":"Field","name":{"kind":"Name","value":"evo_brands"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"evo_brandid"}}]}},{"kind":"Field","name":{"kind":"Name","value":"evo_models"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"evo_modelid"}}]}}]}}]}}]} as unknown as DocumentNode; +export const GetSubsidiesDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetSubsidies"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"currentDate"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"DateTime"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"evo_subsidies"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"statecode"},"value":{"kind":"IntValue","value":"0"}},{"kind":"Argument","name":{"kind":"Name","value":"evo_datefrom_param"},"value":{"kind":"ObjectValue","fields":[{"kind":"ObjectField","name":{"kind":"Name","value":"lte"},"value":{"kind":"Variable","name":{"kind":"Name","value":"currentDate"}}}]}},{"kind":"Argument","name":{"kind":"Name","value":"evo_dateto_param"},"value":{"kind":"ObjectValue","fields":[{"kind":"ObjectField","name":{"kind":"Name","value":"gte"},"value":{"kind":"Variable","name":{"kind":"Name","value":"currentDate"}}}]}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"label"},"name":{"kind":"Name","value":"evo_name"}},{"kind":"Field","alias":{"kind":"Name","value":"value"},"name":{"kind":"Name","value":"evo_subsidyid"}},{"kind":"Field","name":{"kind":"Name","value":"evo_subsidy_type"}}]}}]}}]} as unknown as DocumentNode; +export const GetSubsidyDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetSubsidy"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"subsidyId"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"Uuid"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"evo_subsidy"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"evo_subsidyid"},"value":{"kind":"Variable","name":{"kind":"Name","value":"subsidyId"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"evo_leasingobject_types"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"evo_leasingobject_typeid"}}]}},{"kind":"Field","name":{"kind":"Name","value":"accounts"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"accountid"}}]}},{"kind":"Field","name":{"kind":"Name","value":"evo_brands"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"evo_brandid"}}]}},{"kind":"Field","name":{"kind":"Name","value":"evo_models"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"evo_modelid"}}]}},{"kind":"Field","name":{"kind":"Name","value":"evo_subsidy_summ"}},{"kind":"Field","name":{"kind":"Name","value":"evo_percent_subsidy"}},{"kind":"Field","name":{"kind":"Name","value":"evo_max_subsidy_summ"}}]}}]}}]} as unknown as DocumentNode; export const GetImportProgramDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetImportProgram"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"importProgramId"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"Uuid"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"importProgram"},"name":{"kind":"Name","value":"evo_subsidy"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"evo_subsidyid"},"value":{"kind":"Variable","name":{"kind":"Name","value":"importProgramId"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"evo_leasingobject_types"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"evo_leasingobject_typeid"}}]}},{"kind":"Field","name":{"kind":"Name","value":"accounts"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"accountid"}}]}},{"kind":"Field","name":{"kind":"Name","value":"evo_brands"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"evo_brandid"}}]}},{"kind":"Field","name":{"kind":"Name","value":"evo_models"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"evo_modelid"}}]}}]}}]}}]} as unknown as DocumentNode; +export const GetRegionsDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetRegions"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"evo_regions"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"label"},"name":{"kind":"Name","value":"evo_name"}},{"kind":"Field","alias":{"kind":"Name","value":"value"},"name":{"kind":"Name","value":"evo_regionid"}}]}}]}}]} as unknown as DocumentNode; +export const GetGpsBrandsDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetGPSBrands"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"evo_gps_brands"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"statecode"},"value":{"kind":"IntValue","value":"0"}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"label"},"name":{"kind":"Name","value":"evo_name"}},{"kind":"Field","alias":{"kind":"Name","value":"value"},"name":{"kind":"Name","value":"evo_gps_brandid"}}]}}]}}]} as unknown as DocumentNode; export const GetLeaseObjectTypesDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetLeaseObjectTypes"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"evo_leasingobject_types"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"statecode"},"value":{"kind":"IntValue","value":"0"}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"label"},"name":{"kind":"Name","value":"evo_name"}},{"kind":"Field","alias":{"kind":"Name","value":"value"},"name":{"kind":"Name","value":"evo_leasingobject_typeid"}},{"kind":"Field","name":{"kind":"Name","value":"evo_leasingobject_typeid"}}]}}]}}]} as unknown as DocumentNode; +export const GetLeaseObjectTypeDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetLeaseObjectType"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"leaseObjectTypeId"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"Uuid"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"leaseObjectType"},"name":{"kind":"Name","value":"evo_leasingobject_type"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"evo_leasingobject_typeid"},"value":{"kind":"Variable","name":{"kind":"Name","value":"leaseObjectTypeId"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"evo_vehicle_type"}}]}}]}}]} as unknown as DocumentNode; export const GetBrandsDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetBrands"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"evo_brands"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"statecode"},"value":{"kind":"IntValue","value":"0"}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"label"},"name":{"kind":"Name","value":"evo_name"}},{"kind":"Field","alias":{"kind":"Name","value":"value"},"name":{"kind":"Name","value":"evo_brandid"}},{"kind":"Field","name":{"kind":"Name","value":"evo_brandid"}},{"kind":"Field","name":{"kind":"Name","value":"evo_vehicle_type"}}]}}]}}]} as unknown as DocumentNode; +export const GetModelsDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetModels"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"brandId"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"Uuid"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"evo_models"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"statecode"},"value":{"kind":"IntValue","value":"0"}},{"kind":"Argument","name":{"kind":"Name","value":"evo_brandid"},"value":{"kind":"Variable","name":{"kind":"Name","value":"brandId"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"label"},"name":{"kind":"Name","value":"evo_name"}},{"kind":"Field","alias":{"kind":"Name","value":"value"},"name":{"kind":"Name","value":"evo_modelid"}},{"kind":"Field","name":{"kind":"Name","value":"evo_modelid"}},{"kind":"Field","name":{"kind":"Name","value":"evo_vehicle_type"}}]}}]}}]} as unknown as DocumentNode; +export const GetConfigurationsDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetConfigurations"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"modelId"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"Uuid"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"evo_equipments"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"statecode"},"value":{"kind":"IntValue","value":"0"}},{"kind":"Argument","name":{"kind":"Name","value":"evo_modelid"},"value":{"kind":"Variable","name":{"kind":"Name","value":"modelId"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"label"},"name":{"kind":"Name","value":"evo_name"}},{"kind":"Field","alias":{"kind":"Name","value":"value"},"name":{"kind":"Name","value":"evo_equipmentid"}}]}}]}}]} as unknown as DocumentNode; export const GetDealersDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetDealers"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"dealers"},"name":{"kind":"Name","value":"accounts"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"evo_account_type"},"value":{"kind":"ListValue","values":[{"kind":"IntValue","value":"100000001"}]}},{"kind":"Argument","name":{"kind":"Name","value":"statecode"},"value":{"kind":"IntValue","value":"0"}},{"kind":"Argument","name":{"kind":"Name","value":"evo_legal_form"},"value":{"kind":"IntValue","value":"100000001"}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"label"},"name":{"kind":"Name","value":"name"}},{"kind":"Field","alias":{"kind":"Name","value":"value"},"name":{"kind":"Name","value":"accountid"}},{"kind":"Field","name":{"kind":"Name","value":"accountid"}}]}}]}}]} as unknown as DocumentNode; +export const GetDealerDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetDealer"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"dealerId"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"Uuid"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"dealer"},"name":{"kind":"Name","value":"account"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"accountid"},"value":{"kind":"Variable","name":{"kind":"Name","value":"dealerId"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"evo_return_leasing_dealer"}},{"kind":"Field","name":{"kind":"Name","value":"evo_broker_accountid"}}]}}]}}]} as unknown as DocumentNode; export const GetDealerPersonsDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetDealerPersons"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"dealerId"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"Uuid"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"dealerPersons"},"name":{"kind":"Name","value":"salon_providers"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"statecode"},"value":{"kind":"IntValue","value":"0"}},{"kind":"Argument","name":{"kind":"Name","value":"salonaccountid"},"value":{"kind":"Variable","name":{"kind":"Name","value":"dealerId"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"label"},"name":{"kind":"Name","value":"name"}},{"kind":"Field","alias":{"kind":"Name","value":"value"},"name":{"kind":"Name","value":"accountid"}},{"kind":"Field","name":{"kind":"Name","value":"accountid"}},{"kind":"Field","name":{"kind":"Name","value":"evo_inn"}},{"kind":"Field","name":{"kind":"Name","value":"evo_kpp"}}]}}]}}]} as unknown as DocumentNode; export const GetAgentDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetAgent"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"agentid"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"Uuid"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"agent"},"name":{"kind":"Name","value":"account"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"accountid"},"value":{"kind":"Variable","name":{"kind":"Name","value":"agentid"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"label"},"name":{"kind":"Name","value":"name"}},{"kind":"Field","alias":{"kind":"Name","value":"value"},"name":{"kind":"Name","value":"accountid"}}]}}]}}]} as unknown as DocumentNode; -export const GetDealerReturnLeasingDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetDealerReturnLeasing"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"dealerId"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"Uuid"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"dealer"},"name":{"kind":"Name","value":"account"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"accountid"},"value":{"kind":"Variable","name":{"kind":"Name","value":"dealerId"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"evo_return_leasing_dealer"}}]}}]}}]} as unknown as DocumentNode; -export const GetQuoteDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetQuote"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"quoteId"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"Uuid"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"quote"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"quoteId"},"value":{"kind":"Variable","name":{"kind":"Name","value":"quoteId"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"evo_baseproductid"}}]}}]}}]} as unknown as DocumentNode; -export const GetRisksDataFromQuoteDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetRisksDataFromQuote"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"quoteId"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"Uuid"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"quote"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"quoteId"},"value":{"kind":"Variable","name":{"kind":"Name","value":"quoteId"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"evo_fingap_accountid"}},{"kind":"Field","name":{"kind":"Name","value":"evo_fingap_payer"}},{"kind":"Field","name":{"kind":"Name","value":"evo_fingap_period"}},{"kind":"Field","name":{"kind":"Name","value":"evo_product_risks"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"evo_addproduct_typeid"}}]}}]}}]}}]} as unknown as DocumentNode; +export const GetRewardConditionsDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetRewardConditions"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"agentid"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"Uuid"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"currentDate"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"DateTime"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"evo_reward_conditions"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"evo_agent_accountid"},"value":{"kind":"Variable","name":{"kind":"Name","value":"agentid"}}},{"kind":"Argument","name":{"kind":"Name","value":"evo_datefrom_param"},"value":{"kind":"ObjectValue","fields":[{"kind":"ObjectField","name":{"kind":"Name","value":"lte"},"value":{"kind":"Variable","name":{"kind":"Name","value":"currentDate"}}}]}},{"kind":"Argument","name":{"kind":"Name","value":"evo_dateto_param"},"value":{"kind":"ObjectValue","fields":[{"kind":"ObjectField","name":{"kind":"Name","value":"gte"},"value":{"kind":"Variable","name":{"kind":"Name","value":"currentDate"}}}]}},{"kind":"Argument","name":{"kind":"Name","value":"statecode"},"value":{"kind":"IntValue","value":"0"}},{"kind":"Argument","name":{"kind":"Name","value":"evo_agency_agreementid_param"},"value":{"kind":"ObjectValue","fields":[{"kind":"ObjectField","name":{"kind":"Name","value":"has"},"value":{"kind":"BooleanValue","value":true}}]}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"label"},"name":{"kind":"Name","value":"evo_name"}},{"kind":"Field","alias":{"kind":"Name","value":"value"},"name":{"kind":"Name","value":"evo_reward_conditionid"}},{"kind":"Field","name":{"kind":"Name","value":"evo_reward_summ"}}]}}]}}]} as unknown as DocumentNode; +export const GetRewardConditionDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetRewardCondition"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"conditionId"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"Uuid"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"evo_reward_condition"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"evo_reward_conditionid"},"value":{"kind":"Variable","name":{"kind":"Name","value":"conditionId"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"evo_reward_summ"}},{"kind":"Field","name":{"kind":"Name","value":"evo_reduce_reward"}},{"kind":"Field","name":{"kind":"Name","value":"evo_min_reward_summ"}},{"kind":"Field","name":{"kind":"Name","value":"evo_agency_agreementidData"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"evo_required_reward"}},{"kind":"Field","name":{"kind":"Name","value":"evo_reward_without_other_agent"}}]}}]}}]}}]} as unknown as DocumentNode; +export const GetFingapDataFromQuoteDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetFingapDataFromQuote"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"quoteId"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"Uuid"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"quote"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"quoteId"},"value":{"kind":"Variable","name":{"kind":"Name","value":"quoteId"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"evo_fingap_accountid"}},{"kind":"Field","name":{"kind":"Name","value":"evo_fingap_payer"}},{"kind":"Field","name":{"kind":"Name","value":"evo_fingap_period"}},{"kind":"Field","name":{"kind":"Name","value":"evo_product_risks"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"evo_addproduct_typeid"}}]}}]}}]}}]} as unknown as DocumentNode; export const GetFinGapAddProductTypesDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetFinGAPAddProductTypes"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"currentDate"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"DateTime"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"evo_addproduct_types"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"statecode"},"value":{"kind":"IntValue","value":"0"}},{"kind":"Argument","name":{"kind":"Name","value":"evo_datefrom_param"},"value":{"kind":"ObjectValue","fields":[{"kind":"ObjectField","name":{"kind":"Name","value":"lte"},"value":{"kind":"Variable","name":{"kind":"Name","value":"currentDate"}}}]}},{"kind":"Argument","name":{"kind":"Name","value":"evo_dateto_param"},"value":{"kind":"ObjectValue","fields":[{"kind":"ObjectField","name":{"kind":"Name","value":"gte"},"value":{"kind":"Variable","name":{"kind":"Name","value":"currentDate"}}}]}},{"kind":"Argument","name":{"kind":"Name","value":"evo_product_type"},"value":{"kind":"IntValue","value":"100000006"}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"evo_addproduct_typeid"}},{"kind":"Field","name":{"kind":"Name","value":"evo_name"}},{"kind":"Field","name":{"kind":"Name","value":"evo_type_calc_cerebellum"}},{"kind":"Field","name":{"kind":"Name","value":"evo_cost_service_provider_withoutnds"}},{"kind":"Field","name":{"kind":"Name","value":"evo_addproduct_types"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"evo_addproduct_typeid"}}]}}]}}]}}]} as unknown as DocumentNode; export const GetInsuranceDataDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetInsuranceData"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"evo_account_type"}},"type":{"kind":"ListType","type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"Int"}}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"osago"},"name":{"kind":"Name","value":"accounts"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"evo_account_type"},"value":{"kind":"Variable","name":{"kind":"Name","value":"evo_account_type"}}},{"kind":"Argument","name":{"kind":"Name","value":"evo_type_ins_policy"},"value":{"kind":"ListValue","values":[{"kind":"IntValue","value":"100000001"}]}},{"kind":"Argument","name":{"kind":"Name","value":"statecode"},"value":{"kind":"IntValue","value":"0"}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"value"},"name":{"kind":"Name","value":"accountid"}},{"kind":"Field","alias":{"kind":"Name","value":"label"},"name":{"kind":"Name","value":"name"}}]}},{"kind":"Field","alias":{"kind":"Name","value":"kasko"},"name":{"kind":"Name","value":"accounts"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"evo_account_type"},"value":{"kind":"Variable","name":{"kind":"Name","value":"evo_account_type"}}},{"kind":"Argument","name":{"kind":"Name","value":"evo_type_ins_policy"},"value":{"kind":"ListValue","values":[{"kind":"IntValue","value":"100000000"}]}},{"kind":"Argument","name":{"kind":"Name","value":"statecode"},"value":{"kind":"IntValue","value":"0"}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"value"},"name":{"kind":"Name","value":"accountid"}},{"kind":"Field","alias":{"kind":"Name","value":"label"},"name":{"kind":"Name","value":"name"}}]}},{"kind":"Field","alias":{"kind":"Name","value":"fingap"},"name":{"kind":"Name","value":"accounts"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"evo_account_type"},"value":{"kind":"Variable","name":{"kind":"Name","value":"evo_account_type"}}},{"kind":"Argument","name":{"kind":"Name","value":"evo_type_ins_policy"},"value":{"kind":"ListValue","values":[{"kind":"IntValue","value":"100000002"}]}},{"kind":"Argument","name":{"kind":"Name","value":"statecode"},"value":{"kind":"IntValue","value":"0"}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"value"},"name":{"kind":"Name","value":"accountid"}},{"kind":"Field","alias":{"kind":"Name","value":"label"},"name":{"kind":"Name","value":"name"}}]}}]}}]} as unknown as DocumentNode; -export const GetGpsBrandsDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetGPSBrands"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"selectGPSBrand"},"name":{"kind":"Name","value":"evo_gps_brands"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"statecode"},"value":{"kind":"IntValue","value":"0"}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"label"},"name":{"kind":"Name","value":"evo_name"}},{"kind":"Field","alias":{"kind":"Name","value":"value"},"name":{"kind":"Name","value":"evo_gps_brandid"}}]}}]}}]} as unknown as DocumentNode; -export const GetSubsidiesDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetSubsidies"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"currentDate"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"DateTime"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"evo_subsidies"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"statecode"},"value":{"kind":"IntValue","value":"0"}},{"kind":"Argument","name":{"kind":"Name","value":"evo_datefrom_param"},"value":{"kind":"ObjectValue","fields":[{"kind":"ObjectField","name":{"kind":"Name","value":"lte"},"value":{"kind":"Variable","name":{"kind":"Name","value":"currentDate"}}}]}},{"kind":"Argument","name":{"kind":"Name","value":"evo_dateto_param"},"value":{"kind":"ObjectValue","fields":[{"kind":"ObjectField","name":{"kind":"Name","value":"gte"},"value":{"kind":"Variable","name":{"kind":"Name","value":"currentDate"}}}]}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"label"},"name":{"kind":"Name","value":"evo_name"}},{"kind":"Field","alias":{"kind":"Name","value":"value"},"name":{"kind":"Name","value":"evo_subsidyid"}},{"kind":"Field","name":{"kind":"Name","value":"evo_subsidy_type"}}]}}]}}]} as unknown as DocumentNode; -export const GetRegionsDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetRegions"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"evo_regions"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"label"},"name":{"kind":"Name","value":"evo_name"}},{"kind":"Field","alias":{"kind":"Name","value":"value"},"name":{"kind":"Name","value":"evo_regionid"}}]}}]}}]} as unknown as DocumentNode; export const GetAddproductTypesDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetAddproductTypes"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"currentDate"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"DateTime"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"evo_addproduct_types"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"statecode"},"value":{"kind":"IntValue","value":"0"}},{"kind":"Argument","name":{"kind":"Name","value":"evo_datefrom_param"},"value":{"kind":"ObjectValue","fields":[{"kind":"ObjectField","name":{"kind":"Name","value":"lte"},"value":{"kind":"Variable","name":{"kind":"Name","value":"currentDate"}}}]}},{"kind":"Argument","name":{"kind":"Name","value":"evo_dateto_param"},"value":{"kind":"ObjectValue","fields":[{"kind":"ObjectField","name":{"kind":"Name","value":"gte"},"value":{"kind":"Variable","name":{"kind":"Name","value":"currentDate"}}}]}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"label"},"name":{"kind":"Name","value":"evo_name"}},{"kind":"Field","alias":{"kind":"Name","value":"value"},"name":{"kind":"Name","value":"evo_addproduct_typeid"}},{"kind":"Field","name":{"kind":"Name","value":"evo_graph_price"}},{"kind":"Field","name":{"kind":"Name","value":"evo_product_type"}}]}}]}}]} as unknown as DocumentNode; export const GetOwnerDataDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetOwnerData"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"domainname"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"selectLead"},"name":{"kind":"Name","value":"leads"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"owner_domainname"},"value":{"kind":"Variable","name":{"kind":"Name","value":"domainname"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"label"},"name":{"kind":"Name","value":"fullname"}},{"kind":"Field","alias":{"kind":"Name","value":"value"},"name":{"kind":"Name","value":"leadid"}}]}},{"kind":"Field","alias":{"kind":"Name","value":"selectOpportunity"},"name":{"kind":"Name","value":"opportunities"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"owner_domainname"},"value":{"kind":"Variable","name":{"kind":"Name","value":"domainname"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"label"},"name":{"kind":"Name","value":"name"}},{"kind":"Field","alias":{"kind":"Name","value":"value"},"name":{"kind":"Name","value":"opportunityid"}}]}}]}}]} as unknown as DocumentNode; -export const GetOpportunityByLeadDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetOpportunityByLead"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"leadid"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"Uuid"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"lead"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"leadid"},"value":{"kind":"Variable","name":{"kind":"Name","value":"leadid"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"evo_opportunityidData"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"label"},"name":{"kind":"Name","value":"name"}},{"kind":"Field","alias":{"kind":"Name","value":"value"},"name":{"kind":"Name","value":"opportunityid"}}]}}]}}]}}]} as unknown as DocumentNode; -export const GetLeadidByOpportunityDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetLeadidByOpportunity"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"opportunityid"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"Uuid"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"opportunity"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"opportunityid"},"value":{"kind":"Variable","name":{"kind":"Name","value":"opportunityid"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"evo_leadid"}}]}}]}}]} as unknown as DocumentNode; -export const GetQuotesByLeadDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetQuotesByLead"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"leadid"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"Uuid"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"quotes"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"evo_leadid"},"value":{"kind":"Variable","name":{"kind":"Name","value":"leadid"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"label"},"name":{"kind":"Name","value":"evo_quotename"}},{"kind":"Field","alias":{"kind":"Name","value":"value"},"name":{"kind":"Name","value":"quoteid"}}]}}]}}]} as unknown as DocumentNode; export const GetLeadUrlDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetLeadUrl"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"id"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"Uuid"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"entity"},"name":{"kind":"Name","value":"lead"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"leadid"},"value":{"kind":"Variable","name":{"kind":"Name","value":"id"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"link"}}]}}]}}]} as unknown as DocumentNode; export const GetOpportunityUrlDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetOpportunityUrl"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"id"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"Uuid"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"entity"},"name":{"kind":"Name","value":"opportunity"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"opportunityid"},"value":{"kind":"Variable","name":{"kind":"Name","value":"id"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"link"}}]}}]}}]} as unknown as DocumentNode; export const GetQuoteUrlDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetQuoteUrl"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"id"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"Uuid"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"entity"},"name":{"kind":"Name","value":"quote"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"quoteId"},"value":{"kind":"Variable","name":{"kind":"Name","value":"id"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"link"}}]}}]}}]} as unknown as DocumentNode; export const GetLeasingObjectDataFromQuoteDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetLeasingObjectDataFromQuote"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"quoteId"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"Uuid"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"quote"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"quoteId"},"value":{"kind":"Variable","name":{"kind":"Name","value":"quoteId"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"evo_brandid"}},{"kind":"Field","name":{"kind":"Name","value":"evo_modelid"}},{"kind":"Field","name":{"kind":"Name","value":"evo_equipmentid"}},{"kind":"Field","name":{"kind":"Name","value":"evo_leasingobject_typeid"}}]}}]}}]} as unknown as DocumentNode; -export const GetModelsDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetModels"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"brandid"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"Uuid"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"evo_models"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"statecode"},"value":{"kind":"IntValue","value":"0"}},{"kind":"Argument","name":{"kind":"Name","value":"evo_brandid"},"value":{"kind":"Variable","name":{"kind":"Name","value":"brandid"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"label"},"name":{"kind":"Name","value":"evo_name"}},{"kind":"Field","alias":{"kind":"Name","value":"value"},"name":{"kind":"Name","value":"evo_modelid"}},{"kind":"Field","name":{"kind":"Name","value":"evo_modelid"}},{"kind":"Field","name":{"kind":"Name","value":"evo_vehicle_type"}}]}}]}}]} as unknown as DocumentNode; -export const GetLeaseObjectTypeDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetLeaseObjectType"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"leaseObjectTypeId"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"Uuid"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"leaseObjectType"},"name":{"kind":"Name","value":"evo_leasingobject_type"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"evo_leasingobject_typeid"},"value":{"kind":"Variable","name":{"kind":"Name","value":"leaseObjectTypeId"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"evo_vehicle_type"}}]}}]}}]} as unknown as DocumentNode; -export const GetConfigurationsDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetConfigurations"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"modelId"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"Uuid"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"evo_equipments"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"statecode"},"value":{"kind":"IntValue","value":"0"}},{"kind":"Argument","name":{"kind":"Name","value":"evo_modelid"},"value":{"kind":"Variable","name":{"kind":"Name","value":"modelId"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"label"},"name":{"kind":"Name","value":"evo_name"}},{"kind":"Field","alias":{"kind":"Name","value":"value"},"name":{"kind":"Name","value":"evo_equipmentid"}}]}}]}}]} as unknown as DocumentNode; export const GetLeasingWithoutKaskoOptionsDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetLeasingWithoutKaskoOptions"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"currentDate"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"DateTime"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"evo_addproduct_types"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"statecode"},"value":{"kind":"IntValue","value":"0"}},{"kind":"Argument","name":{"kind":"Name","value":"evo_product_type"},"value":{"kind":"IntValue","value":"100000007"}},{"kind":"Argument","name":{"kind":"Name","value":"evo_datefrom_param"},"value":{"kind":"ObjectValue","fields":[{"kind":"ObjectField","name":{"kind":"Name","value":"lte"},"value":{"kind":"Variable","name":{"kind":"Name","value":"currentDate"}}}]}},{"kind":"Argument","name":{"kind":"Name","value":"evo_dateto_param"},"value":{"kind":"ObjectValue","fields":[{"kind":"ObjectField","name":{"kind":"Name","value":"gte"},"value":{"kind":"Variable","name":{"kind":"Name","value":"currentDate"}}}]}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"label"},"name":{"kind":"Name","value":"evo_name"}},{"kind":"Field","alias":{"kind":"Name","value":"value"},"name":{"kind":"Name","value":"evo_addproduct_typeid"}},{"kind":"Field","name":{"kind":"Name","value":"evo_product_type"}},{"kind":"Field","name":{"kind":"Name","value":"evo_min_period"}},{"kind":"Field","name":{"kind":"Name","value":"evo_max_period"}},{"kind":"Field","name":{"kind":"Name","value":"evo_min_price"}},{"kind":"Field","name":{"kind":"Name","value":"evo_max_price"}},{"kind":"Field","name":{"kind":"Name","value":"evo_leasingobject_types"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"evo_leasingobject_typeid"}}]}},{"kind":"Field","name":{"kind":"Name","value":"evo_visible_calc"}},{"kind":"Field","name":{"kind":"Name","value":"evo_min_first_payment_perc"}},{"kind":"Field","name":{"kind":"Name","value":"evo_max_first_payment_perc"}},{"kind":"Field","name":{"kind":"Name","value":"evo_models"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"evo_modelid"}}]}}]}}]}}]} as unknown as DocumentNode; export const GetPaymentsDataFromQuoteDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetPaymentsDataFromQuote"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"quoteId"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"Uuid"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"quote"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"quoteId"},"value":{"kind":"Variable","name":{"kind":"Name","value":"quoteId"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"evo_period"}},{"kind":"Field","name":{"kind":"Name","value":"evo_accept_period"}},{"kind":"Field","name":{"kind":"Name","value":"evo_first_payment_perc"}},{"kind":"Field","name":{"kind":"Name","value":"evo_last_payment_perc"}},{"kind":"Field","name":{"kind":"Name","value":"evo_graph_type"}},{"kind":"Field","name":{"kind":"Name","value":"evo_payments_decrease_perc"}},{"kind":"Field","name":{"kind":"Name","value":"evo_seasons_type"}},{"kind":"Field","name":{"kind":"Name","value":"evo_high_season"}},{"kind":"Field","name":{"kind":"Name","value":"evo_graphs"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"createdon"}},{"kind":"Field","name":{"kind":"Name","value":"evo_sumpay_withnds"}},{"kind":"Field","name":{"kind":"Name","value":"evo_planpayments"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"evo_payment_ratio"}}]}}]}}]}}]}}]} as unknown as DocumentNode; -export const GetCurrencyChangesDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetCurrencyChanges"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"currentDate"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"DateTime"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"evo_currencychanges"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"statecode"},"value":{"kind":"IntValue","value":"0"}},{"kind":"Argument","name":{"kind":"Name","value":"evo_coursedate_param"},"value":{"kind":"ObjectValue","fields":[{"kind":"ObjectField","name":{"kind":"Name","value":"eq"},"value":{"kind":"Variable","name":{"kind":"Name","value":"currentDate"}}}]}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"evo_currencychange"}},{"kind":"Field","name":{"kind":"Name","value":"evo_ref_transactioncurrency"}}]}}]}}]} as unknown as DocumentNode; -export const GetCurrencyIsoCodeDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetCurrencyISOCode"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"id"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"Uuid"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"transactioncurrency"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"transactioncurrencyid"},"value":{"kind":"Variable","name":{"kind":"Name","value":"id"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"isocurrencycode"}}]}}]}}]} as unknown as DocumentNode; -export const GetImportProgramSubsidyDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetImportProgramSubsidy"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"importProgramId"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"Uuid"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"importProgram"},"name":{"kind":"Name","value":"evo_subsidy"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"evo_subsidyid"},"value":{"kind":"Variable","name":{"kind":"Name","value":"importProgramId"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"evo_subsidy_summ"}},{"kind":"Field","name":{"kind":"Name","value":"evo_percent_subsidy"}},{"kind":"Field","name":{"kind":"Name","value":"evo_max_subsidy_summ"}}]}}]}}]} as unknown as DocumentNode; export const GetRewardRulesDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetRewardRules"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"conditionId"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"Uuid"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"evo_reward_condition"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"evo_reward_conditionid"},"value":{"kind":"Variable","name":{"kind":"Name","value":"conditionId"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"evo_calc_reward_rules"}}]}}]}}]} as unknown as DocumentNode; -export const GetAgentsDataFromQuoteDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetAgentsDataFromQuote"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"quoteId"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"Uuid"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"quote"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"quoteId"},"value":{"kind":"Variable","name":{"kind":"Name","value":"quoteId"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"evo_supplier_accountid"}},{"kind":"Field","name":{"kind":"Name","value":"evo_dealer_person_accountid"}},{"kind":"Field","name":{"kind":"Name","value":"evo_dealer_reward_conditionid"}},{"kind":"Field","name":{"kind":"Name","value":"evo_dealer_reward_total"}},{"kind":"Field","name":{"kind":"Name","value":"evo_dealer_reward_summ"}},{"kind":"Field","name":{"kind":"Name","value":"evo_dealer_broker_accountid"}},{"kind":"Field","name":{"kind":"Name","value":"evo_dealer_broker_reward_conditionid"}},{"kind":"Field","name":{"kind":"Name","value":"evo_dealer_broker_reward_total"}},{"kind":"Field","name":{"kind":"Name","value":"evo_dealer_broker_reward_summ"}},{"kind":"Field","name":{"kind":"Name","value":"evo_agent_accountid"}},{"kind":"Field","name":{"kind":"Name","value":"evo_agent_reward_conditionid"}},{"kind":"Field","name":{"kind":"Name","value":"evo_agent_reward_total"}},{"kind":"Field","name":{"kind":"Name","value":"evo_agent_reward_summ"}},{"kind":"Field","name":{"kind":"Name","value":"evo_double_agent_accountid"}},{"kind":"Field","name":{"kind":"Name","value":"evo_double_agent_reward_conditionid"}},{"kind":"Field","name":{"kind":"Name","value":"evo_double_agent_reward_total"}},{"kind":"Field","name":{"kind":"Name","value":"evo_double_agent_reward_summ"}},{"kind":"Field","name":{"kind":"Name","value":"evo_broker_accountid"}},{"kind":"Field","name":{"kind":"Name","value":"evo_broker_reward_conditionid"}},{"kind":"Field","name":{"kind":"Name","value":"evo_broker_reward_total"}},{"kind":"Field","name":{"kind":"Name","value":"evo_broker_reward_summ"}},{"kind":"Field","name":{"kind":"Name","value":"evo_fin_department_accountid"}},{"kind":"Field","name":{"kind":"Name","value":"evo_fin_department_reward_conditionid"}},{"kind":"Field","name":{"kind":"Name","value":"evo_fin_department_reward_total"}},{"kind":"Field","name":{"kind":"Name","value":"evo_fin_department_reward_summ"}}]}}]}}]} as unknown as DocumentNode; -export const GetRewardConditionsDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetRewardConditions"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"agentid"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"Uuid"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"currentDate"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"DateTime"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"evo_reward_conditions"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"evo_agent_accountid"},"value":{"kind":"Variable","name":{"kind":"Name","value":"agentid"}}},{"kind":"Argument","name":{"kind":"Name","value":"evo_datefrom_param"},"value":{"kind":"ObjectValue","fields":[{"kind":"ObjectField","name":{"kind":"Name","value":"lte"},"value":{"kind":"Variable","name":{"kind":"Name","value":"currentDate"}}}]}},{"kind":"Argument","name":{"kind":"Name","value":"evo_dateto_param"},"value":{"kind":"ObjectValue","fields":[{"kind":"ObjectField","name":{"kind":"Name","value":"gte"},"value":{"kind":"Variable","name":{"kind":"Name","value":"currentDate"}}}]}},{"kind":"Argument","name":{"kind":"Name","value":"statecode"},"value":{"kind":"IntValue","value":"0"}},{"kind":"Argument","name":{"kind":"Name","value":"evo_agency_agreementid_param"},"value":{"kind":"ObjectValue","fields":[{"kind":"ObjectField","name":{"kind":"Name","value":"has"},"value":{"kind":"BooleanValue","value":true}}]}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"label"},"name":{"kind":"Name","value":"evo_name"}},{"kind":"Field","alias":{"kind":"Name","value":"value"},"name":{"kind":"Name","value":"evo_reward_conditionid"}},{"kind":"Field","name":{"kind":"Name","value":"evo_reward_summ"}}]}}]}}]} as unknown as DocumentNode; -export const GetRewardSummDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetRewardSumm"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"conditionId"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"Uuid"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"evo_reward_condition"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"evo_reward_conditionid"},"value":{"kind":"Variable","name":{"kind":"Name","value":"conditionId"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"evo_reward_summ"}}]}}]}}]} as unknown as DocumentNode; -export const GetRewardConditionDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetRewardCondition"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"conditionId"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"Uuid"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"evo_reward_condition"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"evo_reward_conditionid"},"value":{"kind":"Variable","name":{"kind":"Name","value":"conditionId"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"evo_reward_summ"}},{"kind":"Field","name":{"kind":"Name","value":"evo_reduce_reward"}},{"kind":"Field","name":{"kind":"Name","value":"evo_min_reward_summ"}},{"kind":"Field","name":{"kind":"Name","value":"evo_agency_agreementidData"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"evo_required_reward"}}]}}]}}]}}]} as unknown as DocumentNode; -export const GetAgentAccountIdFromLeadDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetAgentAccountIdFromLead"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"leadid"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"Uuid"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"lead"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"leadid"},"value":{"kind":"Variable","name":{"kind":"Name","value":"leadid"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"agentid"},"name":{"kind":"Name","value":"evo_agent_accountid"}}]}}]}}]} as unknown as DocumentNode; -export const GetDoubleAgentAccountIdDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetDoubleAgentAccountId"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"leadid"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"Uuid"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"lead"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"leadid"},"value":{"kind":"Variable","name":{"kind":"Name","value":"leadid"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"agentid"},"name":{"kind":"Name","value":"evo_double_agent_accountid"}}]}}]}}]} as unknown as DocumentNode; -export const GetBrokerAccountIdDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetBrokerAccountId"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"leadid"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"Uuid"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"lead"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"leadid"},"value":{"kind":"Variable","name":{"kind":"Name","value":"leadid"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"agentid"},"name":{"kind":"Name","value":"evo_broker_accountid"}}]}}]}}]} as unknown as DocumentNode; -export const GetFinDepartmentAccountIdDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetFinDepartmentAccountId"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"leadid"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"Uuid"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"lead"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"leadid"},"value":{"kind":"Variable","name":{"kind":"Name","value":"leadid"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"agentid"},"name":{"kind":"Name","value":"evo_fin_department_accountid"}}]}}]}}]} as unknown as DocumentNode; -export const GetRewardWithoutOtherAgentDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetRewardWithoutOtherAgent"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"conditionId"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"Uuid"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"evo_reward_condition"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"evo_reward_conditionid"},"value":{"kind":"Variable","name":{"kind":"Name","value":"conditionId"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"evo_agency_agreementidData"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"evo_reward_without_other_agent"}}]}}]}}]}}]} as unknown as DocumentNode; -export const GetBrokerAccountIdFromDealerDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetBrokerAccountIdFromDealer"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"dealerId"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"Uuid"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"dealer"},"name":{"kind":"Name","value":"account"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"accountid"},"value":{"kind":"Variable","name":{"kind":"Name","value":"dealerId"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"evo_broker_accountid"}}]}}]}}]} as unknown as DocumentNode; \ No newline at end of file +export const GetAgentsDataFromQuoteDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetAgentsDataFromQuote"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"quoteId"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"Uuid"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"quote"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"quoteId"},"value":{"kind":"Variable","name":{"kind":"Name","value":"quoteId"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"evo_supplier_accountid"}},{"kind":"Field","name":{"kind":"Name","value":"evo_dealer_person_accountid"}},{"kind":"Field","name":{"kind":"Name","value":"evo_dealer_reward_conditionid"}},{"kind":"Field","name":{"kind":"Name","value":"evo_dealer_reward_total"}},{"kind":"Field","name":{"kind":"Name","value":"evo_dealer_reward_summ"}},{"kind":"Field","name":{"kind":"Name","value":"evo_dealer_broker_accountid"}},{"kind":"Field","name":{"kind":"Name","value":"evo_dealer_broker_reward_conditionid"}},{"kind":"Field","name":{"kind":"Name","value":"evo_dealer_broker_reward_total"}},{"kind":"Field","name":{"kind":"Name","value":"evo_dealer_broker_reward_summ"}},{"kind":"Field","name":{"kind":"Name","value":"evo_agent_accountid"}},{"kind":"Field","name":{"kind":"Name","value":"evo_agent_reward_conditionid"}},{"kind":"Field","name":{"kind":"Name","value":"evo_agent_reward_total"}},{"kind":"Field","name":{"kind":"Name","value":"evo_agent_reward_summ"}},{"kind":"Field","name":{"kind":"Name","value":"evo_double_agent_accountid"}},{"kind":"Field","name":{"kind":"Name","value":"evo_double_agent_reward_conditionid"}},{"kind":"Field","name":{"kind":"Name","value":"evo_double_agent_reward_total"}},{"kind":"Field","name":{"kind":"Name","value":"evo_double_agent_reward_summ"}},{"kind":"Field","name":{"kind":"Name","value":"evo_broker_accountid"}},{"kind":"Field","name":{"kind":"Name","value":"evo_broker_reward_conditionid"}},{"kind":"Field","name":{"kind":"Name","value":"evo_broker_reward_total"}},{"kind":"Field","name":{"kind":"Name","value":"evo_broker_reward_summ"}},{"kind":"Field","name":{"kind":"Name","value":"evo_fin_department_accountid"}},{"kind":"Field","name":{"kind":"Name","value":"evo_fin_department_reward_conditionid"}},{"kind":"Field","name":{"kind":"Name","value":"evo_fin_department_reward_total"}},{"kind":"Field","name":{"kind":"Name","value":"evo_fin_department_reward_summ"}}]}}]}}]} as unknown as DocumentNode; \ No newline at end of file diff --git a/apps/web/process/configurator/reactions/filters.ts b/apps/web/process/configurator/reactions/filters.ts index 8f954f6..5e4528a 100644 --- a/apps/web/process/configurator/reactions/filters.ts +++ b/apps/web/process/configurator/reactions/filters.ts @@ -98,7 +98,7 @@ export default function commonReactions({ store, apolloClient }: ReactionsContex if (subsidyId) { const { - data: { subsidy }, + data: { evo_subsidy: subsidy }, } = await apolloClient.query({ query: CRMTypes.GetSubsidyDocument, variables: { diff --git a/apps/web/process/fingap/get-kp-data.ts b/apps/web/process/fingap/get-kp-data.ts index 70c0633..79e4523 100644 --- a/apps/web/process/fingap/get-kp-data.ts +++ b/apps/web/process/fingap/get-kp-data.ts @@ -6,8 +6,8 @@ import type { GetQuoteDataInput, GetQuoteDataOutput } from '../load-kp/types'; const DEFAULT_FINGAP_ROW = defaultValues.find((x) => x.key === 'fingap')!; -const QUERY_GET_RISKS = gql` - query GetRisksDataFromQuote($quoteId: Uuid!) { +const QUERY_GET_FINGAP_DATA_FROM_QUOTE = gql` + query GetFingapDataFromQuote($quoteId: Uuid!) { quote(quoteId: $quoteId) { evo_fingap_accountid evo_fingap_payer @@ -34,10 +34,10 @@ export default async function getFingapDataFromKP({ const { data: { quote }, } = await apolloClient.query< - CRMTypes.GetRisksDataFromQuoteQuery, - CRMTypes.GetRisksDataFromQuoteQueryVariables + CRMTypes.GetFingapDataFromQuoteQuery, + CRMTypes.GetFingapDataFromQuoteQueryVariables >({ - query: QUERY_GET_RISKS, + query: QUERY_GET_FINGAP_DATA_FROM_QUOTE, variables: { quoteId, }, diff --git a/apps/web/process/init/get-data/get-main-data.js b/apps/web/process/init/get-data/get-main-data.js index 48da5ed..f6c346a 100644 --- a/apps/web/process/init/get-data/get-main-data.js +++ b/apps/web/process/init/get-data/get-main-data.js @@ -9,38 +9,6 @@ import { normalizeOptions } from 'tools'; dayjs.extend(utc); -const QUERY_GET_GPS_BRANDS = gql` - query GetGPSBrands { - selectGPSBrand: evo_gps_brands(statecode: 0) { - label: evo_name - value: evo_gps_brandid - } - } -`; - -const QUERY_GET_SUBSIDIES = gql` - query GetSubsidies($currentDate: DateTime) { - evo_subsidies( - statecode: 0 - evo_datefrom_param: { lte: $currentDate } - evo_dateto_param: { gte: $currentDate } - ) { - label: evo_name - value: evo_subsidyid - evo_subsidy_type - } - } -`; - -const QUERY_GET_REGIONS = gql` - query GetRegions { - evo_regions { - label: evo_name - value: evo_regionid - } - } -`; - const QUERY_GET_ADDPRODUCT_TYPES = gql` query GetAddproductTypes($currentDate: DateTime) { evo_addproduct_types( @@ -87,9 +55,11 @@ function getMainData(query, onCompleted) { }); query({ - query: QUERY_GET_GPS_BRANDS, + query: CRMTypes.GetGpsBrandsDocument, }).then(({ data }) => { - onCompleted(data); + onCompleted({ + selectGPSBrand: data?.evo_gps_brands, + }); }); query({ @@ -104,7 +74,7 @@ function getMainData(query, onCompleted) { }); query({ - query: QUERY_GET_SUBSIDIES, + query: CRMTypes.GetSubsidiesDocument, variables: { currentDate, }, @@ -124,7 +94,7 @@ function getMainData(query, onCompleted) { }); query({ - query: QUERY_GET_REGIONS, + query: CRMTypes.GetRegionsDocument, }).then(({ data }) => { const selectRegionRegistration = data?.evo_regions; const selectObjectRegionRegistration = data?.evo_regions; diff --git a/apps/web/process/lead-opportunity/reactions/common.ts b/apps/web/process/lead-opportunity/reactions/common.ts index 06d2faa..69734ae 100644 --- a/apps/web/process/lead-opportunity/reactions/common.ts +++ b/apps/web/process/lead-opportunity/reactions/common.ts @@ -1,6 +1,5 @@ /* eslint-disable implicit-arrow-linebreak */ -import { gql } from '@apollo/client'; -import type * as CRMTypes from 'graphql/crm.types'; +import * as CRMTypes from 'graphql/crm.types'; import { reaction } from 'mobx'; import type { ReactionsContext } from 'process/types'; import { normalizeOptions } from 'tools/entity'; @@ -16,17 +15,6 @@ export default function commonReactions({ store, apolloClient }: ReactionsContex * Иначе ничего не указывается */ - const QUERY_GET_OPPORTUNITY_BY_LEAD = gql` - query GetOpportunityByLead($leadid: Uuid!) { - lead(leadid: $leadid) { - evo_opportunityidData { - label: name - value: opportunityid - } - } - } - `; - makeDisposable( () => reaction( @@ -40,11 +28,8 @@ export default function commonReactions({ store, apolloClient }: ReactionsContex const { data: { lead }, - } = await apolloClient.query< - CRMTypes.GetOpportunityByLeadQuery, - CRMTypes.GetOpportunityByLeadQueryVariables - >({ - query: QUERY_GET_OPPORTUNITY_BY_LEAD, + } = await apolloClient.query({ + query: CRMTypes.GetLeadDocument, variables: { leadid, }, @@ -60,20 +45,6 @@ export default function commonReactions({ store, apolloClient }: ReactionsContex () => $process.has('LoadKP') ); - /** - * если opportunity содержит данные, - то в lead подгружается значение из поля Интерес - выбранной карточки Лизинговая сделка (opportunity.evo_leadid) - иначе ничего не делать - */ - const QUERY_GET_LEADID_BY_OPPORTUNITY = gql` - query GetLeadidByOpportunity($opportunityid: Uuid!) { - opportunity(opportunityid: $opportunityid) { - evo_leadid - } - } - `; - reaction( () => $calculation.element('selectOpportunity').getValue(), async (opportunityid) => { @@ -82,11 +53,8 @@ export default function commonReactions({ store, apolloClient }: ReactionsContex if (leadid) { const { data: { lead }, - } = await apolloClient.query< - CRMTypes.GetOpportunityByLeadQuery, - CRMTypes.GetOpportunityByLeadQueryVariables - >({ - query: QUERY_GET_OPPORTUNITY_BY_LEAD, + } = await apolloClient.query({ + query: CRMTypes.GetLeadDocument, variables: { leadid, }, @@ -100,11 +68,8 @@ export default function commonReactions({ store, apolloClient }: ReactionsContex if (opportunityid) { const { data: { opportunity }, - } = await apolloClient.query< - CRMTypes.GetLeadidByOpportunityQuery, - CRMTypes.GetLeadidByOpportunityQueryVariables - >({ - query: QUERY_GET_LEADID_BY_OPPORTUNITY, + } = await apolloClient.query({ + query: CRMTypes.GetOpportunityDocument, variables: { opportunityid, }, @@ -126,26 +91,14 @@ export default function commonReactions({ store, apolloClient }: ReactionsContex Иначе очищать поле калькулятора quote. */ - const QUERY_GET_QUOTES_BY_LEAD = gql` - query GetQuotesByLead($leadid: Uuid!) { - quotes(evo_leadid: $leadid) { - label: evo_quotename - value: quoteid - } - } - `; - reaction( () => $calculation.element('selectLead').getValue(), async (leadid) => { if (leadid) { const { data: { quotes }, - } = await apolloClient.query< - CRMTypes.GetQuotesByLeadQuery, - CRMTypes.GetQuotesByLeadQueryVariables - >({ - query: QUERY_GET_QUOTES_BY_LEAD, + } = await apolloClient.query({ + query: CRMTypes.GetQuotesByLeadDocument, variables: { leadid, }, diff --git a/apps/web/process/leasing-object/reactions/common.ts b/apps/web/process/leasing-object/reactions/common.ts index aa14d19..489ab26 100644 --- a/apps/web/process/leasing-object/reactions/common.ts +++ b/apps/web/process/leasing-object/reactions/common.ts @@ -1,39 +1,10 @@ /* eslint-disable @typescript-eslint/naming-convention */ -import { gql } from '@apollo/client'; import * as CRMTypes from 'graphql/crm.types'; import { reaction } from 'mobx'; import type { ReactionsContext } from 'process/types'; import { intersects } from 'radash'; import { normalizeOptions } from 'tools'; -const QUERY_GET_MODELS = gql` - query GetModels($brandid: Uuid!) { - evo_models(statecode: 0, evo_brandid: $brandid) { - label: evo_name - value: evo_modelid - evo_modelid - evo_vehicle_type - } - } -`; - -const QUERY_GET_LEASE_OBJECT_TYPE = gql` - query GetLeaseObjectType($leaseObjectTypeId: Uuid!) { - leaseObjectType: evo_leasingobject_type(evo_leasingobject_typeid: $leaseObjectTypeId) { - evo_vehicle_type - } - } -`; - -const QUERY_GET_CONFIGURATIONS = gql` - query GetConfigurations($modelId: Uuid) { - evo_equipments(statecode: 0, evo_modelid: $modelId) { - label: evo_name - value: evo_equipmentid - } - } -`; - export default function commonReactions({ store, apolloClient }: ReactionsContext) { const { $calculation } = store; @@ -57,10 +28,10 @@ export default function commonReactions({ store, apolloClient }: ReactionsContex const { data: { evo_models }, - } = await apolloClient.query({ - query: QUERY_GET_MODELS, + } = await apolloClient.query({ + query: CRMTypes.GetModelsDocument, variables: { - brandid: brandId, + brandId, }, }); @@ -75,11 +46,8 @@ export default function commonReactions({ store, apolloClient }: ReactionsContex if (leaseObjectTypeId) { const { data: { leaseObjectType }, - } = await apolloClient.query< - CRMTypes.GetLeaseObjectTypeQuery, - CRMTypes.GetLeaseObjectTypeQueryVariables - >({ - query: QUERY_GET_LEASE_OBJECT_TYPE, + } = await apolloClient.query({ + query: CRMTypes.GetLeaseObjectTypeDocument, variables: { leaseObjectTypeId, }, @@ -99,7 +67,7 @@ export default function commonReactions({ store, apolloClient }: ReactionsContex if (subsidyId) { const { - data: { subsidy }, + data: { evo_subsidy: subsidy }, } = await apolloClient.query({ query: CRMTypes.GetSubsidyDocument, variables: { @@ -205,11 +173,8 @@ export default function commonReactions({ store, apolloClient }: ReactionsContex if (leaseObjectTypeId) { const { data: { leaseObjectType }, - } = await apolloClient.query< - CRMTypes.GetLeaseObjectTypeQuery, - CRMTypes.GetLeaseObjectTypeQueryVariables - >({ - query: QUERY_GET_LEASE_OBJECT_TYPE, + } = await apolloClient.query({ + query: CRMTypes.GetLeaseObjectTypeDocument, variables: { leaseObjectTypeId, }, @@ -233,7 +198,7 @@ export default function commonReactions({ store, apolloClient }: ReactionsContex if (subsidyId) { const { - data: { subsidy }, + data: { evo_subsidy: subsidy }, } = await apolloClient.query({ query: CRMTypes.GetSubsidyDocument, variables: { @@ -304,11 +269,11 @@ export default function commonReactions({ store, apolloClient }: ReactionsContex const { data: { evo_equipments }, - } = await apolloClient.query< - CRMTypes.GetConfigurationsQuery, - CRMTypes.GetConfigurationsQueryVariables - >({ - query: QUERY_GET_CONFIGURATIONS, + } = await apolloClient.query({ + query: CRMTypes.GetConfigurationsDocument, + variables: { + modelId, + }, }); $calculation.element('selectConfiguration').setOptions(normalizeOptions(evo_equipments)); diff --git a/apps/web/process/price/reactions/computed.ts b/apps/web/process/price/reactions/computed.ts index a4bba6c..7452133 100644 --- a/apps/web/process/price/reactions/computed.ts +++ b/apps/web/process/price/reactions/computed.ts @@ -1,31 +1,13 @@ /* eslint-disable @typescript-eslint/naming-convention */ -import { gql } from '@apollo/client'; import dayjs from 'dayjs'; import utc from 'dayjs/plugin/utc'; -import type * as CRMTypes from 'graphql/crm.types'; +import * as CRMTypes from 'graphql/crm.types'; import { autorun } from 'mobx'; import type { ReactionsContext } from 'process/types'; dayjs.extend(utc); export default function computedReactions({ store, apolloClient }: ReactionsContext) { - const QUERY_GET_EVO_CURRENCY_CHANGES = gql` - query GetCurrencyChanges($currentDate: DateTime) { - evo_currencychanges(statecode: 0, evo_coursedate_param: { eq: $currentDate }) { - evo_currencychange - evo_ref_transactioncurrency - } - } - `; - - const QUERY_GET_CURRENCY_ISOCODE = gql` - query GetCurrencyISOCode($id: Uuid!) { - transactioncurrency(transactioncurrencyid: $id) { - isocurrencycode - } - } - `; - const { $calculation } = store; autorun( @@ -43,13 +25,10 @@ export default function computedReactions({ store, apolloClient }: ReactionsCont const { data: { transactioncurrency }, - } = await apolloClient.query< - CRMTypes.GetCurrencyIsoCodeQuery, - CRMTypes.GetCurrencyIsoCodeQueryVariables - >({ - query: QUERY_GET_CURRENCY_ISOCODE, + } = await apolloClient.query({ + query: CRMTypes.GetTransactionCurrencyDocument, variables: { - id: supplierCurrencyId, + currencyid: supplierCurrencyId, }, }); @@ -62,11 +41,8 @@ export default function computedReactions({ store, apolloClient }: ReactionsCont const { data: { evo_currencychanges }, - } = await apolloClient.query< - CRMTypes.GetCurrencyChangesQuery, - CRMTypes.GetCurrencyChangesQueryVariables - >({ - query: QUERY_GET_EVO_CURRENCY_CHANGES, + } = await apolloClient.query({ + query: CRMTypes.GetCurrencyChangesDocument, variables: { currentDate: dayjs().utc(false).format('YYYY-MM-DD'), }, diff --git a/apps/web/process/subsidy/reactions.ts b/apps/web/process/subsidy/reactions.ts index 5e4151b..d4d47d7 100644 --- a/apps/web/process/subsidy/reactions.ts +++ b/apps/web/process/subsidy/reactions.ts @@ -1,19 +1,8 @@ /* eslint-disable @typescript-eslint/naming-convention */ -import { gql } from '@apollo/client'; -import type * as CRMTypes from 'graphql/crm.types'; +import * as CRMTypes from 'graphql/crm.types'; import { autorun } from 'mobx'; import type { ReactionsContext } from 'process/types'; -const QUERY_GET_IMPORT_PROGRAM_SUBSIDY = gql` - query GetImportProgramSubsidy($importProgramId: Uuid!) { - importProgram: evo_subsidy(evo_subsidyid: $importProgramId) { - evo_subsidy_summ - evo_percent_subsidy - evo_max_subsidy_summ - } - } -`; - /* eslint-disable max-len */ /** * При изменении "Программа от производителя" selectImportProgram , Стоимости ПЛ tbxLeaseObjectPrice, Валюты selectSupplierCurrency, Скидка от поставщика, в валюте поставщика (tbxSupplierDiscountRub) @@ -42,14 +31,11 @@ export function computedReactions({ store, apolloClient, queryClient }: Reaction if (importProgramId) { const { - data: { importProgram }, - } = await apolloClient.query< - CRMTypes.GetImportProgramSubsidyQuery, - CRMTypes.GetImportProgramSubsidyQueryVariables - >({ - query: QUERY_GET_IMPORT_PROGRAM_SUBSIDY, + data: { evo_subsidy: importProgram }, + } = await apolloClient.query({ + query: CRMTypes.GetSubsidyDocument, variables: { - importProgramId, + subsidyId: importProgramId, }, }); diff --git a/apps/web/process/supplier-agent/lib/create-reactions.ts b/apps/web/process/supplier-agent/lib/create-reactions.ts index ad72e5e..0656711 100644 --- a/apps/web/process/supplier-agent/lib/create-reactions.ts +++ b/apps/web/process/supplier-agent/lib/create-reactions.ts @@ -1,9 +1,8 @@ /* eslint-disable @typescript-eslint/naming-convention */ import type { ApolloClient } from '@apollo/client'; -import { gql } from '@apollo/client'; import dayjs from 'dayjs'; import utc from 'dayjs/plugin/utc'; -import type * as CRMTypes from 'graphql/crm.types'; +import * as CRMTypes from 'graphql/crm.types'; import { autorun, reaction } from 'mobx'; import type RootStore from 'stores/root'; import ValidationHelper from 'stores/validation/helper'; @@ -13,22 +12,6 @@ import type { AgentsFields, AgentsRewardConditionsFields, AgentsSumFields } from dayjs.extend(utc); -const QUERY_GET_REWARD_CONDITIONS = gql` - query GetRewardConditions($agentid: Uuid!, $currentDate: DateTime) { - evo_reward_conditions( - evo_agent_accountid: $agentid - evo_datefrom_param: { lte: $currentDate } - evo_dateto_param: { gte: $currentDate } - statecode: 0 - evo_agency_agreementid_param: { has: true } - ) { - label: evo_name - value: evo_reward_conditionid - evo_reward_summ - } - } -`; - export function fillAgentRewardReaction( store: RootStore, apolloClient: ApolloClient, @@ -50,11 +33,8 @@ export function fillAgentRewardReaction( } const { data: { evo_reward_conditions }, - } = await apolloClient.query< - CRMTypes.GetRewardConditionsQuery, - CRMTypes.GetRewardConditionsQueryVariables - >({ - query: QUERY_GET_REWARD_CONDITIONS, + } = await apolloClient.query({ + query: CRMTypes.GetRewardConditionsDocument, variables: { agentid, currentDate: dayjs().toISOString(), @@ -72,14 +52,6 @@ export function fillAgentRewardReaction( ); } -const QUERY_GET_REWARD_SUMM = gql` - query GetRewardSumm($conditionId: Uuid!) { - evo_reward_condition(evo_reward_conditionid: $conditionId) { - evo_reward_summ - } - } -`; - export function fillAgentRewardSummReaction( store: RootStore, apolloClient: ApolloClient, @@ -104,11 +76,8 @@ export function fillAgentRewardSummReaction( const { data: { evo_reward_condition }, - } = await apolloClient.query< - CRMTypes.GetRewardSummQuery, - CRMTypes.GetRewardSummQueryVariables - >({ - query: QUERY_GET_REWARD_SUMM, + } = await apolloClient.query({ + query: CRMTypes.GetRewardConditionDocument, variables: { conditionId: rewardConditionId, }, @@ -136,19 +105,6 @@ export function fillAgentRewardSummReaction( ); } -const QUERY_GET_REWARD_CONDITION = gql` - query GetRewardCondition($conditionId: Uuid!) { - evo_reward_condition(evo_reward_conditionid: $conditionId) { - evo_reward_summ - evo_reduce_reward - evo_min_reward_summ - evo_agency_agreementidData { - evo_required_reward - } - } - } -`; - export function validateAgentRewardSumm( store: RootStore, apolloClient: ApolloClient, @@ -178,7 +134,7 @@ export function validateAgentRewardSumm( CRMTypes.GetRewardConditionQuery, CRMTypes.GetRewardConditionQueryVariables >({ - query: QUERY_GET_REWARD_CONDITION, + query: CRMTypes.GetRewardConditionDocument, variables: { conditionId, }, @@ -245,7 +201,7 @@ export function validateAgentRewardSumm( CRMTypes.GetRewardConditionQuery, CRMTypes.GetRewardConditionQueryVariables >({ - query: QUERY_GET_REWARD_CONDITION, + query: CRMTypes.GetRewardConditionDocument, variables: { conditionId, }, diff --git a/apps/web/process/supplier-agent/lib/fill-agents-from-lead.ts b/apps/web/process/supplier-agent/lib/fill-agents-from-lead.ts index 41d6d8b..4750734 100644 --- a/apps/web/process/supplier-agent/lib/fill-agents-from-lead.ts +++ b/apps/web/process/supplier-agent/lib/fill-agents-from-lead.ts @@ -1,17 +1,19 @@ /* eslint-disable import/prefer-default-export */ -import type { ApolloClient, DocumentNode } from '@apollo/client'; -import { gql } from '@apollo/client'; +import type { ApolloClient } from '@apollo/client'; import type { Elements } from 'Components/Calculation/config/map/values'; -import { QUERY_GET_AGENT } from 'graphql/crm.query'; -import type { GetAgentQuery, GetAgentQueryVariables } from 'graphql/crm.types'; +import * as CRMTypes from 'graphql/crm.types'; import type RootStore from 'stores/root'; import { normalizeOptions } from 'tools/entity'; -function makeFillAgentFromLead( - elementName: Elements, - queryGetAgentId: DocumentNode, - queryGetAgent: DocumentNode -) { +type AgentsLeadProp = keyof Pick< + NonNullable, + | 'evo_agent_accountid' + | 'evo_broker_accountid' + | 'evo_double_agent_accountid' + | 'evo_fin_department_accountid' +>; + +function makeFillAgentFromLead(elementName: Elements, leadProp: AgentsLeadProp) { return async function fillAgentFromLead( { $calculation }: RootStore, apolloClient: ApolloClient, @@ -26,19 +28,21 @@ function makeFillAgentFromLead( const { data: { lead }, } = await apolloClient.query({ - query: queryGetAgentId, + query: CRMTypes.GetLeadDocument, variables: { leadid, }, }); - if (lead?.agentid) { + const agentid = lead?.[leadProp]; + + if (agentid) { const { data: { agent }, - } = await apolloClient.query({ - query: queryGetAgent, + } = await apolloClient.query({ + query: CRMTypes.GetAgentDocument, variables: { - agentid: lead.agentid, + agentid, }, }); @@ -60,19 +64,8 @@ function makeFillAgentFromLead( * записанную в поле Интереса "Агент" (lead.evo_agent_accountid → account), * иначе очищать поле калькулятора indAgent */ -const QUERY_GET_AGENT_ACCOUNTID_FROM_LEAD = gql` - query GetAgentAccountIdFromLead($leadid: Uuid!) { - lead(leadid: $leadid) { - agentid: evo_agent_accountid - } - } -`; -export const fillIndAgent = makeFillAgentFromLead( - 'selectIndAgent', - QUERY_GET_AGENT_ACCOUNTID_FROM_LEAD, - QUERY_GET_AGENT -); +export const fillIndAgent = makeFillAgentFromLead('selectIndAgent', 'evo_agent_accountid'); /** * Если lead содержит данные, @@ -81,18 +74,9 @@ export const fillIndAgent = makeFillAgentFromLead( * иначе очищать поле калькулятора calcDoubleAgent */ -const QUERY_GET_DOUBLE_AGENT_ACCOUNTID = gql` - query GetDoubleAgentAccountId($leadid: Uuid!) { - lead(leadid: $leadid) { - agentid: evo_double_agent_accountid - } - } -`; - export const fillCalcDoubleAgent = makeFillAgentFromLead( 'selectCalcDoubleAgent', - QUERY_GET_DOUBLE_AGENT_ACCOUNTID, - QUERY_GET_AGENT + 'evo_double_agent_accountid' ); /** @@ -101,19 +85,7 @@ export const fillCalcDoubleAgent = makeFillAgentFromLead( * иначе очищать поле калькулятора calcBroker */ -const QUERY_GET_BROKER_ACCOUNTID_FROM_LEAD = gql` - query GetBrokerAccountId($leadid: Uuid!) { - lead(leadid: $leadid) { - agentid: evo_broker_accountid - } - } -`; - -export const fillCalcBroker = makeFillAgentFromLead( - 'selectCalcBroker', - QUERY_GET_BROKER_ACCOUNTID_FROM_LEAD, - QUERY_GET_AGENT -); +export const fillCalcBroker = makeFillAgentFromLead('selectCalcBroker', 'evo_broker_accountid'); /** * если lead содержит данные, то calcFinDepartment заполняется ссылкой @@ -122,16 +94,7 @@ export const fillCalcBroker = makeFillAgentFromLead( * иначе очищать поле калькулятора calcFinDepartment */ -const QUERY_GET_FIN_DEPARTMENT_ACCOUNTID = gql` - query GetFinDepartmentAccountId($leadid: Uuid!) { - lead(leadid: $leadid) { - agentid: evo_fin_department_accountid - } - } -`; - export const fillFinDepartment = makeFillAgentFromLead( 'selectCalcFinDepartment', - QUERY_GET_FIN_DEPARTMENT_ACCOUNTID, - QUERY_GET_AGENT + 'evo_fin_department_accountid' ); diff --git a/apps/web/process/supplier-agent/reactions/agents.ts b/apps/web/process/supplier-agent/reactions/agents.ts index 77c082d..13d5c5a 100644 --- a/apps/web/process/supplier-agent/reactions/agents.ts +++ b/apps/web/process/supplier-agent/reactions/agents.ts @@ -1,14 +1,17 @@ /* eslint-disable @typescript-eslint/naming-convention */ -import { gql } from '@apollo/client'; import dayjs from 'dayjs'; import utc from 'dayjs/plugin/utc'; -import type * as CRMTypes from 'graphql/crm.types'; +import * as CRMTypes from 'graphql/crm.types'; import { autorun, reaction } from 'mobx'; import type { ReactionsContext } from 'process/types'; import { makeDisposable } from 'tools/mobx'; import * as createReactions from '../lib/create-reactions'; import * as fillAgentsFromLead from '../lib/fill-agents-from-lead'; +const { fillIndAgent, fillCalcBroker, fillCalcDoubleAgent, fillFinDepartment } = fillAgentsFromLead; +const { fillAgentRewardReaction, fillAgentRewardSummReaction, validateAgentRewardSumm } = + createReactions; + dayjs.extend(utc); export function fillReactions({ store, apolloClient }: ReactionsContext) { @@ -22,10 +25,10 @@ export function fillReactions({ store, apolloClient }: ReactionsContext) { reaction( () => $calculation.element('selectLead').getValue(), (leadid) => { - fillAgentsFromLead.fillIndAgent(store, apolloClient, leadid); - fillAgentsFromLead.fillCalcDoubleAgent(store, apolloClient, leadid); - fillAgentsFromLead.fillCalcBroker(store, apolloClient, leadid); - fillAgentsFromLead.fillFinDepartment(store, apolloClient, leadid); + fillIndAgent(store, apolloClient, leadid); + fillCalcDoubleAgent(store, apolloClient, leadid); + fillCalcBroker(store, apolloClient, leadid); + fillFinDepartment(store, apolloClient, leadid); } ), () => $process.has('LoadKP') @@ -35,13 +38,13 @@ export function fillReactions({ store, apolloClient }: ReactionsContext) { * IndAgent */ // Заполняем selectIndAgentRewardCondition - createReactions.fillAgentRewardReaction(store, apolloClient, { + fillAgentRewardReaction(store, apolloClient, { agentField: 'selectIndAgent', rewardConditionField: 'selectIndAgentRewardCondition', }); // Заполняем tbxIndAgentRewardSumm - createReactions.fillAgentRewardSummReaction(store, apolloClient, { + fillAgentRewardSummReaction(store, apolloClient, { rewardConditionField: 'selectIndAgentRewardCondition', rewardSummField: 'tbxIndAgentRewardSumm', }); @@ -50,13 +53,13 @@ export function fillReactions({ store, apolloClient }: ReactionsContext) { * CalcDoubleAgent */ // Заполняем selectCalcDoubleAgentRewardCondition - createReactions.fillAgentRewardReaction(store, apolloClient, { + fillAgentRewardReaction(store, apolloClient, { agentField: 'selectCalcDoubleAgent', rewardConditionField: 'selectCalcDoubleAgentRewardCondition', }); // Заполняем tbxCalcDoubleAgentRewardSumm - createReactions.fillAgentRewardSummReaction(store, apolloClient, { + fillAgentRewardSummReaction(store, apolloClient, { rewardConditionField: 'selectCalcDoubleAgentRewardCondition', rewardSummField: 'tbxCalcDoubleAgentRewardSumm', }); @@ -65,13 +68,13 @@ export function fillReactions({ store, apolloClient }: ReactionsContext) { * CalcBroker */ // Заполняем selectCalcBrokerRewardCondition - createReactions.fillAgentRewardReaction(store, apolloClient, { + fillAgentRewardReaction(store, apolloClient, { agentField: 'selectCalcBroker', rewardConditionField: 'selectCalcBrokerRewardCondition', }); // Заполняем tbxCalcBrokerRewardSum - createReactions.fillAgentRewardSummReaction(store, apolloClient, { + fillAgentRewardSummReaction(store, apolloClient, { rewardConditionField: 'selectCalcBrokerRewardCondition', rewardSummField: 'tbxCalcBrokerRewardSum', }); @@ -80,13 +83,13 @@ export function fillReactions({ store, apolloClient }: ReactionsContext) { * CalcFinDepartment */ // Заполняем selectFinDepartmentRewardCondtion - createReactions.fillAgentRewardReaction(store, apolloClient, { + fillAgentRewardReaction(store, apolloClient, { agentField: 'selectCalcFinDepartment', rewardConditionField: 'selectFinDepartmentRewardCondtion', }); // Заполняем tbxCalcBrokerRewardSum - createReactions.fillAgentRewardSummReaction(store, apolloClient, { + fillAgentRewardSummReaction(store, apolloClient, { rewardConditionField: 'selectFinDepartmentRewardCondtion', rewardSummField: 'tbxFinDepartmentRewardSumm', }); @@ -109,16 +112,6 @@ class Helper { export function commonReactions({ store, apolloClient }: ReactionsContext) { const { $calculation } = store; - const QUERY_GET_REWARD_WITHOUT_OTHER_AGENT = gql` - query GetRewardWithoutOtherAgent($conditionId: Uuid!) { - evo_reward_condition(evo_reward_conditionid: $conditionId) { - evo_agency_agreementidData { - evo_reward_without_other_agent - } - } - } - `; - /** * Добавить реакцию на изменение списка в поле selectDealerRewardCondition : Если в списке selectDealerRewardCondition есть запись, @@ -140,10 +133,10 @@ export function commonReactions({ store, apolloClient }: ReactionsContext) { async (rewardConditionId) => { function fillAgents() { const leadid = $calculation.element('selectLead').getValue(); - fillAgentsFromLead.fillIndAgent(store, apolloClient, leadid); - fillAgentsFromLead.fillCalcDoubleAgent(store, apolloClient, leadid); - fillAgentsFromLead.fillCalcBroker(store, apolloClient, leadid); - fillAgentsFromLead.fillFinDepartment(store, apolloClient, leadid); + fillIndAgent(store, apolloClient, leadid); + fillCalcDoubleAgent(store, apolloClient, leadid); + fillCalcBroker(store, apolloClient, leadid); + fillFinDepartment(store, apolloClient, leadid); } if (!rewardConditionId) { @@ -157,11 +150,8 @@ export function commonReactions({ store, apolloClient }: ReactionsContext) { const { data: { evo_reward_condition }, - } = await apolloClient.query< - CRMTypes.GetRewardWithoutOtherAgentQuery, - CRMTypes.GetRewardWithoutOtherAgentQueryVariables - >({ - query: QUERY_GET_REWARD_WITHOUT_OTHER_AGENT, + } = await apolloClient.query({ + query: CRMTypes.GetRewardConditionDocument, variables: { conditionId: rewardConditionId, }, @@ -212,10 +202,10 @@ export function commonReactions({ store, apolloClient }: ReactionsContext) { async (rewardConditionId) => { function fillAgents() { const leadid = $calculation.element('selectLead').getValue(); - fillAgentsFromLead.fillIndAgent(store, apolloClient, leadid); - fillAgentsFromLead.fillCalcDoubleAgent(store, apolloClient, leadid); - fillAgentsFromLead.fillCalcBroker(store, apolloClient, leadid); - fillAgentsFromLead.fillFinDepartment(store, apolloClient, leadid); + fillIndAgent(store, apolloClient, leadid); + fillCalcDoubleAgent(store, apolloClient, leadid); + fillCalcBroker(store, apolloClient, leadid); + fillFinDepartment(store, apolloClient, leadid); } if (!rewardConditionId) { @@ -229,11 +219,8 @@ export function commonReactions({ store, apolloClient }: ReactionsContext) { const { data: { evo_reward_condition }, - } = await apolloClient.query< - CRMTypes.GetRewardWithoutOtherAgentQuery, - CRMTypes.GetRewardWithoutOtherAgentQueryVariables - >({ - query: QUERY_GET_REWARD_WITHOUT_OTHER_AGENT, + } = await apolloClient.query({ + query: CRMTypes.GetRewardConditionDocument, variables: { conditionId: rewardConditionId, }, @@ -285,9 +272,9 @@ export function commonReactions({ store, apolloClient }: ReactionsContext) { async (rewardConditionId) => { function fillAgents() { const leadid = $calculation.element('selectLead').getValue(); - fillAgentsFromLead.fillCalcDoubleAgent(store, apolloClient, leadid); - fillAgentsFromLead.fillCalcBroker(store, apolloClient, leadid); - fillAgentsFromLead.fillFinDepartment(store, apolloClient, leadid); + fillCalcDoubleAgent(store, apolloClient, leadid); + fillCalcBroker(store, apolloClient, leadid); + fillFinDepartment(store, apolloClient, leadid); } if (!rewardConditionId) { @@ -301,11 +288,8 @@ export function commonReactions({ store, apolloClient }: ReactionsContext) { const { data: { evo_reward_condition }, - } = await apolloClient.query< - CRMTypes.GetRewardWithoutOtherAgentQuery, - CRMTypes.GetRewardWithoutOtherAgentQueryVariables - >({ - query: QUERY_GET_REWARD_WITHOUT_OTHER_AGENT, + } = await apolloClient.query({ + query: CRMTypes.GetRewardConditionDocument, variables: { conditionId: rewardConditionId, }, @@ -358,9 +342,9 @@ export function commonReactions({ store, apolloClient }: ReactionsContext) { async (rewardConditionId) => { function fillAgents() { const leadid = $calculation.element('selectLead').getValue(); - fillAgentsFromLead.fillIndAgent(store, apolloClient, leadid); - fillAgentsFromLead.fillCalcBroker(store, apolloClient, leadid); - fillAgentsFromLead.fillFinDepartment(store, apolloClient, leadid); + fillIndAgent(store, apolloClient, leadid); + fillCalcBroker(store, apolloClient, leadid); + fillFinDepartment(store, apolloClient, leadid); } if (!rewardConditionId) { @@ -374,11 +358,8 @@ export function commonReactions({ store, apolloClient }: ReactionsContext) { const { data: { evo_reward_condition }, - } = await apolloClient.query< - CRMTypes.GetRewardWithoutOtherAgentQuery, - CRMTypes.GetRewardWithoutOtherAgentQueryVariables - >({ - query: QUERY_GET_REWARD_WITHOUT_OTHER_AGENT, + } = await apolloClient.query({ + query: CRMTypes.GetRewardConditionDocument, variables: { conditionId: rewardConditionId, }, @@ -431,9 +412,9 @@ export function commonReactions({ store, apolloClient }: ReactionsContext) { async (rewardConditionId) => { function fillAgents() { const leadid = $calculation.element('selectLead').getValue(); - fillAgentsFromLead.fillIndAgent(store, apolloClient, leadid); - fillAgentsFromLead.fillCalcDoubleAgent(store, apolloClient, leadid); - fillAgentsFromLead.fillFinDepartment(store, apolloClient, leadid); + fillIndAgent(store, apolloClient, leadid); + fillCalcDoubleAgent(store, apolloClient, leadid); + fillFinDepartment(store, apolloClient, leadid); } if (!rewardConditionId) { @@ -447,11 +428,8 @@ export function commonReactions({ store, apolloClient }: ReactionsContext) { const { data: { evo_reward_condition }, - } = await apolloClient.query< - CRMTypes.GetRewardWithoutOtherAgentQuery, - CRMTypes.GetRewardWithoutOtherAgentQueryVariables - >({ - query: QUERY_GET_REWARD_WITHOUT_OTHER_AGENT, + } = await apolloClient.query({ + query: CRMTypes.GetRewardConditionDocument, variables: { conditionId: rewardConditionId, }, @@ -505,9 +483,9 @@ export function commonReactions({ store, apolloClient }: ReactionsContext) { async (rewardConditionId) => { function fillAgents() { const leadid = $calculation.element('selectLead').getValue(); - fillAgentsFromLead.fillIndAgent(store, apolloClient, leadid); - fillAgentsFromLead.fillCalcDoubleAgent(store, apolloClient, leadid); - fillAgentsFromLead.fillFinDepartment(store, apolloClient, leadid); + fillIndAgent(store, apolloClient, leadid); + fillCalcDoubleAgent(store, apolloClient, leadid); + fillFinDepartment(store, apolloClient, leadid); } if (!rewardConditionId) { @@ -520,11 +498,8 @@ export function commonReactions({ store, apolloClient }: ReactionsContext) { } const { data: { evo_reward_condition }, - } = await apolloClient.query< - CRMTypes.GetRewardWithoutOtherAgentQuery, - CRMTypes.GetRewardWithoutOtherAgentQueryVariables - >({ - query: QUERY_GET_REWARD_WITHOUT_OTHER_AGENT, + } = await apolloClient.query({ + query: CRMTypes.GetRewardConditionDocument, variables: { conditionId: rewardConditionId, }, @@ -553,22 +528,22 @@ export function commonReactions({ store, apolloClient }: ReactionsContext) { export function validationReactions({ store, apolloClient }: ReactionsContext) { const { $calculation } = store; - createReactions.validateAgentRewardSumm(store, apolloClient, { + validateAgentRewardSumm(store, apolloClient, { rewardConditionField: 'selectIndAgentRewardCondition', rewardSummField: 'tbxIndAgentRewardSumm', }); - createReactions.validateAgentRewardSumm(store, apolloClient, { + validateAgentRewardSumm(store, apolloClient, { rewardConditionField: 'selectCalcDoubleAgentRewardCondition', rewardSummField: 'tbxCalcDoubleAgentRewardSumm', }); - createReactions.validateAgentRewardSumm(store, apolloClient, { + validateAgentRewardSumm(store, apolloClient, { rewardConditionField: 'selectCalcBrokerRewardCondition', rewardSummField: 'tbxCalcBrokerRewardSum', }); - createReactions.validateAgentRewardSumm(store, apolloClient, { + validateAgentRewardSumm(store, apolloClient, { rewardConditionField: 'selectFinDepartmentRewardCondtion', rewardSummField: 'tbxFinDepartmentRewardSumm', }); diff --git a/apps/web/process/supplier-agent/reactions/leaseback.ts b/apps/web/process/supplier-agent/reactions/leaseback.ts index 6033dc6..fbb1f80 100644 --- a/apps/web/process/supplier-agent/reactions/leaseback.ts +++ b/apps/web/process/supplier-agent/reactions/leaseback.ts @@ -1,5 +1,4 @@ -import { QUERY_GET_DEALER_RETURN_LEASING } from 'graphql/crm.query'; -import type * as CRMTypes from 'graphql/crm.types'; +import * as CRMTypes from 'graphql/crm.types'; import { autorun, reaction } from 'mobx'; import type { ReactionsContext } from 'process/types'; @@ -27,11 +26,8 @@ export default function leasebackReactions({ store, apolloClient }: ReactionsCon const { data: { dealer }, - } = await apolloClient.query< - CRMTypes.GetDealerReturnLeasingQuery, - CRMTypes.GetDealerReturnLeasingQueryVariables - >({ - query: QUERY_GET_DEALER_RETURN_LEASING, + } = await apolloClient.query({ + query: CRMTypes.GetDealerDocument, variables: { dealerId, }, @@ -61,11 +57,8 @@ export default function leasebackReactions({ store, apolloClient }: ReactionsCon if (dealerId) { const { data: { dealer }, - } = await apolloClient.query< - CRMTypes.GetDealerReturnLeasingQuery, - CRMTypes.GetDealerReturnLeasingQueryVariables - >({ - query: QUERY_GET_DEALER_RETURN_LEASING, + } = await apolloClient.query({ + query: CRMTypes.GetDealerDocument, variables: { dealerId, }, @@ -101,11 +94,8 @@ export default function leasebackReactions({ store, apolloClient }: ReactionsCon if (dealerId) { const { data: { dealer }, - } = await apolloClient.query< - CRMTypes.GetDealerReturnLeasingQuery, - CRMTypes.GetDealerReturnLeasingQueryVariables - >({ - query: QUERY_GET_DEALER_RETURN_LEASING, + } = await apolloClient.query({ + query: CRMTypes.GetDealerDocument, variables: { dealerId, }, diff --git a/apps/web/process/supplier-agent/reactions/supplier.ts b/apps/web/process/supplier-agent/reactions/supplier.ts index ecfb1c7..85665d0 100644 --- a/apps/web/process/supplier-agent/reactions/supplier.ts +++ b/apps/web/process/supplier-agent/reactions/supplier.ts @@ -1,8 +1,6 @@ /* eslint-disable @typescript-eslint/naming-convention */ -import { gql } from '@apollo/client'; import dayjs from 'dayjs'; import utc from 'dayjs/plugin/utc'; -import * as query from 'graphql/crm.query'; import * as CRMTypes from 'graphql/crm.types'; import { reaction } from 'mobx'; import type { ReactionsContext } from 'process/types'; @@ -10,8 +8,6 @@ import { sift } from 'radash'; import { normalizeOptions } from 'tools/entity'; import * as createReactions from '../lib/create-reactions'; -const { QUERY_GET_DEALER_RETURN_LEASING, QUERY_GET_AGENT } = query; - dayjs.extend(utc); export function commonReactions({ store, apolloClient }: ReactionsContext) { @@ -35,11 +31,8 @@ export function commonReactions({ store, apolloClient }: ReactionsContext) { const { data: { dealer }, - } = await apolloClient.query< - CRMTypes.GetDealerReturnLeasingQuery, - CRMTypes.GetDealerReturnLeasingQueryVariables - >({ - query: QUERY_GET_DEALER_RETURN_LEASING, + } = await apolloClient.query({ + query: CRMTypes.GetDealerDocument, variables: { dealerId, }, @@ -50,7 +43,7 @@ export function commonReactions({ store, apolloClient }: ReactionsContext) { } const { - data: { salon_providers }, + data: { dealerPersons }, } = await apolloClient.query({ query: CRMTypes.GetDealerPersonsDocument, variables: { @@ -58,17 +51,17 @@ export function commonReactions({ store, apolloClient }: ReactionsContext) { }, }); - if (salon_providers && salon_providers.length > 0) { + if (dealerPersons && dealerPersons.length > 0) { $calculation.element('selectDealerPerson').setOptions( normalizeOptions( - salon_providers.map((dp) => ({ + dealerPersons.map((dp) => ({ ...dp, label: `${dp?.label} ${sift([dp?.evo_inn, dp?.evo_kpp]).join(' | ')}`, })) ) ); - const value = salon_providers.at(0)?.value; + const value = dealerPersons.at(0)?.value; if (!$process.has('LoadKP') && value) { $calculation.element('selectDealerPerson').setValue(value); } @@ -82,14 +75,6 @@ export function commonReactions({ store, apolloClient }: ReactionsContext) { * Заполняем selectDealerBroker */ - const QUERY_GET_BROKER_ACCOUNTID_FROM_DEALER = gql` - query GetBrokerAccountIdFromDealer($dealerId: Uuid!) { - dealer: account(accountid: $dealerId) { - evo_broker_accountid - } - } - `; - reaction( () => $calculation.element('selectDealerPerson').getValue(), async (dealerPersonId) => { @@ -101,11 +86,8 @@ export function commonReactions({ store, apolloClient }: ReactionsContext) { const { data: { dealer }, - } = await apolloClient.query< - CRMTypes.GetBrokerAccountIdFromDealerQuery, - CRMTypes.GetBrokerAccountIdFromDealerQueryVariables - >({ - query: QUERY_GET_BROKER_ACCOUNTID_FROM_DEALER, + } = await apolloClient.query({ + query: CRMTypes.GetDealerDocument, variables: { dealerId: dealerPersonId, }, @@ -115,7 +97,7 @@ export function commonReactions({ store, apolloClient }: ReactionsContext) { const { data: { agent: dealerBroker }, } = await apolloClient.query({ - query: QUERY_GET_AGENT, + query: CRMTypes.GetAgentDocument, variables: { agentid: dealer?.evo_broker_accountid, },