merge migration/fix-3 & migration/upgrade-code-130423
This commit is contained in:
parent
0d35042e41
commit
87e4783dd5
@ -3,9 +3,8 @@ import { useStore } from '@/stores/hooks';
|
||||
import { toJS } from 'mobx';
|
||||
import { observer } from 'mobx-react-lite';
|
||||
import styled from 'styled-components';
|
||||
import { Flex } from 'ui';
|
||||
import Alert from 'ui/elements/Alert';
|
||||
import Table from 'ui/elements/Table';
|
||||
import { Alert, Table } from 'ui/elements';
|
||||
import { Flex } from 'ui/grid';
|
||||
|
||||
const Grid = styled(Flex)`
|
||||
flex-direction: column;
|
||||
|
||||
@ -4,8 +4,8 @@ import type * as Insurance from './types';
|
||||
import { MAX_INSURANCE } from '@/constants/values';
|
||||
import type { ColumnsType } from 'antd/lib/table';
|
||||
import { parser } from 'tools/number';
|
||||
import InputNumber, { createFormatter } from 'ui/elements/InputNumber';
|
||||
import Select from 'ui/elements/Select';
|
||||
import { InputNumber, Select } from 'ui/elements';
|
||||
import { createFormatter } from 'ui/elements/InputNumber';
|
||||
|
||||
export const columns: ColumnsType<Insurance.RowValues> = [
|
||||
{
|
||||
|
||||
@ -2,9 +2,8 @@ import { columns } from './config';
|
||||
import { useStore } from '@/stores/hooks';
|
||||
import { observer } from 'mobx-react-lite';
|
||||
import styled from 'styled-components';
|
||||
import { Flex } from 'ui';
|
||||
import Alert from 'ui/elements/Alert';
|
||||
import Table from 'ui/elements/Table';
|
||||
import { Alert, Table } from 'ui/elements';
|
||||
import { Flex } from 'ui/grid';
|
||||
|
||||
const Grid = styled(Flex)`
|
||||
flex-direction: column;
|
||||
|
||||
@ -2,7 +2,7 @@ import renderFormRows from '../../lib/render-rows';
|
||||
import { id, rows, title } from './config';
|
||||
import FinGAPTable from './FinGAPTable';
|
||||
import InsuranceTable from './InsuranceTable';
|
||||
import { Flex } from 'ui';
|
||||
import { Flex } from 'ui/grid';
|
||||
|
||||
function Insurance() {
|
||||
const renderedRows = renderFormRows(rows);
|
||||
|
||||
@ -7,8 +7,8 @@ export const rows: FormTabRows = [
|
||||
[['selectProduct'], { gridTemplateColumns: '1fr' }],
|
||||
[['tbxLeaseObjectPrice', 'tbxVATInLeaseObjectPrice', 'tbxLeaseObjectPriceWthtVAT']],
|
||||
[['selectSupplierCurrency', 'tbxSupplierDiscountRub', 'tbxSupplierDiscountPerc']],
|
||||
[['tbxFirstPaymentPerc', 'tbxFirstPaymentRub']],
|
||||
[['tbxLeasingPeriod', 'tbxSaleBonus', 'tbxRedemptionPaymentSum']],
|
||||
[['tbxFirstPaymentPerc', 'tbxFirstPaymentRub', 'cbxSupplierFinancing']],
|
||||
[['tbxLeasingPeriod', 'tbxSaleBonus']],
|
||||
[['selectSubsidy', 'tbxSubsidySum'], { gridTemplateColumns: '2fr 1fr' }],
|
||||
[['selectImportProgram', 'tbxImportProgramSum', 'tbxAddEquipmentPrice']],
|
||||
[['radioLastPaymentRule'], { gridTemplateColumns: '1fr' }],
|
||||
|
||||
@ -2,7 +2,7 @@ import elementsRender from '../../config/elements-render';
|
||||
import { elements } from './config';
|
||||
import { useStore } from '@/stores/hooks';
|
||||
import { observer } from 'mobx-react-lite';
|
||||
import { Flex } from 'ui';
|
||||
import { Flex } from 'ui/grid';
|
||||
|
||||
function PaymentsParams() {
|
||||
const renderedElements = elements.map((elementName) => {
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
/* eslint-disable canonical/sort-keys */
|
||||
import { buildValueComponent } from './builders';
|
||||
import type { ColumnsType } from 'antd/lib/table';
|
||||
import InputNumber from 'ui/elements/InputNumber';
|
||||
import { InputNumber } from 'ui/elements';
|
||||
|
||||
type Payment = {
|
||||
key: number;
|
||||
|
||||
@ -4,8 +4,7 @@ import { min } from '@/styles/mq';
|
||||
import { computed } from 'mobx';
|
||||
import { observer } from 'mobx-react-lite';
|
||||
import styled from 'styled-components';
|
||||
import Alert from 'ui/elements/Alert';
|
||||
import Table from 'ui/elements/Table';
|
||||
import { Alert, Table } from 'ui/elements';
|
||||
import { Box, Flex } from 'ui/grid';
|
||||
|
||||
const Grid = styled(Flex)`
|
||||
|
||||
@ -9,7 +9,7 @@ import Unlimited from './Unlimited';
|
||||
import Background from '@/Components/Layout/Background';
|
||||
import { min } from '@/styles/mq';
|
||||
import styled from 'styled-components';
|
||||
import Tabs from 'ui/elements/layout/Tabs';
|
||||
import { Tabs } from 'ui/elements';
|
||||
|
||||
const formTabs = [
|
||||
Leasing,
|
||||
|
||||
@ -132,6 +132,7 @@ const components = wrapComponentsMap({
|
||||
selectLeasingWithoutKasko: e.Select,
|
||||
tbxVIN: e.Input,
|
||||
selectUser: e.Select,
|
||||
cbxSupplierFinancing: e.Switch,
|
||||
|
||||
/** Readonly Elements */
|
||||
labelLeaseObjectRisk: e.Text,
|
||||
|
||||
@ -451,6 +451,13 @@ const props: Partial<ElementsProps> = {
|
||||
showSearch: true,
|
||||
optionFilterProp: 'label',
|
||||
},
|
||||
tbxBonusCoefficient: {
|
||||
min: 0,
|
||||
max: 10,
|
||||
step: 0.1,
|
||||
precision: 4,
|
||||
formatter: createFormatter({ minimumFractionDigits: 4, maximumFractionDigits: 4 }),
|
||||
},
|
||||
};
|
||||
|
||||
export default props;
|
||||
|
||||
@ -10,9 +10,8 @@ import { useStore } from '@/stores/hooks';
|
||||
import { useIsFetching } from '@tanstack/react-query';
|
||||
import { observer } from 'mobx-react-lite';
|
||||
import type { ComponentProps } from 'react';
|
||||
import { Link, Tooltip } from 'ui/elements';
|
||||
import { LoadingOutlined } from 'ui/elements/icons';
|
||||
import Link from 'ui/elements/Link';
|
||||
import Tooltip from 'ui/elements/Tooltip';
|
||||
|
||||
const defaultLinkProps: ComponentProps<typeof Link> = {
|
||||
text: 'Открыть в CRM',
|
||||
|
||||
@ -126,6 +126,7 @@ const titles: Record<ActionElements | ValuesElements, string> = {
|
||||
selectLeasingWithoutKasko: 'Лизинг без КАСКО',
|
||||
tbxVIN: 'VIN',
|
||||
selectUser: 'Пользователь',
|
||||
cbxSupplierFinancing: 'Финансирование поставщика',
|
||||
|
||||
/** Link Elements */
|
||||
linkDownloadKp: '',
|
||||
|
||||
@ -163,6 +163,7 @@ const types = wrapElementsTypes({
|
||||
selectLeasingWithoutKasko: t.Options,
|
||||
tbxVIN: t.Value,
|
||||
selectUser: t.Options,
|
||||
cbxSupplierFinancing: t.Value,
|
||||
|
||||
labelLeaseObjectRisk: t.Readonly,
|
||||
tbxInsKaskoPriceLeasePeriod: t.Readonly,
|
||||
|
||||
@ -129,6 +129,7 @@ const elementsToValues = wrapElementsMap({
|
||||
tbxBonusCoefficient: 'bonusCoefficient',
|
||||
tbxVIN: 'vin',
|
||||
selectUser: 'user',
|
||||
cbxSupplierFinancing: 'supplierFinancing',
|
||||
|
||||
/** Readonly Elements */
|
||||
labelLeaseObjectRisk: 'leaseObjectRiskName',
|
||||
|
||||
@ -1,9 +1,8 @@
|
||||
/* eslint-disable react/no-array-index-key */
|
||||
|
||||
import elementsRender from '../config/elements-render';
|
||||
import type { Elements as ActionElements } from '../config/map/actions';
|
||||
import type { Elements as ValuesElements } from '../config/map/values';
|
||||
import Divider from 'ui/elements/layout/Divider';
|
||||
import { Divider } from 'ui/elements';
|
||||
import type { BoxProps } from 'ui/grid';
|
||||
import { Box } from 'ui/grid';
|
||||
|
||||
|
||||
@ -1,6 +1,5 @@
|
||||
/* eslint-disable sonarjs/no-small-switch */
|
||||
import Button from 'ui/elements/Button';
|
||||
import Result from 'ui/elements/Result';
|
||||
import { Button, Result } from 'ui/elements';
|
||||
|
||||
function handleRetry() {
|
||||
window.location.reload();
|
||||
|
||||
@ -3,7 +3,7 @@ import { STALE_TIME } from '@/constants/request';
|
||||
import { min } from '@/styles/mq';
|
||||
import { useQuery } from '@tanstack/react-query';
|
||||
import styled from 'styled-components';
|
||||
import { Flex } from 'ui';
|
||||
import { Flex } from 'ui/grid';
|
||||
|
||||
const UserText = styled.span`
|
||||
margin: 0;
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
import { min } from '@/styles/mq';
|
||||
import type { ReactNode } from 'react';
|
||||
import styled from 'styled-components';
|
||||
import { Flex } from 'ui';
|
||||
import { Flex } from 'ui/grid';
|
||||
|
||||
const ElementTitle = styled.label`
|
||||
color: rgba(0, 0, 0, 0.75);
|
||||
|
||||
@ -2,7 +2,7 @@ import Auth from './Auth';
|
||||
import Logo from './Logo';
|
||||
import { min } from '@/styles/mq';
|
||||
import styled from 'styled-components';
|
||||
import { Flex } from 'ui';
|
||||
import { Flex } from 'ui/grid';
|
||||
|
||||
const HeaderContent = styled(Flex)`
|
||||
flex-direction: row;
|
||||
|
||||
@ -7,7 +7,8 @@ import { observer } from 'mobx-react-lite';
|
||||
import Image from 'next/image';
|
||||
import logo from 'public/assets/images/logo-primary.svg';
|
||||
import styled from 'styled-components';
|
||||
import { Flex, Tag } from 'ui';
|
||||
import { Tag } from 'ui/elements';
|
||||
import { Flex } from 'ui/grid';
|
||||
|
||||
const ImageWrapper = styled.div`
|
||||
width: 100px;
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import Header from './Header';
|
||||
import { Flex } from 'ui';
|
||||
import { Flex } from 'ui/grid';
|
||||
|
||||
export default function Layout({ children }) {
|
||||
return (
|
||||
|
||||
@ -3,7 +3,7 @@ import { MAX_LEASING_PERIOD } from '@/constants/values';
|
||||
import { useStore } from '@/stores/hooks';
|
||||
import { toJS } from 'mobx';
|
||||
import { observer } from 'mobx-react-lite';
|
||||
import Table from 'ui/elements/Table';
|
||||
import { Table } from 'ui/elements';
|
||||
|
||||
const PaymentsTable = observer(() => {
|
||||
const { $results } = useStore();
|
||||
|
||||
@ -53,7 +53,7 @@ export const formatters = {
|
||||
resultLastPayment: moneyFormatter,
|
||||
resultParticipationAmount: moneyFormatter,
|
||||
resultPlPrice: moneyFormatter,
|
||||
resultPriceUpPr: moneyFormatter,
|
||||
resultPriceUpPr: percentFormatter,
|
||||
resultTerm: Intl.NumberFormat('ru').format,
|
||||
resultTotalGraphwithNDS: moneyFormatter,
|
||||
};
|
||||
|
||||
@ -5,7 +5,7 @@ import { min } from '@/styles/mq';
|
||||
import { toJS } from 'mobx';
|
||||
import { observer } from 'mobx-react-lite';
|
||||
import styled from 'styled-components';
|
||||
import Text from 'ui/elements/Text';
|
||||
import { Text } from 'ui/elements';
|
||||
import { Box } from 'ui/grid';
|
||||
|
||||
const Grid = styled(Box)`
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
import { useStore } from '@/stores/hooks';
|
||||
import { observer } from 'mobx-react-lite';
|
||||
import styled from 'styled-components';
|
||||
import Alert from 'ui/elements/Alert';
|
||||
import { Alert } from 'ui/elements';
|
||||
import { Box, Flex } from 'ui/grid';
|
||||
|
||||
const Bold = styled.span`
|
||||
|
||||
@ -6,7 +6,7 @@ import { useStore } from '@/stores/hooks';
|
||||
import { min } from '@/styles/mq';
|
||||
import { observer } from 'mobx-react-lite';
|
||||
import styled from 'styled-components';
|
||||
import { Badge, Tabs } from 'ui';
|
||||
import { Badge, Tabs } from 'ui/elements';
|
||||
|
||||
const outputTabs = [PaymentsTable, Results, Validation];
|
||||
const items = outputTabs.map(({ Component, id, title }) => {
|
||||
|
||||
@ -494,6 +494,7 @@ const defaultOptions: CalculationOptions = {
|
||||
selectLeasingWithoutKasko: [],
|
||||
tbxVIN: [],
|
||||
selectUser: [],
|
||||
cbxSupplierFinancing: [],
|
||||
};
|
||||
|
||||
export default defaultOptions;
|
||||
|
||||
@ -18,6 +18,7 @@ const defaultStatuses: CalculationStatuses = {
|
||||
cbxRecalcWithRevision: 'Default',
|
||||
cbxRegistrationQuote: 'Default',
|
||||
cbxShowFinGAP: 'Default',
|
||||
cbxSupplierFinancing: 'Disabled',
|
||||
cbxTechnicalCardQuote: 'Default',
|
||||
cbxWithTrailer: 'Default',
|
||||
labelDepreciationGroup: 'Default',
|
||||
|
||||
@ -111,7 +111,7 @@ const defaultValues: CalculationValues = {
|
||||
quoteUrl: null,
|
||||
rate: null,
|
||||
recalcWithRevision: false,
|
||||
redemptionPaymentSum: 1000,
|
||||
redemptionPaymentSum: 0,
|
||||
regionRegistration: null,
|
||||
registration: null,
|
||||
registrationDescription: '-',
|
||||
@ -125,6 +125,7 @@ const defaultValues: CalculationValues = {
|
||||
supplierCurrency: null,
|
||||
supplierDiscountPerc: 0,
|
||||
supplierDiscountRub: 0,
|
||||
supplierFinancing: false,
|
||||
tarif: null,
|
||||
technicalCard: null,
|
||||
technicalCardQuote: true,
|
||||
|
||||
@ -110,6 +110,7 @@ const ValuesSchema = z.object({
|
||||
supplierCurrency: z.string().nullable(),
|
||||
supplierDiscountPerc: z.number(),
|
||||
supplierDiscountRub: z.number(),
|
||||
supplierFinancing: z.boolean(),
|
||||
tarif: z.string().nullable(),
|
||||
technicalCard: z.string().nullable(),
|
||||
technicalCardQuote: z.boolean(),
|
||||
|
||||
@ -8,7 +8,7 @@ export const MIN_LASTPAYMENT_NSIB = 3500;
|
||||
export const MIN_PAYMENT = 3;
|
||||
export const VAT = 0.2;
|
||||
export const MAX_MASS = 3500;
|
||||
export const MAX_VEHICLE_SEATS = 20;
|
||||
export const VEHICLE_SEATS = 20;
|
||||
export const ESN = 1.3;
|
||||
export const NSIB_MAX = 5_000_000;
|
||||
export const NDFL = 0.13;
|
||||
|
||||
@ -120,6 +120,10 @@ query GetTarifs($currentDate: DateTime) {
|
||||
evo_min_last_payment
|
||||
evo_max_last_payment
|
||||
evo_used
|
||||
evo_leasingobject_types {
|
||||
evo_leasingobject_typeid
|
||||
}
|
||||
evo_pl_use_type
|
||||
}
|
||||
}
|
||||
|
||||
@ -194,6 +198,10 @@ query GetProduct($productId: Uuid!) {
|
||||
evo_cut_irr_with_bonus
|
||||
evo_sale_without_nds
|
||||
evo_id
|
||||
evo_supplier_financing_accept
|
||||
accounts {
|
||||
accountid
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -227,6 +235,7 @@ query GetSubsidy($subsidyId: Uuid!) {
|
||||
evo_percent_subsidy
|
||||
evo_max_subsidy_summ
|
||||
evo_get_subsidy_payment
|
||||
evo_delivery_time
|
||||
}
|
||||
}
|
||||
|
||||
@ -324,6 +333,7 @@ query GetBrand($brandId: Uuid!) {
|
||||
evo_id
|
||||
evo_importer_reward_perc
|
||||
evo_importer_reward_rub
|
||||
evo_maximum_percentage_av
|
||||
}
|
||||
}
|
||||
|
||||
@ -367,6 +377,7 @@ query GetDealers {
|
||||
label: name
|
||||
value: accountid
|
||||
accountid
|
||||
evo_supplier_financing_accept
|
||||
}
|
||||
}
|
||||
|
||||
@ -384,12 +395,14 @@ query GetDealerPersons($dealerId: Uuid!) {
|
||||
accountid
|
||||
evo_inn
|
||||
evo_kpp
|
||||
evo_supplier_financing_accept
|
||||
}
|
||||
}
|
||||
|
||||
query GetDealerPerson($dealerPersonId: Uuid!) {
|
||||
account(accountid: $dealerPersonId) {
|
||||
evo_supplier_type
|
||||
evo_supplier_financing_accept
|
||||
}
|
||||
}
|
||||
|
||||
@ -596,6 +609,16 @@ query GetInsNSIBTypes($currentDate: DateTime) {
|
||||
evo_product_type: 100000002
|
||||
) {
|
||||
...CoreAddProductTypesFields
|
||||
evo_max_period
|
||||
evo_min_period
|
||||
evo_max_price
|
||||
evo_min_price
|
||||
evo_leasingobject_types {
|
||||
evo_leasingobject_typeid
|
||||
}
|
||||
evo_visible_calc
|
||||
evo_min_first_payment_perc
|
||||
evo_max_first_payment_perc
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -196,6 +196,10 @@ type evo_addcontract {
|
||||
evo_change_payment_date: Boolean
|
||||
evo_chassis: String
|
||||
evo_chassis_new: String
|
||||
evo_check_success: Boolean
|
||||
evo_claim_bill_date: DateTime
|
||||
evo_claim_bill_number: String
|
||||
evo_claim_sum_plan: Decimal
|
||||
evo_color: String
|
||||
evo_color_new: String
|
||||
evo_contractid: Uuid
|
||||
@ -316,6 +320,7 @@ type evo_addcontract {
|
||||
evo_leasingobject_specification: String
|
||||
evo_leasingobject_specification_new: String
|
||||
evo_leasing_bonus_summ: Decimal
|
||||
evo_leasing_profit: Decimal
|
||||
evo_log_activdate_1c: String
|
||||
evo_loss_kv: Decimal
|
||||
evo_maker: String
|
||||
@ -398,6 +403,7 @@ type evo_addcontract {
|
||||
evo_pts_type_new: Int
|
||||
evo_quoteid: Uuid
|
||||
evo_reasons_calc: [Int!]
|
||||
evo_reason_validation_doc: [Int!]
|
||||
evo_recalculate_demand: Boolean
|
||||
evo_refuse_reason: Int
|
||||
evo_regionid: Uuid
|
||||
@ -518,6 +524,7 @@ type email {
|
||||
modifiedon: DateTime
|
||||
regardingobjectid_account: Uuid
|
||||
regardingobjectid_evo_contract: Uuid
|
||||
regardingobjectid_evo_debtwork_contract: Uuid
|
||||
regardingobjectid_evo_insurance_period: Uuid
|
||||
regardingobjectid_evo_insurance_policy: Uuid
|
||||
regardingobjectid_evo_insurance_policyData: evo_insurance_policy
|
||||
@ -722,6 +729,7 @@ type evo_request_client {
|
||||
evo_site_text: String
|
||||
evo_statuscodeid: Uuid
|
||||
evo_statuscodeidData: evo_statuscode
|
||||
evo_statuscode_reason: String
|
||||
evo_storage: String
|
||||
incidents: [incidentGraphQL]
|
||||
link: String
|
||||
@ -876,24 +884,35 @@ type account {
|
||||
evo_fingap_number_rules: Int
|
||||
evo_fin_department_accountid: Uuid
|
||||
evo_fin_department_accountidData: account
|
||||
evo_foreign_countries_financing: Boolean
|
||||
evo_fuel_card_code: String
|
||||
evo_fuel_card_login: String
|
||||
evo_fuel_card_pass: String
|
||||
evo_fullname: String
|
||||
evo_group_sales_network: Uuid
|
||||
evo_gt_sc: String
|
||||
evo_id_elt: String
|
||||
evo_id_elt_osago: String
|
||||
evo_id_elt_smr: String
|
||||
evo_ifns_code: String
|
||||
evo_ifns_code_branch: String
|
||||
evo_ifns_name: String
|
||||
evo_individual_executive_docdate: DateTime
|
||||
evo_individual_executive_docnum: String
|
||||
evo_individual_executive_inn: String
|
||||
evo_individual_executive_kpp: String
|
||||
evo_individual_executive_oop: String
|
||||
evo_inn: String
|
||||
evo_insurance_periods: [evo_insurance_period]
|
||||
evo_invoice_number_fix: String
|
||||
evo_invoice_number_rules: Int
|
||||
evo_is_individual_executive: Boolean
|
||||
evo_kpp: String
|
||||
evo_la: String
|
||||
evo_legal_form: Int
|
||||
evo_legal_region_calc: Boolean
|
||||
evo_licenses_list: String
|
||||
evo_lkt: String
|
||||
evo_lk_regdate: DateTime
|
||||
evo_log_activdate_1c: String
|
||||
evo_management_disqualified: Boolean
|
||||
@ -910,6 +929,10 @@ type account {
|
||||
evo_osago_with_kasko: Boolean
|
||||
evo_request_clients: [evo_request_client]
|
||||
evo_return_leasing_dealer: Boolean
|
||||
evo_revenue_source_1: Boolean
|
||||
evo_revenue_source_2: Boolean
|
||||
evo_revenue_source_3: Boolean
|
||||
evo_revenue_source_other: String
|
||||
evo_smb_category: Int
|
||||
evo_smb_issue_date: DateTime
|
||||
evo_special_accounting: Int
|
||||
@ -941,6 +964,7 @@ type account {
|
||||
telephone2: String
|
||||
telephone3: String
|
||||
toObjectString: String
|
||||
websiteurl: String
|
||||
}
|
||||
|
||||
type contact {
|
||||
@ -951,6 +975,7 @@ type contact {
|
||||
emailaddress2: String
|
||||
emailaddress3: String
|
||||
evo_consent_date: DateTime
|
||||
evo_delegation_agreement: Boolean
|
||||
evo_docdate: DateTime
|
||||
evo_docnumber: String
|
||||
evo_fact_addressid: Uuid
|
||||
@ -1060,6 +1085,7 @@ type evo_addproduct_type {
|
||||
}
|
||||
|
||||
type evo_baseproduct {
|
||||
accounts(statecode: Int): [account]
|
||||
createdon: DateTime
|
||||
evo_baseproductid: Uuid
|
||||
evo_baseproducts(statecode: Int): [evo_baseproduct]
|
||||
@ -1118,6 +1144,7 @@ type evo_insurance_period {
|
||||
evo_close: Boolean
|
||||
evo_comment: String
|
||||
evo_contractid: Uuid
|
||||
evo_contractidData: evo_contract
|
||||
evo_datefrom: DateTime
|
||||
evo_dateto: DateTime
|
||||
evo_dgo_price: Decimal
|
||||
@ -1165,6 +1192,8 @@ type evo_insurance_period {
|
||||
evo_pay_summ_fact: Decimal
|
||||
evo_period_number: Int
|
||||
evo_prolong_listid: Uuid
|
||||
evo_request_clientid: Uuid
|
||||
evo_request_clientidData: evo_request_client
|
||||
evo_request_id_elt: String
|
||||
evo_request_status: Int
|
||||
evo_result_reward_factor: Decimal
|
||||
@ -1175,6 +1204,7 @@ type evo_insurance_period {
|
||||
evo_territory_price: Decimal
|
||||
evo_under_payment_compensation: Decimal
|
||||
evo_unlimit_drivers: Boolean
|
||||
link: String
|
||||
modifiedon: DateTime
|
||||
ownerid_systemuser: Uuid
|
||||
ownerid_team: Uuid
|
||||
@ -1233,6 +1263,7 @@ type evo_external_supplier_code {
|
||||
evo_external_supplier_codeid: Uuid
|
||||
evo_id: String
|
||||
evo_manager_systemuserid: Uuid
|
||||
evo_supplier_type: Int
|
||||
modifiedon: DateTime
|
||||
toObjectString: String
|
||||
}
|
||||
@ -1286,6 +1317,7 @@ type evo_leasingobject {
|
||||
evo_engine_power_kvt: Decimal
|
||||
evo_engine_type: Int
|
||||
evo_engine_volume: Decimal
|
||||
evo_epts_status: Int
|
||||
evo_equipmentid: Uuid
|
||||
evo_gosnumber: String
|
||||
evo_gos_akt: String
|
||||
@ -1298,6 +1330,7 @@ type evo_leasingobject {
|
||||
evo_legal_regionid: Uuid
|
||||
evo_legal_townid: Uuid
|
||||
evo_maker: String
|
||||
evo_maximum_percentage_av: Decimal
|
||||
evo_max_mass: Decimal
|
||||
evo_max_speed: Decimal
|
||||
evo_mileage: Decimal
|
||||
@ -1397,6 +1430,7 @@ type lead {
|
||||
evo_comment: String
|
||||
evo_double_agent_accountid: Uuid
|
||||
evo_external_supplierid: Uuid
|
||||
evo_failure: Boolean
|
||||
evo_fin_department_accountid: Uuid
|
||||
evo_firstname: String
|
||||
evo_inn: String
|
||||
@ -1442,6 +1476,7 @@ type opportunity {
|
||||
evo_all_credit_evosmart: Decimal
|
||||
evo_approvallogs: [evo_approvallog]
|
||||
evo_assignor_accountid: Uuid
|
||||
evo_board_of_directors: String
|
||||
evo_businessunitid: Uuid
|
||||
evo_businessunitidData: businessunit
|
||||
evo_cession_incidentid: Uuid
|
||||
@ -1449,6 +1484,7 @@ type opportunity {
|
||||
evo_check_type_fact: [Int!]
|
||||
evo_client_riskid: Uuid
|
||||
evo_client_riskidData: evo_client_risk
|
||||
evo_collective_executive: String
|
||||
evo_comment_description: String
|
||||
evo_contracts: [evo_contract]
|
||||
evo_credit_analyst_systemuserid: Uuid
|
||||
@ -1456,6 +1492,7 @@ type opportunity {
|
||||
evo_declaration_revenue: Decimal
|
||||
evo_docpay_ka_received: Int
|
||||
evo_docpay_ka_require: Boolean
|
||||
evo_financial_loan: Decimal
|
||||
evo_founder1_beneficial_owner: Boolean
|
||||
evo_founder1_contactid: Uuid
|
||||
evo_founder1_part: Decimal
|
||||
@ -1479,10 +1516,13 @@ type opportunity {
|
||||
evo_guarantor2_contactid: Uuid
|
||||
evo_guarantor3_contactid: Uuid
|
||||
evo_guarantor4_contactid: Uuid
|
||||
evo_high_level: String
|
||||
evo_individual_executive: String
|
||||
evo_leadid: Uuid
|
||||
evo_leadidData: lead
|
||||
evo_mps_systemuserid: Uuid
|
||||
evo_oppnumber: String
|
||||
evo_other_control: String
|
||||
evo_process_type: Int
|
||||
evo_programsolution: Int
|
||||
evo_report_year: Int
|
||||
@ -1521,6 +1561,7 @@ type quote {
|
||||
customerid_contact: Uuid
|
||||
evo_accept_control_addproduct_typeid: Uuid
|
||||
evo_accept_control_addproduct_typeidData: evo_addproduct_type
|
||||
evo_accept_param: [Int!]
|
||||
evo_accept_period: Int
|
||||
evo_accept_quoteid: Uuid
|
||||
evo_acquisition_costs: Decimal
|
||||
@ -1833,6 +1874,7 @@ type evo_brand {
|
||||
evo_id: String
|
||||
evo_importer_reward_perc: Decimal
|
||||
evo_importer_reward_rub: Decimal
|
||||
evo_maximum_percentage_av: Decimal
|
||||
evo_name: String
|
||||
evo_subsidies(statecode: Int): [evo_subsidy]
|
||||
evo_vehicle_type: [Int!]
|
||||
@ -2124,6 +2166,7 @@ type evo_request_payment {
|
||||
type evo_documenttype {
|
||||
createdon: DateTime
|
||||
evo_check_edo: Boolean
|
||||
evo_clientsign_field: String
|
||||
evo_code_wm: String
|
||||
evo_comment: String
|
||||
evo_documenttypeid: Uuid
|
||||
@ -2203,6 +2246,7 @@ type evo_contract {
|
||||
evo_date_of_pledge_claim: DateTime
|
||||
evo_date_of_pledge_leasobject: DateTime
|
||||
evo_date_of_sending_dkp: DateTime
|
||||
evo_date_of_sending_dl: DateTime
|
||||
evo_date_sor: DateTime
|
||||
evo_date_termination: DateTime
|
||||
evo_dealer_broker_accountid: Uuid
|
||||
@ -2300,6 +2344,8 @@ type evo_contract {
|
||||
evo_leasing_bonus_pay_date: DateTime
|
||||
evo_leasing_bonus_summ: Decimal
|
||||
evo_leasing_pledge_agreementid: Uuid
|
||||
evo_leasing_profit: Decimal
|
||||
evo_leasing_profit_actual: Decimal
|
||||
evo_lessor_bank_detailsid: Uuid
|
||||
evo_log_activdate_1c: String
|
||||
evo_msfo_irr: Decimal
|
||||
@ -2324,6 +2370,7 @@ type evo_contract {
|
||||
evo_payment_redemption: Int
|
||||
evo_payment_redemption_sum: Decimal
|
||||
evo_payment_redemption_sum_without_nds: Decimal
|
||||
evo_paysum_before_act_date_plan: Decimal
|
||||
evo_period: Int
|
||||
evo_previous_accountid: Uuid
|
||||
evo_price_without_discount: Decimal
|
||||
@ -2365,6 +2412,7 @@ type evo_contract {
|
||||
evo_subsidy_validity_date: DateTime
|
||||
evo_sumhold_date_sor: Decimal
|
||||
evo_sumhold_month: Decimal
|
||||
evo_sum_pay_future: Decimal
|
||||
evo_supplier_accountid: Uuid
|
||||
evo_supplier_bank_detailsid: Uuid
|
||||
evo_supplier_bank_detailsidData: evo_bank_details
|
||||
@ -2411,10 +2459,12 @@ type evo_external_system_request {
|
||||
evo_accountidData: account
|
||||
evo_addcontractid: Uuid
|
||||
evo_addproductid: Uuid
|
||||
evo_addressid: Uuid
|
||||
evo_agency_agreementid: Uuid
|
||||
evo_contactid: Uuid
|
||||
evo_contractid: Uuid
|
||||
evo_credreg_report_code: String
|
||||
evo_debtwork_contractid: Uuid
|
||||
evo_emailid: Uuid
|
||||
evo_emailidData: email
|
||||
evo_external_system_requestid: Uuid
|
||||
@ -2441,6 +2491,7 @@ type evo_external_system_request {
|
||||
type evo_paymentorder {
|
||||
createdon: DateTime
|
||||
evo_account_name_text: String
|
||||
evo_addcontractid: Uuid
|
||||
evo_comment: String
|
||||
evo_contractid: Uuid
|
||||
evo_correction_date_1c: DateTime
|
||||
@ -2569,6 +2620,7 @@ type evo_tarif {
|
||||
evo_model_exceptions(statecode: Int): [evo_model]
|
||||
evo_name: String
|
||||
evo_pay_supplier_without_addcontract: Boolean
|
||||
evo_pl_use_type: [Int!]
|
||||
evo_rates(statecode: Int): [evo_rate]
|
||||
evo_seasons_type_exception: [Int!]
|
||||
evo_tarifid: Uuid
|
||||
@ -2651,6 +2703,7 @@ type evo_address {
|
||||
evo_flat: String
|
||||
evo_flat_type: String
|
||||
evo_flat_type_full: String
|
||||
evo_geocoding_level: Int
|
||||
evo_geo_lat: String
|
||||
evo_geo_lon: String
|
||||
evo_house: String
|
||||
@ -2690,6 +2743,7 @@ type systemuser {
|
||||
domainname: String
|
||||
evo_access_download_ni: Boolean
|
||||
evo_access_exception_addcontract: Boolean
|
||||
evo_alt_lead: Boolean
|
||||
evo_available_assignment_director: Boolean
|
||||
evo_baseproducts(statecode: Int): [evo_baseproduct]
|
||||
evo_callrecords_access: Boolean
|
||||
@ -2729,11 +2783,13 @@ type evo_identity_document {
|
||||
createdon: DateTime
|
||||
evo_citizenship_countryid: Uuid
|
||||
evo_code: String
|
||||
evo_contactid: Uuid
|
||||
evo_docnumber: String
|
||||
evo_doctype: Int
|
||||
evo_employee_systemuserid: Uuid
|
||||
evo_identity_documentid: Uuid
|
||||
evo_issueby: String
|
||||
evo_issueby_search_dadata: String
|
||||
evo_issuedate: DateTime
|
||||
evo_placebirth: String
|
||||
evo_registration_addressid: Uuid
|
||||
@ -2905,6 +2961,7 @@ type evo_insurance_policy {
|
||||
evo_insurance_policyid: Uuid
|
||||
evo_insurer_accountid: Uuid
|
||||
evo_ins_change_comment: String
|
||||
evo_name: String
|
||||
evo_nsib_ins_summ: Decimal
|
||||
evo_one_year_insurance: Boolean
|
||||
evo_owner_comment: String
|
||||
@ -2914,6 +2971,7 @@ type evo_insurance_policy {
|
||||
evo_pre_polis_number: String
|
||||
evo_quoteid: Uuid
|
||||
evo_statuscodeid: Uuid
|
||||
link: String
|
||||
modifiedon: DateTime
|
||||
ownerid: Uuid
|
||||
statecode: Int
|
||||
@ -2982,6 +3040,7 @@ type evo_edo {
|
||||
evo_box_edoidData: evo_edo
|
||||
evo_box_id: String
|
||||
evo_box_name: String
|
||||
evo_client_signer_contactid: Uuid
|
||||
evo_contractid: Uuid
|
||||
evo_contractidData: evo_contract
|
||||
evo_documentid: Uuid
|
||||
|
||||
@ -182,7 +182,7 @@ export type GetTarifsQueryVariables = Exact<{
|
||||
}>;
|
||||
|
||||
|
||||
export type GetTarifsQuery = { __typename?: 'Query', evo_tarifs: Array<{ __typename?: 'evo_tarif', evo_tarifid: string | null, evo_baseproductid: string | null, evo_min_period: number | null, evo_max_period: number | null, evo_delivery_time: Array<number> | null, evo_min_first_payment: number | null, evo_max_first_payment: number | null, evo_min_last_payment: number | null, evo_max_last_payment: number | null, evo_used: boolean | null, label: string | null, value: string | null } | null> | null };
|
||||
export type GetTarifsQuery = { __typename?: 'Query', evo_tarifs: Array<{ __typename?: 'evo_tarif', evo_tarifid: string | null, evo_baseproductid: string | null, evo_min_period: number | null, evo_max_period: number | null, evo_delivery_time: Array<number> | null, evo_min_first_payment: number | null, evo_max_first_payment: number | null, evo_min_last_payment: number | null, evo_max_last_payment: number | null, evo_used: boolean | null, evo_pl_use_type: Array<number> | null, label: string | null, value: string | null, evo_leasingobject_types: Array<{ __typename?: 'evo_leasingobject_type', evo_leasingobject_typeid: string | null } | null> | null } | null> | null };
|
||||
|
||||
export type GetTarifQueryVariables = Exact<{
|
||||
tarifId: Scalars['Uuid'];
|
||||
@ -217,7 +217,7 @@ export type GetProductQueryVariables = Exact<{
|
||||
}>;
|
||||
|
||||
|
||||
export type GetProductQuery = { __typename?: 'Query', evo_baseproduct: { __typename?: 'evo_baseproduct', evo_calculation_method: Array<number> | null, evo_sale_without_nds: boolean | null, evo_cut_proportion_bonus_director: boolean | null, evo_cut_irr_with_bonus: boolean | null, evo_id: string | 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 GetProductQuery = { __typename?: 'Query', evo_baseproduct: { __typename?: 'evo_baseproduct', evo_calculation_method: Array<number> | null, evo_sale_without_nds: boolean | null, evo_cut_proportion_bonus_director: boolean | null, evo_cut_irr_with_bonus: boolean | null, evo_id: string | null, evo_supplier_financing_accept: boolean | 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, accounts: Array<{ __typename?: 'account', accountid: string | null } | null> | null } | null };
|
||||
|
||||
export type GetSubsidiesQueryVariables = Exact<{
|
||||
currentDate: InputMaybe<Scalars['DateTime']>;
|
||||
@ -231,7 +231,7 @@ export type GetSubsidyQueryVariables = Exact<{
|
||||
}>;
|
||||
|
||||
|
||||
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_get_subsidy_payment: 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 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_get_subsidy_payment: number | null, evo_delivery_time: Array<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'];
|
||||
@ -293,7 +293,7 @@ export type GetBrandQueryVariables = Exact<{
|
||||
}>;
|
||||
|
||||
|
||||
export type GetBrandQuery = { __typename?: 'Query', evo_brand: { __typename?: 'evo_brand', evo_id: string | null, evo_importer_reward_perc: number | null, evo_importer_reward_rub: number | null } | null };
|
||||
export type GetBrandQuery = { __typename?: 'Query', evo_brand: { __typename?: 'evo_brand', evo_id: string | null, evo_importer_reward_perc: number | null, evo_importer_reward_rub: number | null, evo_maximum_percentage_av: number | null } | null };
|
||||
|
||||
export type GetModelsQueryVariables = Exact<{
|
||||
brandId: Scalars['Uuid'];
|
||||
@ -326,7 +326,7 @@ export type GetConfigurationQuery = { __typename?: 'Query', evo_equipment: { __t
|
||||
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 GetDealersQuery = { __typename?: 'Query', dealers: Array<{ __typename?: 'account', accountid: string | null, evo_supplier_financing_accept: boolean | null, label: string | null, value: string | null } | null> | null };
|
||||
|
||||
export type GetDealerQueryVariables = Exact<{
|
||||
dealerId: Scalars['Uuid'];
|
||||
@ -340,14 +340,14 @@ export type GetDealerPersonsQueryVariables = Exact<{
|
||||
}>;
|
||||
|
||||
|
||||
export type GetDealerPersonsQuery = { __typename?: 'Query', dealerPersons: Array<{ __typename?: 'account', accountid: string | null, evo_inn: string | null, evo_kpp: string | null, label: string | null, value: string | null } | null> | null };
|
||||
export type GetDealerPersonsQuery = { __typename?: 'Query', dealerPersons: Array<{ __typename?: 'account', accountid: string | null, evo_inn: string | null, evo_kpp: string | null, evo_supplier_financing_accept: boolean | null, label: string | null, value: string | null } | null> | null };
|
||||
|
||||
export type GetDealerPersonQueryVariables = Exact<{
|
||||
dealerPersonId: Scalars['Uuid'];
|
||||
}>;
|
||||
|
||||
|
||||
export type GetDealerPersonQuery = { __typename?: 'Query', account: { __typename?: 'account', evo_supplier_type: number | null } | null };
|
||||
export type GetDealerPersonQuery = { __typename?: 'Query', account: { __typename?: 'account', evo_supplier_type: number | null, evo_supplier_financing_accept: boolean | null } | null };
|
||||
|
||||
export type GetAgentQueryVariables = Exact<{
|
||||
agentid: Scalars['Uuid'];
|
||||
@ -449,7 +449,7 @@ export type GetInsNsibTypesQueryVariables = Exact<{
|
||||
}>;
|
||||
|
||||
|
||||
export type GetInsNsibTypesQuery = { __typename?: 'Query', evo_addproduct_types: Array<{ __typename?: 'evo_addproduct_type', evo_graph_price: number | null, label: string | null, value: string | null } | null> | null };
|
||||
export type GetInsNsibTypesQuery = { __typename?: 'Query', evo_addproduct_types: Array<{ __typename?: 'evo_addproduct_type', evo_max_period: number | null, evo_min_period: number | null, evo_max_price: number | null, evo_min_price: number | null, evo_visible_calc: boolean | null, evo_min_first_payment_perc: number | null, evo_max_first_payment_perc: number | null, evo_graph_price: number | null, label: string | null, value: string | null, evo_leasingobject_types: Array<{ __typename?: 'evo_leasingobject_type', evo_leasingobject_typeid: string | null } | null> | null } | null> | null };
|
||||
|
||||
export type GetLeasingWithoutKaskoTypesQueryVariables = Exact<{
|
||||
currentDate: InputMaybe<Scalars['DateTime']>;
|
||||
@ -503,7 +503,7 @@ export type GetQuoteCreateKpDataQueryVariables = Exact<{
|
||||
}>;
|
||||
|
||||
|
||||
export type GetQuoteCreateKpDataQuery = { __typename?: 'Query', quote: { __typename?: 'quote', evo_price_with_discount: boolean | null, evo_price_without_discount_quote: boolean | null, evo_cost_increace: boolean | null, evo_insurance: boolean | null, evo_registration_quote: boolean | null, evo_card_quote: boolean | null, evo_nsib_quote: boolean | null, evo_redemption_graph: boolean | null, evo_fingap_quote: boolean | null, evo_contact_name: string | null, evo_gender: number | null } | null };
|
||||
export type GetQuoteCreateKpDataQuery = { __typename?: 'Query', quote: { __typename?: 'quote', evo_price_with_discount: boolean | null, evo_price_without_discount_quote: boolean | null, evo_cost_increace: boolean | null, evo_insurance: boolean | null, evo_registration_quote: boolean | null, evo_card_quote: boolean | null, evo_nsib_quote: boolean | null, evo_redemption_graph: boolean | null, evo_fingap_quote: boolean | null, evo_contact_name: string | null, evo_gender: number | null, evo_last_payment_redemption: boolean | null } | null };
|
||||
|
||||
export type GetQuoteFingapDataQueryVariables = Exact<{
|
||||
quoteId: Scalars['Uuid'];
|
||||
@ -580,7 +580,7 @@ export type GetQuotePriceDataQueryVariables = Exact<{
|
||||
}>;
|
||||
|
||||
|
||||
export type GetQuotePriceDataQuery = { __typename?: 'Query', quote: { __typename?: 'quote', evo_comission_rub: number | null, evo_comission_perc: number | null, evo_discount_perc: number | null, evo_discount_supplier_currency: number | null, evo_first_payment_perc: number | null, evo_last_payment_calc: number | null, evo_last_payment_perc: number | null, evo_last_payment_rub: number | null, evo_nds_in_price_supplier_currency: number | null, evo_price_without_nds_supplier_currency: number | null, evo_supplier_currency_price: number | null, evo_transactioncurrencyid: string | null, evo_equip_price: number | null } | null };
|
||||
export type GetQuotePriceDataQuery = { __typename?: 'Query', quote: { __typename?: 'quote', evo_comission_rub: number | null, evo_comission_perc: number | null, evo_discount_perc: number | null, evo_discount_supplier_currency: number | null, evo_first_payment_perc: number | null, evo_first_payment_rub: number | null, evo_last_payment_calc: number | null, evo_last_payment_perc: number | null, evo_last_payment_rub: number | null, evo_nds_in_price_supplier_currency: number | null, evo_price_without_nds_supplier_currency: number | null, evo_supplier_currency_price: number | null, evo_transactioncurrencyid: string | null, evo_equip_price: number | null } | null };
|
||||
|
||||
export type GetQuoteSubsidyDataQueryVariables = Exact<{
|
||||
quoteId: Scalars['Uuid'];
|
||||
@ -601,7 +601,7 @@ export type GetQuoteAgentsDataQueryVariables = Exact<{
|
||||
}>;
|
||||
|
||||
|
||||
export type GetQuoteAgentsDataQuery = { __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 GetQuoteAgentsDataQuery = { __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, evo_supplier_financing: boolean | null } | null };
|
||||
|
||||
export const CoreAddProductTypesFieldsFragmentDoc = {"kind":"Document","definitions":[{"kind":"FragmentDefinition","name":{"kind":"Name","value":"CoreAddProductTypesFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"evo_addproduct_type"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"evo_graph_price"}},{"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"}}]}}]} as unknown as DocumentNode<CoreAddProductTypesFieldsFragment, unknown>;
|
||||
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<GetTransactionCurrenciesQuery, GetTransactionCurrenciesQueryVariables>;
|
||||
@ -613,14 +613,14 @@ export const GetOpportunityDocument = {"kind":"Document","definitions":[{"kind":
|
||||
export const GetOpportunitiesDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetOpportunities"},"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","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<GetOpportunitiesQuery, GetOpportunitiesQueryVariables>;
|
||||
export const GetQuotesDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetQuotes"},"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"}},{"kind":"Field","name":{"kind":"Name","value":"evo_recalc_limit"}},{"kind":"Field","name":{"kind":"Name","value":"evo_statuscodeidData"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"evo_id"}}]}},{"kind":"Field","name":{"kind":"Name","value":"evo_purchases_participation"}}]}}]}}]} as unknown as DocumentNode<GetQuotesQuery, GetQuotesQueryVariables>;
|
||||
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"}},{"kind":"Field","name":{"kind":"Name","value":"evo_one_year_insurance"}},{"kind":"Field","name":{"kind":"Name","value":"evo_min_change_price"}},{"kind":"Field","name":{"kind":"Name","value":"evo_max_price_change"}},{"kind":"Field","name":{"kind":"Name","value":"evo_discount_supplier_currency"}},{"kind":"Field","name":{"kind":"Name","value":"evo_equip_price"}},{"kind":"Field","name":{"kind":"Name","value":"evo_program_import_subsidy_sum"}},{"kind":"Field","name":{"kind":"Name","value":"evo_nds_in_price_supplier_currency"}},{"kind":"Field","name":{"kind":"Name","value":"evo_supplier_currency_price"}},{"kind":"Field","name":{"kind":"Name","value":"evo_approved_first_payment"}},{"kind":"Field","name":{"kind":"Name","value":"evo_recalc_limit"}},{"kind":"Field","name":{"kind":"Name","value":"evo_max_mass"}},{"kind":"Field","name":{"kind":"Name","value":"evo_seats"}},{"kind":"Field","name":{"kind":"Name","value":"evo_year"}},{"kind":"Field","name":{"kind":"Name","value":"evo_last_payment_perc"}},{"kind":"Field","name":{"kind":"Name","value":"evo_maximum_percentage_av"}}]}}]}}]} as unknown as DocumentNode<GetQuoteQuery, GetQuoteQueryVariables>;
|
||||
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<GetTarifsQuery, GetTarifsQueryVariables>;
|
||||
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"}},{"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_pl_use_type"}}]}}]}}]} as unknown as DocumentNode<GetTarifsQuery, GetTarifsQueryVariables>;
|
||||
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"}},{"kind":"Field","name":{"kind":"Name","value":"evo_min_irr"}},{"kind":"Field","name":{"kind":"Name","value":"evo_cut_irr_with_bonus_coefficient"}},{"kind":"Field","name":{"kind":"Name","value":"evo_max_irr"}},{"kind":"Field","name":{"kind":"Name","value":"evo_rates"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"evo_datefrom"}},{"kind":"Field","name":{"kind":"Name","value":"evo_rateid"}}]}},{"kind":"Field","name":{"kind":"Name","value":"evo_irr_plan"}},{"kind":"Field","name":{"kind":"Name","value":"evo_margin_min"}}]}}]}}]} as unknown as DocumentNode<GetTarifQuery, GetTarifQueryVariables>;
|
||||
export const GetRatesDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetRates"},"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_rates"},"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_rateid"}},{"kind":"Field","name":{"kind":"Name","value":"evo_id"}},{"kind":"Field","name":{"kind":"Name","value":"evo_tarifs"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"evo_tarifid"}}]}}]}}]}}]} as unknown as DocumentNode<GetRatesQuery, GetRatesQueryVariables>;
|
||||
export const GetRateDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetRate"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"rateId"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"Uuid"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"evo_rate"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"evo_rateid"},"value":{"kind":"Variable","name":{"kind":"Name","value":"rateId"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"evo_base_rate"}},{"kind":"Field","name":{"kind":"Name","value":"evo_credit_period"}},{"kind":"Field","name":{"kind":"Name","value":"evo_id"}}]}}]}}]} as unknown as DocumentNode<GetRateQuery, GetRateQueryVariables>;
|
||||
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<GetProductsQuery, GetProductsQueryVariables>;
|
||||
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"}}]}},{"kind":"Field","name":{"kind":"Name","value":"evo_sale_without_nds"}},{"kind":"Field","name":{"kind":"Name","value":"evo_cut_proportion_bonus_director"}},{"kind":"Field","name":{"kind":"Name","value":"evo_cut_irr_with_bonus"}},{"kind":"Field","name":{"kind":"Name","value":"evo_sale_without_nds"}},{"kind":"Field","name":{"kind":"Name","value":"evo_id"}}]}}]}}]} as unknown as DocumentNode<GetProductQuery, GetProductQueryVariables>;
|
||||
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"}}]}},{"kind":"Field","name":{"kind":"Name","value":"evo_sale_without_nds"}},{"kind":"Field","name":{"kind":"Name","value":"evo_cut_proportion_bonus_director"}},{"kind":"Field","name":{"kind":"Name","value":"evo_cut_irr_with_bonus"}},{"kind":"Field","name":{"kind":"Name","value":"evo_sale_without_nds"}},{"kind":"Field","name":{"kind":"Name","value":"evo_id"}},{"kind":"Field","name":{"kind":"Name","value":"evo_supplier_financing_accept"}},{"kind":"Field","name":{"kind":"Name","value":"accounts"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"accountid"}}]}}]}}]}}]} as unknown as DocumentNode<GetProductQuery, GetProductQueryVariables>;
|
||||
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<GetSubsidiesQuery, GetSubsidiesQueryVariables>;
|
||||
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"}},{"kind":"Field","name":{"kind":"Name","value":"evo_get_subsidy_payment"}}]}}]}}]} as unknown as DocumentNode<GetSubsidyQuery, GetSubsidyQueryVariables>;
|
||||
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"}},{"kind":"Field","name":{"kind":"Name","value":"evo_get_subsidy_payment"}},{"kind":"Field","name":{"kind":"Name","value":"evo_delivery_time"}}]}}]}}]} as unknown as DocumentNode<GetSubsidyQuery, GetSubsidyQueryVariables>;
|
||||
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<GetImportProgramQuery, GetImportProgramQueryVariables>;
|
||||
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"}},{"kind":"Field","name":{"kind":"Name","value":"evo_fias_id"}},{"kind":"Field","name":{"kind":"Name","value":"evo_businessunit_evolution"}}]}}]}}]} as unknown as DocumentNode<GetRegionsQuery, GetRegionsQueryVariables>;
|
||||
export const GetRegionDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetRegion"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"regionId"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"Uuid"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"evo_region"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"evo_regionid"},"value":{"kind":"Variable","name":{"kind":"Name","value":"regionId"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"evo_oktmo"}},{"kind":"Field","name":{"kind":"Name","value":"accounts"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"accountid"}}]}}]}}]}}]} as unknown as DocumentNode<GetRegionQuery, GetRegionQueryVariables>;
|
||||
@ -630,15 +630,15 @@ export const GetGpsModelsDocument = {"kind":"Document","definitions":[{"kind":"O
|
||||
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<GetLeaseObjectTypesQuery, GetLeaseObjectTypesQueryVariables>;
|
||||
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","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"}},{"kind":"Field","name":{"kind":"Name","value":"evo_id"}},{"kind":"Field","name":{"kind":"Name","value":"evo_category"}},{"kind":"Field","name":{"kind":"Name","value":"evo_vehicle_type_tax"}},{"kind":"Field","name":{"kind":"Name","value":"evo_category_tr"}},{"kind":"Field","name":{"kind":"Name","value":"evo_expluatation_period1"}},{"kind":"Field","name":{"kind":"Name","value":"evo_expluatation_period2"}},{"kind":"Field","name":{"kind":"Name","value":"evo_depreciation_rate1"}},{"kind":"Field","name":{"kind":"Name","value":"evo_depreciation_rate2"}}]}}]}}]} as unknown as DocumentNode<GetLeaseObjectTypeQuery, GetLeaseObjectTypeQueryVariables>;
|
||||
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<GetBrandsQuery, GetBrandsQueryVariables>;
|
||||
export const GetBrandDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetBrand"},"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_brand"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"evo_brandid"},"value":{"kind":"Variable","name":{"kind":"Name","value":"brandId"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"evo_id"}},{"kind":"Field","name":{"kind":"Name","value":"evo_importer_reward_perc"}},{"kind":"Field","name":{"kind":"Name","value":"evo_importer_reward_rub"}}]}}]}}]} as unknown as DocumentNode<GetBrandQuery, GetBrandQueryVariables>;
|
||||
export const GetBrandDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetBrand"},"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_brand"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"evo_brandid"},"value":{"kind":"Variable","name":{"kind":"Name","value":"brandId"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"evo_id"}},{"kind":"Field","name":{"kind":"Name","value":"evo_importer_reward_perc"}},{"kind":"Field","name":{"kind":"Name","value":"evo_importer_reward_rub"}},{"kind":"Field","name":{"kind":"Name","value":"evo_maximum_percentage_av"}}]}}]}}]} as unknown as DocumentNode<GetBrandQuery, GetBrandQueryVariables>;
|
||||
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<GetModelsQuery, GetModelsQueryVariables>;
|
||||
export const GetModelDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetModel"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"modelId"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"Uuid"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"evo_model"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"evo_modelid"},"value":{"kind":"Variable","name":{"kind":"Name","value":"modelId"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"evo_impairment_groupidData"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"evo_name"}}]}},{"kind":"Field","name":{"kind":"Name","value":"evo_importer_reward_perc"}},{"kind":"Field","name":{"kind":"Name","value":"evo_importer_reward_rub"}}]}}]}}]} as unknown as DocumentNode<GetModelQuery, GetModelQueryVariables>;
|
||||
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":"NonNullType","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"}},{"kind":"Field","name":{"kind":"Name","value":"evo_start_production_year"}}]}}]}}]} as unknown as DocumentNode<GetConfigurationsQuery, GetConfigurationsQueryVariables>;
|
||||
export const GetConfigurationDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetConfiguration"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"configurationId"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"Uuid"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"evo_equipment"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"evo_equipmentid"},"value":{"kind":"Variable","name":{"kind":"Name","value":"configurationId"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"evo_impairment_groupidData"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"evo_name"}}]}}]}}]}}]} as unknown as DocumentNode<GetConfigurationQuery, GetConfigurationQueryVariables>;
|
||||
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<GetDealersQuery, GetDealersQueryVariables>;
|
||||
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"}},{"kind":"Field","name":{"kind":"Name","value":"evo_supplier_financing_accept"}}]}}]}}]} as unknown as DocumentNode<GetDealersQuery, GetDealersQueryVariables>;
|
||||
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<GetDealerQuery, GetDealerQueryVariables>;
|
||||
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<GetDealerPersonsQuery, GetDealerPersonsQueryVariables>;
|
||||
export const GetDealerPersonDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetDealerPerson"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"dealerPersonId"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"Uuid"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"account"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"accountid"},"value":{"kind":"Variable","name":{"kind":"Name","value":"dealerPersonId"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"evo_supplier_type"}}]}}]}}]} as unknown as DocumentNode<GetDealerPersonQuery, GetDealerPersonQueryVariables>;
|
||||
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"}},{"kind":"Field","name":{"kind":"Name","value":"evo_supplier_financing_accept"}}]}}]}}]} as unknown as DocumentNode<GetDealerPersonsQuery, GetDealerPersonsQueryVariables>;
|
||||
export const GetDealerPersonDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetDealerPerson"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"dealerPersonId"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"Uuid"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"account"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"accountid"},"value":{"kind":"Variable","name":{"kind":"Name","value":"dealerPersonId"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"evo_supplier_type"}},{"kind":"Field","name":{"kind":"Name","value":"evo_supplier_financing_accept"}}]}}]}}]} as unknown as DocumentNode<GetDealerPersonQuery, GetDealerPersonQueryVariables>;
|
||||
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<GetAgentQuery, GetAgentQueryVariables>;
|
||||
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<GetRewardConditionsQuery, GetRewardConditionsQueryVariables>;
|
||||
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"}},{"kind":"Field","name":{"kind":"Name","value":"evo_leasingobject_price"}}]}},{"kind":"Field","name":{"kind":"Name","value":"evo_calc_reward_rules"}}]}}]}}]} as unknown as DocumentNode<GetRewardConditionQuery, GetRewardConditionQueryVariables>;
|
||||
@ -652,7 +652,7 @@ export const GetTechnicalCardsDocument = {"kind":"Document","definitions":[{"kin
|
||||
export const GetFuelCardsDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetFuelCards"},"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":"100000005"}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"CoreAddProductTypesFields"}},{"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_leasingobject_types"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"evo_leasingobject_typeid"}}]}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"CoreAddProductTypesFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"evo_addproduct_type"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"evo_graph_price"}},{"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"}}]}}]} as unknown as DocumentNode<GetFuelCardsQuery, GetFuelCardsQueryVariables>;
|
||||
export const GetTelematicTypesDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetTelematicTypes"},"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":"100000004"}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"CoreAddProductTypesFields"}},{"kind":"Field","name":{"kind":"Name","value":"evo_controls_program"}},{"kind":"Field","name":{"kind":"Name","value":"evo_visible_calc"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"CoreAddProductTypesFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"evo_addproduct_type"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"evo_graph_price"}},{"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"}}]}}]} as unknown as DocumentNode<GetTelematicTypesQuery, GetTelematicTypesQueryVariables>;
|
||||
export const GetTrackerTypesDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetTrackerTypes"},"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":"100000003"}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"CoreAddProductTypesFields"}},{"kind":"Field","name":{"kind":"Name","value":"evo_controls_program"}},{"kind":"Field","name":{"kind":"Name","value":"evo_visible_calc"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"CoreAddProductTypesFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"evo_addproduct_type"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"evo_graph_price"}},{"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"}}]}}]} as unknown as DocumentNode<GetTrackerTypesQuery, GetTrackerTypesQueryVariables>;
|
||||
export const GetInsNsibTypesDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetInsNSIBTypes"},"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":"100000002"}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"CoreAddProductTypesFields"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"CoreAddProductTypesFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"evo_addproduct_type"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"evo_graph_price"}},{"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"}}]}}]} as unknown as DocumentNode<GetInsNsibTypesQuery, GetInsNsibTypesQueryVariables>;
|
||||
export const GetInsNsibTypesDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetInsNSIBTypes"},"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":"100000002"}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"CoreAddProductTypesFields"}},{"kind":"Field","name":{"kind":"Name","value":"evo_max_period"}},{"kind":"Field","name":{"kind":"Name","value":"evo_min_period"}},{"kind":"Field","name":{"kind":"Name","value":"evo_max_price"}},{"kind":"Field","name":{"kind":"Name","value":"evo_min_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":"FragmentDefinition","name":{"kind":"Name","value":"CoreAddProductTypesFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"evo_addproduct_type"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"evo_graph_price"}},{"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"}}]}}]} as unknown as DocumentNode<GetInsNsibTypesQuery, GetInsNsibTypesQueryVariables>;
|
||||
export const GetLeasingWithoutKaskoTypesDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetLeasingWithoutKaskoTypes"},"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":"FragmentSpread","name":{"kind":"Name","value":"CoreAddProductTypesFields"}},{"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"}}]}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"CoreAddProductTypesFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"evo_addproduct_type"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"evo_graph_price"}},{"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"}}]}}]} as unknown as DocumentNode<GetLeasingWithoutKaskoTypesQuery, GetLeasingWithoutKaskoTypesQueryVariables>;
|
||||
export const GetInsuranceCompanyDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetInsuranceCompany"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"accountId"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"Uuid"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"account"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"accountid"},"value":{"kind":"Variable","name":{"kind":"Name","value":"accountId"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"evo_osago_with_kasko"}}]}}]}}]} as unknown as DocumentNode<GetInsuranceCompanyQuery, GetInsuranceCompanyQueryVariables>;
|
||||
export const GetInsuranceCompaniesDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetInsuranceCompanies"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"accounts"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"evo_account_type"},"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","name":{"kind":"Name","value":"evo_type_ins_policy"}},{"kind":"Field","name":{"kind":"Name","value":"evo_evokasko_access"}},{"kind":"Field","name":{"kind":"Name","value":"evo_inn"}},{"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<GetInsuranceCompaniesQuery, GetInsuranceCompaniesQueryVariables>;
|
||||
@ -660,7 +660,7 @@ export const GetRolesDocument = {"kind":"Document","definitions":[{"kind":"Opera
|
||||
export const GetQuoteAddProductDataDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetQuoteAddProductData"},"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_addproduct_types"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"evo_product_type"}},{"kind":"Field","name":{"kind":"Name","value":"evo_addproduct_typeid"}}]}}]}}]}}]} as unknown as DocumentNode<GetQuoteAddProductDataQuery, GetQuoteAddProductDataQueryVariables>;
|
||||
export const GetQuoteBonusDataDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetQuoteBonusData"},"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_sale_bonus"}}]}}]}}]} as unknown as DocumentNode<GetQuoteBonusDataQuery, GetQuoteBonusDataQueryVariables>;
|
||||
export const GetQuoteConfiguratorDataDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetQuoteConfiguratorData"},"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"}},{"kind":"Field","name":{"kind":"Name","value":"evo_client_typeid"}},{"kind":"Field","name":{"kind":"Name","value":"evo_msfo_irr"}}]}}]}}]} as unknown as DocumentNode<GetQuoteConfiguratorDataQuery, GetQuoteConfiguratorDataQueryVariables>;
|
||||
export const GetQuoteCreateKpDataDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetQuoteCreateKPData"},"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_price_with_discount"}},{"kind":"Field","name":{"kind":"Name","value":"evo_price_without_discount_quote"}},{"kind":"Field","name":{"kind":"Name","value":"evo_cost_increace"}},{"kind":"Field","name":{"kind":"Name","value":"evo_insurance"}},{"kind":"Field","name":{"kind":"Name","value":"evo_registration_quote"}},{"kind":"Field","name":{"kind":"Name","value":"evo_card_quote"}},{"kind":"Field","name":{"kind":"Name","value":"evo_nsib_quote"}},{"kind":"Field","name":{"kind":"Name","value":"evo_redemption_graph"}},{"kind":"Field","name":{"kind":"Name","value":"evo_fingap_quote"}},{"kind":"Field","name":{"kind":"Name","value":"evo_contact_name"}},{"kind":"Field","name":{"kind":"Name","value":"evo_gender"}}]}}]}}]} as unknown as DocumentNode<GetQuoteCreateKpDataQuery, GetQuoteCreateKpDataQueryVariables>;
|
||||
export const GetQuoteCreateKpDataDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetQuoteCreateKPData"},"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_price_with_discount"}},{"kind":"Field","name":{"kind":"Name","value":"evo_price_without_discount_quote"}},{"kind":"Field","name":{"kind":"Name","value":"evo_cost_increace"}},{"kind":"Field","name":{"kind":"Name","value":"evo_insurance"}},{"kind":"Field","name":{"kind":"Name","value":"evo_registration_quote"}},{"kind":"Field","name":{"kind":"Name","value":"evo_card_quote"}},{"kind":"Field","name":{"kind":"Name","value":"evo_nsib_quote"}},{"kind":"Field","name":{"kind":"Name","value":"evo_redemption_graph"}},{"kind":"Field","name":{"kind":"Name","value":"evo_fingap_quote"}},{"kind":"Field","name":{"kind":"Name","value":"evo_contact_name"}},{"kind":"Field","name":{"kind":"Name","value":"evo_gender"}},{"kind":"Field","name":{"kind":"Name","value":"evo_last_payment_redemption"}}]}}]}}]} as unknown as DocumentNode<GetQuoteCreateKpDataQuery, GetQuoteCreateKpDataQueryVariables>;
|
||||
export const GetQuoteFingapDataDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetQuoteFingapData"},"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_product_risks"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"evo_addproduct_typeid"}}]}}]}}]}}]} as unknown as DocumentNode<GetQuoteFingapDataQuery, GetQuoteFingapDataQueryVariables>;
|
||||
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<GetFinGapAddProductTypesQuery, GetFinGapAddProductTypesQueryVariables>;
|
||||
export const GetQuoteGibddDataDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetQuoteGibddData"},"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_db_accept_registration"}},{"kind":"Field","name":{"kind":"Name","value":"evo_object_registration"}},{"kind":"Field","name":{"kind":"Name","value":"evo_pts_type"}},{"kind":"Field","name":{"kind":"Name","value":"evo_vehicle_tax_year"}},{"kind":"Field","name":{"kind":"Name","value":"evo_vehicle_tax_approved"}},{"kind":"Field","name":{"kind":"Name","value":"evo_category_tr"}},{"kind":"Field","name":{"kind":"Name","value":"evo_vehicle_type_tax"}},{"kind":"Field","name":{"kind":"Name","value":"evo_regionid"}},{"kind":"Field","name":{"kind":"Name","value":"evo_townid"}},{"kind":"Field","name":{"kind":"Name","value":"evo_legal_regionid"}},{"kind":"Field","name":{"kind":"Name","value":"evo_legal_townid"}},{"kind":"Field","name":{"kind":"Name","value":"evo_registration_regionid"}},{"kind":"Field","name":{"kind":"Name","value":"evo_req_telematic"}},{"kind":"Field","name":{"kind":"Name","value":"evo_req_telematic_accept"}}]}}]}}]} as unknown as DocumentNode<GetQuoteGibddDataQuery, GetQuoteGibddDataQueryVariables>;
|
||||
@ -671,7 +671,7 @@ export const GetOpportunityUrlDocument = {"kind":"Document","definitions":[{"kin
|
||||
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<GetQuoteUrlQuery, GetQuoteUrlQueryVariables>;
|
||||
export const GetQuoteLeasingObjectDataDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetQuoteLeasingObjectData"},"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_category"}},{"kind":"Field","name":{"kind":"Name","value":"evo_delivery_time"}},{"kind":"Field","name":{"kind":"Name","value":"evo_engine_hours"}},{"kind":"Field","name":{"kind":"Name","value":"evo_engine_type"}},{"kind":"Field","name":{"kind":"Name","value":"evo_engine_volume"}},{"kind":"Field","name":{"kind":"Name","value":"evo_equipmentid"}},{"kind":"Field","name":{"kind":"Name","value":"evo_leasingobject_typeid"}},{"kind":"Field","name":{"kind":"Name","value":"evo_leasingobject_used"}},{"kind":"Field","name":{"kind":"Name","value":"evo_max_mass"}},{"kind":"Field","name":{"kind":"Name","value":"evo_max_speed"}},{"kind":"Field","name":{"kind":"Name","value":"evo_mileage"}},{"kind":"Field","name":{"kind":"Name","value":"evo_modelid"}},{"kind":"Field","name":{"kind":"Name","value":"evo_object_count"}},{"kind":"Field","name":{"kind":"Name","value":"evo_power"}},{"kind":"Field","name":{"kind":"Name","value":"evo_recalc_limit"}},{"kind":"Field","name":{"kind":"Name","value":"evo_seats"}},{"kind":"Field","name":{"kind":"Name","value":"evo_trailer"}},{"kind":"Field","name":{"kind":"Name","value":"evo_use_for"}},{"kind":"Field","name":{"kind":"Name","value":"evo_vin"}},{"kind":"Field","name":{"kind":"Name","value":"evo_year"}}]}}]}}]} as unknown as DocumentNode<GetQuoteLeasingObjectDataQuery, GetQuoteLeasingObjectDataQueryVariables>;
|
||||
export const GetQuotePaymentsDataDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetQuotePaymentsData"},"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<GetQuotePaymentsDataQuery, GetQuotePaymentsDataQueryVariables>;
|
||||
export const GetQuotePriceDataDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetQuotePriceData"},"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_comission_rub"}},{"kind":"Field","name":{"kind":"Name","value":"evo_comission_perc"}},{"kind":"Field","name":{"kind":"Name","value":"evo_discount_perc"}},{"kind":"Field","name":{"kind":"Name","value":"evo_discount_supplier_currency"}},{"kind":"Field","name":{"kind":"Name","value":"evo_first_payment_perc"}},{"kind":"Field","name":{"kind":"Name","value":"evo_last_payment_calc"}},{"kind":"Field","name":{"kind":"Name","value":"evo_last_payment_perc"}},{"kind":"Field","name":{"kind":"Name","value":"evo_last_payment_rub"}},{"kind":"Field","name":{"kind":"Name","value":"evo_nds_in_price_supplier_currency"}},{"kind":"Field","name":{"kind":"Name","value":"evo_price_without_nds_supplier_currency"}},{"kind":"Field","name":{"kind":"Name","value":"evo_supplier_currency_price"}},{"kind":"Field","name":{"kind":"Name","value":"evo_transactioncurrencyid"}},{"kind":"Field","name":{"kind":"Name","value":"evo_equip_price"}}]}}]}}]} as unknown as DocumentNode<GetQuotePriceDataQuery, GetQuotePriceDataQueryVariables>;
|
||||
export const GetQuotePriceDataDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetQuotePriceData"},"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_comission_rub"}},{"kind":"Field","name":{"kind":"Name","value":"evo_comission_perc"}},{"kind":"Field","name":{"kind":"Name","value":"evo_discount_perc"}},{"kind":"Field","name":{"kind":"Name","value":"evo_discount_supplier_currency"}},{"kind":"Field","name":{"kind":"Name","value":"evo_first_payment_perc"}},{"kind":"Field","name":{"kind":"Name","value":"evo_first_payment_rub"}},{"kind":"Field","name":{"kind":"Name","value":"evo_last_payment_calc"}},{"kind":"Field","name":{"kind":"Name","value":"evo_last_payment_perc"}},{"kind":"Field","name":{"kind":"Name","value":"evo_last_payment_rub"}},{"kind":"Field","name":{"kind":"Name","value":"evo_nds_in_price_supplier_currency"}},{"kind":"Field","name":{"kind":"Name","value":"evo_price_without_nds_supplier_currency"}},{"kind":"Field","name":{"kind":"Name","value":"evo_supplier_currency_price"}},{"kind":"Field","name":{"kind":"Name","value":"evo_transactioncurrencyid"}},{"kind":"Field","name":{"kind":"Name","value":"evo_equip_price"}}]}}]}}]} as unknown as DocumentNode<GetQuotePriceDataQuery, GetQuotePriceDataQueryVariables>;
|
||||
export const GetQuoteSubsidyDataDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetQuoteSubsidyData"},"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_subsidyid"}},{"kind":"Field","name":{"kind":"Name","value":"evo_program_import_subsidyid"}}]}}]}}]} as unknown as DocumentNode<GetQuoteSubsidyDataQuery, GetQuoteSubsidyDataQueryVariables>;
|
||||
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<GetRewardRulesQuery, GetRewardRulesQueryVariables>;
|
||||
export const GetQuoteAgentsDataDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetQuoteAgentsData"},"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<GetQuoteAgentsDataQuery, GetQuoteAgentsDataQueryVariables>;
|
||||
export const GetQuoteAgentsDataDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetQuoteAgentsData"},"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"}},{"kind":"Field","name":{"kind":"Name","value":"evo_supplier_financing"}}]}}]}}]} as unknown as DocumentNode<GetQuoteAgentsDataQuery, GetQuoteAgentsDataQueryVariables>;
|
||||
@ -1,4 +1,5 @@
|
||||
import Result from 'ui/elements/Result';
|
||||
/* eslint-disable canonical/filename-match-regex */
|
||||
import { Result } from 'ui/elements';
|
||||
|
||||
export default function NotFound() {
|
||||
return <Result status="404" title="404" subTitle="Тут ничего нет" />;
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
import Result from 'ui/elements/Result';
|
||||
/* eslint-disable canonical/filename-match-regex */
|
||||
import { Result } from 'ui/elements';
|
||||
|
||||
export default function ServerError() {
|
||||
return <Result status="500" title="Ой" subTitle=" Что-то сломалось" />;
|
||||
|
||||
@ -1,2 +1,3 @@
|
||||
export * from './get-kp-data';
|
||||
export * as reactions from './reactions';
|
||||
export * from './validation';
|
||||
|
||||
@ -1,18 +1,27 @@
|
||||
import { createValidationReaction } from '../tools';
|
||||
import type { ProcessContext } from '../types';
|
||||
import { createValidationSchema } from './validation';
|
||||
import { selectRequirementTelematic } from '@/config/default-options';
|
||||
import * as CRMTypes from '@/graphql/crm.types';
|
||||
import { normalizeOptions } from '@/utils/entity';
|
||||
import { debouncedReaction } from '@/utils/mobx';
|
||||
import dayjs from 'dayjs';
|
||||
import utc from 'dayjs/plugin/utc';
|
||||
import { reaction } from 'mobx';
|
||||
import { normalizeOptions } from 'tools';
|
||||
import { reaction, toJS } from 'mobx';
|
||||
|
||||
dayjs.extend(utc);
|
||||
|
||||
export default function reactions({ store, apolloClient }: ProcessContext) {
|
||||
const { $calculation } = store;
|
||||
const { $calculation, $tables } = store;
|
||||
|
||||
reaction(
|
||||
() => $calculation.$values.getValues(['leasingPeriod', 'leaseObjectType']),
|
||||
async ({ leasingPeriod, leaseObjectType }) => {
|
||||
() => $calculation.$values.getValues(['leasingPeriod', 'leaseObjectType', 'maxMass']),
|
||||
async ({ leasingPeriod, leaseObjectType, maxMass }) => {
|
||||
if (maxMass >= 40_000) {
|
||||
$calculation.element('selectTechnicalCard').setOptions([]);
|
||||
|
||||
return;
|
||||
}
|
||||
const currentDate = dayjs().utc(false).format('YYYY-MM-DD');
|
||||
|
||||
const {
|
||||
@ -105,16 +114,171 @@ export default function reactions({ store, apolloClient }: ProcessContext) {
|
||||
);
|
||||
|
||||
reaction(
|
||||
() => $calculation.element('tbxLeasingPeriod').getValue(),
|
||||
(leasingPeriod) => {
|
||||
if (leasingPeriod < 12) {
|
||||
() => {
|
||||
const values = $calculation.$values.getValues(['leasingPeriod', 'leasingWithoutKasko']);
|
||||
const kaskoInsured = toJS($tables.insurance.row('kasko').getValue('insured'));
|
||||
const fingapInsured = toJS($tables.insurance.row('fingap').getValue('insured'));
|
||||
|
||||
return {
|
||||
...values,
|
||||
fingapInsured,
|
||||
kaskoInsured,
|
||||
};
|
||||
},
|
||||
({ leasingPeriod, fingapInsured, kaskoInsured, leasingWithoutKasko }) => {
|
||||
if (
|
||||
leasingPeriod < 12 ||
|
||||
leasingWithoutKasko ||
|
||||
kaskoInsured === 100_000_001 ||
|
||||
(fingapInsured === 100_000_001 && leasingPeriod < 36)
|
||||
) {
|
||||
$calculation.element('selectInsNSIB').resetValue().block();
|
||||
} else {
|
||||
$calculation.element('selectInsNSIB').unblock();
|
||||
}
|
||||
},
|
||||
{
|
||||
delay: 10,
|
||||
fireImmediately: true,
|
||||
}
|
||||
);
|
||||
|
||||
debouncedReaction(
|
||||
() =>
|
||||
$calculation.$values.getValues([
|
||||
'leasingPeriod',
|
||||
'leaseObjectType',
|
||||
'plPriceRub',
|
||||
'discountRub',
|
||||
'addEquipmentPrice',
|
||||
'importProgramSum',
|
||||
'firstPaymentPerc',
|
||||
]),
|
||||
async ({
|
||||
addEquipmentPrice,
|
||||
discountRub,
|
||||
firstPaymentPerc,
|
||||
importProgramSum,
|
||||
leaseObjectType: leaseObjectTypeId,
|
||||
leasingPeriod,
|
||||
plPriceRub,
|
||||
}) => {
|
||||
const currentDate = dayjs().utc(false).format('YYYY-MM-DD');
|
||||
|
||||
const {
|
||||
data: { evo_addproduct_types },
|
||||
} = await apolloClient.query({
|
||||
query: CRMTypes.GetInsNsibTypesDocument,
|
||||
variables: { currentDate },
|
||||
});
|
||||
|
||||
const options = evo_addproduct_types?.filter(
|
||||
(x) =>
|
||||
x &&
|
||||
Boolean(x?.evo_max_period && x.evo_max_period >= leasingPeriod) &&
|
||||
Boolean(x?.evo_min_period && x.evo_min_period <= leasingPeriod) &&
|
||||
Boolean(
|
||||
x?.evo_max_price &&
|
||||
x.evo_max_price >= plPriceRub - discountRub - importProgramSum + addEquipmentPrice
|
||||
) &&
|
||||
Boolean(
|
||||
x?.evo_min_price &&
|
||||
x.evo_min_price <= plPriceRub - discountRub - importProgramSum + addEquipmentPrice
|
||||
) &&
|
||||
x.evo_leasingobject_types?.find(
|
||||
(evo_leasingobject_type) =>
|
||||
evo_leasingobject_type?.evo_leasingobject_typeid === leaseObjectTypeId
|
||||
) &&
|
||||
x.evo_visible_calc &&
|
||||
Boolean(
|
||||
x.evo_min_first_payment_perc && x.evo_min_first_payment_perc <= firstPaymentPerc
|
||||
) &&
|
||||
Boolean(x.evo_max_first_payment_perc && x.evo_max_first_payment_perc >= firstPaymentPerc)
|
||||
);
|
||||
|
||||
$calculation.element('selectInsNSIB').setOptions(normalizeOptions(options));
|
||||
},
|
||||
{
|
||||
delay: 10,
|
||||
wait: 100,
|
||||
}
|
||||
);
|
||||
|
||||
reaction(
|
||||
() => $calculation.$values.getValues(['recalcWithRevision', 'leaseObjectType']),
|
||||
async ({ recalcWithRevision, leaseObjectType: leaseObjectTypeId }) => {
|
||||
if (recalcWithRevision === false) {
|
||||
$calculation
|
||||
.element('selectRequirementTelematic')
|
||||
.setOptions(
|
||||
selectRequirementTelematic.filter((x) =>
|
||||
[100_000_000, 100_000_001, 100_000_002, 100_000_003].includes(x.value)
|
||||
)
|
||||
);
|
||||
|
||||
if (leaseObjectTypeId) {
|
||||
const {
|
||||
data: { evo_leasingobject_type },
|
||||
} = await apolloClient.query({
|
||||
query: CRMTypes.GetLeaseObjectTypeDocument,
|
||||
variables: { leaseObjectTypeId },
|
||||
});
|
||||
|
||||
if (evo_leasingobject_type?.evo_id === '11') {
|
||||
$calculation.element('selectRequirementTelematic').setValue(100_000_000).block();
|
||||
} else {
|
||||
$calculation.element('selectRequirementTelematic').unblock();
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$calculation.element('selectRequirementTelematic').resetOptions();
|
||||
}
|
||||
},
|
||||
{
|
||||
fireImmediately: true,
|
||||
}
|
||||
);
|
||||
|
||||
reaction(
|
||||
() => $calculation.$values.getValues(['requirementTelematic', 'recalcWithRevision']),
|
||||
async ({ requirementTelematic, recalcWithRevision }) => {
|
||||
const currentDate = dayjs().utc(false).format('YYYY-MM-DD');
|
||||
const {
|
||||
data: { evo_addproduct_types: trackerTypes },
|
||||
} = await apolloClient.query({
|
||||
query: CRMTypes.GetTrackerTypesDocument,
|
||||
variables: { currentDate },
|
||||
});
|
||||
|
||||
const {
|
||||
data: { evo_addproduct_types: telematicTypes },
|
||||
} = await apolloClient.query({
|
||||
query: CRMTypes.GetTelematicTypesDocument,
|
||||
variables: { currentDate },
|
||||
});
|
||||
|
||||
let filteredTrackerTypes = trackerTypes?.filter(
|
||||
(x) => requirementTelematic && x?.evo_controls_program?.includes(requirementTelematic)
|
||||
);
|
||||
|
||||
let filteredTelematicTypes = telematicTypes?.filter(
|
||||
(x) => requirementTelematic && x?.evo_controls_program?.includes(requirementTelematic)
|
||||
);
|
||||
|
||||
if (!recalcWithRevision) {
|
||||
filteredTrackerTypes = filteredTrackerTypes?.filter((x) => x?.evo_visible_calc === true);
|
||||
filteredTelematicTypes = filteredTelematicTypes?.filter(
|
||||
(x) => x?.evo_visible_calc === true
|
||||
);
|
||||
}
|
||||
|
||||
$calculation.element('selectTracker').setOptions(normalizeOptions(filteredTrackerTypes));
|
||||
$calculation.element('selectTelematic').setOptions(normalizeOptions(filteredTelematicTypes));
|
||||
},
|
||||
{
|
||||
fireImmediately: true,
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
export const validation = createValidationReaction(createValidationSchema);
|
||||
|
||||
28
apps/web/process/add-product/validation.ts
Normal file
28
apps/web/process/add-product/validation.ts
Normal file
@ -0,0 +1,28 @@
|
||||
import type { ValidationContext } from '../types';
|
||||
import ValuesSchema from '@/config/schema/values';
|
||||
import { z } from 'zod';
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
export function createValidationSchema(context: ValidationContext) {
|
||||
return ValuesSchema.pick({
|
||||
requirementTelematic: true,
|
||||
telematic: true,
|
||||
tracker: true,
|
||||
}).superRefine(async ({ requirementTelematic, telematic, tracker }, ctx) => {
|
||||
if (requirementTelematic !== 100_000_004 && !telematic && !tracker) {
|
||||
ctx.addIssue({
|
||||
code: z.ZodIssueCode.custom,
|
||||
message: 'Не заполнено поле',
|
||||
path: ['selectTracker', 'selectTelematic'],
|
||||
});
|
||||
}
|
||||
|
||||
if (requirementTelematic === 100_000_004 && (telematic || tracker)) {
|
||||
ctx.addIssue({
|
||||
code: z.ZodIssueCode.custom,
|
||||
message: 'Не требуется',
|
||||
path: ['selectTracker', 'selectTelematic'],
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
@ -1,10 +1,11 @@
|
||||
import type { ProcessContext } from '../../types';
|
||||
import helper from '../lib/helper';
|
||||
import * as CRMTypes from '@/graphql/crm.types';
|
||||
import { disposableReaction } from '@/utils/mobx';
|
||||
import dayjs from 'dayjs';
|
||||
import utc from 'dayjs/plugin/utc';
|
||||
import { reaction } from 'mobx';
|
||||
import { makeDisposable } from 'tools';
|
||||
import { round } from 'tools';
|
||||
|
||||
dayjs.extend(utc);
|
||||
|
||||
@ -20,33 +21,30 @@ export default function reactions(context: ProcessContext) {
|
||||
* Если продукта нет или нет коэффициента по условиям, то поле tbxSaleBonus = 0 и закрыто для редактирования
|
||||
*/
|
||||
|
||||
makeDisposable(
|
||||
() =>
|
||||
reaction(
|
||||
() => $calculation.element('selectProduct').getValue(),
|
||||
async (productId) => {
|
||||
if (!productId) {
|
||||
$calculation.element('tbxSaleBonus').resetValue().block();
|
||||
disposableReaction(
|
||||
() => $process.has('LoadKP'),
|
||||
() => $calculation.element('selectProduct').getValue(),
|
||||
async (productId) => {
|
||||
if (!productId) {
|
||||
$calculation.element('tbxSaleBonus').resetValue().block();
|
||||
|
||||
return;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
const coefficient = await getCoefficient(productId);
|
||||
const coefficient = await getCoefficient(productId);
|
||||
|
||||
if (!coefficient?.evo_sot_coefficient) {
|
||||
$calculation.element('tbxSaleBonus').resetValue().block();
|
||||
if (!coefficient?.evo_sot_coefficient) {
|
||||
$calculation.element('tbxSaleBonus').resetValue().block();
|
||||
|
||||
return;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
const maxBonus = (coefficient?.evo_sot_coefficient || 0) * 100;
|
||||
$calculation.element('tbxSaleBonus').setValue(maxBonus).unblock();
|
||||
},
|
||||
{
|
||||
fireImmediately: true,
|
||||
}
|
||||
),
|
||||
() => $process.has('LoadKP')
|
||||
const maxBonus = (coefficient?.evo_sot_coefficient || 0) * 100;
|
||||
$calculation.element('tbxSaleBonus').setValue(maxBonus).unblock();
|
||||
},
|
||||
{
|
||||
fireImmediately: true,
|
||||
}
|
||||
);
|
||||
|
||||
/**
|
||||
@ -86,7 +84,9 @@ export default function reactions(context: ProcessContext) {
|
||||
const coefficient = await getCoefficient(productId);
|
||||
const maxBonus = (coefficient?.evo_sot_coefficient || 0) * 100;
|
||||
|
||||
$calculation.element('tbxBonusCoefficient').setValue(maxBonus ? saleBonus / maxBonus : 0);
|
||||
$calculation
|
||||
.element('tbxBonusCoefficient')
|
||||
.setValue(maxBonus ? round(saleBonus / maxBonus, 4) : 0);
|
||||
} else {
|
||||
$calculation.element('tbxBonusCoefficient').resetValue();
|
||||
}
|
||||
|
||||
@ -1,2 +1,2 @@
|
||||
export { default as common } from './common';
|
||||
export { default as validation } from './validation';
|
||||
export * from './validation';
|
||||
|
||||
@ -1,35 +1,4 @@
|
||||
import { createValidationSchema } from '../validation';
|
||||
import type { Elements } from '@/Components/Calculation/config/map/values';
|
||||
import type { ProcessContext } from '@/process/types';
|
||||
import ValidationHelper from '@/stores/validation/helper';
|
||||
import { reaction } from 'mobx';
|
||||
import { uid } from 'radash';
|
||||
import { createValidationReaction } from '@/process/tools';
|
||||
|
||||
const key = uid(7);
|
||||
|
||||
export default function reactions(context: ProcessContext) {
|
||||
const { store } = context;
|
||||
const { $calculation } = store;
|
||||
const validationSchema = createValidationSchema(context);
|
||||
|
||||
const helper = new ValidationHelper();
|
||||
reaction(
|
||||
() => $calculation.$values.getValues(['product', 'saleBonus']),
|
||||
async (values) => {
|
||||
helper.removeErrors();
|
||||
const validationResult = await validationSchema.safeParseAsync(values);
|
||||
|
||||
if (!validationResult.success) {
|
||||
validationResult.error.errors.forEach(({ path, message }) => {
|
||||
(path as Elements[]).forEach((elementName) => {
|
||||
const removeError = $calculation.element(elementName).setError({ key, message });
|
||||
if (removeError) helper.add(removeError);
|
||||
});
|
||||
});
|
||||
}
|
||||
},
|
||||
{
|
||||
delay: 100,
|
||||
}
|
||||
);
|
||||
}
|
||||
export const validation = createValidationReaction(createValidationSchema);
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
import type { ProcessContext } from '../types';
|
||||
import { toJS } from 'mobx';
|
||||
import notification from 'ui/elements/notification';
|
||||
import { notification } from 'ui/elements';
|
||||
|
||||
const key = 'ACTION_CALCULATE';
|
||||
const errorMessage = 'Ошибка во время расчета графика!';
|
||||
|
||||
@ -3,9 +3,9 @@ import type * as Values from '@/Components/Calculation/config/map/values';
|
||||
import type * as Insurance from '@/Components/Calculation/Form/Insurance/InsuranceTable/types';
|
||||
import type { ProcessContext } from '@/process/types';
|
||||
import ValidationHelper from '@/stores/validation/helper';
|
||||
import { disposableReaction } from '@/utils/mobx';
|
||||
import { reaction } from 'mobx';
|
||||
import { uid } from 'radash';
|
||||
import { makeDisposable } from 'tools';
|
||||
import { shake, uid } from 'radash';
|
||||
import type { BaseOption } from 'ui/elements/types';
|
||||
|
||||
function hasInvalidValueOrOptions(value: unknown, options: Array<BaseOption<unknown>>) {
|
||||
@ -19,36 +19,33 @@ function hasInvalidValueOrOptions(value: unknown, options: Array<BaseOption<unkn
|
||||
export default function reactions({ store }: ProcessContext) {
|
||||
const { $calculation, $tables, $process } = store;
|
||||
|
||||
makeDisposable(
|
||||
() =>
|
||||
reaction(
|
||||
() => {
|
||||
const hasElementsErrors = Object.values($calculation.$validation).some(
|
||||
(validation) => validation.hasErrors
|
||||
);
|
||||
disposableReaction(
|
||||
() => $process.has('Unlimited'),
|
||||
() => {
|
||||
const hasElementsErrors = Object.values($calculation.$validation).some(
|
||||
(validation) => validation.hasErrors
|
||||
);
|
||||
|
||||
const hasPaymentsErrors = $tables.payments.validation.hasErrors;
|
||||
const hasInsuranceErrors = $tables.insurance.validation.hasErrors;
|
||||
const hasFingapErrors = $tables.fingap.validation.hasErrors;
|
||||
const hasPaymentsErrors = $tables.payments.validation.hasErrors;
|
||||
const hasInsuranceErrors = $tables.insurance.validation.hasErrors;
|
||||
const hasFingapErrors = $tables.fingap.validation.hasErrors;
|
||||
|
||||
return hasElementsErrors || hasPaymentsErrors || hasInsuranceErrors || hasFingapErrors;
|
||||
},
|
||||
(hasErrors) => {
|
||||
if (hasErrors) {
|
||||
$calculation.$status.setStatus('btnCalculate', 'Disabled');
|
||||
$calculation.$status.setStatus('btnCreateKP', 'Disabled');
|
||||
$calculation.$status.setStatus('btnCreateKPMini', 'Disabled');
|
||||
} else {
|
||||
$calculation.$status.setStatus('btnCalculate', 'Default');
|
||||
$calculation.$status.setStatus('btnCreateKP', 'Default');
|
||||
$calculation.$status.setStatus('btnCreateKPMini', 'Default');
|
||||
}
|
||||
},
|
||||
{
|
||||
fireImmediately: true,
|
||||
}
|
||||
),
|
||||
() => $process.has('Unlimited')
|
||||
return hasElementsErrors || hasPaymentsErrors || hasInsuranceErrors || hasFingapErrors;
|
||||
},
|
||||
(hasErrors) => {
|
||||
if (hasErrors) {
|
||||
$calculation.$status.setStatus('btnCalculate', 'Disabled');
|
||||
$calculation.$status.setStatus('btnCreateKP', 'Disabled');
|
||||
$calculation.$status.setStatus('btnCreateKPMini', 'Disabled');
|
||||
} else {
|
||||
$calculation.$status.setStatus('btnCalculate', 'Default');
|
||||
$calculation.$status.setStatus('btnCreateKP', 'Default');
|
||||
$calculation.$status.setStatus('btnCreateKPMini', 'Default');
|
||||
}
|
||||
},
|
||||
{
|
||||
fireImmediately: true,
|
||||
}
|
||||
);
|
||||
|
||||
/**
|
||||
@ -95,7 +92,8 @@ export default function reactions({ store }: ProcessContext) {
|
||||
}
|
||||
);
|
||||
|
||||
reaction(
|
||||
disposableReaction(
|
||||
() => $process.has('LoadKP'),
|
||||
() => element.getOptions(),
|
||||
(options) => {
|
||||
const value = element.getValue();
|
||||
@ -109,7 +107,9 @@ export default function reactions({ store }: ProcessContext) {
|
||||
);
|
||||
}
|
||||
|
||||
(Object.keys(types) as Values.Elements[]).forEach((elementName) =>
|
||||
const optionsTypes = shake(types, (type) => type().typeName !== 'Options');
|
||||
|
||||
(Object.keys(optionsTypes) as Values.Elements[]).forEach((elementName) =>
|
||||
validateOptionsElement(elementName)
|
||||
);
|
||||
|
||||
@ -145,7 +145,8 @@ export default function reactions({ store }: ProcessContext) {
|
||||
}
|
||||
);
|
||||
|
||||
reaction(
|
||||
disposableReaction(
|
||||
() => $process.has('LoadKP'),
|
||||
() => row.getOptions('insuranceCompany'),
|
||||
(options) => {
|
||||
const value = row.getValue('insuranceCompany');
|
||||
|
||||
@ -2,11 +2,11 @@ import { radioCalcType, radioGraphType, selectSeasonType } from '@/config/defaul
|
||||
import * as CRMTypes from '@/graphql/crm.types';
|
||||
import { SEASON_TYPES } from '@/process/payments/lib/seasons-constants';
|
||||
import type { ProcessContext } from '@/process/types';
|
||||
import { normalizeOptions } from '@/utils/entity';
|
||||
import dayjs from 'dayjs';
|
||||
import utc from 'dayjs/plugin/utc';
|
||||
import { reaction } from 'mobx';
|
||||
import { diff } from 'radash';
|
||||
import { normalizeOptions } from 'tools';
|
||||
|
||||
dayjs.extend(utc);
|
||||
|
||||
@ -90,6 +90,39 @@ export default function reactions({ store, apolloClient }: ProcessContext) {
|
||||
)?.length
|
||||
);
|
||||
}
|
||||
|
||||
if (dealers) {
|
||||
dealers = dealers
|
||||
.filter(
|
||||
(dealer) =>
|
||||
!evo_baseproduct?.accounts?.length ||
|
||||
evo_baseproduct.accounts.filter((x) => x?.accountid === dealer?.accountid)?.length
|
||||
)
|
||||
.filter((dealer) => {
|
||||
if (evo_baseproduct?.evo_supplier_financing_accept === true) {
|
||||
return dealer?.evo_supplier_financing_accept;
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
if (dealerPersons) {
|
||||
dealerPersons = dealerPersons
|
||||
.filter(
|
||||
(dealerPerson) =>
|
||||
!evo_baseproduct?.accounts?.length ||
|
||||
evo_baseproduct.accounts.filter((x) => x?.accountid === dealerPerson?.accountid)
|
||||
?.length
|
||||
)
|
||||
.filter((dealerPerson) => {
|
||||
if (evo_baseproduct?.evo_supplier_financing_accept) {
|
||||
return dealerPerson?.evo_supplier_financing_accept;
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
if (subsidyId) {
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
export { default as filters } from './filters';
|
||||
export { default as unlimited } from './unlimited';
|
||||
export { default as validation } from './validation';
|
||||
export * from './validation';
|
||||
export { default as values } from './values';
|
||||
|
||||
@ -1,41 +1,38 @@
|
||||
import * as CRMTypes from '@/graphql/crm.types';
|
||||
import type { ProcessContext } from '@/process/types';
|
||||
import { reaction } from 'mobx';
|
||||
import { makeDisposable, normalizeOptions } from 'tools';
|
||||
import { normalizeOptions } from '@/utils/entity';
|
||||
import { disposableReaction } from '@/utils/mobx';
|
||||
|
||||
export default function unlimitedReactions({ store, apolloClient }: ProcessContext) {
|
||||
const { $calculation, $process } = store;
|
||||
|
||||
makeDisposable(
|
||||
() =>
|
||||
reaction(
|
||||
() => $calculation.element('selectUser').getValue(),
|
||||
async (domainname) => {
|
||||
if (!domainname) {
|
||||
$calculation.element('selectLead').reset();
|
||||
$calculation.element('selectOpportunity').reset();
|
||||
disposableReaction(
|
||||
() => !$process.has('Unlimited'),
|
||||
() => $calculation.element('selectUser').getValue(),
|
||||
async (domainname) => {
|
||||
if (!domainname) {
|
||||
$calculation.element('selectLead').reset();
|
||||
$calculation.element('selectOpportunity').reset();
|
||||
|
||||
return;
|
||||
}
|
||||
const {
|
||||
data: { leads },
|
||||
} = await apolloClient.query({
|
||||
query: CRMTypes.GetLeadsDocument,
|
||||
variables: { domainname },
|
||||
});
|
||||
return;
|
||||
}
|
||||
const {
|
||||
data: { leads },
|
||||
} = await apolloClient.query({
|
||||
query: CRMTypes.GetLeadsDocument,
|
||||
variables: { domainname },
|
||||
});
|
||||
|
||||
$calculation.element('selectLead').setOptions(normalizeOptions(leads));
|
||||
$calculation.element('selectLead').setOptions(normalizeOptions(leads));
|
||||
|
||||
const {
|
||||
data: { opportunities },
|
||||
} = await apolloClient.query({
|
||||
query: CRMTypes.GetOpportunitiesDocument,
|
||||
variables: { domainname },
|
||||
});
|
||||
const {
|
||||
data: { opportunities },
|
||||
} = await apolloClient.query({
|
||||
query: CRMTypes.GetOpportunitiesDocument,
|
||||
variables: { domainname },
|
||||
});
|
||||
|
||||
$calculation.element('selectOpportunity').setOptions(normalizeOptions(opportunities));
|
||||
}
|
||||
),
|
||||
() => !$process.has('Unlimited')
|
||||
$calculation.element('selectOpportunity').setOptions(normalizeOptions(opportunities));
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
@ -1,35 +1,4 @@
|
||||
import { createValidationSchema } from '../validation';
|
||||
import type { Elements } from '@/Components/Calculation/config/map/values';
|
||||
import type { ProcessContext } from '@/process/types';
|
||||
import ValidationHelper from '@/stores/validation/helper';
|
||||
import { reaction } from 'mobx';
|
||||
import { uid } from 'radash';
|
||||
import { createValidationReaction } from '@/process/tools';
|
||||
|
||||
const key = uid(7);
|
||||
|
||||
export default function reactions(context: ProcessContext) {
|
||||
const { store } = context;
|
||||
const { $calculation } = store;
|
||||
const validationSchema = createValidationSchema(context);
|
||||
|
||||
const helper = new ValidationHelper();
|
||||
reaction(
|
||||
() => $calculation.$values.getValues(['parmentsDecreasePercent', 'tarif']),
|
||||
async (values) => {
|
||||
helper.removeErrors();
|
||||
const validationResult = await validationSchema.safeParseAsync(values);
|
||||
|
||||
if (!validationResult.success) {
|
||||
validationResult.error.errors.forEach(({ path, message }) => {
|
||||
(path as Elements[]).forEach((elementName) => {
|
||||
const removeError = $calculation.element(elementName).setError({ key, message });
|
||||
if (removeError) helper.add(removeError);
|
||||
});
|
||||
});
|
||||
}
|
||||
},
|
||||
{
|
||||
delay: 100,
|
||||
}
|
||||
);
|
||||
}
|
||||
export const validation = createValidationReaction(createValidationSchema);
|
||||
|
||||
@ -1,18 +1,19 @@
|
||||
import type { Elements } from '@/Components/Calculation/config/map/values';
|
||||
import * as CRMTypes from '@/graphql/crm.types';
|
||||
import type { ProcessContext } from '@/process/types';
|
||||
import { normalizeOptions } from '@/utils/entity';
|
||||
import { debouncedReaction, disposableReaction } from '@/utils/mobx';
|
||||
import dayjs from 'dayjs';
|
||||
import utc from 'dayjs/plugin/utc';
|
||||
import { reaction } from 'mobx';
|
||||
import { first, sort } from 'radash';
|
||||
import { makeDisposable, normalizeOptions } from 'tools';
|
||||
|
||||
dayjs.extend(utc);
|
||||
|
||||
export default function valuesReactions({ store, apolloClient }: ProcessContext) {
|
||||
const { $calculation, $process } = store;
|
||||
|
||||
reaction(
|
||||
debouncedReaction(
|
||||
() =>
|
||||
$calculation.$values.getValues([
|
||||
'product',
|
||||
@ -21,6 +22,7 @@ export default function valuesReactions({ store, apolloClient }: ProcessContext)
|
||||
'deliveryTime',
|
||||
'firstPaymentPerc',
|
||||
'lastPaymentPerc',
|
||||
'leaseObjectType',
|
||||
]),
|
||||
async ({
|
||||
product,
|
||||
@ -29,6 +31,7 @@ export default function valuesReactions({ store, apolloClient }: ProcessContext)
|
||||
deliveryTime,
|
||||
firstPaymentPerc,
|
||||
lastPaymentPerc,
|
||||
leaseObjectType: leaseObjectTypeId,
|
||||
}) => {
|
||||
const currentDate = dayjs().utc(false).format('YYYY-MM-DD');
|
||||
|
||||
@ -42,77 +45,87 @@ export default function valuesReactions({ store, apolloClient }: ProcessContext)
|
||||
},
|
||||
});
|
||||
|
||||
$calculation.element('selectTarif').setOptions(normalizeOptions(evo_tarifs));
|
||||
$calculation.element('selectTarif').setOptions(normalizeOptions(evo_tarifs)).resetValue();
|
||||
|
||||
if (product && leasingPeriod && deliveryTime && evo_tarifs) {
|
||||
evo_tarifs = evo_tarifs?.filter(
|
||||
(tarif) =>
|
||||
tarif &&
|
||||
tarif.evo_baseproductid === product &&
|
||||
tarif.evo_min_period !== null &&
|
||||
tarif.evo_min_period <= leasingPeriod &&
|
||||
tarif.evo_max_period !== null &&
|
||||
tarif.evo_max_period >= leasingPeriod &&
|
||||
tarif.evo_delivery_time?.includes(deliveryTime) &&
|
||||
tarif.evo_min_first_payment !== null &&
|
||||
tarif.evo_min_first_payment <= firstPaymentPerc &&
|
||||
tarif.evo_max_first_payment !== null &&
|
||||
tarif.evo_max_first_payment >= firstPaymentPerc &&
|
||||
tarif.evo_min_last_payment !== null &&
|
||||
tarif.evo_min_last_payment <= lastPaymentPerc &&
|
||||
tarif.evo_max_last_payment !== null &&
|
||||
tarif.evo_max_last_payment >= lastPaymentPerc
|
||||
);
|
||||
if (evo_tarifs) {
|
||||
evo_tarifs = evo_tarifs
|
||||
?.filter(
|
||||
(tarif) =>
|
||||
tarif &&
|
||||
product &&
|
||||
tarif.evo_baseproductid === product &&
|
||||
tarif.evo_min_period !== null &&
|
||||
tarif.evo_min_period <= leasingPeriod &&
|
||||
tarif.evo_max_period !== null &&
|
||||
tarif.evo_max_period >= leasingPeriod &&
|
||||
tarif.evo_delivery_time?.includes(deliveryTime) &&
|
||||
tarif.evo_min_first_payment !== null &&
|
||||
tarif.evo_min_first_payment <= firstPaymentPerc &&
|
||||
tarif.evo_max_first_payment !== null &&
|
||||
tarif.evo_max_first_payment >= firstPaymentPerc &&
|
||||
tarif.evo_min_last_payment !== null &&
|
||||
tarif.evo_min_last_payment <= lastPaymentPerc &&
|
||||
tarif.evo_max_last_payment !== null &&
|
||||
tarif.evo_max_last_payment >= lastPaymentPerc
|
||||
)
|
||||
.filter(
|
||||
(tarif) =>
|
||||
!tarif?.evo_leasingobject_types?.length ||
|
||||
(leaseObjectTypeId &&
|
||||
tarif.evo_leasingobject_types
|
||||
.map((x) => x?.evo_leasingobject_typeid)
|
||||
.includes(leaseObjectTypeId))
|
||||
)
|
||||
.filter((tarif) => {
|
||||
if (leaseObjectUsed === true) {
|
||||
if (!tarif?.evo_pl_use_type?.length || tarif.evo_pl_use_type.includes(100_000_001)) {
|
||||
return true;
|
||||
}
|
||||
} else if (
|
||||
!tarif?.evo_pl_use_type?.length ||
|
||||
tarif.evo_pl_use_type.includes(100_000_000)
|
||||
) {
|
||||
return true;
|
||||
}
|
||||
|
||||
$calculation.element('selectTarif').setValue(evo_tarifs?.at(0)?.evo_tarifid || null);
|
||||
} else if (leaseObjectUsed === true && evo_tarifs) {
|
||||
evo_tarifs = evo_tarifs?.filter((tarif) => {
|
||||
if (leaseObjectUsed === true) {
|
||||
return tarif?.evo_used;
|
||||
}
|
||||
|
||||
return true;
|
||||
});
|
||||
$calculation.element('selectTarif').setValue(evo_tarifs?.at(0)?.evo_tarifid || null);
|
||||
} else {
|
||||
$calculation.element('selectTarif').resetValue();
|
||||
return false;
|
||||
});
|
||||
}
|
||||
|
||||
$calculation.element('selectTarif').setValue(evo_tarifs?.at(0)?.evo_tarifid || null);
|
||||
},
|
||||
{
|
||||
delay: 10,
|
||||
fireImmediately: true,
|
||||
wait: 50,
|
||||
}
|
||||
);
|
||||
|
||||
makeDisposable(
|
||||
() =>
|
||||
reaction(
|
||||
() => $calculation.element('selectTarif').getValue(),
|
||||
async (tarifId) => {
|
||||
if (!tarifId) {
|
||||
$calculation.element('tbxIRR_Perc').resetValue();
|
||||
disposableReaction(
|
||||
() => $process.has('LoadKP'),
|
||||
() => $calculation.element('selectTarif').getValue(),
|
||||
async (tarifId) => {
|
||||
if (!tarifId) {
|
||||
$calculation.element('tbxIRR_Perc').resetValue();
|
||||
|
||||
return;
|
||||
}
|
||||
const {
|
||||
data: { evo_tarif },
|
||||
} = await apolloClient.query({
|
||||
fetchPolicy: 'network-only',
|
||||
query: CRMTypes.GetTarifDocument,
|
||||
variables: {
|
||||
tarifId,
|
||||
},
|
||||
});
|
||||
return;
|
||||
}
|
||||
const {
|
||||
data: { evo_tarif },
|
||||
} = await apolloClient.query({
|
||||
fetchPolicy: 'network-only',
|
||||
query: CRMTypes.GetTarifDocument,
|
||||
variables: {
|
||||
tarifId,
|
||||
},
|
||||
});
|
||||
|
||||
if (evo_tarif?.evo_irr) {
|
||||
$calculation.element('tbxIRR_Perc').setValue(evo_tarif?.evo_irr);
|
||||
} else {
|
||||
$calculation.element('tbxIRR_Perc').resetValue();
|
||||
}
|
||||
}
|
||||
),
|
||||
|
||||
() => $process.has('LoadKP')
|
||||
if (evo_tarif?.evo_irr) {
|
||||
$calculation.element('tbxIRR_Perc').setValue(evo_tarif?.evo_irr);
|
||||
} else {
|
||||
$calculation.element('tbxIRR_Perc').resetValue();
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
reaction(
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
import { updateSelectQuote } from '../lead-opportunity/reactions/common';
|
||||
import type { ProcessContext } from '../types';
|
||||
import { toJS } from 'mobx';
|
||||
import notification from 'ui/elements/notification';
|
||||
import { notification } from 'ui/elements';
|
||||
|
||||
const key = 'ACTION_CREATEKP';
|
||||
const errorMessage = 'Ошибка во время создания КП!';
|
||||
|
||||
@ -19,6 +19,7 @@ const QUERY_GET_CREATEKP_DATA = gql`
|
||||
evo_fingap_quote
|
||||
evo_contact_name
|
||||
evo_gender
|
||||
evo_last_payment_redemption
|
||||
}
|
||||
}
|
||||
`;
|
||||
@ -44,6 +45,8 @@ export async function getKPData({
|
||||
fullPriceWithDiscount:
|
||||
quote?.evo_price_without_discount_quote ?? defaultValues.fullPriceWithDiscount,
|
||||
insurance: quote?.evo_insurance ?? defaultValues.insurance,
|
||||
lastPaymentRedemption:
|
||||
quote?.evo_last_payment_redemption ?? defaultValues.lastPaymentRedemption,
|
||||
priceWithDiscount: quote?.evo_price_with_discount ?? defaultValues.priceWithDiscount,
|
||||
quoteContactGender: quote?.evo_gender ?? defaultValues.quoteContactGender,
|
||||
quoteName: quote?.evo_contact_name ?? defaultValues.quoteName,
|
||||
|
||||
@ -1,18 +1,17 @@
|
||||
import { createValidationReaction } from '../tools';
|
||||
import type { ProcessContext } from '../types';
|
||||
import helper from './lib/helper';
|
||||
import { createValidationSchema } from './validation';
|
||||
import { getTransTax } from '@/api/1c/query';
|
||||
import type { Elements } from '@/Components/Calculation/config/map/values';
|
||||
import { selectObjectCategoryTax } from '@/config/default-options';
|
||||
import { STALE_TIME } from '@/constants/request';
|
||||
import * as CRMTypes from '@/graphql/crm.types';
|
||||
import ValidationHelper from '@/stores/validation/helper';
|
||||
import { normalizeOptions } from '@/utils/entity';
|
||||
import { disposableReaction } from '@/utils/mobx';
|
||||
import type { QueryFunctionContext } from '@tanstack/react-query';
|
||||
import dayjs from 'dayjs';
|
||||
import utc from 'dayjs/plugin/utc';
|
||||
import { reaction } from 'mobx';
|
||||
import { uid } from 'radash';
|
||||
import { makeDisposable, normalizeOptions } from 'tools';
|
||||
|
||||
dayjs.extend(utc);
|
||||
|
||||
@ -20,8 +19,8 @@ export function common({ store, apolloClient, queryClient }: ProcessContext) {
|
||||
const { $calculation, $process } = store;
|
||||
|
||||
reaction(
|
||||
() => $calculation.element('selectLeaseObjectType').getValue(),
|
||||
async (leaseObjectTypeId) => {
|
||||
() => $calculation.$values.getValues(['leaseObjectType', 'supplierFinancing']),
|
||||
async ({ leaseObjectType: leaseObjectTypeId, supplierFinancing }) => {
|
||||
if (!leaseObjectTypeId) {
|
||||
$calculation.element('radioObjectRegistration').resetValue().unblock();
|
||||
|
||||
@ -35,8 +34,9 @@ export function common({ store, apolloClient, queryClient }: ProcessContext) {
|
||||
});
|
||||
|
||||
if (
|
||||
evo_leasingobject_type?.evo_id &&
|
||||
['6', '9', '10', '11'].includes(evo_leasingobject_type.evo_id)
|
||||
supplierFinancing ||
|
||||
(evo_leasingobject_type?.evo_id &&
|
||||
['6', '9', '10', '11'].includes(evo_leasingobject_type.evo_id))
|
||||
) {
|
||||
$calculation.element('radioObjectRegistration').setValue(100_000_000).block();
|
||||
} else {
|
||||
@ -45,41 +45,38 @@ export function common({ store, apolloClient, queryClient }: ProcessContext) {
|
||||
}
|
||||
);
|
||||
|
||||
makeDisposable(
|
||||
disposableReaction(
|
||||
() => $process.has('LoadKP'),
|
||||
() =>
|
||||
reaction(
|
||||
() =>
|
||||
$calculation.$values.getValues([
|
||||
'leaseObjectType',
|
||||
'objectCategoryTax',
|
||||
'objectRegistration',
|
||||
]),
|
||||
async ({ leaseObjectType: leaseObjectTypeId, objectRegistration, objectCategoryTax }) => {
|
||||
if (objectRegistration === 100_000_001) {
|
||||
if (objectCategoryTax && [100_000_006, 100_000_009].includes(objectCategoryTax)) {
|
||||
$calculation.element('selectObjectTypeTax').setValue(100_000_002);
|
||||
} else if (leaseObjectTypeId) {
|
||||
const {
|
||||
data: { evo_leasingobject_type },
|
||||
} = await apolloClient.query({
|
||||
query: CRMTypes.GetLeaseObjectTypeDocument,
|
||||
variables: { leaseObjectTypeId },
|
||||
});
|
||||
$calculation.$values.getValues([
|
||||
'leaseObjectType',
|
||||
'objectCategoryTax',
|
||||
'objectRegistration',
|
||||
]),
|
||||
async ({ leaseObjectType: leaseObjectTypeId, objectRegistration, objectCategoryTax }) => {
|
||||
if (objectRegistration === 100_000_001) {
|
||||
if (objectCategoryTax && [100_000_006, 100_000_009].includes(objectCategoryTax)) {
|
||||
$calculation.element('selectObjectTypeTax').setValue(100_000_002);
|
||||
} else if (leaseObjectTypeId) {
|
||||
const {
|
||||
data: { evo_leasingobject_type },
|
||||
} = await apolloClient.query({
|
||||
query: CRMTypes.GetLeaseObjectTypeDocument,
|
||||
variables: { leaseObjectTypeId },
|
||||
});
|
||||
|
||||
if (evo_leasingobject_type?.evo_vehicle_type_tax) {
|
||||
$calculation
|
||||
.element('selectObjectTypeTax')
|
||||
.setValue(evo_leasingobject_type?.evo_vehicle_type_tax);
|
||||
} else {
|
||||
$calculation.element('selectObjectTypeTax').resetValue();
|
||||
}
|
||||
}
|
||||
if (evo_leasingobject_type?.evo_vehicle_type_tax) {
|
||||
$calculation
|
||||
.element('selectObjectTypeTax')
|
||||
.setValue(evo_leasingobject_type?.evo_vehicle_type_tax);
|
||||
} else {
|
||||
$calculation.element('selectObjectTypeTax').resetValue();
|
||||
}
|
||||
}
|
||||
),
|
||||
() => $process.has('LoadKP')
|
||||
} else {
|
||||
$calculation.element('selectObjectTypeTax').resetValue();
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
reaction(
|
||||
@ -149,82 +146,79 @@ export function common({ store, apolloClient, queryClient }: ProcessContext) {
|
||||
return mapObjectTypeTaxToCategory[objectTypeTax as keyof typeof mapObjectTypeTaxToCategory];
|
||||
}
|
||||
|
||||
makeDisposable(
|
||||
disposableReaction(
|
||||
() => $process.has('LoadKP'),
|
||||
() =>
|
||||
reaction(
|
||||
() =>
|
||||
$calculation.$values.getValues([
|
||||
'objectRegistration',
|
||||
'objectTypeTax',
|
||||
'regionRegistration',
|
||||
'leaseObjectYear',
|
||||
'leaseObjectMotorPower',
|
||||
]),
|
||||
async ({
|
||||
objectRegistration,
|
||||
objectTypeTax,
|
||||
regionRegistration,
|
||||
leaseObjectYear,
|
||||
leaseObjectMotorPower,
|
||||
}) => {
|
||||
if (
|
||||
objectRegistration === null ||
|
||||
objectRegistration !== 100_000_001 ||
|
||||
objectTypeTax === null ||
|
||||
regionRegistration === null ||
|
||||
leaseObjectYear === 0 ||
|
||||
leaseObjectMotorPower === 0
|
||||
) {
|
||||
$calculation.element('tbxVehicleTaxInYear').resetValue();
|
||||
$calculation.$values.getValues([
|
||||
'objectRegistration',
|
||||
'objectTypeTax',
|
||||
'regionRegistration',
|
||||
'leaseObjectYear',
|
||||
'leaseObjectMotorPower',
|
||||
]),
|
||||
async ({
|
||||
objectRegistration,
|
||||
objectTypeTax,
|
||||
regionRegistration,
|
||||
leaseObjectYear,
|
||||
leaseObjectMotorPower,
|
||||
}) => {
|
||||
if (
|
||||
objectRegistration === null ||
|
||||
objectRegistration !== 100_000_001 ||
|
||||
objectTypeTax === null ||
|
||||
regionRegistration === null ||
|
||||
leaseObjectYear === 0 ||
|
||||
leaseObjectMotorPower === 0
|
||||
) {
|
||||
$calculation.element('tbxVehicleTaxInYear').resetValue();
|
||||
|
||||
return;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
const {
|
||||
data: { evo_region },
|
||||
} = await apolloClient.query({
|
||||
query: CRMTypes.GetRegionDocument,
|
||||
variables: {
|
||||
regionId: regionRegistration,
|
||||
const {
|
||||
data: { evo_region },
|
||||
} = await apolloClient.query({
|
||||
query: CRMTypes.GetRegionDocument,
|
||||
variables: {
|
||||
regionId: regionRegistration,
|
||||
},
|
||||
});
|
||||
|
||||
const OKTMO = evo_region?.evo_oktmo;
|
||||
const carCategory = getCarCategory(objectTypeTax);
|
||||
|
||||
if (OKTMO) {
|
||||
const currentDate = dayjs().utc(false).toDate();
|
||||
|
||||
const request = (context: QueryFunctionContext) =>
|
||||
getTransTax(
|
||||
{
|
||||
OKTMO,
|
||||
calcDate: currentDate,
|
||||
carCategory,
|
||||
power: leaseObjectMotorPower,
|
||||
year: leaseObjectYear,
|
||||
},
|
||||
});
|
||||
|
||||
const OKTMO = evo_region?.evo_oktmo;
|
||||
const carCategory = getCarCategory(objectTypeTax);
|
||||
|
||||
if (OKTMO) {
|
||||
const currentDate = dayjs().utc(false).toDate();
|
||||
|
||||
const request = (context: QueryFunctionContext) =>
|
||||
getTransTax(
|
||||
{
|
||||
OKTMO,
|
||||
calcDate: currentDate,
|
||||
carCategory,
|
||||
power: leaseObjectMotorPower,
|
||||
year: leaseObjectYear,
|
||||
},
|
||||
context
|
||||
);
|
||||
const { tax, error } = await queryClient.fetchQuery(
|
||||
['1c', 'trans-tax', carCategory, leaseObjectMotorPower, leaseObjectYear],
|
||||
request,
|
||||
{
|
||||
staleTime: STALE_TIME,
|
||||
}
|
||||
);
|
||||
|
||||
if (!error && tax) {
|
||||
$calculation.element('tbxVehicleTaxInYear').setValue(tax);
|
||||
} else {
|
||||
$calculation.element('tbxVehicleTaxInYear').resetValue();
|
||||
}
|
||||
} else {
|
||||
$calculation.element('tbxVehicleTaxInYear').resetValue();
|
||||
context
|
||||
);
|
||||
const { tax, error } = await queryClient.fetchQuery(
|
||||
['1c', 'trans-tax', carCategory, leaseObjectMotorPower, leaseObjectYear],
|
||||
request,
|
||||
{
|
||||
staleTime: STALE_TIME,
|
||||
}
|
||||
);
|
||||
|
||||
if (!error && tax) {
|
||||
$calculation.element('tbxVehicleTaxInYear').setValue(tax);
|
||||
} else {
|
||||
$calculation.element('tbxVehicleTaxInYear').resetValue();
|
||||
}
|
||||
),
|
||||
() => $process.has('LoadKP')
|
||||
} else {
|
||||
$calculation.element('tbxVehicleTaxInYear').resetValue();
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
// Не дышать на реакцию
|
||||
@ -514,41 +508,4 @@ export function common({ store, apolloClient, queryClient }: ProcessContext) {
|
||||
);
|
||||
}
|
||||
|
||||
const key = uid(7);
|
||||
|
||||
export function validation(context: ProcessContext) {
|
||||
const { store } = context;
|
||||
const { $calculation } = store;
|
||||
const validationSchema = createValidationSchema(context);
|
||||
|
||||
const validationHelper = new ValidationHelper();
|
||||
reaction(
|
||||
() =>
|
||||
$calculation.$values.getValues([
|
||||
'leaseObjectCategory',
|
||||
'maxMass',
|
||||
'leaseObjectType',
|
||||
'typePTS',
|
||||
'objectRegistration',
|
||||
'objectCategoryTax',
|
||||
'insNSIB',
|
||||
'vehicleTaxInYear',
|
||||
]),
|
||||
async (values) => {
|
||||
validationHelper.removeErrors();
|
||||
const validationResult = await validationSchema.safeParseAsync(values);
|
||||
|
||||
if (!validationResult.success) {
|
||||
validationResult.error.errors.forEach(({ path, message }) => {
|
||||
(path as Elements[]).forEach((elementName) => {
|
||||
const removeError = $calculation.element(elementName).setError({ key, message });
|
||||
if (removeError) validationHelper.add(removeError);
|
||||
});
|
||||
});
|
||||
}
|
||||
},
|
||||
{
|
||||
delay: 100,
|
||||
}
|
||||
);
|
||||
}
|
||||
export const validation = createValidationReaction(createValidationSchema);
|
||||
|
||||
@ -1,3 +1,5 @@
|
||||
/* eslint-disable sonarjs/cognitive-complexity */
|
||||
/* eslint-disable complexity */
|
||||
import type { ValidationContext } from '../types';
|
||||
import ValuesSchema from '@/config/schema/values';
|
||||
import { MAX_MASS } from '@/constants/values';
|
||||
@ -11,8 +13,13 @@ export function createValidationSchema({ apolloClient }: ValidationContext) {
|
||||
leaseObjectType: true,
|
||||
maxMass: true,
|
||||
objectCategoryTax: true,
|
||||
objectRegionRegistration: true,
|
||||
objectRegistration: true,
|
||||
regionRegistration: true,
|
||||
registration: true,
|
||||
townRegistration: true,
|
||||
typePTS: true,
|
||||
vehicleTaxInLeasingPeriod: true,
|
||||
vehicleTaxInYear: true,
|
||||
}).superRefine(
|
||||
async (
|
||||
@ -25,6 +32,11 @@ export function createValidationSchema({ apolloClient }: ValidationContext) {
|
||||
objectCategoryTax,
|
||||
insNSIB,
|
||||
vehicleTaxInYear,
|
||||
vehicleTaxInLeasingPeriod,
|
||||
objectRegionRegistration,
|
||||
regionRegistration,
|
||||
townRegistration,
|
||||
registration,
|
||||
},
|
||||
ctx
|
||||
) => {
|
||||
@ -74,21 +86,57 @@ export function createValidationSchema({ apolloClient }: ValidationContext) {
|
||||
}
|
||||
}
|
||||
|
||||
if (objectRegistration === 100_000_001 && !(vehicleTaxInYear > 0)) {
|
||||
ctx.addIssue({
|
||||
code: z.ZodIssueCode.custom,
|
||||
message: 'Значение должно быть больше 0',
|
||||
path: ['tbxVehicleTaxInYear'],
|
||||
});
|
||||
if (objectRegistration === 100_000_001) {
|
||||
if (!(vehicleTaxInYear > 0))
|
||||
ctx.addIssue({
|
||||
code: z.ZodIssueCode.custom,
|
||||
message: 'Значение должно быть больше 0',
|
||||
path: ['tbxVehicleTaxInYear'],
|
||||
});
|
||||
|
||||
if (!(vehicleTaxInLeasingPeriod > 0))
|
||||
ctx.addIssue({
|
||||
code: z.ZodIssueCode.custom,
|
||||
message: 'Значение должно быть больше 0',
|
||||
path: ['tbxVehicleTaxInLeasingPeriod'],
|
||||
});
|
||||
|
||||
if (!objectRegionRegistration)
|
||||
ctx.addIssue({
|
||||
code: z.ZodIssueCode.custom,
|
||||
message: 'Не заполнено поле',
|
||||
path: ['selectObjectRegionRegistration'],
|
||||
});
|
||||
|
||||
if (!typePTS) {
|
||||
ctx.addIssue({
|
||||
code: z.ZodIssueCode.custom,
|
||||
message: 'Не заполнено поле',
|
||||
path: ['radioTypePTS'],
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
if (objectRegistration === 100_000_001 && !typePTS) {
|
||||
if (objectRegistration === 100_000_000 && !townRegistration)
|
||||
ctx.addIssue({
|
||||
code: z.ZodIssueCode.custom,
|
||||
message: 'Не заполнено поле',
|
||||
path: ['radioTypePTS'],
|
||||
path: ['selectTownRegistration'],
|
||||
});
|
||||
|
||||
if (!regionRegistration)
|
||||
ctx.addIssue({
|
||||
code: z.ZodIssueCode.custom,
|
||||
message: 'Не заполнено поле',
|
||||
path: ['selectRegionRegistration'],
|
||||
});
|
||||
|
||||
if (!registration)
|
||||
ctx.addIssue({
|
||||
code: z.ZodIssueCode.custom,
|
||||
message: 'Не заполнено поле',
|
||||
path: ['selectRegistration'],
|
||||
});
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
@ -1,11 +1,11 @@
|
||||
/* eslint-disable canonical/sort-keys */
|
||||
import * as CRMTypes from '@/graphql/crm.types';
|
||||
import { useStore } from '@/stores/hooks';
|
||||
import { normalizeOptions } from '@/utils/entity';
|
||||
import { useApolloClient } from '@apollo/client';
|
||||
import dayjs from 'dayjs';
|
||||
import utc from 'dayjs/plugin/utc';
|
||||
import { useEffect } from 'react';
|
||||
import { normalizeOptions } from 'tools';
|
||||
|
||||
dayjs.extend(utc);
|
||||
|
||||
|
||||
@ -1,8 +1,8 @@
|
||||
import * as CRMTypes from '@/graphql/crm.types';
|
||||
import { useStore } from '@/stores/hooks';
|
||||
import { normalizeOptions } from '@/utils/entity';
|
||||
import { useApolloClient } from '@apollo/client';
|
||||
import { useEffect } from 'react';
|
||||
import { normalizeOptions } from 'tools';
|
||||
|
||||
/**
|
||||
* @param {import('@apollo/client').ApolloClient} apolloClient
|
||||
|
||||
@ -1,12 +1,12 @@
|
||||
/* eslint-disable sonarjs/cognitive-complexity */
|
||||
import { createValidationReaction } from '../tools';
|
||||
import type { ProcessContext } from '../types';
|
||||
import { createValidationSchema } from './validation';
|
||||
import type { Elements } from '@/Components/Calculation/config/map/values';
|
||||
import { selectLeaseObjectUseFor } from '@/config/default-options';
|
||||
import * as CRMTypes from '@/graphql/crm.types';
|
||||
import ValidationHelper from '@/stores/validation/helper';
|
||||
import { comparer, reaction, toJS } from 'mobx';
|
||||
import { uid } from 'radash';
|
||||
import { normalizeOptions } from 'tools';
|
||||
import { normalizeOptions } from '@/utils/entity';
|
||||
import { debouncedReaction } from '@/utils/mobx';
|
||||
import { reaction } from 'mobx';
|
||||
|
||||
export function common({ store, apolloClient }: ProcessContext) {
|
||||
const { $calculation, $tables } = store;
|
||||
@ -113,7 +113,7 @@ export function common({ store, apolloClient }: ProcessContext) {
|
||||
}
|
||||
);
|
||||
|
||||
reaction(
|
||||
debouncedReaction(
|
||||
() => $calculation.$values.getValues(['leasingPeriod', 'leasingWithoutKasko']),
|
||||
async ({ leasingPeriod, leasingWithoutKasko }) => {
|
||||
const {
|
||||
@ -168,11 +168,13 @@ export function common({ store, apolloClient }: ProcessContext) {
|
||||
}
|
||||
},
|
||||
{
|
||||
delay: 1,
|
||||
fireImmediately: true,
|
||||
wait: 100,
|
||||
}
|
||||
);
|
||||
|
||||
reaction(
|
||||
debouncedReaction(
|
||||
() => $calculation.$values.getValues(['leaseObjectCategory', 'leasingWithoutKasko']),
|
||||
async ({ leaseObjectCategory, leasingWithoutKasko }) => {
|
||||
const {
|
||||
@ -220,6 +222,10 @@ export function common({ store, apolloClient }: ProcessContext) {
|
||||
.setOptions(normalizeOptions(defaultOsagoOptions));
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
delay: 1,
|
||||
wait: 100,
|
||||
}
|
||||
);
|
||||
|
||||
@ -265,56 +271,4 @@ export function common({ store, apolloClient }: ProcessContext) {
|
||||
);
|
||||
}
|
||||
|
||||
const key = uid(7);
|
||||
|
||||
export function validation(context: ProcessContext) {
|
||||
const { $calculation, $tables } = context.store;
|
||||
|
||||
const validationSchema = createValidationSchema(context);
|
||||
const helper = new ValidationHelper();
|
||||
|
||||
reaction(
|
||||
() => {
|
||||
const values = $calculation.$values.getValues([
|
||||
'leasingPeriod',
|
||||
'quote',
|
||||
'recalcWithRevision',
|
||||
'leasingWithoutKasko',
|
||||
'insDecentral',
|
||||
]);
|
||||
|
||||
return {
|
||||
insurance: {
|
||||
values: {
|
||||
fingap: toJS($tables.insurance.row('fingap').getValues()),
|
||||
kasko: toJS($tables.insurance.row('kasko').getValues()),
|
||||
osago: toJS($tables.insurance.row('osago').getValues()),
|
||||
},
|
||||
},
|
||||
...values,
|
||||
};
|
||||
},
|
||||
async (values) => {
|
||||
helper.removeErrors();
|
||||
const validationResult = await validationSchema.safeParseAsync(values);
|
||||
|
||||
if (!validationResult.success) {
|
||||
validationResult.error.errors.forEach(({ path, message }) => {
|
||||
(path as Array<Elements & 'insurance'>).forEach((elementName) => {
|
||||
if (elementName === 'insurance') {
|
||||
const removeError = $tables.insurance.setError({ key, message });
|
||||
if (removeError) helper.add(removeError);
|
||||
} else {
|
||||
const removeError = $calculation.element(elementName).setError({ key, message });
|
||||
if (removeError) helper.add(removeError);
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
},
|
||||
{
|
||||
delay: 100,
|
||||
equals: comparer.structural,
|
||||
}
|
||||
);
|
||||
}
|
||||
export const validation = createValidationReaction(createValidationSchema);
|
||||
|
||||
@ -1,8 +1,8 @@
|
||||
import * as CRMTypes from '@/graphql/crm.types';
|
||||
import type { ProcessContext } from '@/process/types';
|
||||
import { normalizeOptions } from '@/utils/entity';
|
||||
import { disposableReaction } from '@/utils/mobx';
|
||||
import { reaction } from 'mobx';
|
||||
import { normalizeOptions } from 'tools/entity';
|
||||
import { makeDisposable } from 'tools/mobx';
|
||||
|
||||
export default function reactions({ store, apolloClient }: ProcessContext) {
|
||||
const { $calculation, $process } = store;
|
||||
@ -14,34 +14,31 @@ export default function reactions({ store, apolloClient }: ProcessContext) {
|
||||
* Иначе ничего не указывается
|
||||
*/
|
||||
|
||||
makeDisposable(
|
||||
() =>
|
||||
reaction(
|
||||
() => $calculation.element('selectLead').getValue(),
|
||||
async (leadid) => {
|
||||
if (!leadid) {
|
||||
$calculation.element('selectOpportunity').resetValue();
|
||||
disposableReaction(
|
||||
() => $process.has('LoadKP'),
|
||||
() => $calculation.element('selectLead').getValue(),
|
||||
async (leadid) => {
|
||||
if (!leadid) {
|
||||
$calculation.element('selectOpportunity').resetValue();
|
||||
|
||||
return;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
const {
|
||||
data: { lead },
|
||||
} = await apolloClient.query({
|
||||
query: CRMTypes.GetLeadDocument,
|
||||
variables: {
|
||||
leadid,
|
||||
},
|
||||
});
|
||||
const {
|
||||
data: { lead },
|
||||
} = await apolloClient.query({
|
||||
query: CRMTypes.GetLeadDocument,
|
||||
variables: {
|
||||
leadid,
|
||||
},
|
||||
});
|
||||
|
||||
if (lead?.evo_opportunityidData?.value) {
|
||||
$calculation.element('selectOpportunity').setValue(lead?.evo_opportunityidData?.value);
|
||||
} else {
|
||||
$calculation.element('selectOpportunity').resetValue();
|
||||
}
|
||||
}
|
||||
),
|
||||
() => $process.has('LoadKP')
|
||||
if (lead?.evo_opportunityidData?.value) {
|
||||
$calculation.element('selectOpportunity').setValue(lead?.evo_opportunityidData?.value);
|
||||
} else {
|
||||
$calculation.element('selectOpportunity').resetValue();
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
reaction(
|
||||
|
||||
@ -1,8 +1,8 @@
|
||||
import * as CRMTypes from '@/graphql/crm.types';
|
||||
import type { ProcessContext } from '@/process/types';
|
||||
import { normalizeOptions } from '@/utils/entity';
|
||||
import { reaction } from 'mobx';
|
||||
import { intersects } from 'radash';
|
||||
import { normalizeOptions } from 'tools';
|
||||
|
||||
export default function reactions({ store, apolloClient }: ProcessContext) {
|
||||
const { $calculation } = store;
|
||||
|
||||
@ -1,2 +1,2 @@
|
||||
export { default as common } from './common';
|
||||
export { default as validation } from './validation';
|
||||
export * from './validation';
|
||||
|
||||
@ -1,65 +1,4 @@
|
||||
import { createValidationReaction } from '../../tools';
|
||||
import { createValidationSchema } from '../validation';
|
||||
import type { Elements } from '@/Components/Calculation/config/map/values';
|
||||
import type { ProcessContext } from '@/process/types';
|
||||
import ValidationHelper from '@/stores/validation/helper';
|
||||
import { autorun, reaction } from 'mobx';
|
||||
import { uid } from 'radash';
|
||||
|
||||
const key = uid(7);
|
||||
|
||||
export default function reactions(context: ProcessContext) {
|
||||
const { $calculation } = context.store;
|
||||
|
||||
/**
|
||||
* Если model содержит данные и по связи Модель-Комплектация в CRM у данной модели есть связанные активные записи Комплектаций,
|
||||
* то configuration становится обязательным для заполнения, иначе configuration не обязателен для заполнения
|
||||
*/
|
||||
autorun(
|
||||
() => {
|
||||
const selectConfiguration = $calculation.element('selectConfiguration');
|
||||
if (selectConfiguration.getOptions()?.length > 0 && !selectConfiguration.getValue()) {
|
||||
selectConfiguration.setError({
|
||||
key,
|
||||
message: 'Не заполнено поле',
|
||||
});
|
||||
} else {
|
||||
selectConfiguration.removeError({ key });
|
||||
}
|
||||
},
|
||||
{
|
||||
delay: 10,
|
||||
}
|
||||
);
|
||||
|
||||
const validationSchema = createValidationSchema(context);
|
||||
const helper = new ValidationHelper();
|
||||
|
||||
reaction(
|
||||
() =>
|
||||
$calculation.$values.getValues([
|
||||
'leaseObjectType',
|
||||
'engineVolume',
|
||||
'engineType',
|
||||
'leaseObjectMotorPower',
|
||||
'countSeats',
|
||||
'maxMass',
|
||||
'leaseObjectCategory',
|
||||
]),
|
||||
async (values) => {
|
||||
helper.removeErrors();
|
||||
const validationResult = await validationSchema.safeParseAsync(values);
|
||||
|
||||
if (!validationResult.success) {
|
||||
validationResult.error.errors.forEach(({ path, message }) => {
|
||||
(path as Elements[]).forEach((elementName) => {
|
||||
const removeError = $calculation.element(elementName).setError({ key, message });
|
||||
if (removeError) helper.add(removeError);
|
||||
});
|
||||
});
|
||||
}
|
||||
},
|
||||
{
|
||||
delay: 100,
|
||||
}
|
||||
);
|
||||
}
|
||||
export const validation = createValidationReaction(createValidationSchema);
|
||||
|
||||
@ -2,12 +2,12 @@
|
||||
|
||||
import * as CRMTypes from '@/graphql/crm.types';
|
||||
import type { ProcessContext } from '@/process/types';
|
||||
import { normalizeOptions } from '@/utils/entity';
|
||||
import dayjs from 'dayjs';
|
||||
import utc from 'dayjs/plugin/utc';
|
||||
import { reaction } from 'mobx';
|
||||
import { uid } from 'radash';
|
||||
import { normalizeOptions } from 'tools';
|
||||
import notification from 'ui/elements/notification';
|
||||
import { notification } from 'ui/elements';
|
||||
|
||||
dayjs.extend(utc);
|
||||
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
import type { ProcessContext } from '@/process/types';
|
||||
import { reaction } from 'mobx';
|
||||
import { omit } from 'radash';
|
||||
import message from 'ui/elements/message';
|
||||
import { message } from 'ui/elements';
|
||||
|
||||
const key = 'KP_LOADING_INFO';
|
||||
|
||||
@ -39,6 +39,9 @@ export function common({ store, trpcClient }: ProcessContext) {
|
||||
'opportunityUrl',
|
||||
'quoteUrl',
|
||||
'recalcWithRevision',
|
||||
'plPriceRub',
|
||||
'discountRub',
|
||||
'user',
|
||||
])
|
||||
);
|
||||
|
||||
|
||||
@ -5,10 +5,10 @@ import { selectHighSeasonStart } from '@/config/default-options';
|
||||
import { MIN_PAYMENT } from '@/constants/values';
|
||||
import type { ProcessContext } from '@/process/types';
|
||||
import type { Row } from '@/stores/tables/payments/types';
|
||||
import { disposableReaction } from '@/utils/mobx';
|
||||
import { comparer, reaction, toJS } from 'mobx';
|
||||
import { shift } from 'radash';
|
||||
import { difference } from 'tools/array';
|
||||
import { makeDisposable } from 'tools/mobx';
|
||||
|
||||
const {
|
||||
generateSeasonPaymentsRows,
|
||||
@ -245,74 +245,68 @@ export default function reactions({ store }: ProcessContext) {
|
||||
// }
|
||||
// );
|
||||
|
||||
makeDisposable(
|
||||
() =>
|
||||
reaction(
|
||||
() => $calculation.$values.getValues(['leasingPeriod', 'seasonType']),
|
||||
({ seasonType, leasingPeriod }) => {
|
||||
const middlePayments: Row[] = degressionTools.generateDegressionRows({
|
||||
leasingPeriod,
|
||||
seasonType,
|
||||
});
|
||||
disposableReaction(
|
||||
() => $calculation.element('radioGraphType').getValue() !== 100_000_001,
|
||||
() => $calculation.$values.getValues(['leasingPeriod', 'seasonType']),
|
||||
({ seasonType, leasingPeriod }) => {
|
||||
const middlePayments: Row[] = degressionTools.generateDegressionRows({
|
||||
leasingPeriod,
|
||||
seasonType,
|
||||
});
|
||||
|
||||
const firstPaymentPerc = $calculation.element('tbxFirstPaymentPerc').getValue();
|
||||
const lastPaymentPerc = $calculation.element('tbxLastPaymentPerc').getValue();
|
||||
const firstPaymentPerc = $calculation.element('tbxFirstPaymentPerc').getValue();
|
||||
const lastPaymentPerc = $calculation.element('tbxLastPaymentPerc').getValue();
|
||||
|
||||
const rows: Row[] = [
|
||||
{
|
||||
status: 'Disabled',
|
||||
value: firstPaymentPerc,
|
||||
},
|
||||
...middlePayments,
|
||||
{
|
||||
status: 'Disabled',
|
||||
value: lastPaymentPerc,
|
||||
},
|
||||
];
|
||||
const rows: Row[] = [
|
||||
{
|
||||
status: 'Disabled',
|
||||
value: firstPaymentPerc,
|
||||
},
|
||||
...middlePayments,
|
||||
{
|
||||
status: 'Disabled',
|
||||
value: lastPaymentPerc,
|
||||
},
|
||||
];
|
||||
|
||||
if (!$process.has('LoadKP')) {
|
||||
$tables.payments.setValues(rows.map((row) => row.value));
|
||||
}
|
||||
if (!$process.has('LoadKP')) {
|
||||
$tables.payments.setValues(rows.map((row) => row.value));
|
||||
}
|
||||
|
||||
$tables.payments.setStatuses(rows.map((row) => row.status));
|
||||
}
|
||||
),
|
||||
() => $calculation.element('radioGraphType').getValue() !== 100_000_001
|
||||
$tables.payments.setStatuses(rows.map((row) => row.status));
|
||||
}
|
||||
);
|
||||
|
||||
makeDisposable(
|
||||
() =>
|
||||
reaction(
|
||||
() => toJS($tables.payments.values),
|
||||
(nextPayments, prevPayments) => {
|
||||
const graphType = $calculation.element('radioGraphType').getValue();
|
||||
const degressionType = $calculation.element('selectSeasonType').getValue();
|
||||
disposableReaction(
|
||||
() => $process.has('LoadKP'),
|
||||
() => toJS($tables.payments.values),
|
||||
(nextPayments, prevPayments) => {
|
||||
const graphType = $calculation.element('radioGraphType').getValue();
|
||||
const degressionType = $calculation.element('selectSeasonType').getValue();
|
||||
|
||||
if (graphType === 100_000_001 && degressionType === 100_000_007) {
|
||||
const changes = difference(nextPayments, prevPayments);
|
||||
if (graphType === 100_000_001 && degressionType === 100_000_007) {
|
||||
const changes = difference(nextPayments, prevPayments);
|
||||
|
||||
if (!changes?.length || changes.length > 1) return;
|
||||
if (!changes?.length || changes.length > 1) return;
|
||||
|
||||
const [changeIndex] = changes;
|
||||
const value = nextPayments[changeIndex];
|
||||
const payments = nextPayments.slice(1, -1).map((payment, i) => {
|
||||
if (i <= changeIndex - 2) return payment;
|
||||
const [changeIndex] = changes;
|
||||
const value = nextPayments[changeIndex];
|
||||
const payments = nextPayments.slice(1, -1).map((payment, i) => {
|
||||
if (i <= changeIndex - 2) return payment;
|
||||
|
||||
return value;
|
||||
});
|
||||
return value;
|
||||
});
|
||||
|
||||
const firstPaymentPerc = $calculation.element('tbxFirstPaymentPerc').getValue();
|
||||
const lastPaymentPerc = $calculation.element('tbxLastPaymentPerc').getValue();
|
||||
const firstPaymentPerc = $calculation.element('tbxFirstPaymentPerc').getValue();
|
||||
const lastPaymentPerc = $calculation.element('tbxLastPaymentPerc').getValue();
|
||||
|
||||
$tables.payments.setValues([firstPaymentPerc, ...payments, lastPaymentPerc]);
|
||||
}
|
||||
},
|
||||
{
|
||||
delay: 50,
|
||||
equals: comparer.structural,
|
||||
}
|
||||
),
|
||||
() => $process.has('LoadKP')
|
||||
$tables.payments.setValues([firstPaymentPerc, ...payments, lastPaymentPerc]);
|
||||
}
|
||||
},
|
||||
{
|
||||
delay: 50,
|
||||
equals: comparer.structural,
|
||||
}
|
||||
);
|
||||
|
||||
/**
|
||||
@ -408,72 +402,66 @@ export default function reactions({ store }: ProcessContext) {
|
||||
}
|
||||
);
|
||||
|
||||
makeDisposable(
|
||||
() =>
|
||||
reaction(
|
||||
() => {
|
||||
const payments = toJS($tables.payments.values);
|
||||
disposableReaction(
|
||||
() => $process.has('LoadKP'),
|
||||
() => {
|
||||
const payments = toJS($tables.payments.values);
|
||||
|
||||
return payments.slice(1, SEASONS_PERIOD_NUMBER + 1);
|
||||
},
|
||||
(nextSeasons, prevSeasons) => {
|
||||
const graphType = $calculation.element('radioGraphType').getValue();
|
||||
if (graphType !== 100_000_003) return;
|
||||
return payments.slice(1, SEASONS_PERIOD_NUMBER + 1);
|
||||
},
|
||||
(nextSeasons, prevSeasons) => {
|
||||
const graphType = $calculation.element('radioGraphType').getValue();
|
||||
if (graphType !== 100_000_003) return;
|
||||
|
||||
const seasonType = $calculation.element('selectSeasonType').getValue();
|
||||
const highSeasonStartOption = $calculation.element('selectHighSeasonStart').getOption();
|
||||
if (!seasonType || !highSeasonStartOption) return;
|
||||
const seasonType = $calculation.element('selectSeasonType').getValue();
|
||||
const highSeasonStartOption = $calculation.element('selectHighSeasonStart').getOption();
|
||||
if (!seasonType || !highSeasonStartOption) return;
|
||||
|
||||
const shiftNumber = Number.parseInt(highSeasonStartOption.label, 10) - 2;
|
||||
const unshiftedNextSeasons = shift(nextSeasons, -shiftNumber);
|
||||
const unshiftedPrevSeasons = shift(prevSeasons, -shiftNumber);
|
||||
const shiftNumber = Number.parseInt(highSeasonStartOption.label, 10) - 2;
|
||||
const unshiftedNextSeasons = shift(nextSeasons, -shiftNumber);
|
||||
const unshiftedPrevSeasons = shift(prevSeasons, -shiftNumber);
|
||||
|
||||
const changes = difference(unshiftedNextSeasons, unshiftedPrevSeasons);
|
||||
if (changes === null || changes.length > 1) return;
|
||||
const changes = difference(unshiftedNextSeasons, unshiftedPrevSeasons);
|
||||
if (changes === null || changes.length > 1) return;
|
||||
|
||||
const [changeIndex] = changes;
|
||||
const positionIndex = getPositionIndex(seasonType, changeIndex);
|
||||
const [changeIndex] = changes;
|
||||
const positionIndex = getPositionIndex(seasonType, changeIndex);
|
||||
|
||||
const values = getSeasonsValues(seasonType, unshiftedNextSeasons);
|
||||
values[positionIndex] = unshiftedNextSeasons[changeIndex];
|
||||
const values = getSeasonsValues(seasonType, unshiftedNextSeasons);
|
||||
values[positionIndex] = unshiftedNextSeasons[changeIndex];
|
||||
|
||||
const seasons = generateSeasons(seasonType, values);
|
||||
const leasingPeriod = $calculation.element('tbxLeasingPeriod').getValue();
|
||||
const payments = generateSeasonsPayments(leasingPeriod, shift(seasons, shiftNumber));
|
||||
const rows: Row[] = generateSeasonPaymentsRows(seasonType, shiftNumber, payments);
|
||||
const firstPaymentPerc = $calculation.element('tbxFirstPaymentPerc').getValue();
|
||||
const lastPaymentPerc = $calculation.element('tbxLastPaymentPerc').getValue();
|
||||
const seasons = generateSeasons(seasonType, values);
|
||||
const leasingPeriod = $calculation.element('tbxLeasingPeriod').getValue();
|
||||
const payments = generateSeasonsPayments(leasingPeriod, shift(seasons, shiftNumber));
|
||||
const rows: Row[] = generateSeasonPaymentsRows(seasonType, shiftNumber, payments);
|
||||
const firstPaymentPerc = $calculation.element('tbxFirstPaymentPerc').getValue();
|
||||
const lastPaymentPerc = $calculation.element('tbxLastPaymentPerc').getValue();
|
||||
|
||||
$tables.payments.setRows([
|
||||
{
|
||||
status: 'Disabled',
|
||||
value: firstPaymentPerc,
|
||||
},
|
||||
...rows,
|
||||
{
|
||||
status: 'Disabled',
|
||||
value: lastPaymentPerc,
|
||||
},
|
||||
]);
|
||||
},
|
||||
$tables.payments.setRows([
|
||||
{
|
||||
delay: 50,
|
||||
equals: comparer.structural,
|
||||
}
|
||||
),
|
||||
() => $process.has('LoadKP')
|
||||
status: 'Disabled',
|
||||
value: firstPaymentPerc,
|
||||
},
|
||||
...rows,
|
||||
{
|
||||
status: 'Disabled',
|
||||
value: lastPaymentPerc,
|
||||
},
|
||||
]);
|
||||
},
|
||||
{
|
||||
delay: 50,
|
||||
equals: comparer.structural,
|
||||
}
|
||||
);
|
||||
|
||||
makeDisposable(
|
||||
() =>
|
||||
reaction(
|
||||
() => $calculation.element('radioGraphType').getValue(),
|
||||
() => {
|
||||
$calculation.element('selectSeasonType').resetValue();
|
||||
$calculation.element('selectHighSeasonStart').resetValue();
|
||||
$calculation.element('tbxParmentsDecreasePercent').resetValue();
|
||||
}
|
||||
),
|
||||
() => $process.has('LoadKP')
|
||||
disposableReaction(
|
||||
() => $process.has('LoadKP'),
|
||||
() => $calculation.element('radioGraphType').getValue(),
|
||||
() => {
|
||||
$calculation.element('selectSeasonType').resetValue();
|
||||
$calculation.element('selectHighSeasonStart').resetValue();
|
||||
$calculation.element('tbxParmentsDecreasePercent').resetValue();
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
@ -1,2 +1,2 @@
|
||||
export { default as common } from './common';
|
||||
export { default as validation } from './validation';
|
||||
export * from './validation';
|
||||
|
||||
@ -1,56 +1,4 @@
|
||||
import { createValidationReaction } from '../../tools';
|
||||
import { createValidationSchema } from '../validation';
|
||||
import type { Elements } from '@/Components/Calculation/config/map/values';
|
||||
import type { ProcessContext } from '@/process/types';
|
||||
import ValidationHelper from '@/stores/validation/helper';
|
||||
import { comparer, reaction, toJS } from 'mobx';
|
||||
import { uid } from 'radash';
|
||||
|
||||
const key = uid(7);
|
||||
|
||||
export default function reactions(context: ProcessContext) {
|
||||
const { $calculation, $tables } = context.store;
|
||||
|
||||
const validationSchema = createValidationSchema();
|
||||
const helper = new ValidationHelper();
|
||||
|
||||
reaction(
|
||||
() => {
|
||||
const payments = toJS($tables.payments.values);
|
||||
const values = $calculation.$values.getValues([
|
||||
'graphType',
|
||||
'highSeasonStart',
|
||||
'leasingPeriod',
|
||||
'seasonType',
|
||||
'insNSIB',
|
||||
'lastPaymentRub',
|
||||
]);
|
||||
|
||||
return {
|
||||
payments: { values: payments },
|
||||
...values,
|
||||
};
|
||||
},
|
||||
async (values) => {
|
||||
helper.removeErrors();
|
||||
const validationResult = await validationSchema.safeParseAsync(values);
|
||||
|
||||
if (!validationResult.success) {
|
||||
validationResult.error.errors.forEach(({ path, message }) => {
|
||||
(path as Array<Elements & 'payments'>).forEach((elementName) => {
|
||||
if (elementName === 'payments') {
|
||||
const removeError = $tables.payments.setError({ key, message });
|
||||
if (removeError) helper.add(removeError);
|
||||
} else {
|
||||
const removeError = $calculation.element(elementName).setError({ key, message });
|
||||
if (removeError) helper.add(removeError);
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
},
|
||||
{
|
||||
delay: 100,
|
||||
equals: comparer.structural,
|
||||
}
|
||||
);
|
||||
}
|
||||
export const validation = createValidationReaction(createValidationSchema);
|
||||
|
||||
@ -4,6 +4,7 @@ import defaultValues from '@/config/default-values';
|
||||
import * as CRMTypes from '@/graphql/crm.types';
|
||||
import { gql } from '@apollo/client';
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
const QUERY_GET_QUOTE_PRICE_DATA = gql`
|
||||
query GetQuotePriceData($quoteId: Uuid!) {
|
||||
quote(quoteId: $quoteId) {
|
||||
@ -12,6 +13,7 @@ const QUERY_GET_QUOTE_PRICE_DATA = gql`
|
||||
evo_discount_perc
|
||||
evo_discount_supplier_currency
|
||||
evo_first_payment_perc
|
||||
evo_first_payment_rub
|
||||
evo_last_payment_calc
|
||||
evo_last_payment_perc
|
||||
evo_last_payment_rub
|
||||
@ -44,16 +46,19 @@ export async function getKPData({
|
||||
quote?.evo_nds_in_price_supplier_currency ?? defaultValues.VATInLeaseObjectPrice,
|
||||
addEquipmentPrice: quote?.evo_equip_price ?? defaultValues.addEquipmentPrice,
|
||||
comissionPerc: quote?.evo_comission_perc ?? defaultValues.comissionPerc,
|
||||
// comissionRub: quote?.evo_comission_rub ,
|
||||
comissionRub: quote?.evo_comission_rub ?? defaultValues.comissionRub,
|
||||
firstPaymentPerc: quote?.evo_first_payment_perc ?? defaultValues.firstPaymentPerc,
|
||||
// lastPaymentRub: quote?.evo_last_payment_rub ,
|
||||
firstPaymentRub: quote?.evo_first_payment_rub ?? defaultValues.firstPaymentRub,
|
||||
lastPaymentPerc: quote?.evo_last_payment_perc ?? defaultValues.lastPaymentPerc,
|
||||
lastPaymentRub: quote?.evo_last_payment_rub ?? defaultValues.lastPaymentRub,
|
||||
lastPaymentRule: quote?.evo_last_payment_calc,
|
||||
leaseObjectPrice: quote?.evo_supplier_currency_price ?? defaultValues.leaseObjectPrice,
|
||||
// leaseObjectPriceWthtVAT: quote?.evo_price_without_nds_supplier_currency ,
|
||||
supplierCurrency: quote?.evo_transactioncurrencyid,
|
||||
leaseObjectPriceWthtVAT:
|
||||
quote?.evo_price_without_nds_supplier_currency ?? defaultValues.leaseObjectPriceWthtVAT,
|
||||
supplierCurrency: quote?.evo_transactioncurrencyid ?? defaultValues.supplierCurrency,
|
||||
supplierDiscountPerc: quote?.evo_discount_perc ?? defaultValues.supplierDiscountPerc,
|
||||
// supplierDiscountRub: quote?.evo_discount_supplier_currency ,
|
||||
supplierDiscountRub:
|
||||
quote?.evo_discount_supplier_currency ?? defaultValues.supplierDiscountRub,
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
@ -1,8 +1,9 @@
|
||||
import { VAT } from '@/constants/values';
|
||||
import * as CRMTypes from '@/graphql/crm.types';
|
||||
import type { ProcessContext } from '@/process/types';
|
||||
import { disposableReaction } from '@/utils/mobx';
|
||||
import { reaction } from 'mobx';
|
||||
import { makeDisposable, round } from 'tools';
|
||||
import { round } from 'tools';
|
||||
|
||||
export default function reactions({ store, apolloClient }: ProcessContext) {
|
||||
const { $calculation, $process } = store;
|
||||
@ -35,25 +36,23 @@ export default function reactions({ store, apolloClient }: ProcessContext) {
|
||||
/**
|
||||
* Расчет размера скидки поставщика в валюте
|
||||
*/
|
||||
makeDisposable(
|
||||
() =>
|
||||
reaction(
|
||||
() => $calculation.$values.getValues(['leaseObjectPrice', 'supplierDiscountRub']),
|
||||
({ leaseObjectPrice, supplierDiscountRub }) => {
|
||||
// NaN fix
|
||||
if (leaseObjectPrice === 0) {
|
||||
$calculation.element('tbxSupplierDiscountPerc').resetValue();
|
||||
} else {
|
||||
$calculation
|
||||
.element('tbxSupplierDiscountPerc')
|
||||
.setValue((supplierDiscountRub / leaseObjectPrice) * 100);
|
||||
}
|
||||
},
|
||||
{
|
||||
fireImmediately: true,
|
||||
}
|
||||
),
|
||||
() => $process.has('LoadKP')
|
||||
|
||||
disposableReaction(
|
||||
() => $process.has('LoadKP'),
|
||||
() => $calculation.$values.getValues(['leaseObjectPrice', 'supplierDiscountRub']),
|
||||
({ leaseObjectPrice, supplierDiscountRub }) => {
|
||||
// NaN fix
|
||||
if (leaseObjectPrice === 0) {
|
||||
$calculation.element('tbxSupplierDiscountPerc').resetValue();
|
||||
} else {
|
||||
$calculation
|
||||
.element('tbxSupplierDiscountPerc')
|
||||
.setValue((supplierDiscountRub / leaseObjectPrice) * 100);
|
||||
}
|
||||
},
|
||||
{
|
||||
fireImmediately: true,
|
||||
}
|
||||
);
|
||||
|
||||
/**
|
||||
@ -103,7 +102,8 @@ export default function reactions({ store, apolloClient }: ProcessContext) {
|
||||
}
|
||||
);
|
||||
|
||||
reaction(
|
||||
disposableReaction(
|
||||
() => $process.has('LoadKP'),
|
||||
() =>
|
||||
$calculation.$values.getValues([
|
||||
'firstPaymentPerc',
|
||||
@ -117,19 +117,14 @@ export default function reactions({ store, apolloClient }: ProcessContext) {
|
||||
}
|
||||
);
|
||||
|
||||
makeDisposable(
|
||||
() =>
|
||||
reaction(
|
||||
() => $calculation.element('tbxFirstPaymentRub').getValue(),
|
||||
(firstPaymentRub) => {
|
||||
const { plPriceRub, addEquipmentPrice, importProgramSum } =
|
||||
$calculation.$values.getValues();
|
||||
const perc =
|
||||
(firstPaymentRub / (plPriceRub + addEquipmentPrice - importProgramSum)) * 100;
|
||||
$calculation.element('tbxFirstPaymentPerc').setValue(perc);
|
||||
}
|
||||
),
|
||||
() => $process.has('LoadKP')
|
||||
disposableReaction(
|
||||
() => $process.has('LoadKP'),
|
||||
() => $calculation.element('tbxFirstPaymentRub').getValue(),
|
||||
(firstPaymentRub) => {
|
||||
const { plPriceRub, addEquipmentPrice, importProgramSum } = $calculation.$values.getValues();
|
||||
const perc = (firstPaymentRub / (plPriceRub + addEquipmentPrice - importProgramSum)) * 100;
|
||||
$calculation.element('tbxFirstPaymentPerc').setValue(perc);
|
||||
}
|
||||
);
|
||||
|
||||
reaction(
|
||||
@ -146,63 +141,53 @@ export default function reactions({ store, apolloClient }: ProcessContext) {
|
||||
}
|
||||
);
|
||||
|
||||
makeDisposable(
|
||||
() =>
|
||||
reaction(
|
||||
() => $calculation.element('tbxComissionRub').getValue(),
|
||||
(comissionRub) => {
|
||||
const { plPriceRub, addEquipmentPrice, importProgramSum } =
|
||||
$calculation.$values.getValues();
|
||||
const perc = (comissionRub / (plPriceRub + addEquipmentPrice - importProgramSum)) * 100;
|
||||
$calculation.element('tbxComissionPerc').setValue(perc);
|
||||
}
|
||||
),
|
||||
() => $process.has('LoadKP')
|
||||
disposableReaction(
|
||||
() => $process.has('LoadKP'),
|
||||
() => $calculation.element('tbxComissionRub').getValue(),
|
||||
(comissionRub) => {
|
||||
const { plPriceRub, addEquipmentPrice, importProgramSum } = $calculation.$values.getValues();
|
||||
const perc = (comissionRub / (plPriceRub + addEquipmentPrice - importProgramSum)) * 100;
|
||||
$calculation.element('tbxComissionPerc').setValue(perc);
|
||||
}
|
||||
);
|
||||
|
||||
makeDisposable(
|
||||
disposableReaction(
|
||||
() => $process.has('LoadKP'),
|
||||
() =>
|
||||
reaction(
|
||||
() =>
|
||||
$calculation.$values.getValues([
|
||||
'plPriceRub',
|
||||
'lastPaymentPerc',
|
||||
'addEquipmentPrice',
|
||||
'importProgramSum',
|
||||
'lastPaymentRule',
|
||||
]),
|
||||
({ addEquipmentPrice, lastPaymentPerc, plPriceRub, importProgramSum, lastPaymentRule }) => {
|
||||
if (lastPaymentRule === 100_000_000) {
|
||||
return;
|
||||
}
|
||||
$calculation.$values.getValues([
|
||||
'plPriceRub',
|
||||
'lastPaymentPerc',
|
||||
'addEquipmentPrice',
|
||||
'importProgramSum',
|
||||
'lastPaymentRule',
|
||||
]),
|
||||
({ addEquipmentPrice, lastPaymentPerc, plPriceRub, importProgramSum, lastPaymentRule }) => {
|
||||
if (lastPaymentRule === 100_000_000) {
|
||||
return;
|
||||
}
|
||||
|
||||
const rub = (lastPaymentPerc * (plPriceRub + addEquipmentPrice - importProgramSum)) / 100;
|
||||
$calculation.element('tbxLastPaymentRub').setValue(rub);
|
||||
}
|
||||
),
|
||||
() => $process.has('LoadKP')
|
||||
const rub = (lastPaymentPerc * (plPriceRub + addEquipmentPrice - importProgramSum)) / 100;
|
||||
$calculation.element('tbxLastPaymentRub').setValue(rub);
|
||||
}
|
||||
);
|
||||
|
||||
makeDisposable(
|
||||
disposableReaction(
|
||||
() => $process.has('LoadKP'),
|
||||
() =>
|
||||
reaction(
|
||||
() =>
|
||||
$calculation.$values.getValues([
|
||||
'plPriceRub',
|
||||
'lastPaymentRub',
|
||||
'addEquipmentPrice',
|
||||
'importProgramSum',
|
||||
'lastPaymentRule',
|
||||
]),
|
||||
({ lastPaymentRub, plPriceRub, addEquipmentPrice, importProgramSum, lastPaymentRule }) => {
|
||||
if (lastPaymentRule === 100_000_001) {
|
||||
return;
|
||||
}
|
||||
$calculation.$values.getValues([
|
||||
'plPriceRub',
|
||||
'lastPaymentRub',
|
||||
'addEquipmentPrice',
|
||||
'importProgramSum',
|
||||
'lastPaymentRule',
|
||||
]),
|
||||
({ lastPaymentRub, plPriceRub, addEquipmentPrice, importProgramSum, lastPaymentRule }) => {
|
||||
if (lastPaymentRule === 100_000_001) {
|
||||
return;
|
||||
}
|
||||
|
||||
const perc = (lastPaymentRub / (plPriceRub + addEquipmentPrice - importProgramSum)) * 100;
|
||||
$calculation.element('tbxLastPaymentPerc').setValue(perc);
|
||||
}
|
||||
),
|
||||
() => $process.has('LoadKP')
|
||||
const perc = (lastPaymentRub / (plPriceRub + addEquipmentPrice - importProgramSum)) * 100;
|
||||
$calculation.element('tbxLastPaymentPerc').setValue(perc);
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
@ -1,4 +1,3 @@
|
||||
import * as CRMTypes from '@/graphql/crm.types';
|
||||
import type { ProcessContext } from '@/process/types';
|
||||
import { createCurrencyUtility } from '@/utils/currency';
|
||||
import { reaction } from 'mobx';
|
||||
@ -9,32 +8,10 @@ export default function reactions({ store, apolloClient }: ProcessContext) {
|
||||
const { RUB } = createCurrencyUtility({ apolloClient });
|
||||
|
||||
reaction(
|
||||
() =>
|
||||
$calculation.$values.getValues([
|
||||
'supplierCurrency',
|
||||
'leaseObjectPrice',
|
||||
'supplierDiscountRub',
|
||||
]),
|
||||
async ({ supplierCurrency: supplierCurrencyId, supplierDiscountRub, leaseObjectPrice }) => {
|
||||
() => $calculation.$values.getValues(['supplierCurrency', 'leaseObjectPrice']),
|
||||
async ({ supplierCurrency: supplierCurrencyId, leaseObjectPrice }) => {
|
||||
if (!supplierCurrencyId) {
|
||||
$calculation.$values.resetValue('plPriceRub');
|
||||
$calculation.$values.resetValue('discountRub');
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
const {
|
||||
data: { transactioncurrency },
|
||||
} = await apolloClient.query({
|
||||
query: CRMTypes.GetTransactionCurrencyDocument,
|
||||
variables: {
|
||||
currencyid: supplierCurrencyId,
|
||||
},
|
||||
});
|
||||
|
||||
if (transactioncurrency?.isocurrencycode === 'RUB') {
|
||||
$calculation.$values.setValue('plPriceRub', leaseObjectPrice);
|
||||
$calculation.$values.setValue('discountRub', supplierDiscountRub);
|
||||
|
||||
return;
|
||||
}
|
||||
@ -46,6 +23,21 @@ export default function reactions({ store, apolloClient }: ProcessContext) {
|
||||
value: leaseObjectPrice,
|
||||
})
|
||||
);
|
||||
},
|
||||
{
|
||||
delay: 100,
|
||||
fireImmediately: true,
|
||||
}
|
||||
);
|
||||
|
||||
reaction(
|
||||
() => $calculation.$values.getValues(['supplierCurrency', 'supplierDiscountRub']),
|
||||
async ({ supplierCurrency: supplierCurrencyId, supplierDiscountRub }) => {
|
||||
if (!supplierCurrencyId) {
|
||||
$calculation.$values.resetValue('discountRub');
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
$calculation.$values.setValue(
|
||||
'discountRub',
|
||||
|
||||
@ -1,3 +1,3 @@
|
||||
export { default as common } from './common';
|
||||
export { default as computed } from './computed';
|
||||
export { default as validation } from './validation';
|
||||
export * from './validation';
|
||||
|
||||
@ -1,44 +1,4 @@
|
||||
import { createValidationReaction } from '../../tools';
|
||||
import { createValidationSchema } from '../validation';
|
||||
import type { Elements } from '@/Components/Calculation/config/map/values';
|
||||
import type { ProcessContext } from '@/process/types';
|
||||
import ValidationHelper from '@/stores/validation/helper';
|
||||
import { reaction } from 'mobx';
|
||||
import { uid } from 'radash';
|
||||
|
||||
const key = uid(7);
|
||||
|
||||
export default function reactions(context: ProcessContext) {
|
||||
const { store } = context;
|
||||
const { $calculation } = store;
|
||||
const validationSchema = createValidationSchema(context);
|
||||
|
||||
const helper = new ValidationHelper();
|
||||
reaction(
|
||||
() =>
|
||||
$calculation.$values.getValues([
|
||||
'VATInLeaseObjectPrice',
|
||||
'leaseObjectPriceWthtVAT',
|
||||
'product',
|
||||
'supplierDiscountRub',
|
||||
'plPriceRub',
|
||||
'firstPaymentRub',
|
||||
'subsidySum',
|
||||
]),
|
||||
async (values) => {
|
||||
helper.removeErrors();
|
||||
const validationResult = await validationSchema.safeParseAsync(values);
|
||||
|
||||
if (!validationResult.success) {
|
||||
validationResult.error.errors.forEach(({ path, message }) => {
|
||||
(path as Elements[]).forEach((elementName) => {
|
||||
const removeError = $calculation.element(elementName).setError({ key, message });
|
||||
if (removeError) helper.add(removeError);
|
||||
});
|
||||
});
|
||||
}
|
||||
},
|
||||
{
|
||||
delay: 100,
|
||||
}
|
||||
);
|
||||
}
|
||||
export const validation = createValidationReaction(createValidationSchema);
|
||||
|
||||
@ -1,15 +1,12 @@
|
||||
import type { ProcessContext } from '../types';
|
||||
import { createValidationSchema } from './validation';
|
||||
import { makeDisposable, normalizeOptions } from '@/../../packages/tools';
|
||||
import type { Elements } from '@/Components/Calculation/config/map/values';
|
||||
import { selectRequirementTelematic } from '@/config/default-options';
|
||||
import * as CRMTypes from '@/graphql/crm.types';
|
||||
import type { Values } from '@/stores/calculation/values/types';
|
||||
import ValidationHelper from '@/stores/validation/helper';
|
||||
import { createValidationReaction } from '@/process/tools';
|
||||
import { disposableReaction } from '@/utils/mobx';
|
||||
import dayjs from 'dayjs';
|
||||
import utc from 'dayjs/plugin/utc';
|
||||
import { reaction } from 'mobx';
|
||||
import { uid } from 'radash';
|
||||
|
||||
dayjs.extend(utc);
|
||||
|
||||
@ -21,34 +18,51 @@ export function common({ store, apolloClient }: ProcessContext) {
|
||||
() => $calculation.element('selectQuote').resetValue()
|
||||
);
|
||||
|
||||
makeDisposable(
|
||||
disposableReaction(
|
||||
() => $calculation.element('cbxRecalcWithRevision').getValue() === true,
|
||||
() =>
|
||||
reaction(
|
||||
() =>
|
||||
$calculation.$values.getValues([
|
||||
'supplierDiscountRub',
|
||||
'addEquipmentPrice',
|
||||
'importProgramSum',
|
||||
'plPriceRub',
|
||||
]),
|
||||
({ supplierDiscountRub, importProgramSum, addEquipmentPrice, plPriceRub }) => {
|
||||
const price = plPriceRub + addEquipmentPrice - importProgramSum;
|
||||
const maxPriceChange =
|
||||
price - supplierDiscountRub < 800_000
|
||||
? price - supplierDiscountRub + 50_000
|
||||
: (price - supplierDiscountRub) * 1.05;
|
||||
$calculation.$values.getValues([
|
||||
'discountRub',
|
||||
'addEquipmentPrice',
|
||||
'importProgramSum',
|
||||
'plPriceRub',
|
||||
'leaseObjectType',
|
||||
]),
|
||||
async ({
|
||||
discountRub,
|
||||
importProgramSum,
|
||||
addEquipmentPrice,
|
||||
plPriceRub,
|
||||
leaseObjectType: leaseObjectTypeId,
|
||||
}) => {
|
||||
let evo_leasingobject_type: CRMTypes.GetLeaseObjectTypeQuery['evo_leasingobject_type'] = null;
|
||||
|
||||
$calculation.element('tbxMaxPriceChange').setValue(maxPriceChange);
|
||||
if (leaseObjectTypeId) {
|
||||
const { data } = await apolloClient.query({
|
||||
query: CRMTypes.GetLeaseObjectTypeDocument,
|
||||
variables: { leaseObjectTypeId },
|
||||
});
|
||||
|
||||
const minPriceChange =
|
||||
price - supplierDiscountRub < 800_000
|
||||
? price - supplierDiscountRub - 50_000
|
||||
: (price - supplierDiscountRub) * 0.95;
|
||||
({ evo_leasingobject_type } = data);
|
||||
}
|
||||
|
||||
$calculation.element('tbxMinPriceChange').setValue(minPriceChange);
|
||||
}
|
||||
),
|
||||
() => $calculation.element('cbxRecalcWithRevision').getValue() === true
|
||||
const price = plPriceRub + addEquipmentPrice - importProgramSum;
|
||||
const maxPriceChange =
|
||||
price - discountRub < 800_000
|
||||
? price - discountRub + 50_000
|
||||
: (price - discountRub) *
|
||||
(evo_leasingobject_type?.evo_vehicle_type?.includes(100_000_001) ||
|
||||
evo_leasingobject_type?.evo_vehicle_type?.includes(100_000_005)
|
||||
? 1.01
|
||||
: 1.05);
|
||||
|
||||
$calculation.element('tbxMaxPriceChange').setValue(maxPriceChange);
|
||||
|
||||
const minPriceChange =
|
||||
price - discountRub < 800_000 ? price - discountRub - 50_000 : (price - discountRub) * 0.95;
|
||||
|
||||
$calculation.element('tbxMinPriceChange').setValue(minPriceChange);
|
||||
}
|
||||
);
|
||||
|
||||
reaction(
|
||||
@ -62,76 +76,6 @@ export function common({ store, apolloClient }: ProcessContext) {
|
||||
}
|
||||
);
|
||||
|
||||
reaction(
|
||||
() => $calculation.$values.getValues(['recalcWithRevision', 'leaseObjectType']),
|
||||
async ({ recalcWithRevision, leaseObjectType: leaseObjectTypeId }) => {
|
||||
if (recalcWithRevision === false) {
|
||||
$calculation
|
||||
.element('selectRequirementTelematic')
|
||||
.setOptions(
|
||||
selectRequirementTelematic.filter((x) =>
|
||||
[100_000_000, 100_000_001, 100_000_002, 100_000_003].includes(x.value)
|
||||
)
|
||||
);
|
||||
|
||||
if (leaseObjectTypeId) {
|
||||
const {
|
||||
data: { evo_leasingobject_type },
|
||||
} = await apolloClient.query({
|
||||
query: CRMTypes.GetLeaseObjectTypeDocument,
|
||||
variables: { leaseObjectTypeId },
|
||||
});
|
||||
|
||||
if (evo_leasingobject_type?.evo_id === '11') {
|
||||
$calculation.element('selectRequirementTelematic').setValue(100_000_000).block();
|
||||
} else {
|
||||
$calculation.element('selectRequirementTelematic').unblock();
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$calculation.element('selectRequirementTelematic').resetOptions();
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
reaction(
|
||||
() => $calculation.$values.getValues(['requirementTelematic', 'recalcWithRevision']),
|
||||
async ({ requirementTelematic, recalcWithRevision }) => {
|
||||
const currentDate = dayjs().utc(false).format('YYYY-MM-DD');
|
||||
const {
|
||||
data: { evo_addproduct_types: trackerTypes },
|
||||
} = await apolloClient.query({
|
||||
query: CRMTypes.GetTrackerTypesDocument,
|
||||
variables: { currentDate },
|
||||
});
|
||||
|
||||
const {
|
||||
data: { evo_addproduct_types: telematicTypes },
|
||||
} = await apolloClient.query({
|
||||
query: CRMTypes.GetTelematicTypesDocument,
|
||||
variables: { currentDate },
|
||||
});
|
||||
|
||||
let filteredTrackerTypes = trackerTypes?.filter(
|
||||
(x) => requirementTelematic && x?.evo_controls_program?.includes(requirementTelematic)
|
||||
);
|
||||
|
||||
let filteredTelematicTypes = telematicTypes?.filter(
|
||||
(x) => requirementTelematic && x?.evo_controls_program?.includes(requirementTelematic)
|
||||
);
|
||||
|
||||
if (!recalcWithRevision) {
|
||||
filteredTrackerTypes = filteredTrackerTypes?.filter((x) => x?.evo_visible_calc === true);
|
||||
filteredTelematicTypes = filteredTelematicTypes?.filter(
|
||||
(x) => x?.evo_visible_calc === true
|
||||
);
|
||||
}
|
||||
|
||||
$calculation.element('selectTracker').setOptions(normalizeOptions(filteredTrackerTypes));
|
||||
$calculation.element('selectTelematic').setOptions(normalizeOptions(filteredTelematicTypes));
|
||||
}
|
||||
);
|
||||
|
||||
{
|
||||
const elements: Elements[] = [
|
||||
'cbxLeaseObjectUsed',
|
||||
@ -221,32 +165,4 @@ export function common({ store, apolloClient }: ProcessContext) {
|
||||
}
|
||||
}
|
||||
|
||||
const key = uid(7);
|
||||
|
||||
export function validation(context: ProcessContext) {
|
||||
const { store } = context;
|
||||
const { $calculation } = store;
|
||||
const validationSchema = createValidationSchema(context);
|
||||
|
||||
const helper = new ValidationHelper();
|
||||
reaction(
|
||||
() =>
|
||||
$calculation.$values.getValues(Object.keys(validationSchema._def.schema.shape) as Values[]),
|
||||
async (values) => {
|
||||
helper.removeErrors();
|
||||
const validationResult = await validationSchema.safeParseAsync(values);
|
||||
|
||||
if (!validationResult.success) {
|
||||
validationResult.error.errors.forEach(({ path, message }) => {
|
||||
(path as Elements[]).forEach((elementName) => {
|
||||
const removeError = $calculation.element(elementName).setError({ key, message });
|
||||
if (removeError) helper.add(removeError);
|
||||
});
|
||||
});
|
||||
}
|
||||
},
|
||||
{
|
||||
delay: 100,
|
||||
}
|
||||
);
|
||||
}
|
||||
export const validation = createValidationReaction(createValidationSchema);
|
||||
|
||||
@ -1,7 +1,8 @@
|
||||
/* eslint-disable sonarjs/cognitive-complexity */
|
||||
/* eslint-disable complexity */
|
||||
import type { ValidationContext } from '../types';
|
||||
import ValuesSchema from '@/config/schema/values';
|
||||
import { MAX_MASS, MAX_VEHICLE_SEATS } from '@/constants/values';
|
||||
import { MAX_MASS, VEHICLE_SEATS } from '@/constants/values';
|
||||
import * as CRMTypes from '@/graphql/crm.types';
|
||||
import { z } from 'zod';
|
||||
|
||||
@ -11,9 +12,11 @@ export function createValidationSchema({ apolloClient }: ValidationContext) {
|
||||
balanceHolder: true,
|
||||
countSeats: true,
|
||||
dealerPerson: true,
|
||||
discountRub: true,
|
||||
firstPaymentPerc: true,
|
||||
importProgramSum: true,
|
||||
lastPaymentPerc: true,
|
||||
leaseObjectCategory: true,
|
||||
leaseObjectCount: true,
|
||||
leaseObjectPriceWthtVAT: true,
|
||||
leaseObjectUsed: true,
|
||||
@ -23,7 +26,6 @@ export function createValidationSchema({ apolloClient }: ValidationContext) {
|
||||
product: true,
|
||||
quote: true,
|
||||
recalcWithRevision: true,
|
||||
supplierDiscountRub: true,
|
||||
}).superRefine(
|
||||
async (
|
||||
{
|
||||
@ -35,7 +37,7 @@ export function createValidationSchema({ apolloClient }: ValidationContext) {
|
||||
product: productId,
|
||||
quote: quoteId,
|
||||
recalcWithRevision,
|
||||
supplierDiscountRub,
|
||||
discountRub,
|
||||
plPriceRub,
|
||||
firstPaymentPerc,
|
||||
leaseObjectCount,
|
||||
@ -44,6 +46,7 @@ export function createValidationSchema({ apolloClient }: ValidationContext) {
|
||||
leaseObjectYear,
|
||||
lastPaymentPerc,
|
||||
balanceHolder,
|
||||
leaseObjectCategory,
|
||||
},
|
||||
ctx
|
||||
) => {
|
||||
@ -51,6 +54,14 @@ export function createValidationSchema({ apolloClient }: ValidationContext) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!quoteId) {
|
||||
ctx.addIssue({
|
||||
code: z.ZodIssueCode.custom,
|
||||
message: 'Не указано предложение, по которому осуществляется Пересчет без пересмотра',
|
||||
path: ['selectQuote'],
|
||||
});
|
||||
}
|
||||
|
||||
if (dealerPersonId && quoteId && productId) {
|
||||
const {
|
||||
data: { account: dealerPerson },
|
||||
@ -79,7 +90,7 @@ export function createValidationSchema({ apolloClient }: ValidationContext) {
|
||||
!evo_baseproduct?.evo_sale_without_nds &&
|
||||
Boolean(
|
||||
quote?.evo_max_price_change &&
|
||||
plPriceRub - supplierDiscountRub + addEquipmentPrice - importProgramSum >
|
||||
plPriceRub - discountRub + addEquipmentPrice - importProgramSum >
|
||||
quote.evo_max_price_change
|
||||
);
|
||||
|
||||
@ -101,7 +112,7 @@ export function createValidationSchema({ apolloClient }: ValidationContext) {
|
||||
quote.evo_discount_supplier_currency &&
|
||||
quote.evo_equip_price &&
|
||||
quote.evo_program_import_subsidy_sum &&
|
||||
plPriceRub - supplierDiscountRub + addEquipmentPrice - importProgramSum >
|
||||
plPriceRub - discountRub + addEquipmentPrice - importProgramSum >
|
||||
quote?.evo_supplier_currency_price -
|
||||
quote.evo_discount_supplier_currency +
|
||||
quote.evo_equip_price -
|
||||
@ -112,7 +123,7 @@ export function createValidationSchema({ apolloClient }: ValidationContext) {
|
||||
!evo_baseproduct?.evo_sale_without_nds &&
|
||||
Boolean(
|
||||
quote?.evo_min_change_price &&
|
||||
plPriceRub - supplierDiscountRub + addEquipmentPrice - importProgramSum <
|
||||
plPriceRub - discountRub + addEquipmentPrice - importProgramSum <
|
||||
quote.evo_min_change_price
|
||||
);
|
||||
|
||||
@ -179,8 +190,9 @@ export function createValidationSchema({ apolloClient }: ValidationContext) {
|
||||
}
|
||||
|
||||
if (
|
||||
(quote?.evo_max_mass && maxMass < MAX_MASS && quote.evo_max_mass < MAX_MASS) ||
|
||||
(quote?.evo_max_mass && maxMass >= MAX_MASS && quote?.evo_max_mass >= MAX_MASS)
|
||||
quote?.evo_max_mass &&
|
||||
((quote.evo_max_mass < MAX_MASS && maxMass >= MAX_MASS) ||
|
||||
(quote?.evo_max_mass >= MAX_MASS && maxMass < MAX_MASS))
|
||||
) {
|
||||
ctx.addIssue({
|
||||
code: z.ZodIssueCode.custom,
|
||||
@ -191,12 +203,10 @@ export function createValidationSchema({ apolloClient }: ValidationContext) {
|
||||
}
|
||||
|
||||
if (
|
||||
(quote?.evo_seats &&
|
||||
countSeats < MAX_VEHICLE_SEATS &&
|
||||
quote.evo_seats < MAX_VEHICLE_SEATS) ||
|
||||
(quote?.evo_seats &&
|
||||
countSeats >= MAX_VEHICLE_SEATS &&
|
||||
quote.evo_seats >= MAX_VEHICLE_SEATS)
|
||||
leaseObjectCategory === 100_000_003 &&
|
||||
quote?.evo_seats &&
|
||||
((quote.evo_seats < VEHICLE_SEATS && countSeats >= VEHICLE_SEATS) ||
|
||||
(quote.evo_seats >= VEHICLE_SEATS && countSeats < VEHICLE_SEATS))
|
||||
) {
|
||||
ctx.addIssue({
|
||||
code: z.ZodIssueCode.custom,
|
||||
@ -206,7 +216,7 @@ export function createValidationSchema({ apolloClient }: ValidationContext) {
|
||||
});
|
||||
}
|
||||
|
||||
if (quote?.evo_year && leaseObjectYear >= quote.evo_year) {
|
||||
if (quote?.evo_year && leaseObjectYear < quote.evo_year) {
|
||||
ctx.addIssue({
|
||||
code: z.ZodIssueCode.custom,
|
||||
message: 'При пересчете без пересмотра год выпуска нельзя уменьшать',
|
||||
|
||||
@ -6,6 +6,7 @@ import defaultValues from '@/config/default-values';
|
||||
import * as CRMTypes from '@/graphql/crm.types';
|
||||
import { gql } from '@apollo/client';
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
const QUERY_GET_QUOTE_AGENTS_DATA = gql`
|
||||
query GetQuoteAgentsData($quoteId: Uuid!) {
|
||||
quote(quoteId: $quoteId) {
|
||||
@ -34,6 +35,7 @@ const QUERY_GET_QUOTE_AGENTS_DATA = gql`
|
||||
evo_fin_department_reward_conditionid
|
||||
evo_fin_department_reward_total
|
||||
evo_fin_department_reward_summ
|
||||
evo_supplier_financing
|
||||
}
|
||||
}
|
||||
`;
|
||||
@ -78,6 +80,7 @@ export async function getKPData({
|
||||
indAgent: quote?.evo_agent_accountid,
|
||||
indAgentRewardCondition: quote?.evo_agent_reward_conditionid,
|
||||
indAgentRewardSumm: sums?.indAgentRewardSumm ?? defaultValues.indAgentRewardSumm,
|
||||
supplierFinancing: quote?.evo_supplier_financing ?? defaultValues.supplierFinancing,
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
@ -1,12 +1,12 @@
|
||||
import type { AgentsFields, AgentsRewardConditionsFields, AgentsSumFields } from './types';
|
||||
import * as CRMTypes from '@/graphql/crm.types';
|
||||
import type RootStore from '@/stores/root';
|
||||
import { normalizeOptions } from '@/utils/entity';
|
||||
import { disposableReaction } from '@/utils/mobx';
|
||||
import type { ApolloClient } from '@apollo/client';
|
||||
import dayjs from 'dayjs';
|
||||
import utc from 'dayjs/plugin/utc';
|
||||
import { reaction } from 'mobx';
|
||||
import { normalizeOptions } from 'tools/entity';
|
||||
import { makeDisposable } from 'tools/mobx';
|
||||
|
||||
dayjs.extend(utc);
|
||||
|
||||
@ -61,34 +61,31 @@ export function fillAgentRewardSummReaction(
|
||||
const { $calculation, $process } = store;
|
||||
const { rewardConditionField, rewardSummField } = agentParams;
|
||||
|
||||
makeDisposable(
|
||||
() =>
|
||||
reaction(
|
||||
() => $calculation.element(rewardConditionField).getValue(),
|
||||
async (rewardConditionId) => {
|
||||
if (!rewardConditionId) {
|
||||
$calculation.element(rewardSummField).reset();
|
||||
disposableReaction(
|
||||
() => $process.has('LoadKP'),
|
||||
() => $calculation.element(rewardConditionField).getValue(),
|
||||
async (rewardConditionId) => {
|
||||
if (!rewardConditionId) {
|
||||
$calculation.element(rewardSummField).reset();
|
||||
|
||||
return;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
const {
|
||||
data: { evo_reward_condition },
|
||||
} = await apolloClient.query({
|
||||
query: CRMTypes.GetRewardConditionDocument,
|
||||
variables: {
|
||||
conditionId: rewardConditionId,
|
||||
},
|
||||
});
|
||||
const {
|
||||
data: { evo_reward_condition },
|
||||
} = await apolloClient.query({
|
||||
query: CRMTypes.GetRewardConditionDocument,
|
||||
variables: {
|
||||
conditionId: rewardConditionId,
|
||||
},
|
||||
});
|
||||
|
||||
if (evo_reward_condition?.evo_reward_summ) {
|
||||
$calculation.element(rewardSummField).setValue(evo_reward_condition.evo_reward_summ);
|
||||
} else {
|
||||
$calculation.element(rewardSummField).resetValue();
|
||||
}
|
||||
}
|
||||
),
|
||||
() => $process.has('LoadKP')
|
||||
if (evo_reward_condition?.evo_reward_summ) {
|
||||
$calculation.element(rewardSummField).setValue(evo_reward_condition.evo_reward_summ);
|
||||
} else {
|
||||
$calculation.element(rewardSummField).resetValue();
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
reaction(
|
||||
|
||||
@ -1,8 +1,8 @@
|
||||
import type { Elements } from '@/Components/Calculation/config/map/values';
|
||||
import * as CRMTypes from '@/graphql/crm.types';
|
||||
import type RootStore from '@/stores/root';
|
||||
import { normalizeOptions } from '@/utils/entity';
|
||||
import type { ApolloClient } from '@apollo/client';
|
||||
import { normalizeOptions } from 'tools/entity';
|
||||
|
||||
type AgentsLeadProp = keyof Pick<
|
||||
NonNullable<CRMTypes.GetLeadQuery['lead']>,
|
||||
|
||||
@ -3,10 +3,10 @@ import * as createReactions from '../lib/create-reactions';
|
||||
import * as fillAgentsFromLead from '../lib/fill-agents-from-lead';
|
||||
import * as CRMTypes from '@/graphql/crm.types';
|
||||
import type { ProcessContext } from '@/process/types';
|
||||
import { disposableReaction } from '@/utils/mobx';
|
||||
import dayjs from 'dayjs';
|
||||
import utc from 'dayjs/plugin/utc';
|
||||
import { reaction } from 'mobx';
|
||||
import { makeDisposable } from 'tools/mobx';
|
||||
|
||||
const { fillIndAgent, fillCalcBroker, fillCalcDoubleAgent, fillFinDepartment } = fillAgentsFromLead;
|
||||
const { fillAgentRewardReaction, fillAgentRewardSummReaction } = createReactions;
|
||||
@ -33,18 +33,16 @@ export function common({ store, apolloClient }: ProcessContext) {
|
||||
/**
|
||||
* Заполняем агентов из Интереса
|
||||
*/
|
||||
makeDisposable(
|
||||
() =>
|
||||
reaction(
|
||||
() => $calculation.element('selectLead').getValue(),
|
||||
(leadid) => {
|
||||
fillIndAgent(store, apolloClient, leadid);
|
||||
fillCalcDoubleAgent(store, apolloClient, leadid);
|
||||
fillCalcBroker(store, apolloClient, leadid);
|
||||
fillFinDepartment(store, apolloClient, leadid);
|
||||
}
|
||||
),
|
||||
() => $process.has('LoadKP')
|
||||
|
||||
disposableReaction(
|
||||
() => $process.has('LoadKP'),
|
||||
() => $calculation.element('selectLead').getValue(),
|
||||
(leadid) => {
|
||||
fillIndAgent(store, apolloClient, leadid);
|
||||
fillCalcDoubleAgent(store, apolloClient, leadid);
|
||||
fillCalcBroker(store, apolloClient, leadid);
|
||||
fillFinDepartment(store, apolloClient, leadid);
|
||||
}
|
||||
);
|
||||
|
||||
/**
|
||||
|
||||
@ -11,4 +11,4 @@ function common(context: ProcessContext) {
|
||||
|
||||
export { common };
|
||||
|
||||
export { default as validation } from './validation';
|
||||
export * from './validation';
|
||||
|
||||
@ -1,11 +1,11 @@
|
||||
import * as createReactions from '../lib/create-reactions';
|
||||
import * as CRMTypes from '@/graphql/crm.types';
|
||||
import type { ProcessContext } from '@/process/types';
|
||||
import { normalizeOptions } from '@/utils/entity';
|
||||
import dayjs from 'dayjs';
|
||||
import utc from 'dayjs/plugin/utc';
|
||||
import { reaction } from 'mobx';
|
||||
import { sift } from 'radash';
|
||||
import { normalizeOptions } from 'tools/entity';
|
||||
|
||||
dayjs.extend(utc);
|
||||
|
||||
@ -156,4 +156,39 @@ export function common({ store, apolloClient }: ProcessContext) {
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
reaction(
|
||||
() => $calculation.$values.getValues(['product', 'dealerPerson']),
|
||||
async ({ product: productId, dealerPerson: dealerPersonId }) => {
|
||||
let evo_baseproduct: CRMTypes.GetProductQuery['evo_baseproduct'] = null;
|
||||
let dealerPerson: CRMTypes.GetDealerPersonQuery['account'] = null;
|
||||
|
||||
if (productId) {
|
||||
const { data } = await apolloClient.query({
|
||||
query: CRMTypes.GetProductDocument,
|
||||
variables: { productId },
|
||||
});
|
||||
|
||||
({ evo_baseproduct } = data);
|
||||
}
|
||||
|
||||
if (dealerPersonId) {
|
||||
const { data } = await apolloClient.query({
|
||||
query: CRMTypes.GetDealerPersonDocument,
|
||||
variables: { dealerPersonId },
|
||||
});
|
||||
|
||||
({ account: dealerPerson } = data);
|
||||
}
|
||||
|
||||
if (
|
||||
evo_baseproduct?.evo_supplier_financing_accept &&
|
||||
dealerPerson?.evo_supplier_financing_accept
|
||||
) {
|
||||
$calculation.element('cbxSupplierFinancing').unblock();
|
||||
} else {
|
||||
$calculation.element('cbxSupplierFinancing').setValue(false).block();
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
@ -1,70 +1,4 @@
|
||||
import { createValidationReaction } from '../../tools';
|
||||
import { createValidationSchema } from '../validation';
|
||||
import type { Elements } from '@/Components/Calculation/config/map/values';
|
||||
import type { ProcessContext } from '@/process/types';
|
||||
import ValidationHelper from '@/stores/validation/helper';
|
||||
import { reaction } from 'mobx';
|
||||
import { uid } from 'radash';
|
||||
|
||||
const key = uid(7);
|
||||
|
||||
export default function reactions(context: ProcessContext) {
|
||||
const { store } = context;
|
||||
const { $calculation } = store;
|
||||
const validationSchema = createValidationSchema(context);
|
||||
|
||||
const helper = new ValidationHelper();
|
||||
reaction(
|
||||
() => {
|
||||
const values = $calculation.$values.getValues([
|
||||
'calcBrokerRewardCondition',
|
||||
'calcBrokerRewardSum',
|
||||
'calcDoubleAgentRewardCondition',
|
||||
'calcDoubleAgentRewardSumm',
|
||||
'dealer',
|
||||
'dealerBroker',
|
||||
'calcFinDepartment',
|
||||
'dealerBrokerRewardCondition',
|
||||
'dealerBrokerRewardSumm',
|
||||
'dealerPerson',
|
||||
'dealerRewardCondition',
|
||||
'dealerRewardSumm',
|
||||
'finDepartmentRewardCondtion',
|
||||
'finDepartmentRewardSumm',
|
||||
'indAgent',
|
||||
'indAgentRewardCondition',
|
||||
'indAgentRewardSumm',
|
||||
'calcDoubleAgent',
|
||||
'calcBroker',
|
||||
]);
|
||||
|
||||
const options = (
|
||||
[
|
||||
'selectCalcBrokerRewardCondition',
|
||||
'selectCalcDoubleAgentRewardCondition',
|
||||
'selectDealerBrokerRewardCondition',
|
||||
'selectDealerRewardCondition',
|
||||
'selectFinDepartmentRewardCondtion',
|
||||
'selectIndAgentRewardCondition',
|
||||
] as Elements[]
|
||||
).map((elementName) => $calculation.element(elementName).getOptions());
|
||||
|
||||
return { options, values };
|
||||
},
|
||||
async ({ values }) => {
|
||||
helper.removeErrors();
|
||||
const validationResult = await validationSchema.safeParseAsync(values);
|
||||
|
||||
if (!validationResult.success) {
|
||||
validationResult.error.errors.forEach(({ path, message }) => {
|
||||
(path as Elements[]).forEach((elementName) => {
|
||||
const removeError = $calculation.element(elementName).setError({ key, message });
|
||||
if (removeError) helper.add(removeError);
|
||||
});
|
||||
});
|
||||
}
|
||||
},
|
||||
{
|
||||
delay: 100,
|
||||
}
|
||||
);
|
||||
}
|
||||
export const validation = createValidationReaction(createValidationSchema);
|
||||
|
||||
@ -4,9 +4,9 @@ import type { ValidationContext } from '../types';
|
||||
import type { Elements } from '@/Components/Calculation/config/map/values';
|
||||
import ValuesSchema from '@/config/schema/values';
|
||||
import * as CRMTypes from '@/graphql/crm.types';
|
||||
import { normalizeOptions } from '@/utils/entity';
|
||||
import dayjs from 'dayjs';
|
||||
import utc from 'dayjs/plugin/utc';
|
||||
import { normalizeOptions } from 'tools';
|
||||
import type { RefinementCtx } from 'zod';
|
||||
import { z } from 'zod';
|
||||
|
||||
@ -176,8 +176,7 @@ const SumsSchema = ValuesSchema.pick({
|
||||
export function createValidationSchema(context: ValidationContext) {
|
||||
const { apolloClient } = context;
|
||||
|
||||
return z
|
||||
.object({})
|
||||
return ValuesSchema.pick({ brand: true })
|
||||
.merge(AgentsSchema)
|
||||
.merge(ConditionsSchema)
|
||||
.merge(SumsSchema)
|
||||
@ -202,6 +201,7 @@ export function createValidationSchema(context: ValidationContext) {
|
||||
indAgent,
|
||||
indAgentRewardCondition,
|
||||
indAgentRewardSumm,
|
||||
brand: brandId,
|
||||
} = values;
|
||||
|
||||
/**
|
||||
@ -463,5 +463,39 @@ export function createValidationSchema(context: ValidationContext) {
|
||||
fieldName: 'selectIndAgentRewardCondition',
|
||||
});
|
||||
}
|
||||
|
||||
if (brandId) {
|
||||
const {
|
||||
data: { evo_brand },
|
||||
} = await apolloClient.query({
|
||||
query: CRMTypes.GetBrandDocument,
|
||||
variables: { brandId },
|
||||
});
|
||||
|
||||
if (
|
||||
evo_brand?.evo_maximum_percentage_av &&
|
||||
indAgentRewardSumm +
|
||||
calcDoubleAgentRewardSumm +
|
||||
dealerRewardSumm +
|
||||
calcBrokerRewardSum +
|
||||
dealerBrokerRewardSumm +
|
||||
finDepartmentRewardSumm >
|
||||
evo_brand?.evo_maximum_percentage_av
|
||||
) {
|
||||
ctx.addIssue({
|
||||
code: z.ZodIssueCode.custom,
|
||||
message:
|
||||
'В данном расчете АВ закладывается выше установленного максимума. Уменьшите размер АВ',
|
||||
path: [
|
||||
'tbxDealerRewardSumm',
|
||||
'tbxDealerBrokerRewardSumm',
|
||||
'tbxIndAgentRewardSumm',
|
||||
'tbxCalcDoubleAgentRewardSumm',
|
||||
'tbxCalcBrokerRewardSum',
|
||||
'tbxFinDepartmentRewardSumm',
|
||||
],
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
79
apps/web/process/tools.ts
Normal file
79
apps/web/process/tools.ts
Normal file
@ -0,0 +1,79 @@
|
||||
/* eslint-disable sonarjs/cognitive-complexity */
|
||||
import { debouncedReaction } from '../utils/mobx';
|
||||
import type { ProcessContext } from './types';
|
||||
import type { Elements } from '@/Components/Calculation/config/map/values';
|
||||
import type { Values } from '@/stores/calculation/values/types';
|
||||
import ValidationHelper from '@/stores/validation/helper';
|
||||
import { comparer, toJS } from 'mobx';
|
||||
import { uid } from 'radash';
|
||||
import type { ZodTypeAny } from 'zod';
|
||||
|
||||
export function createValidationReaction<T extends ZodTypeAny>(
|
||||
createValidationSchema: (context: ProcessContext) => T
|
||||
) {
|
||||
const key = uid(7);
|
||||
|
||||
return (context: ProcessContext) => {
|
||||
const validationSchema = createValidationSchema(context);
|
||||
const shapeValues = Object.keys(validationSchema._def.schema.shape) as string[];
|
||||
|
||||
const { store } = context;
|
||||
const { $calculation, $tables } = store;
|
||||
|
||||
const helper = new ValidationHelper();
|
||||
|
||||
debouncedReaction(
|
||||
() => {
|
||||
const values = $calculation.$values.getValues(shapeValues as Values[]);
|
||||
if (shapeValues.includes('insurance'))
|
||||
return {
|
||||
...values,
|
||||
insurance: {
|
||||
values: {
|
||||
fingap: toJS($tables.insurance.row('fingap').getValues()),
|
||||
kasko: toJS($tables.insurance.row('kasko').getValues()),
|
||||
osago: toJS($tables.insurance.row('osago').getValues()),
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
if (shapeValues.includes('payments')) {
|
||||
return {
|
||||
...values,
|
||||
payments: { values: toJS($tables.payments.values) },
|
||||
};
|
||||
}
|
||||
|
||||
return values;
|
||||
},
|
||||
async (values) => {
|
||||
helper.removeErrors();
|
||||
const validationResult = await validationSchema.safeParseAsync(values);
|
||||
|
||||
if (validationResult.success === false) {
|
||||
validationResult.error.errors.forEach(({ path, message }) => {
|
||||
(path as Array<Elements & ('insurance' | 'insurance')>).forEach((elementName) => {
|
||||
if (elementName === 'insurance') {
|
||||
const removeError = $tables.insurance.setError({ key, message });
|
||||
if (removeError) helper.add(removeError);
|
||||
} else if (elementName === 'payments') {
|
||||
const removeError = $tables.payments.setError({ key, message });
|
||||
if (removeError) helper.add(removeError);
|
||||
} else {
|
||||
const removeError = $calculation.element(elementName).setError({ key, message });
|
||||
if (removeError) helper.add(removeError);
|
||||
}
|
||||
});
|
||||
});
|
||||
} else {
|
||||
helper.removeErrors();
|
||||
}
|
||||
},
|
||||
{
|
||||
delay: 1,
|
||||
equals: comparer.structural,
|
||||
wait: 100,
|
||||
}
|
||||
);
|
||||
};
|
||||
}
|
||||
@ -1,10 +1,8 @@
|
||||
import type { ProcessContext } from '../types';
|
||||
import { createValidationSchema } from './validation';
|
||||
import type { Elements } from '@/Components/Calculation/config/map/values';
|
||||
import * as CRMTypes from '@/graphql/crm.types';
|
||||
import ValidationHelper from '@/stores/validation/helper';
|
||||
import { createValidationReaction } from '@/process/tools';
|
||||
import { reaction } from 'mobx';
|
||||
import { uid } from 'radash';
|
||||
|
||||
export function common({ store, apolloClient }: ProcessContext) {
|
||||
const { $calculation } = store;
|
||||
@ -180,10 +178,24 @@ export function common({ store, apolloClient }: ProcessContext) {
|
||||
* то поле Срок поставки = 100 000 000 и закрыто для редактирования, иначе открыто для редактирования
|
||||
*/
|
||||
reaction(
|
||||
() => $calculation.$values.getValues(['leaseObjectUsed', 'subsidy', 'product', 'dealer']),
|
||||
async ({ leaseObjectUsed, subsidy, product: productId, dealer: dealerId }) => {
|
||||
() =>
|
||||
$calculation.$values.getValues([
|
||||
'leaseObjectUsed',
|
||||
'subsidy',
|
||||
'product',
|
||||
'dealer',
|
||||
'supplierFinancing',
|
||||
]),
|
||||
async ({
|
||||
leaseObjectUsed,
|
||||
subsidy: subsidyId,
|
||||
product: productId,
|
||||
dealer: dealerId,
|
||||
supplierFinancing,
|
||||
}) => {
|
||||
let evo_baseproduct: CRMTypes.GetProductQuery['evo_baseproduct'] = null;
|
||||
let dealer: CRMTypes.GetDealerQuery['dealer'] = null;
|
||||
let evo_subsidy: CRMTypes.GetSubsidyQuery['evo_subsidy'] = null;
|
||||
|
||||
if (productId) {
|
||||
const { data } = await apolloClient.query({
|
||||
@ -202,13 +214,30 @@ export function common({ store, apolloClient }: ProcessContext) {
|
||||
({ dealer } = data);
|
||||
}
|
||||
|
||||
if (subsidyId) {
|
||||
const { data } = await apolloClient.query({
|
||||
query: CRMTypes.GetSubsidyDocument,
|
||||
variables: { subsidyId },
|
||||
});
|
||||
({ evo_subsidy } = data);
|
||||
}
|
||||
|
||||
const evo_subsidy_evo_delivery_time = evo_subsidy?.evo_delivery_time?.filter((x) => x > 0);
|
||||
|
||||
if (
|
||||
leaseObjectUsed ||
|
||||
subsidy ||
|
||||
(evo_subsidy_evo_delivery_time?.length === 1 &&
|
||||
evo_subsidy_evo_delivery_time.includes(100_000_000)) ||
|
||||
evo_baseproduct?.evo_sale_without_nds ||
|
||||
dealer?.evo_return_leasing_dealer
|
||||
) {
|
||||
$calculation.element('radioDeliveryTime').setValue(100_000_000).block();
|
||||
} else if (
|
||||
(evo_subsidy_evo_delivery_time?.length === 1 &&
|
||||
evo_subsidy_evo_delivery_time.includes(100_000_001)) ||
|
||||
supplierFinancing
|
||||
) {
|
||||
$calculation.element('radioDeliveryTime').setValue(100_000_001).block();
|
||||
} else {
|
||||
$calculation.element('radioDeliveryTime').unblock();
|
||||
}
|
||||
@ -216,13 +245,17 @@ export function common({ store, apolloClient }: ProcessContext) {
|
||||
);
|
||||
|
||||
reaction(
|
||||
() => $calculation.element('selectSubsidy').getValue(),
|
||||
(subsidyId) => {
|
||||
if (subsidyId) {
|
||||
() => $calculation.$values.getValues(['subsidy', 'supplierFinancing']),
|
||||
({ subsidy: subsidyId, supplierFinancing }) => {
|
||||
if (subsidyId || supplierFinancing) {
|
||||
$calculation.element('tbxLeaseObjectCount').setValue(1).block();
|
||||
$calculation.element('cbxLeaseObjectUsed').setValue(false).block();
|
||||
} else {
|
||||
$calculation.element('tbxLeaseObjectCount').unblock();
|
||||
}
|
||||
|
||||
if (subsidyId) {
|
||||
$calculation.element('cbxLeaseObjectUsed').setValue(false).block();
|
||||
} else {
|
||||
$calculation.element('cbxLeaseObjectUsed').unblock();
|
||||
}
|
||||
}
|
||||
@ -240,39 +273,4 @@ export function common({ store, apolloClient }: ProcessContext) {
|
||||
);
|
||||
}
|
||||
|
||||
const key = uid(7);
|
||||
|
||||
export function validation(context: ProcessContext) {
|
||||
const { store } = context;
|
||||
const { $calculation } = store;
|
||||
const validationSchema = createValidationSchema(context);
|
||||
|
||||
const helper = new ValidationHelper();
|
||||
reaction(
|
||||
() =>
|
||||
$calculation.$values.getValues([
|
||||
'engineHours',
|
||||
'leaseObjectCategory',
|
||||
'leaseObjectType',
|
||||
'leaseObjectUsed',
|
||||
'mileage',
|
||||
'vin',
|
||||
]),
|
||||
async (values) => {
|
||||
helper.removeErrors();
|
||||
const validationResult = await validationSchema.safeParseAsync(values);
|
||||
|
||||
if (!validationResult.success) {
|
||||
validationResult.error.errors.forEach(({ path, message }) => {
|
||||
(path as Elements[]).forEach((elementName) => {
|
||||
const removeError = $calculation.element(elementName).setError({ key, message });
|
||||
if (removeError) helper.add(removeError);
|
||||
});
|
||||
});
|
||||
}
|
||||
},
|
||||
{
|
||||
delay: 100,
|
||||
}
|
||||
);
|
||||
}
|
||||
export const validation = createValidationReaction(createValidationSchema);
|
||||
|
||||
@ -47,15 +47,6 @@ export async function createRequestData({
|
||||
|
||||
const currentUTCDate = dayjs().utc(false);
|
||||
|
||||
const transactioncurrency = values.supplierCurrency
|
||||
? (
|
||||
await apolloClient.query({
|
||||
query: CRMTypes.GetTransactionCurrencyDocument,
|
||||
variables: { currencyid: values.supplierCurrency },
|
||||
})
|
||||
).data.transactioncurrency
|
||||
: null;
|
||||
|
||||
let systemuser: CRMTypes.GetSystemUserQuery['systemuser'] = null;
|
||||
|
||||
if (user?.domainName) {
|
||||
@ -396,7 +387,7 @@ export async function createRequestData({
|
||||
},
|
||||
|
||||
async discount() {
|
||||
if (values.supplierCurrency && transactioncurrency?.isocurrencycode !== 'RUB') {
|
||||
if (values.supplierCurrency) {
|
||||
return (
|
||||
((await RUB({
|
||||
currencyid: values.supplierCurrency,
|
||||
@ -710,7 +701,7 @@ export async function createRequestData({
|
||||
},
|
||||
|
||||
async lastPaymentFix() {
|
||||
return values.lastPaymentRule === 100_000_002;
|
||||
return values.lastPaymentRule !== 100_000_002;
|
||||
},
|
||||
|
||||
async lastPaymentSum() {
|
||||
@ -921,7 +912,7 @@ export async function createRequestData({
|
||||
},
|
||||
|
||||
async plPrice() {
|
||||
if (values.supplierCurrency && transactioncurrency?.isocurrencycode !== 'RUB') {
|
||||
if (values.supplierCurrency) {
|
||||
return (
|
||||
(await RUB({
|
||||
currencyid: values.supplierCurrency,
|
||||
@ -935,7 +926,7 @@ export async function createRequestData({
|
||||
},
|
||||
|
||||
async plPriceVAT() {
|
||||
if (values.supplierCurrency && transactioncurrency?.isocurrencycode !== 'RUB') {
|
||||
if (values.supplierCurrency) {
|
||||
return (
|
||||
(await RUB({
|
||||
currencyid: values.supplierCurrency,
|
||||
@ -952,7 +943,7 @@ export async function createRequestData({
|
||||
},
|
||||
|
||||
async plPriceWithVAT() {
|
||||
if (values.supplierCurrency && transactioncurrency?.isocurrencycode !== 'RUB') {
|
||||
if (values.supplierCurrency) {
|
||||
return (
|
||||
(await RUB({
|
||||
currencyid: values.supplierCurrency,
|
||||
@ -1122,7 +1113,7 @@ export async function createRequestData({
|
||||
},
|
||||
|
||||
async supplierFinancing() {
|
||||
return false;
|
||||
return values.supplierFinancing;
|
||||
},
|
||||
|
||||
async tlmCost() {
|
||||
|
||||
@ -29,6 +29,10 @@ export function transformCalculateResults({
|
||||
})
|
||||
);
|
||||
|
||||
const { subsidySum } = inputValues;
|
||||
resultPayments[0].paymentSum -= subsidySum;
|
||||
resultPayments[0].ndsCompensation -= subsidySum - subsidySum / (1 + VAT);
|
||||
|
||||
const resultValues: OutputData['resultValues'] = {
|
||||
resultAB_FL: ((preparedValues.agentsSum + preparedValues.doubleAgentsSum) / ESN) * (1 - NDFL),
|
||||
resultAB_UL:
|
||||
@ -55,12 +59,12 @@ export function transformCalculateResults({
|
||||
preparedValues.nsibBrutto +
|
||||
preparedValues.insuranceFinGAPNmper,
|
||||
resultFirstPayment: preparedValues.firstPaymentSum * (1 + VAT) - inputValues.subsidySum,
|
||||
resultFirstPaymentRiskPolicy: preparedValues?.firstPayment * 100,
|
||||
resultIRRGraphPerc: columns.sumColumn.irr * 100,
|
||||
resultIRRNominalPerc: columns.cashflowMsfoColumn.nominal * 100,
|
||||
resultFirstPaymentRiskPolicy: preparedValues?.firstPayment,
|
||||
resultIRRGraphPerc: columns.sumColumn.irr,
|
||||
resultIRRNominalPerc: columns.cashflowMsfoColumn.nominal,
|
||||
resultInsKasko: preparedValues.insuranceKasko,
|
||||
resultInsOsago: preparedValues.insuranceOsago,
|
||||
resultLastPayment: preparedValues.lastPaymentSum * (1 + VAT),
|
||||
resultLastPayment: last(columns?.sumWithVatColumn?.values) || 0,
|
||||
resultParticipationAmount:
|
||||
preparedValues.niAtInception +
|
||||
(preparedValues.ratBonus + preparedValues.nsBonus + preparedValues.nsibBonus) *
|
||||
@ -80,7 +84,7 @@ export function transformCalculateResults({
|
||||
preparedValues.plPriceWithVAT -
|
||||
inputValues.supplierDiscountRub -
|
||||
inputValues.importProgramSum,
|
||||
resultPriceUpPr: postValues.priceUP_Year_PR * 100,
|
||||
resultPriceUpPr: postValues.priceUP_Year_PR,
|
||||
resultTerm: preparedValues.nmper,
|
||||
resultTotalGraphwithNDS: columns.sumWithVatColumn.values[0] - inputValues.subsidySum,
|
||||
};
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
import type { CalculateInput, Context } from '../types';
|
||||
import elementsTitles from '@/Components/Calculation/config/elements-titles';
|
||||
import type { Elements } from '@/Components/Calculation/config/map/values';
|
||||
import * as addProduct from '@/process/add-product';
|
||||
import * as bonuses from '@/process/bonuses';
|
||||
import * as configurator from '@/process/configurator';
|
||||
import * as gibdd from '@/process/gibdd';
|
||||
@ -20,6 +21,7 @@ const processes = [
|
||||
leasingObject,
|
||||
gibdd,
|
||||
insuranceProcess,
|
||||
addProduct,
|
||||
];
|
||||
|
||||
const titles = Object.assign(elementsTitles, {
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
import type RootStore from '../root';
|
||||
import type { RemoveError, ValidationConfig, ValidationError, ValidationParams } from './types';
|
||||
import { makeAutoObservable } from 'mobx';
|
||||
import notification from 'ui/elements/notification';
|
||||
import { notification } from 'ui/elements';
|
||||
|
||||
export default class Validation {
|
||||
private root: RootStore;
|
||||
|
||||
@ -17,6 +17,19 @@ type Input = {
|
||||
export function createCurrencyUtility({ apolloClient }: Context) {
|
||||
return {
|
||||
async RUB({ currencyid, value }: Input) {
|
||||
const {
|
||||
data: { transactioncurrency },
|
||||
} = await apolloClient.query({
|
||||
query: CRMTypes.GetTransactionCurrencyDocument,
|
||||
variables: {
|
||||
currencyid,
|
||||
},
|
||||
});
|
||||
|
||||
if (transactioncurrency?.isocurrencycode === 'RUB') {
|
||||
return value;
|
||||
}
|
||||
|
||||
const {
|
||||
data: { evo_currencychanges },
|
||||
} = await apolloClient.query({
|
||||
|
||||
51
apps/web/utils/mobx.ts
Normal file
51
apps/web/utils/mobx.ts
Normal file
@ -0,0 +1,51 @@
|
||||
import type { IReactionDisposer, IReactionOptions, IReactionPublic } from 'mobx';
|
||||
import { reaction } from 'mobx';
|
||||
import { debounce, omit } from 'radash';
|
||||
|
||||
export function disposableReaction<T, FireImmediately extends boolean = false>(
|
||||
disposeExpression: () => boolean,
|
||||
expression: (r: IReactionPublic) => T,
|
||||
effect: (
|
||||
arg: T,
|
||||
prev: FireImmediately extends true ? T | undefined : T,
|
||||
r: IReactionPublic
|
||||
) => void,
|
||||
reactionOpts?: IReactionOptions<T, FireImmediately>
|
||||
) {
|
||||
let disposer: IReactionDisposer | undefined;
|
||||
|
||||
if (!disposeExpression()) {
|
||||
disposer = reaction(expression, effect, reactionOpts);
|
||||
}
|
||||
|
||||
function cleanDisposer() {
|
||||
disposer = undefined;
|
||||
}
|
||||
|
||||
reaction(disposeExpression, (mustBeDisposed) => {
|
||||
if (mustBeDisposed) {
|
||||
if (disposer !== undefined) disposer();
|
||||
cleanDisposer();
|
||||
} else {
|
||||
disposer = reaction(
|
||||
expression,
|
||||
effect,
|
||||
reactionOpts ? omit(reactionOpts, ['fireImmediately']) : undefined
|
||||
);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
export function debouncedReaction<T, FireImmediately extends boolean = false>(
|
||||
expression: (r: IReactionPublic) => T,
|
||||
effect: (
|
||||
arg: T,
|
||||
prev: FireImmediately extends true ? T | undefined : T,
|
||||
r: IReactionPublic
|
||||
) => void,
|
||||
{ wait, ...reactionOpts }: IReactionOptions<T, FireImmediately> & { wait: number }
|
||||
): IReactionDisposer {
|
||||
const debouncedEffect = debounce({ delay: wait }, effect);
|
||||
|
||||
return reaction(expression, debouncedEffect, reactionOpts);
|
||||
}
|
||||
@ -1,6 +1,4 @@
|
||||
export * from './array';
|
||||
export * from './common';
|
||||
export * from './entity';
|
||||
export * from './mobx';
|
||||
export * from './number';
|
||||
export * from './object';
|
||||
|
||||
@ -1,22 +0,0 @@
|
||||
import type { IReactionDisposer } from 'mobx';
|
||||
import { autorun } from 'mobx';
|
||||
|
||||
export function makeDisposable(
|
||||
createReaction: () => IReactionDisposer,
|
||||
mustBeDisposed: () => boolean
|
||||
) {
|
||||
let disposer: IReactionDisposer | undefined;
|
||||
|
||||
function cleanDisposer() {
|
||||
disposer = undefined;
|
||||
}
|
||||
|
||||
autorun(() => {
|
||||
if (mustBeDisposed()) {
|
||||
if (disposer !== undefined) disposer();
|
||||
cleanDisposer();
|
||||
} else {
|
||||
disposer = createReaction();
|
||||
}
|
||||
});
|
||||
}
|
||||
@ -11,7 +11,5 @@
|
||||
"eslint": "^8.35.0",
|
||||
"eslint-config-custom": "*"
|
||||
},
|
||||
"dependencies": {
|
||||
"mobx": "^6.8.0"
|
||||
}
|
||||
"dependencies": {}
|
||||
}
|
||||
|
||||
@ -1 +0,0 @@
|
||||
export { Alert as default } from 'antd';
|
||||
@ -1 +0,0 @@
|
||||
export { Result as default } from 'antd';
|
||||
@ -1 +0,0 @@
|
||||
export { Table as default } from 'antd';
|
||||
@ -1 +0,0 @@
|
||||
export { Tooltip as default } from 'antd';
|
||||
@ -1 +0,0 @@
|
||||
export { Badge } from 'antd';
|
||||
@ -1,19 +1,34 @@
|
||||
export * from './badge';
|
||||
import { message, notification } from 'antd';
|
||||
|
||||
message.config({
|
||||
maxCount: 3,
|
||||
top: 70,
|
||||
});
|
||||
|
||||
notification.config({
|
||||
placement: 'bottomRight',
|
||||
});
|
||||
|
||||
export { default as Button } from './Button';
|
||||
export { default as Checkbox } from './Checkbox';
|
||||
export { default as AntdConfig } from './Config';
|
||||
export { default as Input } from './Input';
|
||||
export { default as InputNumber } from './InputNumber';
|
||||
export * from './layout';
|
||||
export { default as Link } from './Link';
|
||||
export { default as message } from './message';
|
||||
export { default as notification } from './notification';
|
||||
export { default as Radio } from './Radio';
|
||||
export { default as Result } from './Result';
|
||||
export { default as Segmented } from './Segmented';
|
||||
export { default as Select } from './Select';
|
||||
export { default as Switch } from './Switch';
|
||||
export { default as Table } from './Table';
|
||||
export * from './tag';
|
||||
export { default as Text } from './Text';
|
||||
export { default as Tooltip } from './Tooltip';
|
||||
export {
|
||||
Alert,
|
||||
Badge,
|
||||
Divider,
|
||||
message,
|
||||
notification,
|
||||
Result,
|
||||
Table,
|
||||
Tabs,
|
||||
Tag,
|
||||
Tooltip,
|
||||
} from 'antd';
|
||||
|
||||
@ -1 +0,0 @@
|
||||
export { Divider as default } from 'antd';
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user