merge migration/random-2
This commit is contained in:
parent
b786f49aa1
commit
d1df501f86
1
.env
1
.env
@ -9,3 +9,4 @@ USERS_SUPER=["akalinina","vchikalkin"]
|
||||
URL_GET_USER_DIRECT=
|
||||
URL_CRM_GRAPHQL_DIRECT=
|
||||
URL_CORE_FINGAP_DIRECT=
|
||||
URL_1C_TRANSTAX_DIRECT=
|
||||
3
.vscode/settings.json
vendored
3
.vscode/settings.json
vendored
@ -14,7 +14,8 @@
|
||||
"editor.formatOnSave": true,
|
||||
"editor.codeActionsOnSave": {
|
||||
"source.fixAll": true,
|
||||
"source.fixAll.eslint": true
|
||||
"source.fixAll.eslint": true,
|
||||
"source.removeUnusedImports": true
|
||||
},
|
||||
"workbench.editor.labelFormat": "short",
|
||||
"eslint.workingDirectories": [{ "directory": "apps/web", "changeProcessCWD": true }],
|
||||
|
||||
@ -49,7 +49,7 @@ export const columns: ColumnsType<Insurance.RowValues> = [
|
||||
min={0}
|
||||
parser={parser}
|
||||
precision={2}
|
||||
step={1_000}
|
||||
step={1000}
|
||||
/>
|
||||
);
|
||||
},
|
||||
|
||||
@ -13,7 +13,7 @@ export function useInsuranceValue(key, valueName) {
|
||||
|
||||
const [value, setValue] = useState(storeValue);
|
||||
|
||||
const debouncedSetStoreValue = useDebouncedCallback(setStoreValue, 350, { maxWait: 1_000 });
|
||||
const debouncedSetStoreValue = useDebouncedCallback(setStoreValue, 350, { maxWait: 1000 });
|
||||
|
||||
useEffect(() => {
|
||||
if (storeValue !== value) {
|
||||
|
||||
@ -14,5 +14,5 @@ export const rows: FormTabRows = [
|
||||
[['tbxLeaseObjectCount', 'selectEngineType', 'tbxMaxSpeed']],
|
||||
[['tbxLeaseObjectYear', 'tbxLeaseObjectMotorPower', 'tbxCountSeats']],
|
||||
[['selectLeaseObjectCategory', 'tbxEngineVolume', 'tbxMileage']],
|
||||
[['tbxMaxMass', 'tbxEngineHours']],
|
||||
[['tbxMaxMass', 'tbxEngineHours', 'tbxVIN']],
|
||||
];
|
||||
|
||||
@ -24,14 +24,7 @@ export const columns: ColumnsType<Payment> = [
|
||||
render: (_value, payment) => {
|
||||
const Component = buildValueComponent(payment.num, InputNumber);
|
||||
|
||||
return (
|
||||
<Component
|
||||
max={100}
|
||||
min={payment.num === 0 ? 0 : 0.01}
|
||||
precision={payment.num === 0 ? 4 : 2}
|
||||
step={1}
|
||||
/>
|
||||
);
|
||||
return <Component max={100} min={0} precision={payment.num === 0 ? 4 : 2} step={1} />;
|
||||
},
|
||||
},
|
||||
];
|
||||
|
||||
@ -6,7 +6,7 @@ export function usePaymentValue(index) {
|
||||
const [storeValue, setStoreValue] = useRowValue(index);
|
||||
const [value, setValue] = useState(storeValue);
|
||||
|
||||
const debouncedSetStoreValue = useDebouncedCallback(setStoreValue, 350, { maxWait: 1_000 });
|
||||
const debouncedSetStoreValue = useDebouncedCallback(setStoreValue, 350, { maxWait: 1000 });
|
||||
|
||||
useEffect(() => {
|
||||
if (storeValue !== value) {
|
||||
|
||||
@ -10,14 +10,14 @@ type BuilderProps = {
|
||||
|
||||
export default function buildAction<T>(
|
||||
Component: ComponentType<T>,
|
||||
{ elementName, valueName: actionName }: BuilderProps
|
||||
{ elementName, valueName: processName }: BuilderProps
|
||||
) {
|
||||
return observer((props: T) => {
|
||||
const status = useStatus(elementName);
|
||||
|
||||
return (
|
||||
<Component
|
||||
action={() => import(`process/${actionName}`).then((module) => module.default())}
|
||||
action={() => import(`process/${processName}/action`).then((module) => module.action())}
|
||||
status={status}
|
||||
{...props}
|
||||
/>
|
||||
|
||||
@ -6,7 +6,7 @@ export function useStoreValue(valueName) {
|
||||
const [storeValue, setStoreValue] = useValue(valueName);
|
||||
const [value, setValue] = useState(storeValue);
|
||||
|
||||
const debouncedSetStoreValue = useDebouncedCallback(setStoreValue, 350, { maxWait: 1_000 });
|
||||
const debouncedSetStoreValue = useDebouncedCallback(setStoreValue, 350, { maxWait: 1000 });
|
||||
|
||||
useEffect(() => {
|
||||
if (storeValue !== value) {
|
||||
|
||||
@ -133,6 +133,7 @@ const components = wrapComponentsMap({
|
||||
tbxMinPriceChange: e.InputNumber,
|
||||
tbxBonusCoefficient: e.InputNumber,
|
||||
selectLeasingWithoutKasko: e.Select,
|
||||
tbxVIN: e.Input,
|
||||
|
||||
/** Readonly Elements */
|
||||
labelLeaseObjectRisk: e.Text,
|
||||
|
||||
@ -48,7 +48,7 @@ const props: Partial<ElementsProps> = {
|
||||
precision: 2,
|
||||
parser,
|
||||
formatter,
|
||||
addonAfter: '₽',
|
||||
addonAfter: CurrencyAddon,
|
||||
},
|
||||
tbxSupplierDiscountPerc: {
|
||||
min: 0,
|
||||
@ -199,7 +199,7 @@ const props: Partial<ElementsProps> = {
|
||||
},
|
||||
tbxEngineVolume: {
|
||||
min: 0,
|
||||
max: 99.999_9,
|
||||
max: 99.9999,
|
||||
step: 0.5,
|
||||
precision: 4,
|
||||
parser,
|
||||
@ -217,8 +217,8 @@ const props: Partial<ElementsProps> = {
|
||||
tbxCountSeats: {
|
||||
min: 0,
|
||||
max: 2000,
|
||||
precision: 0,
|
||||
parser,
|
||||
formatter,
|
||||
},
|
||||
tbxMaxSpeed: {
|
||||
min: 0,
|
||||
@ -356,7 +356,7 @@ const props: Partial<ElementsProps> = {
|
||||
tbxIRR_Perc: {
|
||||
min: 0,
|
||||
max: 500,
|
||||
step: 0.000_1,
|
||||
step: 0.0001,
|
||||
precision: 6,
|
||||
parser,
|
||||
formatter: formatterExtra,
|
||||
@ -365,7 +365,7 @@ const props: Partial<ElementsProps> = {
|
||||
linkDownloadKp: {
|
||||
type: 'primary',
|
||||
text: 'Скачать КП',
|
||||
icon: DownloadOutlined,
|
||||
icon: <DownloadOutlined />,
|
||||
},
|
||||
tbxMileage: {
|
||||
min: 0,
|
||||
@ -7,8 +7,10 @@ import map from '../map';
|
||||
import type { RenderProps } from './types';
|
||||
import { Container, Head } from '@/Components/Layout/Element';
|
||||
import { useStore } from '@/stores/hooks';
|
||||
import { useIsFetching } from '@tanstack/react-query';
|
||||
import { observer } from 'mobx-react-lite';
|
||||
import type { ComponentProps } from 'react';
|
||||
import { LoadingOutlined } from 'ui/elements/icons';
|
||||
import Link from 'ui/elements/Link';
|
||||
import Tooltip from 'ui/elements/Tooltip';
|
||||
|
||||
@ -192,14 +194,24 @@ const overrideRender: Partial<Record<keyof typeof map, RenderProps>> = {
|
||||
valueName,
|
||||
});
|
||||
|
||||
function RenderedComponent() {
|
||||
const isFetching = useIsFetching({ queryKey: ['1c', 'trans-tax'] });
|
||||
|
||||
return (
|
||||
<Tooltip placement="topLeft" title="Без учета налога на роскошь">
|
||||
<Container>
|
||||
<Head htmlFor={elementName} title={title} />
|
||||
<Element {...props} id={elementName} />
|
||||
<Element
|
||||
{...props}
|
||||
id={elementName}
|
||||
addonBefore={isFetching && <LoadingOutlined spin />}
|
||||
/>
|
||||
</Container>
|
||||
</Tooltip>
|
||||
);
|
||||
}
|
||||
|
||||
return <RenderedComponent />;
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
@ -127,6 +127,7 @@ const titles: Record<ActionElements | ValuesElements, string> = {
|
||||
tbxVATInLeaseObjectPrice: 'НДС в стоимости ПЛ',
|
||||
tbxBonusCoefficient: 'Коэффициент снижения бонуса',
|
||||
selectLeasingWithoutKasko: 'Лизинг без КАСКО',
|
||||
tbxVIN: 'VIN',
|
||||
|
||||
/** Link Elements */
|
||||
linkDownloadKp: '',
|
||||
|
||||
@ -164,6 +164,7 @@ const types = wrapElementsTypes({
|
||||
radioTypePTS: t.Options,
|
||||
tbxBonusCoefficient: t.Value,
|
||||
selectLeasingWithoutKasko: t.Options,
|
||||
tbxVIN: t.Value,
|
||||
|
||||
labelLeaseObjectRisk: t.Readonly,
|
||||
tbxInsKaskoPriceLeasePeriod: t.Readonly,
|
||||
|
||||
@ -130,6 +130,7 @@ const elementsToValues = wrapElementsMap({
|
||||
selectFuelCard: 'fuelCard',
|
||||
tbxMinPriceChange: 'minPriceChange',
|
||||
tbxBonusCoefficient: 'bonusCoefficient',
|
||||
tbxVIN: 'vin',
|
||||
|
||||
/** Readonly Elements */
|
||||
labelLeaseObjectRisk: 'leaseObjectRiskName',
|
||||
|
||||
12
apps/web/api/1c/query.ts
Normal file
12
apps/web/api/1c/query.ts
Normal file
@ -0,0 +1,12 @@
|
||||
import type { RequestTransTax, ResponseTransTax } from './types';
|
||||
import getUrls from '@/config/urls';
|
||||
import type { QueryFunctionContext } from '@tanstack/react-query';
|
||||
import axios from 'axios';
|
||||
|
||||
const { URL_1C_TRANSTAX } = getUrls();
|
||||
|
||||
export async function getTransTax(payload: RequestTransTax, { signal }: QueryFunctionContext) {
|
||||
const { data } = await axios.post<ResponseTransTax>(URL_1C_TRANSTAX, payload, { signal });
|
||||
|
||||
return data;
|
||||
}
|
||||
11
apps/web/api/1c/types.ts
Normal file
11
apps/web/api/1c/types.ts
Normal file
@ -0,0 +1,11 @@
|
||||
export type RequestTransTax = {
|
||||
OKTMO: string;
|
||||
calcDate: Date;
|
||||
carCategory: string;
|
||||
power: number;
|
||||
year: number;
|
||||
};
|
||||
export type ResponseTransTax = {
|
||||
error: string;
|
||||
tax: number;
|
||||
};
|
||||
@ -6,6 +6,6 @@ import axios from 'axios';
|
||||
|
||||
const { URL_GET_USER } = getUrls();
|
||||
|
||||
export async function getUser(config: AxiosRequestConfig) {
|
||||
export async function getUser(config?: AxiosRequestConfig) {
|
||||
return await axios.get<User>(URL_GET_USER, config).then((res) => love(res.data));
|
||||
}
|
||||
|
||||
@ -67,10 +67,36 @@ export const radioGraphType = [
|
||||
{
|
||||
label: 'легкий старт',
|
||||
value: 100_000_004,
|
||||
disabled: true,
|
||||
},
|
||||
];
|
||||
|
||||
export const selectObjectCategoryTax = [
|
||||
'M1',
|
||||
'M2',
|
||||
'M3',
|
||||
'M1G',
|
||||
'M2G',
|
||||
'M3G',
|
||||
'N1',
|
||||
'N2',
|
||||
'N3',
|
||||
'N1G',
|
||||
'N2G',
|
||||
'N3G',
|
||||
'O1',
|
||||
'O2',
|
||||
'O3',
|
||||
'O4',
|
||||
'L1',
|
||||
'L2',
|
||||
'L3',
|
||||
'L4',
|
||||
'L5',
|
||||
].map((label, i) => ({
|
||||
label,
|
||||
value: 100_000_000 + i,
|
||||
}));
|
||||
|
||||
const defaultOptions: CalculationOptions = {
|
||||
radioLastPaymentRule: [
|
||||
{
|
||||
@ -345,32 +371,7 @@ const defaultOptions: CalculationOptions = {
|
||||
value: 100_000_001,
|
||||
},
|
||||
],
|
||||
selectObjectCategoryTax: [
|
||||
'M1',
|
||||
'M2',
|
||||
'M3',
|
||||
'M1G',
|
||||
'M2G',
|
||||
'M3G',
|
||||
'N1',
|
||||
'N2',
|
||||
'N3',
|
||||
'N1G',
|
||||
'N2G',
|
||||
'N3G',
|
||||
'O1',
|
||||
'O2',
|
||||
'O3',
|
||||
'O4',
|
||||
'L1',
|
||||
'L2',
|
||||
'L3',
|
||||
'L4',
|
||||
'L5',
|
||||
].map((label, i) => ({
|
||||
label,
|
||||
value: 100_000_000 + i,
|
||||
})),
|
||||
selectObjectCategoryTax,
|
||||
selectObjectTypeTax: [
|
||||
{
|
||||
label: 'Автобус',
|
||||
@ -508,6 +509,7 @@ const defaultOptions: CalculationOptions = {
|
||||
linkQuoteUrl: [],
|
||||
tbxBonusCoefficient: [],
|
||||
selectLeasingWithoutKasko: [],
|
||||
tbxVIN: [],
|
||||
};
|
||||
|
||||
export default defaultOptions;
|
||||
|
||||
@ -132,8 +132,9 @@ const defaultStatuses: CalculationStatuses = {
|
||||
tbxSubsidySum: 'Default',
|
||||
tbxSupplierDiscountPerc: 'Default',
|
||||
tbxSupplierDiscountRub: 'Default',
|
||||
tbxTotalPayments: 'Default',
|
||||
tbxTotalPayments: 'Disabled',
|
||||
tbxVATInLeaseObjectPrice: 'Default',
|
||||
tbxVIN: 'Disabled',
|
||||
tbxVehicleTaxInLeasingPeriod: 'Disabled',
|
||||
tbxVehicleTaxInYear: 'Default',
|
||||
};
|
||||
|
||||
@ -40,7 +40,7 @@ const defaultValues: CalculationValues = {
|
||||
engineVolume: 0,
|
||||
finDepartmentRewardCondtion: null,
|
||||
finDepartmentRewardSumm: 0,
|
||||
firstPaymentPerc: 25,
|
||||
firstPaymentPerc: 0,
|
||||
firstPaymentRub: 0,
|
||||
fuelCard: null,
|
||||
fullPriceWithDiscount: false,
|
||||
@ -113,13 +113,13 @@ const defaultValues: CalculationValues = {
|
||||
quoteUrl: null,
|
||||
rate: null,
|
||||
recalcWithRevision: false,
|
||||
redemptionPaymentSum: 1_000,
|
||||
redemptionPaymentSum: 1000,
|
||||
regionRegistration: null,
|
||||
registration: null,
|
||||
registrationDescription: '-',
|
||||
registrationQuote: true,
|
||||
requirementTelematic: 100_000_000,
|
||||
saleBonus: 1.3,
|
||||
saleBonus: 0,
|
||||
seasonType: null,
|
||||
showFinGAP: true,
|
||||
subsidy: null,
|
||||
@ -134,11 +134,12 @@ const defaultValues: CalculationValues = {
|
||||
totalPayments: 0,
|
||||
townRegistration: null,
|
||||
tracker: null,
|
||||
typePTS: 100_000_001,
|
||||
typePTS: null,
|
||||
VATInLeaseObjectPrice: 0,
|
||||
vehicleTaxInLeasingPeriod: 0,
|
||||
vehicleTaxInYear: 0,
|
||||
withTrailer: false,
|
||||
vin: null,
|
||||
};
|
||||
|
||||
export default defaultValues;
|
||||
|
||||
37
apps/web/config/process/default.ts
Normal file
37
apps/web/config/process/default.ts
Normal file
@ -0,0 +1,37 @@
|
||||
import * as bonuses from '@/process/bonuses';
|
||||
import * as calculate from '@/process/calculate';
|
||||
import * as configurator from '@/process/configurator';
|
||||
import * as createKP from '@/process/create-kp';
|
||||
import * as fingap from '@/process/fingap';
|
||||
import * as gibdd from '@/process/gibdd';
|
||||
import { useProcess } from '@/process/hooks';
|
||||
import * as leadOpportunity from '@/process/lead-opportunity';
|
||||
import * as leasingObject from '@/process/leasing-object';
|
||||
import * as leasingWithoutKasko from '@/process/leasing-without-kasko';
|
||||
import * as loadKP from '@/process/load-kp';
|
||||
import * as payments from '@/process/payments';
|
||||
import * as price from '@/process/price';
|
||||
import * as subsidy from '@/process/subsidy';
|
||||
import * as subsidyImportProgram from '@/process/subsidy-import-program';
|
||||
import * as supplierAgent from '@/process/supplier-agent';
|
||||
import * as usedPl from '@/process/used-pl';
|
||||
|
||||
export default function useReactions() {
|
||||
useProcess(leadOpportunity);
|
||||
useProcess(loadKP);
|
||||
useProcess(calculate);
|
||||
useProcess(supplierAgent);
|
||||
useProcess(price);
|
||||
useProcess(fingap);
|
||||
useProcess(loadKP);
|
||||
useProcess(leasingWithoutKasko);
|
||||
useProcess(subsidy);
|
||||
useProcess(leasingObject);
|
||||
useProcess(configurator);
|
||||
useProcess(createKP);
|
||||
useProcess(bonuses);
|
||||
useProcess(usedPl);
|
||||
useProcess(subsidyImportProgram);
|
||||
useProcess(payments);
|
||||
useProcess(gibdd);
|
||||
}
|
||||
1
apps/web/config/process/index.ts
Normal file
1
apps/web/config/process/index.ts
Normal file
@ -0,0 +1 @@
|
||||
export { default as useDefaultReactions } from './default';
|
||||
@ -3,6 +3,7 @@ const { z } = require('zod');
|
||||
const envSchema = z.object({
|
||||
BASE_PATH: z.string().optional().default(''),
|
||||
PORT: z.string().optional(),
|
||||
URL_1C_TRANSTAX_DIRECT: z.string(),
|
||||
URL_CORE_FINGAP_DIRECT: z.string(),
|
||||
URL_CRM_GRAPHQL_DIRECT: z.string(),
|
||||
URL_GET_USER_DIRECT: z.string(),
|
||||
|
||||
@ -9,6 +9,7 @@ const publicRuntimeConfigSchema = envSchema.pick({
|
||||
const serverRuntimeConfigSchema = envSchema.pick({
|
||||
BASE_PATH: true,
|
||||
PORT: true,
|
||||
URL_1C_TRANSTAX_DIRECT: true,
|
||||
URL_CORE_FINGAP_DIRECT: true,
|
||||
URL_CRM_GRAPHQL_DIRECT: true,
|
||||
URL_GET_USER_DIRECT: true,
|
||||
|
||||
@ -126,6 +126,7 @@ const ValuesSchema = z
|
||||
vehicleTaxInLeasingPeriod: z.number(),
|
||||
vehicleTaxInYear: z.number(),
|
||||
withTrailer: z.boolean(),
|
||||
vin: z.string().nullable(),
|
||||
|
||||
/**
|
||||
* Link Values
|
||||
|
||||
@ -33,31 +33,37 @@ export const defaultOptions: Record<Insurance.Keys, Insurance.RowOptions> = {
|
||||
fingap: defaultRowOptions,
|
||||
};
|
||||
|
||||
export const defaultValues: Insurance.RowValues[] = [
|
||||
{
|
||||
export const DEFAULT_OSAGO_ROW: Insurance.RowValues = {
|
||||
key: 'osago',
|
||||
policyType: 'ОСАГО',
|
||||
insuranceCompany: null,
|
||||
insured: 100_000_000,
|
||||
insCost: 0,
|
||||
insTerm: 100_000_000,
|
||||
},
|
||||
{
|
||||
};
|
||||
|
||||
export const DEFAULT_KASKO_ROW: Insurance.RowValues = {
|
||||
key: 'kasko',
|
||||
policyType: 'КАСКО',
|
||||
insuranceCompany: null,
|
||||
insured: 100_000_000,
|
||||
insCost: 0,
|
||||
insTerm: null,
|
||||
},
|
||||
{
|
||||
};
|
||||
|
||||
export const DEFAULT_FINGAP_ROW: Insurance.RowValues = {
|
||||
key: 'fingap',
|
||||
policyType: 'Safe Finance',
|
||||
insuranceCompany: null,
|
||||
insured: 100_000_000,
|
||||
insCost: 0,
|
||||
insTerm: null,
|
||||
},
|
||||
};
|
||||
|
||||
export const defaultValues: Insurance.RowValues[] = [
|
||||
DEFAULT_OSAGO_ROW,
|
||||
DEFAULT_KASKO_ROW,
|
||||
DEFAULT_FINGAP_ROW,
|
||||
];
|
||||
|
||||
export const defaultStatuses: Record<Insurance.Keys, Insurance.RowStatuses> = {
|
||||
|
||||
@ -9,12 +9,18 @@ function getUrls() {
|
||||
const { BASE_PATH } = publicRuntimeConfigSchema.parse(publicRuntimeConfig);
|
||||
|
||||
if (isServer()) {
|
||||
const { URL_CRM_GRAPHQL_DIRECT, URL_GET_USER_DIRECT, URL_CORE_FINGAP_DIRECT, PORT } =
|
||||
serverRuntimeConfigSchema.parse(serverRuntimeConfig);
|
||||
const {
|
||||
URL_CRM_GRAPHQL_DIRECT,
|
||||
URL_GET_USER_DIRECT,
|
||||
URL_CORE_FINGAP_DIRECT,
|
||||
URL_1C_TRANSTAX_DIRECT,
|
||||
PORT,
|
||||
} = serverRuntimeConfigSchema.parse(serverRuntimeConfig);
|
||||
|
||||
return {
|
||||
BASE_PATH,
|
||||
PORT,
|
||||
URL_1C_TRANSTAX: URL_1C_TRANSTAX_DIRECT,
|
||||
URL_CORE_FINGAP: URL_CORE_FINGAP_DIRECT,
|
||||
URL_CRM_GRAPHQL: URL_CRM_GRAPHQL_DIRECT,
|
||||
URL_GET_USER: URL_GET_USER_DIRECT,
|
||||
@ -27,6 +33,7 @@ function getUrls() {
|
||||
|
||||
return {
|
||||
BASE_PATH,
|
||||
URL_1C_TRANSTAX: withBasePath(urls.URL_1C_TRANSTAX_PROXY),
|
||||
URL_CORE_FINGAP: withBasePath(urls.URL_CORE_FINGAP_PROXY),
|
||||
URL_CRM_GRAPHQL: withBasePath(urls.URL_CRM_GRAPHQL_PROXY),
|
||||
URL_GET_USER: withBasePath(urls.URL_GET_USER_PROXY),
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
module.exports = {
|
||||
URL_1C_TRANSTAX_PROXY: '/api/1c/transtax',
|
||||
URL_CORE_FINGAP_PROXY: '/api/core/fingap',
|
||||
URL_CRM_GRAPHQL_PROXY: '/api/graphql/crm',
|
||||
URL_GET_USER_PROXY: '/api/auth/user',
|
||||
|
||||
@ -5,3 +5,5 @@ export const MIN_INSURANCE = 3000;
|
||||
export const RATE = 7.75;
|
||||
export const MAX_LEASING_PERIOD = 60;
|
||||
export const MIN_LASTPAYMENT_NSIB = 3500;
|
||||
export const MIN_PAYMENT = 3;
|
||||
export const VAT = 0.2;
|
||||
|
||||
@ -22,6 +22,13 @@ query GetCurrencyChanges($currentDate: DateTime) {
|
||||
}
|
||||
}
|
||||
|
||||
query GetLeads($domainname: String) {
|
||||
leads(owner_domainname: $domainname) {
|
||||
label: fullname
|
||||
value: leadid
|
||||
}
|
||||
}
|
||||
|
||||
query GetLead($leadid: Uuid!) {
|
||||
lead(leadid: $leadid) {
|
||||
evo_agent_accountid
|
||||
@ -32,12 +39,32 @@ query GetLead($leadid: Uuid!) {
|
||||
label: name
|
||||
value: opportunityid
|
||||
}
|
||||
evo_inn
|
||||
accountidData {
|
||||
evo_address_legalidData {
|
||||
evo_region_fias_id
|
||||
evo_city_fias_id
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
query GetOpportunity($opportunityid: Uuid!) {
|
||||
opportunity(opportunityid: $opportunityid) {
|
||||
evo_leadid
|
||||
accountidData {
|
||||
evo_address_legalidData {
|
||||
evo_region_fias_id
|
||||
evo_city_fias_id
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
query GetOpportunities($domainname: String) {
|
||||
opportunities(owner_domainname: $domainname) {
|
||||
label: name
|
||||
value: opportunityid
|
||||
}
|
||||
}
|
||||
|
||||
@ -81,6 +108,9 @@ query GetTarif($tarifId: Uuid!) {
|
||||
evo_graphtype_exception
|
||||
evo_seasons_type_exception
|
||||
evo_min_decreasing_perc
|
||||
evo_min_irr
|
||||
evo_cut_irr_with_bonus_coefficient
|
||||
evo_max_irr
|
||||
}
|
||||
}
|
||||
|
||||
@ -99,6 +129,12 @@ query GetRates($currentDate: DateTime) {
|
||||
}
|
||||
}
|
||||
|
||||
query GetRate($rateId: Uuid!) {
|
||||
evo_rate(evo_rateid: $rateId) {
|
||||
evo_base_rate
|
||||
}
|
||||
}
|
||||
|
||||
query GetProducts($currentDate: DateTime) {
|
||||
evo_baseproducts(
|
||||
statecode: 0
|
||||
@ -124,6 +160,9 @@ query GetProduct($productId: Uuid!) {
|
||||
evo_brands {
|
||||
evo_brandid
|
||||
}
|
||||
evo_sale_without_nds
|
||||
evo_cut_proportion_bonus_director
|
||||
evo_cut_irr_with_bonus
|
||||
}
|
||||
}
|
||||
|
||||
@ -180,6 +219,26 @@ query GetRegions {
|
||||
evo_regions {
|
||||
label: evo_name
|
||||
value: evo_regionid
|
||||
evo_fias_id
|
||||
evo_businessunit_evolution
|
||||
}
|
||||
}
|
||||
|
||||
query GetRegion($regionId: Uuid!) {
|
||||
evo_region(evo_regionid: $regionId) {
|
||||
evo_oktmo
|
||||
accounts {
|
||||
accountid
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
query GetTowns($regionId: Uuid!) {
|
||||
evo_towns(evo_regionid: $regionId) {
|
||||
evo_fias_id
|
||||
label: evo_name
|
||||
value: evo_townid
|
||||
evo_businessunit_evolution
|
||||
}
|
||||
}
|
||||
|
||||
@ -199,8 +258,12 @@ query GetLeaseObjectTypes {
|
||||
}
|
||||
|
||||
query GetLeaseObjectType($leaseObjectTypeId: Uuid!) {
|
||||
leaseObjectType: evo_leasingobject_type(evo_leasingobject_typeid: $leaseObjectTypeId) {
|
||||
evo_leasingobject_type(evo_leasingobject_typeid: $leaseObjectTypeId) {
|
||||
evo_vehicle_type
|
||||
evo_id
|
||||
evo_category
|
||||
evo_vehicle_type_tax
|
||||
evo_category_tr
|
||||
}
|
||||
}
|
||||
|
||||
@ -213,6 +276,13 @@ query GetBrands {
|
||||
}
|
||||
}
|
||||
|
||||
query GetBrand($brandId: Uuid!) {
|
||||
evo_brand(evo_brandid: $brandId) {
|
||||
evo_importer_reward_perc
|
||||
evo_importer_reward_rub
|
||||
}
|
||||
}
|
||||
|
||||
query GetModels($brandId: Uuid!) {
|
||||
evo_models(statecode: 0, evo_brandid: $brandId) {
|
||||
label: evo_name
|
||||
@ -222,13 +292,31 @@ query GetModels($brandId: Uuid!) {
|
||||
}
|
||||
}
|
||||
|
||||
query GetConfigurations($modelId: Uuid) {
|
||||
query GetModel($modelId: Uuid!) {
|
||||
evo_model(evo_modelid: $modelId) {
|
||||
evo_impairment_groupidData {
|
||||
evo_name
|
||||
}
|
||||
evo_importer_reward_perc
|
||||
evo_importer_reward_rub
|
||||
}
|
||||
}
|
||||
|
||||
query GetConfigurations($modelId: Uuid!) {
|
||||
evo_equipments(statecode: 0, evo_modelid: $modelId) {
|
||||
label: evo_name
|
||||
value: evo_equipmentid
|
||||
}
|
||||
}
|
||||
|
||||
query GetConfiguration($configurationId: Uuid!) {
|
||||
evo_equipment(evo_equipmentid: $configurationId) {
|
||||
evo_impairment_groupidData {
|
||||
evo_name
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
query GetDealers {
|
||||
dealers: accounts(evo_account_type: [100000001], statecode: 0, evo_legal_form: 100000001) {
|
||||
label: name
|
||||
@ -286,3 +374,70 @@ query GetRewardCondition($conditionId: Uuid!) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
query GetSotCoefficientType($evo_id: String) {
|
||||
evo_sot_coefficient_type(evo_id: $evo_id) {
|
||||
evo_sot_coefficient_typeid
|
||||
}
|
||||
}
|
||||
query GetCoefficients($currentDate: DateTime, $jobTitleId: Uuid!) {
|
||||
evo_coefficients(
|
||||
statecode: 0
|
||||
evo_datefrom_param: { lte: $currentDate }
|
||||
evo_dateto_param: { gte: $currentDate }
|
||||
evo_job_titleid: $jobTitleId
|
||||
) {
|
||||
evo_job_titleid
|
||||
evo_sot_coefficient_typeid
|
||||
evo_baseproducts {
|
||||
evo_baseproductid
|
||||
}
|
||||
evo_sot_coefficient
|
||||
}
|
||||
}
|
||||
|
||||
query GetSystemUser($domainname: String) {
|
||||
systemuser(domainname: $domainname) {
|
||||
evo_job_titleid
|
||||
}
|
||||
}
|
||||
|
||||
query GetAddproductTypes($currentDate: DateTime) {
|
||||
evo_addproduct_types(
|
||||
statecode: 0
|
||||
evo_datefrom_param: { lte: $currentDate }
|
||||
evo_dateto_param: { gte: $currentDate }
|
||||
) {
|
||||
label: evo_name
|
||||
value: evo_addproduct_typeid
|
||||
evo_graph_price
|
||||
evo_product_type
|
||||
}
|
||||
}
|
||||
|
||||
query GetRegistrationTypes($currentDate: DateTime) {
|
||||
evo_addproduct_types(
|
||||
statecode: 0
|
||||
evo_datefrom_param: { lte: $currentDate }
|
||||
evo_dateto_param: { gte: $currentDate }
|
||||
evo_product_type: 100000001
|
||||
) {
|
||||
label: evo_name
|
||||
value: evo_addproduct_typeid
|
||||
evo_graph_price
|
||||
evo_leasingobject_types {
|
||||
evo_leasingobject_typeid
|
||||
}
|
||||
evo_whom_register
|
||||
evo_gibdd_region
|
||||
evo_pts_type
|
||||
evo_accountid
|
||||
evo_towtruck
|
||||
}
|
||||
}
|
||||
|
||||
query GetAddProductType($addproductTypeId: Uuid!) {
|
||||
evo_addproduct_type(evo_addproduct_typeid: $addproductTypeId) {
|
||||
evo_description
|
||||
}
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -135,19 +135,33 @@ export type GetCurrencyChangesQueryVariables = Exact<{
|
||||
|
||||
export type GetCurrencyChangesQuery = { __typename?: 'Query', evo_currencychanges: Array<{ __typename?: 'evo_currencychange', evo_currencychange: number | null, evo_ref_transactioncurrency: string | null } | null> | null };
|
||||
|
||||
export type GetLeadsQueryVariables = Exact<{
|
||||
domainname: InputMaybe<Scalars['String']>;
|
||||
}>;
|
||||
|
||||
|
||||
export type GetLeadsQuery = { __typename?: 'Query', leads: Array<{ __typename?: 'lead', label: string | null, value: string | null } | null> | null };
|
||||
|
||||
export type GetLeadQueryVariables = Exact<{
|
||||
leadid: Scalars['Uuid'];
|
||||
}>;
|
||||
|
||||
|
||||
export type GetLeadQuery = { __typename?: 'Query', lead: { __typename?: 'lead', evo_agent_accountid: string | null, evo_double_agent_accountid: string | null, evo_broker_accountid: string | null, evo_fin_department_accountid: string | null, evo_opportunityidData: { __typename?: 'opportunity', label: string | null, value: string | null } | null } | null };
|
||||
export type GetLeadQuery = { __typename?: 'Query', lead: { __typename?: 'lead', evo_agent_accountid: string | null, evo_double_agent_accountid: string | null, evo_broker_accountid: string | null, evo_fin_department_accountid: string | null, evo_inn: string | null, evo_opportunityidData: { __typename?: 'opportunity', label: string | null, value: string | null } | null, accountidData: { __typename?: 'account', evo_address_legalidData: { __typename?: 'evo_address', evo_region_fias_id: string | null, evo_city_fias_id: string | null } | null } | null } | null };
|
||||
|
||||
export type GetOpportunityQueryVariables = Exact<{
|
||||
opportunityid: Scalars['Uuid'];
|
||||
}>;
|
||||
|
||||
|
||||
export type GetOpportunityQuery = { __typename?: 'Query', opportunity: { __typename?: 'opportunity', evo_leadid: string | null } | null };
|
||||
export type GetOpportunityQuery = { __typename?: 'Query', opportunity: { __typename?: 'opportunity', evo_leadid: string | null, accountidData: { __typename?: 'account', evo_address_legalidData: { __typename?: 'evo_address', evo_region_fias_id: string | null, evo_city_fias_id: string | null } | null } | null } | null };
|
||||
|
||||
export type GetOpportunitiesQueryVariables = Exact<{
|
||||
domainname: InputMaybe<Scalars['String']>;
|
||||
}>;
|
||||
|
||||
|
||||
export type GetOpportunitiesQuery = { __typename?: 'Query', opportunities: Array<{ __typename?: 'opportunity', label: string | null, value: string | null } | null> | null };
|
||||
|
||||
export type GetQuotesQueryVariables = Exact<{
|
||||
leadid: Scalars['Uuid'];
|
||||
@ -175,7 +189,7 @@ export type GetTarifQueryVariables = Exact<{
|
||||
}>;
|
||||
|
||||
|
||||
export type GetTarifQuery = { __typename?: 'Query', evo_tarif: { __typename?: 'evo_tarif', evo_irr: number | null, evo_graphtype_exception: Array<number> | null, evo_seasons_type_exception: Array<number> | null, evo_min_decreasing_perc: number | null } | null };
|
||||
export type GetTarifQuery = { __typename?: 'Query', evo_tarif: { __typename?: 'evo_tarif', evo_irr: number | null, evo_graphtype_exception: Array<number> | null, evo_seasons_type_exception: Array<number> | null, evo_min_decreasing_perc: number | null, evo_min_irr: number | null, evo_cut_irr_with_bonus_coefficient: number | null, evo_max_irr: number | null } | null };
|
||||
|
||||
export type GetRatesQueryVariables = Exact<{
|
||||
currentDate: InputMaybe<Scalars['DateTime']>;
|
||||
@ -184,6 +198,13 @@ export type GetRatesQueryVariables = Exact<{
|
||||
|
||||
export type GetRatesQuery = { __typename?: 'Query', evo_rates: Array<{ __typename?: 'evo_rate', evo_id: string | null, label: string | null, value: string | null, evo_tarifs: Array<{ __typename?: 'evo_tarif', evo_tarifid: string | null } | null> | null } | null> | null };
|
||||
|
||||
export type GetRateQueryVariables = Exact<{
|
||||
rateId: Scalars['Uuid'];
|
||||
}>;
|
||||
|
||||
|
||||
export type GetRateQuery = { __typename?: 'Query', evo_rate: { __typename?: 'evo_rate', evo_base_rate: number | null } | null };
|
||||
|
||||
export type GetProductsQueryVariables = Exact<{
|
||||
currentDate: InputMaybe<Scalars['DateTime']>;
|
||||
}>;
|
||||
@ -196,7 +217,7 @@ export type GetProductQueryVariables = Exact<{
|
||||
}>;
|
||||
|
||||
|
||||
export type GetProductQuery = { __typename?: 'Query', evo_baseproduct: { __typename?: 'evo_baseproduct', evo_calculation_method: Array<number> | 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_leasingobject_types: Array<{ __typename?: 'evo_leasingobject_type', evo_leasingobject_typeid: string | null } | null> | null, evo_baseproducts: Array<{ __typename?: 'evo_baseproduct', evo_baseproductid: string | null } | null> | null, evo_brands: Array<{ __typename?: 'evo_brand', evo_brandid: string | null } | null> | null } | null };
|
||||
|
||||
export type GetSubsidiesQueryVariables = Exact<{
|
||||
currentDate: InputMaybe<Scalars['DateTime']>;
|
||||
@ -222,7 +243,21 @@ export type GetImportProgramQuery = { __typename?: 'Query', importProgram: { __t
|
||||
export type GetRegionsQueryVariables = Exact<{ [key: string]: never; }>;
|
||||
|
||||
|
||||
export type GetRegionsQuery = { __typename?: 'Query', evo_regions: Array<{ __typename?: 'evo_region', label: string | null, value: string | null } | null> | null };
|
||||
export type GetRegionsQuery = { __typename?: 'Query', evo_regions: Array<{ __typename?: 'evo_region', evo_fias_id: string | null, evo_businessunit_evolution: boolean | null, label: string | null, value: string | null } | null> | null };
|
||||
|
||||
export type GetRegionQueryVariables = Exact<{
|
||||
regionId: Scalars['Uuid'];
|
||||
}>;
|
||||
|
||||
|
||||
export type GetRegionQuery = { __typename?: 'Query', evo_region: { __typename?: 'evo_region', evo_oktmo: string | null, accounts: Array<{ __typename?: 'account', accountid: string | null } | null> | null } | null };
|
||||
|
||||
export type GetTownsQueryVariables = Exact<{
|
||||
regionId: Scalars['Uuid'];
|
||||
}>;
|
||||
|
||||
|
||||
export type GetTownsQuery = { __typename?: 'Query', evo_towns: Array<{ __typename?: 'evo_town', evo_fias_id: string | null, evo_businessunit_evolution: boolean | null, label: string | null, value: string | null } | null> | null };
|
||||
|
||||
export type GetGpsBrandsQueryVariables = Exact<{ [key: string]: never; }>;
|
||||
|
||||
@ -239,13 +274,20 @@ export type GetLeaseObjectTypeQueryVariables = Exact<{
|
||||
}>;
|
||||
|
||||
|
||||
export type GetLeaseObjectTypeQuery = { __typename?: 'Query', leaseObjectType: { __typename?: 'evo_leasingobject_type', evo_vehicle_type: Array<number> | null } | null };
|
||||
export type GetLeaseObjectTypeQuery = { __typename?: 'Query', evo_leasingobject_type: { __typename?: 'evo_leasingobject_type', evo_vehicle_type: Array<number> | null, evo_id: string | null, evo_category: number | null, evo_vehicle_type_tax: number | null, evo_category_tr: Array<number> | null } | null };
|
||||
|
||||
export type GetBrandsQueryVariables = Exact<{ [key: string]: never; }>;
|
||||
|
||||
|
||||
export type GetBrandsQuery = { __typename?: 'Query', evo_brands: Array<{ __typename?: 'evo_brand', evo_brandid: string | null, evo_vehicle_type: Array<number> | null, label: string | null, value: string | null } | null> | null };
|
||||
|
||||
export type GetBrandQueryVariables = Exact<{
|
||||
brandId: Scalars['Uuid'];
|
||||
}>;
|
||||
|
||||
|
||||
export type GetBrandQuery = { __typename?: 'Query', evo_brand: { __typename?: 'evo_brand', evo_importer_reward_perc: number | null, evo_importer_reward_rub: number | null } | null };
|
||||
|
||||
export type GetModelsQueryVariables = Exact<{
|
||||
brandId: Scalars['Uuid'];
|
||||
}>;
|
||||
@ -253,13 +295,27 @@ export type GetModelsQueryVariables = Exact<{
|
||||
|
||||
export type GetModelsQuery = { __typename?: 'Query', evo_models: Array<{ __typename?: 'evo_model', evo_modelid: string | null, evo_vehicle_type: number | null, label: string | null, value: string | null } | null> | null };
|
||||
|
||||
export type GetModelQueryVariables = Exact<{
|
||||
modelId: Scalars['Uuid'];
|
||||
}>;
|
||||
|
||||
|
||||
export type GetModelQuery = { __typename?: 'Query', evo_model: { __typename?: 'evo_model', evo_importer_reward_perc: number | null, evo_importer_reward_rub: number | null, evo_impairment_groupidData: { __typename?: 'evo_impairment_group', evo_name: string | null } | null } | null };
|
||||
|
||||
export type GetConfigurationsQueryVariables = Exact<{
|
||||
modelId: InputMaybe<Scalars['Uuid']>;
|
||||
modelId: Scalars['Uuid'];
|
||||
}>;
|
||||
|
||||
|
||||
export type GetConfigurationsQuery = { __typename?: 'Query', evo_equipments: Array<{ __typename?: 'evo_equipment', label: string | null, value: string | null } | null> | null };
|
||||
|
||||
export type GetConfigurationQueryVariables = Exact<{
|
||||
configurationId: Scalars['Uuid'];
|
||||
}>;
|
||||
|
||||
|
||||
export type GetConfigurationQuery = { __typename?: 'Query', evo_equipment: { __typename?: 'evo_equipment', evo_impairment_groupidData: { __typename?: 'evo_impairment_group', evo_name: string | null } | null } | null };
|
||||
|
||||
export type GetDealersQueryVariables = Exact<{ [key: string]: never; }>;
|
||||
|
||||
|
||||
@ -301,33 +357,27 @@ export type GetRewardConditionQueryVariables = Exact<{
|
||||
|
||||
export type GetRewardConditionQuery = { __typename?: 'Query', evo_reward_condition: { __typename?: 'evo_reward_condition', evo_reward_summ: number | null, evo_reduce_reward: boolean | null, evo_min_reward_summ: number | null, evo_agency_agreementidData: { __typename?: 'evo_agency_agreement', evo_required_reward: boolean | null, evo_reward_without_other_agent: boolean | null } | null } | null };
|
||||
|
||||
export type GetConfiguratorDataFromQuoteQueryVariables = Exact<{
|
||||
quoteId: Scalars['Uuid'];
|
||||
export type GetSotCoefficientTypeQueryVariables = Exact<{
|
||||
evo_id: InputMaybe<Scalars['String']>;
|
||||
}>;
|
||||
|
||||
|
||||
export type GetConfiguratorDataFromQuoteQuery = { __typename?: 'Query', quote: { __typename?: 'quote', evo_baseproductid: string | null } | null };
|
||||
export type GetSotCoefficientTypeQuery = { __typename?: 'Query', evo_sot_coefficient_type: { __typename?: 'evo_sot_coefficient_type', evo_sot_coefficient_typeid: string | null } | null };
|
||||
|
||||
export type GetFingapDataFromQuoteQueryVariables = Exact<{
|
||||
quoteId: Scalars['Uuid'];
|
||||
}>;
|
||||
|
||||
|
||||
export type GetFingapDataFromQuoteQuery = { __typename?: 'Query', quote: { __typename?: 'quote', evo_fingap_accountid: string | null, evo_fingap_payer: number | null, evo_fingap_period: number | null, evo_product_risks: Array<{ __typename?: 'evo_product_risk', evo_addproduct_typeid: string | null } | null> | null } | null };
|
||||
|
||||
export type GetFinGapAddProductTypesQueryVariables = Exact<{
|
||||
export type GetCoefficientsQueryVariables = Exact<{
|
||||
currentDate: InputMaybe<Scalars['DateTime']>;
|
||||
jobTitleId: Scalars['Uuid'];
|
||||
}>;
|
||||
|
||||
|
||||
export type GetFinGapAddProductTypesQuery = { __typename?: 'Query', evo_addproduct_types: Array<{ __typename?: 'evo_addproduct_type', evo_addproduct_typeid: string | null, evo_name: string | null, evo_type_calc_cerebellum: number | null, evo_cost_service_provider_withoutnds: number | null, evo_addproduct_types: Array<{ __typename?: 'evo_addproduct_type', evo_addproduct_typeid: string | null } | null> | null } | null> | null };
|
||||
export type GetCoefficientsQuery = { __typename?: 'Query', evo_coefficients: Array<{ __typename?: 'evo_coefficient', evo_job_titleid: string | null, evo_sot_coefficient_typeid: string | null, evo_sot_coefficient: number | null, evo_baseproducts: Array<{ __typename?: 'evo_baseproduct', evo_baseproductid: string | null } | null> | null } | null> | null };
|
||||
|
||||
export type GetInsuranceDataQueryVariables = Exact<{
|
||||
evo_account_type: InputMaybe<Array<Scalars['Int']> | Scalars['Int']>;
|
||||
export type GetSystemUserQueryVariables = Exact<{
|
||||
domainname: InputMaybe<Scalars['String']>;
|
||||
}>;
|
||||
|
||||
|
||||
export type GetInsuranceDataQuery = { __typename?: 'Query', osago: Array<{ __typename?: 'account', value: string | null, label: string | null } | null> | null, kasko: Array<{ __typename?: 'account', value: string | null, label: string | null } | null> | null, fingap: Array<{ __typename?: 'account', value: string | null, label: string | null } | null> | null };
|
||||
export type GetSystemUserQuery = { __typename?: 'Query', systemuser: { __typename?: 'systemuser', evo_job_titleid: string | null } | null };
|
||||
|
||||
export type GetAddproductTypesQueryVariables = Exact<{
|
||||
currentDate: InputMaybe<Scalars['DateTime']>;
|
||||
@ -336,12 +386,75 @@ export type GetAddproductTypesQueryVariables = Exact<{
|
||||
|
||||
export type GetAddproductTypesQuery = { __typename?: 'Query', evo_addproduct_types: Array<{ __typename?: 'evo_addproduct_type', evo_graph_price: number | null, evo_product_type: number | null, label: string | null, value: string | null } | null> | null };
|
||||
|
||||
export type GetOwnerDataQueryVariables = Exact<{
|
||||
domainname: InputMaybe<Scalars['String']>;
|
||||
export type GetRegistrationTypesQueryVariables = Exact<{
|
||||
currentDate: InputMaybe<Scalars['DateTime']>;
|
||||
}>;
|
||||
|
||||
|
||||
export type GetOwnerDataQuery = { __typename?: 'Query', selectLead: Array<{ __typename?: 'lead', label: string | null, value: string | null } | null> | null, selectOpportunity: Array<{ __typename?: 'opportunity', label: string | null, value: string | null } | null> | null };
|
||||
export type GetRegistrationTypesQuery = { __typename?: 'Query', evo_addproduct_types: Array<{ __typename?: 'evo_addproduct_type', evo_graph_price: number | null, evo_whom_register: number | null, evo_gibdd_region: boolean | null, evo_pts_type: Array<number> | null, evo_accountid: string | null, evo_towtruck: boolean | 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 GetAddProductTypeQueryVariables = Exact<{
|
||||
addproductTypeId: Scalars['Uuid'];
|
||||
}>;
|
||||
|
||||
|
||||
export type GetAddProductTypeQuery = { __typename?: 'Query', evo_addproduct_type: { __typename?: 'evo_addproduct_type', evo_description: string | null } | null };
|
||||
|
||||
export type GetQuoteBonusDataQueryVariables = Exact<{
|
||||
quoteId: Scalars['Uuid'];
|
||||
}>;
|
||||
|
||||
|
||||
export type GetQuoteBonusDataQuery = { __typename?: 'Query', quote: { __typename?: 'quote', evo_sale_bonus: number | null } | null };
|
||||
|
||||
export type GetQuoteConfiguratorDataQueryVariables = Exact<{
|
||||
quoteId: Scalars['Uuid'];
|
||||
}>;
|
||||
|
||||
|
||||
export type GetQuoteConfiguratorDataQuery = { __typename?: 'Query', quote: { __typename?: 'quote', evo_baseproductid: string | null } | null };
|
||||
|
||||
export type GetQuoteFingapDataQueryVariables = Exact<{
|
||||
quoteId: Scalars['Uuid'];
|
||||
}>;
|
||||
|
||||
|
||||
export type GetQuoteFingapDataQuery = { __typename?: 'Query', quote: { __typename?: 'quote', evo_product_risks: Array<{ __typename?: 'evo_product_risk', evo_addproduct_typeid: string | null } | null> | null } | null };
|
||||
|
||||
export type GetFinGapAddProductTypesQueryVariables = Exact<{
|
||||
currentDate: InputMaybe<Scalars['DateTime']>;
|
||||
}>;
|
||||
|
||||
|
||||
export type GetFinGapAddProductTypesQuery = { __typename?: 'Query', evo_addproduct_types: Array<{ __typename?: 'evo_addproduct_type', evo_addproduct_typeid: string | null, evo_name: string | null, evo_type_calc_cerebellum: number | null, evo_cost_service_provider_withoutnds: number | null, evo_addproduct_types: Array<{ __typename?: 'evo_addproduct_type', evo_addproduct_typeid: string | null } | null> | null } | null> | null };
|
||||
|
||||
export type GetQuoteGibddDataQueryVariables = Exact<{
|
||||
quoteId: Scalars['Uuid'];
|
||||
}>;
|
||||
|
||||
|
||||
export type GetQuoteGibddDataQuery = { __typename?: 'Query', quote: { __typename?: 'quote', evo_db_accept_registration: number | null, evo_object_registration: number | null, evo_pts_type: number | null, evo_vehicle_tax_year: number | null, evo_vehicle_tax_approved: number | null, evo_category_tr: number | null, evo_vehicle_type_tax: number | null, evo_regionid: string | null, evo_townid: string | null, evo_legal_regionid: string | null, evo_legal_townid: string | null, evo_registration_regionid: string | null, evo_addproduct_types: Array<{ __typename?: 'evo_addproduct_type', evo_product_type: number | null, evo_addproduct_typeid: string | null } | null> | null } | null };
|
||||
|
||||
export type GetQuoteRegionTownQueryVariables = Exact<{
|
||||
quoteId: Scalars['Uuid'];
|
||||
}>;
|
||||
|
||||
|
||||
export type GetQuoteRegionTownQuery = { __typename?: 'Query', quote: { __typename?: 'quote', evo_regionid: string | null, evo_townid: string | null, evo_legal_regionid: string | null, evo_legal_townid: string | null } | null };
|
||||
|
||||
export type GetInsuranceDataQueryVariables = Exact<{
|
||||
evo_account_type: InputMaybe<Array<Scalars['Int']> | Scalars['Int']>;
|
||||
}>;
|
||||
|
||||
|
||||
export type GetInsuranceDataQuery = { __typename?: 'Query', osago: Array<{ __typename?: 'account', value: string | null, label: string | null } | null> | null, kasko: Array<{ __typename?: 'account', value: string | null, label: string | null } | null> | null, fingap: Array<{ __typename?: 'account', value: string | null, label: string | null } | null> | null };
|
||||
|
||||
export type GetQuoteInsuranceDataQueryVariables = Exact<{
|
||||
quoteId: Scalars['Uuid'];
|
||||
}>;
|
||||
|
||||
|
||||
export type GetQuoteInsuranceDataQuery = { __typename?: 'Query', quote: { __typename?: 'quote', evo_osago_accountid: string | null, evo_osago_payer: number | null, evo_osago_price: number | null, evo_kasko_accountid: string | null, evo_kasko_payer: number | null, evo_kasko_price: number | null, evo_insurance_period: number | null, evo_fingap_accountid: string | null, evo_fingap_payer: number | null, evo_fingap_period: number | null } | null };
|
||||
|
||||
export type GetLeadUrlQueryVariables = Exact<{
|
||||
id: Scalars['Uuid'];
|
||||
@ -364,12 +477,12 @@ export type GetQuoteUrlQueryVariables = Exact<{
|
||||
|
||||
export type GetQuoteUrlQuery = { __typename?: 'Query', entity: { __typename?: 'quote', link: string | null } | null };
|
||||
|
||||
export type GetLeasingObjectDataFromQuoteQueryVariables = Exact<{
|
||||
export type GetQuoteLeasingObjectDataQueryVariables = Exact<{
|
||||
quoteId: Scalars['Uuid'];
|
||||
}>;
|
||||
|
||||
|
||||
export type GetLeasingObjectDataFromQuoteQuery = { __typename?: 'Query', quote: { __typename?: 'quote', evo_brandid: string | null, evo_modelid: string | null, evo_equipmentid: string | null, evo_leasingobject_typeid: string | null } | null };
|
||||
export type GetQuoteLeasingObjectDataQuery = { __typename?: 'Query', quote: { __typename?: 'quote', evo_brandid: string | null, evo_category: number | null, evo_delivery_time: number | null, evo_engine_hours: number | null, evo_engine_type: number | null, evo_engine_volume: number | null, evo_equipmentid: string | null, evo_leasingobject_typeid: string | null, evo_leasingobject_used: boolean | null, evo_max_mass: number | null, evo_max_speed: number | null, evo_mileage: number | null, evo_modelid: string | null, evo_object_count: number | null, evo_power: number | null, evo_recalc_limit: number | null, evo_seats: number | null, evo_trailer: boolean | null, evo_use_for: number | null, evo_vin: string | null, evo_year: number | null } | null };
|
||||
|
||||
export type GetLeasingWithoutKaskoOptionsQueryVariables = Exact<{
|
||||
currentDate: InputMaybe<Scalars['DateTime']>;
|
||||
@ -378,19 +491,26 @@ export type GetLeasingWithoutKaskoOptionsQueryVariables = Exact<{
|
||||
|
||||
export type GetLeasingWithoutKaskoOptionsQuery = { __typename?: 'Query', evo_addproduct_types: Array<{ __typename?: 'evo_addproduct_type', evo_product_type: number | null, evo_min_period: number | null, evo_max_period: number | null, evo_min_price: number | null, evo_max_price: number | null, evo_visible_calc: boolean | null, evo_min_first_payment_perc: number | null, evo_max_first_payment_perc: number | null, label: string | null, value: string | null, evo_leasingobject_types: Array<{ __typename?: 'evo_leasingobject_type', evo_leasingobject_typeid: string | null } | null> | null, evo_models: Array<{ __typename?: 'evo_model', evo_modelid: string | null } | null> | null } | null> | null };
|
||||
|
||||
export type GetPaymentsDataFromQuoteQueryVariables = Exact<{
|
||||
export type GetQuotePaymentsDataQueryVariables = Exact<{
|
||||
quoteId: Scalars['Uuid'];
|
||||
}>;
|
||||
|
||||
|
||||
export type GetPaymentsDataFromQuoteQuery = { __typename?: 'Query', quote: { __typename?: 'quote', evo_period: number | null, evo_accept_period: number | null, evo_first_payment_perc: number | null, evo_last_payment_perc: number | null, evo_graph_type: number | null, evo_payments_decrease_perc: number | null, evo_seasons_type: number | null, evo_high_season: number | null, evo_graphs: Array<{ __typename?: 'evo_graph', createdon: string | null, evo_sumpay_withnds: number | null, evo_planpayments: Array<{ __typename?: 'evo_planpayment', evo_payment_ratio: number | null } | null> | null } | null> | null } | null };
|
||||
export type GetQuotePaymentsDataQuery = { __typename?: 'Query', quote: { __typename?: 'quote', evo_period: number | null, evo_accept_period: number | null, evo_first_payment_perc: number | null, evo_last_payment_perc: number | null, evo_graph_type: number | null, evo_payments_decrease_perc: number | null, evo_seasons_type: number | null, evo_high_season: number | null, evo_graphs: Array<{ __typename?: 'evo_graph', createdon: string | null, evo_sumpay_withnds: number | null, evo_planpayments: Array<{ __typename?: 'evo_planpayment', evo_payment_ratio: number | null } | null> | null } | null> | null } | null };
|
||||
|
||||
export type GetPriceDataFromQuoteQueryVariables = Exact<{
|
||||
export type GetQuotePriceDataQueryVariables = Exact<{
|
||||
quoteId: Scalars['Uuid'];
|
||||
}>;
|
||||
|
||||
|
||||
export type GetPriceDataFromQuoteQuery = { __typename?: 'Query', quote: { __typename?: 'quote', evo_supplier_currency_price: number | null, evo_price_without_nds_supplier_currency: number | null, evo_nds_in_price_supplier_currency: number | null, evo_last_payment_rub: number | null, evo_last_payment_calc: number | null, evo_transactioncurrencyid: string | null, evo_discount_supplier_currency: number | null, evo_discount_perc: number | null, evo_comission_perc: number | null, evo_comission_rub: number | null, evo_sale_bonus: 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_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 } | null };
|
||||
|
||||
export type GetQuoteSubsidyDataQueryVariables = Exact<{
|
||||
quoteId: Scalars['Uuid'];
|
||||
}>;
|
||||
|
||||
|
||||
export type GetQuoteSubsidyDataQuery = { __typename?: 'Query', quote: { __typename?: 'quote', evo_subsidyid: string | null, evo_program_import_subsidyid: string | null } | null };
|
||||
|
||||
export type GetRewardRulesQueryVariables = Exact<{
|
||||
conditionId: Scalars['Uuid'];
|
||||
@ -399,54 +519,71 @@ export type GetRewardRulesQueryVariables = Exact<{
|
||||
|
||||
export type GetRewardRulesQuery = { __typename?: 'Query', evo_reward_condition: { __typename?: 'evo_reward_condition', evo_calc_reward_rules: number | null } | null };
|
||||
|
||||
export type GetAgentsDataFromQuoteQueryVariables = Exact<{
|
||||
export type GetQuoteAgentsDataQueryVariables = Exact<{
|
||||
quoteId: Scalars['Uuid'];
|
||||
}>;
|
||||
|
||||
|
||||
export type GetAgentsDataFromQuoteQuery = { __typename?: 'Query', quote: { __typename?: 'quote', evo_supplier_accountid: string | null, evo_dealer_person_accountid: string | null, evo_dealer_reward_conditionid: string | null, evo_dealer_reward_total: number | null, evo_dealer_reward_summ: number | null, evo_dealer_broker_accountid: string | null, evo_dealer_broker_reward_conditionid: string | null, evo_dealer_broker_reward_total: number | null, evo_dealer_broker_reward_summ: number | null, evo_agent_accountid: string | null, evo_agent_reward_conditionid: string | null, evo_agent_reward_total: number | null, evo_agent_reward_summ: number | null, evo_double_agent_accountid: string | null, evo_double_agent_reward_conditionid: string | null, evo_double_agent_reward_total: number | null, evo_double_agent_reward_summ: number | null, evo_broker_accountid: string | null, evo_broker_reward_conditionid: string | null, evo_broker_reward_total: number | null, evo_broker_reward_summ: number | null, evo_fin_department_accountid: string | null, evo_fin_department_reward_conditionid: string | null, evo_fin_department_reward_total: number | null, evo_fin_department_reward_summ: number | null } | null };
|
||||
export type 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 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>;
|
||||
export const GetTransactionCurrencyDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetTransactionCurrency"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"currencyid"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"Uuid"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"transactioncurrency"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"transactioncurrencyid"},"value":{"kind":"Variable","name":{"kind":"Name","value":"currencyid"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"currencysymbol"}},{"kind":"Field","name":{"kind":"Name","value":"isocurrencycode"}}]}}]}}]} as unknown as DocumentNode<GetTransactionCurrencyQuery, GetTransactionCurrencyQueryVariables>;
|
||||
export const GetCurrencyChangesDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetCurrencyChanges"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"currentDate"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"DateTime"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"evo_currencychanges"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"statecode"},"value":{"kind":"IntValue","value":"0"}},{"kind":"Argument","name":{"kind":"Name","value":"evo_coursedate_param"},"value":{"kind":"ObjectValue","fields":[{"kind":"ObjectField","name":{"kind":"Name","value":"eq"},"value":{"kind":"Variable","name":{"kind":"Name","value":"currentDate"}}}]}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"evo_currencychange"}},{"kind":"Field","name":{"kind":"Name","value":"evo_ref_transactioncurrency"}}]}}]}}]} as unknown as DocumentNode<GetCurrencyChangesQuery, GetCurrencyChangesQueryVariables>;
|
||||
export const GetLeadDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetLead"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"leadid"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"Uuid"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"lead"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"leadid"},"value":{"kind":"Variable","name":{"kind":"Name","value":"leadid"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"evo_agent_accountid"}},{"kind":"Field","name":{"kind":"Name","value":"evo_double_agent_accountid"}},{"kind":"Field","name":{"kind":"Name","value":"evo_broker_accountid"}},{"kind":"Field","name":{"kind":"Name","value":"evo_fin_department_accountid"}},{"kind":"Field","name":{"kind":"Name","value":"evo_opportunityidData"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"label"},"name":{"kind":"Name","value":"name"}},{"kind":"Field","alias":{"kind":"Name","value":"value"},"name":{"kind":"Name","value":"opportunityid"}}]}}]}}]}}]} as unknown as DocumentNode<GetLeadQuery, GetLeadQueryVariables>;
|
||||
export const GetOpportunityDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetOpportunity"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"opportunityid"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"Uuid"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"opportunity"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"opportunityid"},"value":{"kind":"Variable","name":{"kind":"Name","value":"opportunityid"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"evo_leadid"}}]}}]}}]} as unknown as DocumentNode<GetOpportunityQuery, GetOpportunityQueryVariables>;
|
||||
export const GetLeadsDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetLeads"},"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":"leads"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"owner_domainname"},"value":{"kind":"Variable","name":{"kind":"Name","value":"domainname"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"label"},"name":{"kind":"Name","value":"fullname"}},{"kind":"Field","alias":{"kind":"Name","value":"value"},"name":{"kind":"Name","value":"leadid"}}]}}]}}]} as unknown as DocumentNode<GetLeadsQuery, GetLeadsQueryVariables>;
|
||||
export const GetLeadDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetLead"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"leadid"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"Uuid"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"lead"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"leadid"},"value":{"kind":"Variable","name":{"kind":"Name","value":"leadid"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"evo_agent_accountid"}},{"kind":"Field","name":{"kind":"Name","value":"evo_double_agent_accountid"}},{"kind":"Field","name":{"kind":"Name","value":"evo_broker_accountid"}},{"kind":"Field","name":{"kind":"Name","value":"evo_fin_department_accountid"}},{"kind":"Field","name":{"kind":"Name","value":"evo_opportunityidData"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"label"},"name":{"kind":"Name","value":"name"}},{"kind":"Field","alias":{"kind":"Name","value":"value"},"name":{"kind":"Name","value":"opportunityid"}}]}},{"kind":"Field","name":{"kind":"Name","value":"evo_inn"}},{"kind":"Field","name":{"kind":"Name","value":"accountidData"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"evo_address_legalidData"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"evo_region_fias_id"}},{"kind":"Field","name":{"kind":"Name","value":"evo_city_fias_id"}}]}}]}}]}}]}}]} as unknown as DocumentNode<GetLeadQuery, GetLeadQueryVariables>;
|
||||
export const GetOpportunityDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetOpportunity"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"opportunityid"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"Uuid"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"opportunity"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"opportunityid"},"value":{"kind":"Variable","name":{"kind":"Name","value":"opportunityid"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"evo_leadid"}},{"kind":"Field","name":{"kind":"Name","value":"accountidData"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"evo_address_legalidData"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"evo_region_fias_id"}},{"kind":"Field","name":{"kind":"Name","value":"evo_city_fias_id"}}]}}]}}]}}]}}]} as unknown as DocumentNode<GetOpportunityQuery, GetOpportunityQueryVariables>;
|
||||
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"}}]}}]}}]} 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"}}]}}]}}]} 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 GetTarifDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetTarif"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"tarifId"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"Uuid"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"evo_tarif"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"evo_tarifid"},"value":{"kind":"Variable","name":{"kind":"Name","value":"tarifId"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"evo_irr"}},{"kind":"Field","name":{"kind":"Name","value":"evo_graphtype_exception"}},{"kind":"Field","name":{"kind":"Name","value":"evo_seasons_type_exception"}},{"kind":"Field","name":{"kind":"Name","value":"evo_min_decreasing_perc"}}]}}]}}]} as unknown as DocumentNode<GetTarifQuery, GetTarifQueryVariables>;
|
||||
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"}}]}}]}}]} 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"}}]}}]}}]} 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"}}]}}]}}]}}]} 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"}}]}}]}}]} 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"}}]}}]}}]} 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"}}]}}]}}]} as unknown as DocumentNode<GetRegionsQuery, GetRegionsQueryVariables>;
|
||||
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>;
|
||||
export const GetTownsDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetTowns"},"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_towns"},"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_fias_id"}},{"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_townid"}},{"kind":"Field","name":{"kind":"Name","value":"evo_businessunit_evolution"}}]}}]}}]} as unknown as DocumentNode<GetTownsQuery, GetTownsQueryVariables>;
|
||||
export const GetGpsBrandsDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetGPSBrands"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"evo_gps_brands"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"statecode"},"value":{"kind":"IntValue","value":"0"}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"label"},"name":{"kind":"Name","value":"evo_name"}},{"kind":"Field","alias":{"kind":"Name","value":"value"},"name":{"kind":"Name","value":"evo_gps_brandid"}}]}}]}}]} as unknown as DocumentNode<GetGpsBrandsQuery, GetGpsBrandsQueryVariables>;
|
||||
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","alias":{"kind":"Name","value":"leaseObjectType"},"name":{"kind":"Name","value":"evo_leasingobject_type"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"evo_leasingobject_typeid"},"value":{"kind":"Variable","name":{"kind":"Name","value":"leaseObjectTypeId"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"evo_vehicle_type"}}]}}]}}]} as unknown as DocumentNode<GetLeaseObjectTypeQuery, GetLeaseObjectTypeQueryVariables>;
|
||||
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"}}]}}]}}]} 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_importer_reward_perc"}},{"kind":"Field","name":{"kind":"Name","value":"evo_importer_reward_rub"}}]}}]}}]} 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 GetConfigurationsDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetConfigurations"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"modelId"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"Uuid"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"evo_equipments"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"statecode"},"value":{"kind":"IntValue","value":"0"}},{"kind":"Argument","name":{"kind":"Name","value":"evo_modelid"},"value":{"kind":"Variable","name":{"kind":"Name","value":"modelId"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"label"},"name":{"kind":"Name","value":"evo_name"}},{"kind":"Field","alias":{"kind":"Name","value":"value"},"name":{"kind":"Name","value":"evo_equipmentid"}}]}}]}}]} as unknown as DocumentNode<GetConfigurationsQuery, GetConfigurationsQueryVariables>;
|
||||
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"}}]}}]}}]} 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 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 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"}}]}}]}}]}}]} as unknown as DocumentNode<GetRewardConditionQuery, GetRewardConditionQueryVariables>;
|
||||
export const GetConfiguratorDataFromQuoteDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetConfiguratorDataFromQuote"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"quoteId"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"Uuid"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"quote"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"quoteId"},"value":{"kind":"Variable","name":{"kind":"Name","value":"quoteId"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"evo_baseproductid"}}]}}]}}]} as unknown as DocumentNode<GetConfiguratorDataFromQuoteQuery, GetConfiguratorDataFromQuoteQueryVariables>;
|
||||
export const GetFingapDataFromQuoteDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetFingapDataFromQuote"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"quoteId"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"Uuid"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"quote"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"quoteId"},"value":{"kind":"Variable","name":{"kind":"Name","value":"quoteId"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"evo_fingap_accountid"}},{"kind":"Field","name":{"kind":"Name","value":"evo_fingap_payer"}},{"kind":"Field","name":{"kind":"Name","value":"evo_fingap_period"}},{"kind":"Field","name":{"kind":"Name","value":"evo_product_risks"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"evo_addproduct_typeid"}}]}}]}}]}}]} as unknown as DocumentNode<GetFingapDataFromQuoteQuery, GetFingapDataFromQuoteQueryVariables>;
|
||||
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 GetInsuranceDataDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetInsuranceData"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"evo_account_type"}},"type":{"kind":"ListType","type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"Int"}}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"osago"},"name":{"kind":"Name","value":"accounts"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"evo_account_type"},"value":{"kind":"Variable","name":{"kind":"Name","value":"evo_account_type"}}},{"kind":"Argument","name":{"kind":"Name","value":"evo_type_ins_policy"},"value":{"kind":"ListValue","values":[{"kind":"IntValue","value":"100000001"}]}},{"kind":"Argument","name":{"kind":"Name","value":"statecode"},"value":{"kind":"IntValue","value":"0"}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"value"},"name":{"kind":"Name","value":"accountid"}},{"kind":"Field","alias":{"kind":"Name","value":"label"},"name":{"kind":"Name","value":"name"}}]}},{"kind":"Field","alias":{"kind":"Name","value":"kasko"},"name":{"kind":"Name","value":"accounts"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"evo_account_type"},"value":{"kind":"Variable","name":{"kind":"Name","value":"evo_account_type"}}},{"kind":"Argument","name":{"kind":"Name","value":"evo_type_ins_policy"},"value":{"kind":"ListValue","values":[{"kind":"IntValue","value":"100000000"}]}},{"kind":"Argument","name":{"kind":"Name","value":"statecode"},"value":{"kind":"IntValue","value":"0"}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"value"},"name":{"kind":"Name","value":"accountid"}},{"kind":"Field","alias":{"kind":"Name","value":"label"},"name":{"kind":"Name","value":"name"}}]}},{"kind":"Field","alias":{"kind":"Name","value":"fingap"},"name":{"kind":"Name","value":"accounts"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"evo_account_type"},"value":{"kind":"Variable","name":{"kind":"Name","value":"evo_account_type"}}},{"kind":"Argument","name":{"kind":"Name","value":"evo_type_ins_policy"},"value":{"kind":"ListValue","values":[{"kind":"IntValue","value":"100000002"}]}},{"kind":"Argument","name":{"kind":"Name","value":"statecode"},"value":{"kind":"IntValue","value":"0"}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"value"},"name":{"kind":"Name","value":"accountid"}},{"kind":"Field","alias":{"kind":"Name","value":"label"},"name":{"kind":"Name","value":"name"}}]}}]}}]} as unknown as DocumentNode<GetInsuranceDataQuery, GetInsuranceDataQueryVariables>;
|
||||
export const GetSotCoefficientTypeDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetSotCoefficientType"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"evo_id"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"evo_sot_coefficient_type"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"evo_id"},"value":{"kind":"Variable","name":{"kind":"Name","value":"evo_id"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"evo_sot_coefficient_typeid"}}]}}]}}]} as unknown as DocumentNode<GetSotCoefficientTypeQuery, GetSotCoefficientTypeQueryVariables>;
|
||||
export const GetCoefficientsDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetCoefficients"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"currentDate"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"DateTime"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"jobTitleId"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"Uuid"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"evo_coefficients"},"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_job_titleid"},"value":{"kind":"Variable","name":{"kind":"Name","value":"jobTitleId"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"evo_job_titleid"}},{"kind":"Field","name":{"kind":"Name","value":"evo_sot_coefficient_typeid"}},{"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_sot_coefficient"}}]}}]}}]} as unknown as DocumentNode<GetCoefficientsQuery, GetCoefficientsQueryVariables>;
|
||||
export const GetSystemUserDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetSystemUser"},"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":"systemuser"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"domainname"},"value":{"kind":"Variable","name":{"kind":"Name","value":"domainname"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"evo_job_titleid"}}]}}]}}]} as unknown as DocumentNode<GetSystemUserQuery, GetSystemUserQueryVariables>;
|
||||
export const GetAddproductTypesDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetAddproductTypes"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"currentDate"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"DateTime"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"evo_addproduct_types"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"statecode"},"value":{"kind":"IntValue","value":"0"}},{"kind":"Argument","name":{"kind":"Name","value":"evo_datefrom_param"},"value":{"kind":"ObjectValue","fields":[{"kind":"ObjectField","name":{"kind":"Name","value":"lte"},"value":{"kind":"Variable","name":{"kind":"Name","value":"currentDate"}}}]}},{"kind":"Argument","name":{"kind":"Name","value":"evo_dateto_param"},"value":{"kind":"ObjectValue","fields":[{"kind":"ObjectField","name":{"kind":"Name","value":"gte"},"value":{"kind":"Variable","name":{"kind":"Name","value":"currentDate"}}}]}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"label"},"name":{"kind":"Name","value":"evo_name"}},{"kind":"Field","alias":{"kind":"Name","value":"value"},"name":{"kind":"Name","value":"evo_addproduct_typeid"}},{"kind":"Field","name":{"kind":"Name","value":"evo_graph_price"}},{"kind":"Field","name":{"kind":"Name","value":"evo_product_type"}}]}}]}}]} as unknown as DocumentNode<GetAddproductTypesQuery, GetAddproductTypesQueryVariables>;
|
||||
export const GetOwnerDataDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetOwnerData"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"domainname"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"selectLead"},"name":{"kind":"Name","value":"leads"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"owner_domainname"},"value":{"kind":"Variable","name":{"kind":"Name","value":"domainname"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"label"},"name":{"kind":"Name","value":"fullname"}},{"kind":"Field","alias":{"kind":"Name","value":"value"},"name":{"kind":"Name","value":"leadid"}}]}},{"kind":"Field","alias":{"kind":"Name","value":"selectOpportunity"},"name":{"kind":"Name","value":"opportunities"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"owner_domainname"},"value":{"kind":"Variable","name":{"kind":"Name","value":"domainname"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"label"},"name":{"kind":"Name","value":"name"}},{"kind":"Field","alias":{"kind":"Name","value":"value"},"name":{"kind":"Name","value":"opportunityid"}}]}}]}}]} as unknown as DocumentNode<GetOwnerDataQuery, GetOwnerDataQueryVariables>;
|
||||
export const GetRegistrationTypesDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetRegistrationTypes"},"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":"100000001"}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"label"},"name":{"kind":"Name","value":"evo_name"}},{"kind":"Field","alias":{"kind":"Name","value":"value"},"name":{"kind":"Name","value":"evo_addproduct_typeid"}},{"kind":"Field","name":{"kind":"Name","value":"evo_graph_price"}},{"kind":"Field","name":{"kind":"Name","value":"evo_leasingobject_types"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"evo_leasingobject_typeid"}}]}},{"kind":"Field","name":{"kind":"Name","value":"evo_whom_register"}},{"kind":"Field","name":{"kind":"Name","value":"evo_gibdd_region"}},{"kind":"Field","name":{"kind":"Name","value":"evo_pts_type"}},{"kind":"Field","name":{"kind":"Name","value":"evo_accountid"}},{"kind":"Field","name":{"kind":"Name","value":"evo_towtruck"}}]}}]}}]} as unknown as DocumentNode<GetRegistrationTypesQuery, GetRegistrationTypesQueryVariables>;
|
||||
export const GetAddProductTypeDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetAddProductType"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"addproductTypeId"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"Uuid"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"evo_addproduct_type"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"evo_addproduct_typeid"},"value":{"kind":"Variable","name":{"kind":"Name","value":"addproductTypeId"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"evo_description"}}]}}]}}]} as unknown as DocumentNode<GetAddProductTypeQuery, GetAddProductTypeQueryVariables>;
|
||||
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"}}]}}]}}]} as unknown as DocumentNode<GetQuoteConfiguratorDataQuery, GetQuoteConfiguratorDataQueryVariables>;
|
||||
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_addproduct_types"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"evo_product_type"}},{"kind":"Field","name":{"kind":"Name","value":"evo_addproduct_typeid"}}]}},{"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"}}]}}]}}]} as unknown as DocumentNode<GetQuoteGibddDataQuery, GetQuoteGibddDataQueryVariables>;
|
||||
export const GetQuoteRegionTownDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetQuoteRegionTown"},"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_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"}}]}}]}}]} as unknown as DocumentNode<GetQuoteRegionTownQuery, GetQuoteRegionTownQueryVariables>;
|
||||
export const GetInsuranceDataDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetInsuranceData"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"evo_account_type"}},"type":{"kind":"ListType","type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"Int"}}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"osago"},"name":{"kind":"Name","value":"accounts"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"evo_account_type"},"value":{"kind":"Variable","name":{"kind":"Name","value":"evo_account_type"}}},{"kind":"Argument","name":{"kind":"Name","value":"evo_type_ins_policy"},"value":{"kind":"ListValue","values":[{"kind":"IntValue","value":"100000001"}]}},{"kind":"Argument","name":{"kind":"Name","value":"statecode"},"value":{"kind":"IntValue","value":"0"}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"value"},"name":{"kind":"Name","value":"accountid"}},{"kind":"Field","alias":{"kind":"Name","value":"label"},"name":{"kind":"Name","value":"name"}}]}},{"kind":"Field","alias":{"kind":"Name","value":"kasko"},"name":{"kind":"Name","value":"accounts"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"evo_account_type"},"value":{"kind":"Variable","name":{"kind":"Name","value":"evo_account_type"}}},{"kind":"Argument","name":{"kind":"Name","value":"evo_type_ins_policy"},"value":{"kind":"ListValue","values":[{"kind":"IntValue","value":"100000000"}]}},{"kind":"Argument","name":{"kind":"Name","value":"statecode"},"value":{"kind":"IntValue","value":"0"}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"value"},"name":{"kind":"Name","value":"accountid"}},{"kind":"Field","alias":{"kind":"Name","value":"label"},"name":{"kind":"Name","value":"name"}}]}},{"kind":"Field","alias":{"kind":"Name","value":"fingap"},"name":{"kind":"Name","value":"accounts"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"evo_account_type"},"value":{"kind":"Variable","name":{"kind":"Name","value":"evo_account_type"}}},{"kind":"Argument","name":{"kind":"Name","value":"evo_type_ins_policy"},"value":{"kind":"ListValue","values":[{"kind":"IntValue","value":"100000002"}]}},{"kind":"Argument","name":{"kind":"Name","value":"statecode"},"value":{"kind":"IntValue","value":"0"}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"value"},"name":{"kind":"Name","value":"accountid"}},{"kind":"Field","alias":{"kind":"Name","value":"label"},"name":{"kind":"Name","value":"name"}}]}}]}}]} as unknown as DocumentNode<GetInsuranceDataQuery, GetInsuranceDataQueryVariables>;
|
||||
export const GetQuoteInsuranceDataDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetQuoteInsuranceData"},"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_osago_accountid"}},{"kind":"Field","name":{"kind":"Name","value":"evo_osago_payer"}},{"kind":"Field","name":{"kind":"Name","value":"evo_osago_price"}},{"kind":"Field","name":{"kind":"Name","value":"evo_kasko_accountid"}},{"kind":"Field","name":{"kind":"Name","value":"evo_kasko_payer"}},{"kind":"Field","name":{"kind":"Name","value":"evo_kasko_price"}},{"kind":"Field","name":{"kind":"Name","value":"evo_insurance_period"}},{"kind":"Field","name":{"kind":"Name","value":"evo_fingap_accountid"}},{"kind":"Field","name":{"kind":"Name","value":"evo_fingap_payer"}},{"kind":"Field","name":{"kind":"Name","value":"evo_fingap_period"}}]}}]}}]} as unknown as DocumentNode<GetQuoteInsuranceDataQuery, GetQuoteInsuranceDataQueryVariables>;
|
||||
export const GetLeadUrlDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetLeadUrl"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"id"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"Uuid"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"entity"},"name":{"kind":"Name","value":"lead"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"leadid"},"value":{"kind":"Variable","name":{"kind":"Name","value":"id"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"link"}}]}}]}}]} as unknown as DocumentNode<GetLeadUrlQuery, GetLeadUrlQueryVariables>;
|
||||
export const GetOpportunityUrlDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetOpportunityUrl"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"id"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"Uuid"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"entity"},"name":{"kind":"Name","value":"opportunity"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"opportunityid"},"value":{"kind":"Variable","name":{"kind":"Name","value":"id"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"link"}}]}}]}}]} as unknown as DocumentNode<GetOpportunityUrlQuery, GetOpportunityUrlQueryVariables>;
|
||||
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 GetLeasingObjectDataFromQuoteDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetLeasingObjectDataFromQuote"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"quoteId"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"Uuid"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"quote"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"quoteId"},"value":{"kind":"Variable","name":{"kind":"Name","value":"quoteId"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"evo_brandid"}},{"kind":"Field","name":{"kind":"Name","value":"evo_modelid"}},{"kind":"Field","name":{"kind":"Name","value":"evo_equipmentid"}},{"kind":"Field","name":{"kind":"Name","value":"evo_leasingobject_typeid"}}]}}]}}]} as unknown as DocumentNode<GetLeasingObjectDataFromQuoteQuery, GetLeasingObjectDataFromQuoteQueryVariables>;
|
||||
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 GetLeasingWithoutKaskoOptionsDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetLeasingWithoutKaskoOptions"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"currentDate"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"DateTime"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"evo_addproduct_types"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"statecode"},"value":{"kind":"IntValue","value":"0"}},{"kind":"Argument","name":{"kind":"Name","value":"evo_product_type"},"value":{"kind":"IntValue","value":"100000007"}},{"kind":"Argument","name":{"kind":"Name","value":"evo_datefrom_param"},"value":{"kind":"ObjectValue","fields":[{"kind":"ObjectField","name":{"kind":"Name","value":"lte"},"value":{"kind":"Variable","name":{"kind":"Name","value":"currentDate"}}}]}},{"kind":"Argument","name":{"kind":"Name","value":"evo_dateto_param"},"value":{"kind":"ObjectValue","fields":[{"kind":"ObjectField","name":{"kind":"Name","value":"gte"},"value":{"kind":"Variable","name":{"kind":"Name","value":"currentDate"}}}]}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"label"},"name":{"kind":"Name","value":"evo_name"}},{"kind":"Field","alias":{"kind":"Name","value":"value"},"name":{"kind":"Name","value":"evo_addproduct_typeid"}},{"kind":"Field","name":{"kind":"Name","value":"evo_product_type"}},{"kind":"Field","name":{"kind":"Name","value":"evo_min_period"}},{"kind":"Field","name":{"kind":"Name","value":"evo_max_period"}},{"kind":"Field","name":{"kind":"Name","value":"evo_min_price"}},{"kind":"Field","name":{"kind":"Name","value":"evo_max_price"}},{"kind":"Field","name":{"kind":"Name","value":"evo_leasingobject_types"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"evo_leasingobject_typeid"}}]}},{"kind":"Field","name":{"kind":"Name","value":"evo_visible_calc"}},{"kind":"Field","name":{"kind":"Name","value":"evo_min_first_payment_perc"}},{"kind":"Field","name":{"kind":"Name","value":"evo_max_first_payment_perc"}},{"kind":"Field","name":{"kind":"Name","value":"evo_models"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"evo_modelid"}}]}}]}}]}}]} as unknown as DocumentNode<GetLeasingWithoutKaskoOptionsQuery, GetLeasingWithoutKaskoOptionsQueryVariables>;
|
||||
export const GetPaymentsDataFromQuoteDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetPaymentsDataFromQuote"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"quoteId"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"Uuid"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"quote"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"quoteId"},"value":{"kind":"Variable","name":{"kind":"Name","value":"quoteId"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"evo_period"}},{"kind":"Field","name":{"kind":"Name","value":"evo_accept_period"}},{"kind":"Field","name":{"kind":"Name","value":"evo_first_payment_perc"}},{"kind":"Field","name":{"kind":"Name","value":"evo_last_payment_perc"}},{"kind":"Field","name":{"kind":"Name","value":"evo_graph_type"}},{"kind":"Field","name":{"kind":"Name","value":"evo_payments_decrease_perc"}},{"kind":"Field","name":{"kind":"Name","value":"evo_seasons_type"}},{"kind":"Field","name":{"kind":"Name","value":"evo_high_season"}},{"kind":"Field","name":{"kind":"Name","value":"evo_graphs"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"createdon"}},{"kind":"Field","name":{"kind":"Name","value":"evo_sumpay_withnds"}},{"kind":"Field","name":{"kind":"Name","value":"evo_planpayments"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"evo_payment_ratio"}}]}}]}}]}}]}}]} as unknown as DocumentNode<GetPaymentsDataFromQuoteQuery, GetPaymentsDataFromQuoteQueryVariables>;
|
||||
export const GetPriceDataFromQuoteDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetPriceDataFromQuote"},"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_currency_price"}},{"kind":"Field","name":{"kind":"Name","value":"evo_price_without_nds_supplier_currency"}},{"kind":"Field","name":{"kind":"Name","value":"evo_nds_in_price_supplier_currency"}},{"kind":"Field","name":{"kind":"Name","value":"evo_last_payment_rub"}},{"kind":"Field","name":{"kind":"Name","value":"evo_last_payment_calc"}},{"kind":"Field","name":{"kind":"Name","value":"evo_transactioncurrencyid"}},{"kind":"Field","name":{"kind":"Name","value":"evo_discount_supplier_currency"}},{"kind":"Field","name":{"kind":"Name","value":"evo_discount_perc"}},{"kind":"Field","name":{"kind":"Name","value":"evo_comission_perc"}},{"kind":"Field","name":{"kind":"Name","value":"evo_comission_rub"}},{"kind":"Field","name":{"kind":"Name","value":"evo_sale_bonus"}}]}}]}}]} as unknown as DocumentNode<GetPriceDataFromQuoteQuery, GetPriceDataFromQuoteQueryVariables>;
|
||||
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"}}]}}]}}]} 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 GetAgentsDataFromQuoteDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetAgentsDataFromQuote"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"quoteId"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"Uuid"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"quote"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"quoteId"},"value":{"kind":"Variable","name":{"kind":"Name","value":"quoteId"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"evo_supplier_accountid"}},{"kind":"Field","name":{"kind":"Name","value":"evo_dealer_person_accountid"}},{"kind":"Field","name":{"kind":"Name","value":"evo_dealer_reward_conditionid"}},{"kind":"Field","name":{"kind":"Name","value":"evo_dealer_reward_total"}},{"kind":"Field","name":{"kind":"Name","value":"evo_dealer_reward_summ"}},{"kind":"Field","name":{"kind":"Name","value":"evo_dealer_broker_accountid"}},{"kind":"Field","name":{"kind":"Name","value":"evo_dealer_broker_reward_conditionid"}},{"kind":"Field","name":{"kind":"Name","value":"evo_dealer_broker_reward_total"}},{"kind":"Field","name":{"kind":"Name","value":"evo_dealer_broker_reward_summ"}},{"kind":"Field","name":{"kind":"Name","value":"evo_agent_accountid"}},{"kind":"Field","name":{"kind":"Name","value":"evo_agent_reward_conditionid"}},{"kind":"Field","name":{"kind":"Name","value":"evo_agent_reward_total"}},{"kind":"Field","name":{"kind":"Name","value":"evo_agent_reward_summ"}},{"kind":"Field","name":{"kind":"Name","value":"evo_double_agent_accountid"}},{"kind":"Field","name":{"kind":"Name","value":"evo_double_agent_reward_conditionid"}},{"kind":"Field","name":{"kind":"Name","value":"evo_double_agent_reward_total"}},{"kind":"Field","name":{"kind":"Name","value":"evo_double_agent_reward_summ"}},{"kind":"Field","name":{"kind":"Name","value":"evo_broker_accountid"}},{"kind":"Field","name":{"kind":"Name","value":"evo_broker_reward_conditionid"}},{"kind":"Field","name":{"kind":"Name","value":"evo_broker_reward_total"}},{"kind":"Field","name":{"kind":"Name","value":"evo_broker_reward_summ"}},{"kind":"Field","name":{"kind":"Name","value":"evo_fin_department_accountid"}},{"kind":"Field","name":{"kind":"Name","value":"evo_fin_department_reward_conditionid"}},{"kind":"Field","name":{"kind":"Name","value":"evo_fin_department_reward_total"}},{"kind":"Field","name":{"kind":"Name","value":"evo_fin_department_reward_summ"}}]}}]}}]} as unknown as DocumentNode<GetAgentsDataFromQuoteQuery, GetAgentsDataFromQuoteQueryVariables>;
|
||||
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>;
|
||||
@ -23,7 +23,7 @@ const users = {
|
||||
},
|
||||
};
|
||||
|
||||
const { URL_GET_USER, URL_CORE_FINGAP, URL_CRM_GRAPHQL } = getUrls();
|
||||
const { URL_GET_USER, URL_CORE_FINGAP, URL_1C_TRANSTAX } = getUrls();
|
||||
|
||||
export const handlers = [
|
||||
rest.get(URL_GET_USER, (req, res, ctx) => {
|
||||
@ -37,6 +37,15 @@ export const handlers = [
|
||||
})
|
||||
);
|
||||
}),
|
||||
rest.post(URL_1C_TRANSTAX, (req, res, ctx) => {
|
||||
return res(
|
||||
ctx.json({
|
||||
error: null,
|
||||
tax: _.random(100000, 200000),
|
||||
})
|
||||
);
|
||||
}),
|
||||
|
||||
// rest.post(URL_CRM_GRAPHQL, (req, res, ctx) => {
|
||||
// return res(ctx.status(503));
|
||||
// }),
|
||||
|
||||
@ -52,6 +52,10 @@ const nextConfig = {
|
||||
destination: env.URL_CORE_FINGAP_DIRECT,
|
||||
source: urls.URL_CORE_FINGAP_PROXY,
|
||||
},
|
||||
{
|
||||
destination: env.URL_1C_TRANSTAX_DIRECT,
|
||||
source: urls.URL_1C_TRANSTAX_PROXY,
|
||||
},
|
||||
...favicons.map((fileName) => buildFaviconRewrite(`/${fileName}`)),
|
||||
];
|
||||
},
|
||||
|
||||
@ -9,6 +9,7 @@
|
||||
"lint:fix": "next lint -- --fix",
|
||||
"start": "next start",
|
||||
"graphql:update": "node ./scripts/graphql-update.js",
|
||||
"graphql:codegen": "node ./scripts/graphql-codegen.js",
|
||||
"test": "jest"
|
||||
},
|
||||
"dependencies": {
|
||||
|
||||
@ -3,8 +3,8 @@ import initializeApollo from '@/apollo/client';
|
||||
import * as Calculation from '@/Components/Calculation';
|
||||
import { CRMError } from '@/Components/Common/Error';
|
||||
import Output from '@/Components/Output';
|
||||
import { getOwnerData, useInsuranceData, useMainData } from '@/process/init/get-data';
|
||||
import { useReactions } from '@/process/init/inject-reactions/hooks';
|
||||
import { useDefaultReactions } from '@/config/process';
|
||||
import * as init from '@/process/init';
|
||||
import { min } from '@/styles/mq';
|
||||
import { dehydrate, QueryClient } from '@tanstack/react-query';
|
||||
import Head from 'next/head';
|
||||
@ -36,9 +36,9 @@ const Grid = styled(Box)`
|
||||
`;
|
||||
|
||||
function Home({ error }) {
|
||||
useMainData();
|
||||
useInsuranceData();
|
||||
useReactions();
|
||||
init.useMainData();
|
||||
init.useInsuranceData();
|
||||
useDefaultReactions();
|
||||
|
||||
if (error) return <CRMError error={error} />;
|
||||
|
||||
@ -69,12 +69,13 @@ export const getServerSideProps = async ({ req }) => {
|
||||
const apolloClient = initializeApollo();
|
||||
|
||||
try {
|
||||
const { data } = await getOwnerData(apolloClient, user);
|
||||
const { values, options } = await init.getInitialData(apolloClient, user);
|
||||
|
||||
return {
|
||||
props: {
|
||||
calculation: {
|
||||
options: data,
|
||||
options,
|
||||
values,
|
||||
},
|
||||
initialApolloState: apolloClient.cache.extract(),
|
||||
initialQueryState: dehydrate(queryClient),
|
||||
|
||||
34
apps/web/process/bonuses/get-kp-data.ts
Normal file
34
apps/web/process/bonuses/get-kp-data.ts
Normal file
@ -0,0 +1,34 @@
|
||||
import type { GetQuoteInputData, GetQuoteProcessData } from '../load-kp/types';
|
||||
import initializeApollo from '@/apollo/client';
|
||||
import defaultValues from '@/config/default-values';
|
||||
import * as CRMTypes from '@/graphql/crm.types';
|
||||
import { gql } from '@apollo/client';
|
||||
|
||||
const QUERY_GET_QUOTE_BONUS_DATA = gql`
|
||||
query GetQuoteBonusData($quoteId: Uuid!) {
|
||||
quote(quoteId: $quoteId) {
|
||||
evo_sale_bonus
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
export async function getKPData({
|
||||
values: { quote: quoteId },
|
||||
}: GetQuoteInputData): Promise<GetQuoteProcessData> {
|
||||
const apolloClient = initializeApollo();
|
||||
|
||||
const {
|
||||
data: { quote },
|
||||
} = await apolloClient.query({
|
||||
query: CRMTypes.GetQuoteBonusDataDocument,
|
||||
variables: {
|
||||
quoteId,
|
||||
},
|
||||
});
|
||||
|
||||
return {
|
||||
values: {
|
||||
saleBonus: quote?.evo_sale_bonus ?? defaultValues.saleBonus,
|
||||
},
|
||||
};
|
||||
}
|
||||
2
apps/web/process/bonuses/index.ts
Normal file
2
apps/web/process/bonuses/index.ts
Normal file
@ -0,0 +1,2 @@
|
||||
export * from './get-kp-data';
|
||||
export * as reactions from './reactions';
|
||||
96
apps/web/process/bonuses/reactions/common.ts
Normal file
96
apps/web/process/bonuses/reactions/common.ts
Normal file
@ -0,0 +1,96 @@
|
||||
/* eslint-disable @typescript-eslint/naming-convention */
|
||||
import type { ProcessContext } from '../../types';
|
||||
import helper from './lib/helper';
|
||||
import { makeDisposable } from '@/../../packages/tools';
|
||||
import * as CRMTypes from '@/graphql/crm.types';
|
||||
import dayjs from 'dayjs';
|
||||
import utc from 'dayjs/plugin/utc';
|
||||
import { reaction } from 'mobx';
|
||||
|
||||
dayjs.extend(utc);
|
||||
|
||||
export default function reactions(context: ProcessContext) {
|
||||
const { store, apolloClient } = context;
|
||||
const { $calculation, $process } = store;
|
||||
const { getCoefficient } = helper(context);
|
||||
|
||||
/**
|
||||
* При изменении значения необходимо значение поля tbxSaleBonus сравнивать со значением из записи Коэффициент
|
||||
* для расчета evo_coefficient как сейчас + данная запись должна быть связана с Продуктом product
|
||||
* из поля Продукт selectProduct evo_evo_coefficient_evo_baseproduct
|
||||
* Если продукта нет или нет коэффициента по условиям, то поле tbxSaleBonus = 0 и закрыто для редактирования
|
||||
*/
|
||||
|
||||
makeDisposable(
|
||||
() =>
|
||||
reaction(
|
||||
() => $calculation.element('selectProduct').getValue(),
|
||||
async (productId) => {
|
||||
if (!productId) {
|
||||
$calculation.element('tbxSaleBonus').resetValue().block();
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
const coefficient = await getCoefficient(productId);
|
||||
|
||||
if (!coefficient?.evo_sot_coefficient) {
|
||||
$calculation.element('tbxSaleBonus').resetValue().block();
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
const maxBonus = (coefficient?.evo_sot_coefficient || 0) * 100;
|
||||
$calculation.element('tbxSaleBonus').setValue(maxBonus).unblock();
|
||||
},
|
||||
{
|
||||
fireImmediately: true,
|
||||
}
|
||||
),
|
||||
() => $process.has('LoadKP')
|
||||
);
|
||||
|
||||
/**
|
||||
* если в Продукте evo_cut_proportion_bonus_director " = Да,
|
||||
* то tbxBonusCoefficient = tbxSaleBonus/evo_sot_coefficient,
|
||||
* иначе tbxBonusCoefficient = 1
|
||||
* где evo_sot_coefficient ищем так:
|
||||
* в справочнике Коэффициент для расчета (evo_coefficient) найти запись, у которой:
|
||||
*
|
||||
* Тип коэффициента (evo_corfficient_type) = СОТ (100 000 002)
|
||||
* Статус (statecode) = активный (0)
|
||||
* Начало действия (evo_datefrom) меньше или равно текущей даты
|
||||
* Окончание действия (evo_dateto) больше или равно текущей даты
|
||||
* Должность (evo_evo_job_title_evo_coefficient_job_titleid) = Должности (evo_job_titleid) текущего пользователя (systemuser)
|
||||
* Тип коэффициента для СОТ (evo_sot_coefficient_typeid) = (evo_sot_coefficient_type.evo_id=BONUS_LEASING)
|
||||
* данная запись должна быть связана с Продуктом product из поля Продукт selectProduct
|
||||
*/
|
||||
reaction(
|
||||
() => $calculation.$values.getValues(['product', 'saleBonus']),
|
||||
async ({ product: productId, saleBonus }) => {
|
||||
if (!productId) {
|
||||
$calculation.element('tbxBonusCoefficient').resetValue();
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
const {
|
||||
data: { evo_baseproduct },
|
||||
} = await apolloClient.query({
|
||||
query: CRMTypes.GetProductDocument,
|
||||
variables: {
|
||||
productId,
|
||||
},
|
||||
});
|
||||
|
||||
if (evo_baseproduct?.evo_cut_proportion_bonus_director) {
|
||||
const coefficient = await getCoefficient(productId);
|
||||
const maxBonus = (coefficient?.evo_sot_coefficient || 0) * 100;
|
||||
|
||||
$calculation.element('tbxBonusCoefficient').setValue(maxBonus ? saleBonus / maxBonus : 0);
|
||||
} else {
|
||||
$calculation.element('tbxBonusCoefficient').resetValue();
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
64
apps/web/process/bonuses/reactions/lib/helper.ts
Normal file
64
apps/web/process/bonuses/reactions/lib/helper.ts
Normal file
@ -0,0 +1,64 @@
|
||||
/* eslint-disable @typescript-eslint/naming-convention */
|
||||
import type { ProcessContext } from '../../../types';
|
||||
import { getUser } from '@/api/user/query';
|
||||
import type { ElementsTypes } from '@/Components/Calculation/config/map/values';
|
||||
import { STALE_TIME } from '@/constants/request';
|
||||
import * as CRMTypes from '@/graphql/crm.types';
|
||||
import dayjs from 'dayjs';
|
||||
|
||||
export type ProductId = ElementsTypes['selectProduct'];
|
||||
|
||||
export default function helper({ apolloClient, queryClient }: ProcessContext) {
|
||||
return {
|
||||
async getCoefficient(productId: ProductId) {
|
||||
if (!productId) {
|
||||
return null;
|
||||
}
|
||||
|
||||
const user = await queryClient.fetchQuery(['user'], () => getUser(), {
|
||||
staleTime: STALE_TIME,
|
||||
});
|
||||
|
||||
const {
|
||||
data: { systemuser },
|
||||
} = await apolloClient.query({
|
||||
query: CRMTypes.GetSystemUserDocument,
|
||||
variables: {
|
||||
domainname: user.domainName,
|
||||
},
|
||||
});
|
||||
|
||||
if (!systemuser?.evo_job_titleid) {
|
||||
return null;
|
||||
}
|
||||
|
||||
const currentDate = dayjs().utc(false).toISOString();
|
||||
|
||||
const {
|
||||
data: { evo_coefficients },
|
||||
} = await apolloClient.query({
|
||||
query: CRMTypes.GetCoefficientsDocument,
|
||||
variables: {
|
||||
currentDate,
|
||||
jobTitleId: systemuser?.evo_job_titleid,
|
||||
},
|
||||
});
|
||||
|
||||
const {
|
||||
data: { evo_sot_coefficient_type },
|
||||
} = await apolloClient.query({
|
||||
query: CRMTypes.GetSotCoefficientTypeDocument,
|
||||
variables: {
|
||||
evo_id: 'BONUS_LEASING',
|
||||
},
|
||||
});
|
||||
|
||||
return evo_coefficients?.find(
|
||||
(evo_coefficient) =>
|
||||
evo_coefficient?.evo_sot_coefficient_typeid ===
|
||||
evo_sot_coefficient_type?.evo_sot_coefficient_typeid &&
|
||||
evo_coefficient?.evo_baseproducts?.some((x) => x?.evo_baseproductid === productId)
|
||||
);
|
||||
},
|
||||
};
|
||||
}
|
||||
23
apps/web/process/bonuses/reactions/validation.ts
Normal file
23
apps/web/process/bonuses/reactions/validation.ts
Normal file
@ -0,0 +1,23 @@
|
||||
import helper from './lib/helper';
|
||||
import type { ProcessContext } from '@/process/types';
|
||||
import { reaction } from 'mobx';
|
||||
import { round } from 'tools';
|
||||
|
||||
export default function reactions(context: ProcessContext) {
|
||||
const { store } = context;
|
||||
const { $calculation } = store;
|
||||
const { getCoefficient } = helper(context);
|
||||
|
||||
reaction(
|
||||
() => $calculation.$values.getValues(['product', 'saleBonus']),
|
||||
async ({ product: productId, saleBonus }) => {
|
||||
const coefficient = await getCoefficient(productId);
|
||||
const maxBonus = (coefficient?.evo_sot_coefficient || 0) * 100;
|
||||
|
||||
$calculation.element('tbxSaleBonus').validate({
|
||||
invalid: round(saleBonus, 2) > round(maxBonus, 2),
|
||||
message: 'Размер бонуса МПЛ не может быть выше установленного по СОТ',
|
||||
});
|
||||
}
|
||||
);
|
||||
}
|
||||
1
apps/web/process/calculate/action.ts
Normal file
1
apps/web/process/calculate/action.ts
Normal file
@ -0,0 +1 @@
|
||||
export function action() {}
|
||||
@ -1 +1,2 @@
|
||||
export default () => {};
|
||||
export * from './action';
|
||||
export * as reactions from './reactions';
|
||||
|
||||
68
apps/web/process/calculate/reactions/common.ts
Normal file
68
apps/web/process/calculate/reactions/common.ts
Normal file
@ -0,0 +1,68 @@
|
||||
/* eslint-disable @typescript-eslint/naming-convention */
|
||||
import * as CRMTypes from '@/graphql/crm.types';
|
||||
import type { ProcessContext } from '@/process/types';
|
||||
import { reaction } from 'mobx';
|
||||
import { formatter } from 'tools';
|
||||
|
||||
export default function reactions({ store, apolloClient }: ProcessContext) {
|
||||
const { $calculation } = store;
|
||||
|
||||
reaction(
|
||||
() => $calculation.element('radioCalcType').getValue(),
|
||||
(calcType) => {
|
||||
switch (calcType) {
|
||||
case 100_000_001: {
|
||||
$calculation.element('tbxIRR_Perc').block();
|
||||
$calculation.element('tbxTotalPayments').unblock();
|
||||
break;
|
||||
}
|
||||
case 100_000_000:
|
||||
default: {
|
||||
$calculation.element('tbxIRR_Perc').unblock();
|
||||
$calculation.element('tbxTotalPayments').block();
|
||||
break;
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
fireImmediately: true,
|
||||
}
|
||||
);
|
||||
|
||||
reaction(
|
||||
() => $calculation.$values.getValues(['product', 'tarif', 'bonusCoefficient']),
|
||||
async ({ product: productId, tarif: tarifId, bonusCoefficient }) => {
|
||||
let max = 0;
|
||||
let min = 0;
|
||||
|
||||
if (productId && tarifId) {
|
||||
const {
|
||||
data: { evo_baseproduct },
|
||||
} = await apolloClient.query({
|
||||
query: CRMTypes.GetProductDocument,
|
||||
variables: {
|
||||
productId,
|
||||
},
|
||||
});
|
||||
|
||||
const {
|
||||
data: { evo_tarif },
|
||||
} = await apolloClient.query({
|
||||
query: CRMTypes.GetTarifDocument,
|
||||
variables: {
|
||||
tarifId,
|
||||
},
|
||||
});
|
||||
|
||||
min = evo_tarif?.evo_min_irr ?? 0;
|
||||
max = evo_tarif?.evo_max_irr ?? 0;
|
||||
|
||||
if (evo_baseproduct?.evo_cut_irr_with_bonus && bonusCoefficient < 1) {
|
||||
min -= (1 - bonusCoefficient) * (evo_tarif?.evo_cut_irr_with_bonus_coefficient ?? 0);
|
||||
}
|
||||
}
|
||||
|
||||
$calculation.element('labelIrrInfo').setValue(`${formatter(min)}% - ${formatter(max)}%`);
|
||||
}
|
||||
);
|
||||
}
|
||||
@ -1,7 +1,7 @@
|
||||
import types from '@/Components/Calculation/config/elements-types';
|
||||
import type * as Values from '@/Components/Calculation/config/map/values';
|
||||
import type * as Insurance from '@/Components/Calculation/Form/Insurance/InsuranceTable/types';
|
||||
import type { ReactionsContext } from '@/process/types';
|
||||
import type { ProcessContext } from '@/process/types';
|
||||
import { reaction } from 'mobx';
|
||||
import type { BaseOption } from 'ui/elements/types';
|
||||
|
||||
@ -13,7 +13,7 @@ function hasInvalidValueOrOptions(value: unknown, options: Array<BaseOption<unkn
|
||||
return (value && !options?.length) || !options.some((x) => x.value === value);
|
||||
}
|
||||
|
||||
export default function validationReactions({ store }: ReactionsContext) {
|
||||
export default function reactions({ store }: ProcessContext) {
|
||||
const { $calculation, $tables } = store;
|
||||
|
||||
reaction(
|
||||
|
||||
@ -1,32 +1,25 @@
|
||||
import type { GetQuoteDataInput, GetQuoteDataOutput } from '../load-kp/types';
|
||||
import type { GetQuoteInputData, GetQuoteProcessData } from '../load-kp/types';
|
||||
import initializeApollo from '@/apollo/client';
|
||||
import type * as CRMTypes from '@/graphql/crm.types';
|
||||
import * as CRMTypes from '@/graphql/crm.types';
|
||||
import { gql } from '@apollo/client';
|
||||
|
||||
const QUERY_GET_CONFIGURATOR_DATA_FROM_QUOTE = gql`
|
||||
query GetConfiguratorDataFromQuote($quoteId: Uuid!) {
|
||||
const QUERY_GET_QUOTE_CONFIGURATOR_DATA = gql`
|
||||
query GetQuoteConfiguratorData($quoteId: Uuid!) {
|
||||
quote(quoteId: $quoteId) {
|
||||
evo_baseproductid
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
type QuotePaymentsProcessData = {
|
||||
values: Partial<GetQuoteDataOutput['values']>;
|
||||
};
|
||||
|
||||
export default async function getConfiguratorDataFromKP({
|
||||
export async function getKPData({
|
||||
values: { quote: quoteId },
|
||||
}: GetQuoteDataInput): Promise<QuotePaymentsProcessData> {
|
||||
}: GetQuoteInputData): Promise<GetQuoteProcessData> {
|
||||
const apolloClient = initializeApollo();
|
||||
|
||||
const {
|
||||
data: { quote },
|
||||
} = await apolloClient.query<
|
||||
CRMTypes.GetConfiguratorDataFromQuoteQuery,
|
||||
CRMTypes.GetConfiguratorDataFromQuoteQueryVariables
|
||||
>({
|
||||
query: QUERY_GET_CONFIGURATOR_DATA_FROM_QUOTE,
|
||||
} = await apolloClient.query({
|
||||
query: CRMTypes.GetQuoteConfiguratorDataDocument,
|
||||
variables: {
|
||||
quoteId,
|
||||
},
|
||||
|
||||
2
apps/web/process/configurator/index.ts
Normal file
2
apps/web/process/configurator/index.ts
Normal file
@ -0,0 +1,2 @@
|
||||
export * from './get-kp-data';
|
||||
export * as reactions from './reactions';
|
||||
@ -2,7 +2,7 @@
|
||||
import { radioGraphType, selectSeasonType } from '@/config/default-options';
|
||||
import * as CRMTypes from '@/graphql/crm.types';
|
||||
import { SEASON_TYPES } from '@/process/payments/lib/seasons-constants';
|
||||
import type { ReactionsContext } from '@/process/types';
|
||||
import type { ProcessContext } from '@/process/types';
|
||||
import dayjs from 'dayjs';
|
||||
import utc from 'dayjs/plugin/utc';
|
||||
import { reaction } from 'mobx';
|
||||
@ -11,22 +11,18 @@ import { normalizeOptions } from 'tools';
|
||||
|
||||
dayjs.extend(utc);
|
||||
|
||||
export default function commonReactions({ store, apolloClient }: ReactionsContext) {
|
||||
export default function reactions({ store, apolloClient }: ProcessContext) {
|
||||
const { $calculation } = store;
|
||||
|
||||
reaction(
|
||||
() => {
|
||||
const { product, subsidy, importProgram, dealer } = $calculation.$values.values;
|
||||
|
||||
return {
|
||||
dealerId: dealer,
|
||||
importProgramId: importProgram,
|
||||
productId: product,
|
||||
subsidyId: subsidy,
|
||||
};
|
||||
},
|
||||
() => $calculation.$values.getValues(['dealer', 'importProgram', 'product', 'subsidy']),
|
||||
async ({
|
||||
product: productId,
|
||||
subsidy: subsidyId,
|
||||
importProgram: importProgramId,
|
||||
dealer: dealerId,
|
||||
// eslint-disable-next-line sonarjs/cognitive-complexity
|
||||
async ({ productId, subsidyId, importProgramId, dealerId }) => {
|
||||
}) => {
|
||||
/**
|
||||
* #1
|
||||
* DYN-190 При выборе значения в поле selectSubsidy необходимо добавить
|
||||
@ -351,9 +347,9 @@ export default function commonReactions({ store, apolloClient }: ReactionsContex
|
||||
},
|
||||
});
|
||||
|
||||
const allowedProducts = evo_baseproduct?.evo_baseproducts?.map(
|
||||
(product) => product?.evo_baseproductid
|
||||
);
|
||||
const allowedProducts = evo_baseproduct?.evo_baseproducts
|
||||
?.map((product) => product?.evo_baseproductid)
|
||||
.concat(quote.evo_baseproductid);
|
||||
|
||||
const filteredSelectProductOptions = normalizeOptions(
|
||||
evo_baseproducts?.filter((product) =>
|
||||
|
||||
@ -1,9 +1,9 @@
|
||||
/* eslint-disable @typescript-eslint/naming-convention */
|
||||
import * as CRMTypes from '@/graphql/crm.types';
|
||||
import type { ReactionsContext } from '@/process/types';
|
||||
import type { ProcessContext } from '@/process/types';
|
||||
import { reaction } from 'mobx';
|
||||
|
||||
export default function validationReactions({ store, apolloClient }: ReactionsContext) {
|
||||
export default function reactions({ store, apolloClient }: ProcessContext) {
|
||||
const { $calculation } = store;
|
||||
/**
|
||||
* На изменение поля Процет убывания платежей tbxParmentsDecreasePercent необходимо заложить проверку:
|
||||
|
||||
@ -1,27 +1,34 @@
|
||||
/* eslint-disable @typescript-eslint/naming-convention */
|
||||
import * as CRMTypes from '@/graphql/crm.types';
|
||||
import type { ReactionsContext } from '@/process/types';
|
||||
import type { ProcessContext } from '@/process/types';
|
||||
import dayjs from 'dayjs';
|
||||
import utc from 'dayjs/plugin/utc';
|
||||
import { autorun, reaction } from 'mobx';
|
||||
import { reaction } from 'mobx';
|
||||
import { makeDisposable, normalizeOptions } from 'tools';
|
||||
|
||||
dayjs.extend(utc);
|
||||
|
||||
export default function valuesReactions({ store, apolloClient }: ReactionsContext) {
|
||||
export default function valuesReactions({ store, apolloClient }: ProcessContext) {
|
||||
const { $calculation, $process } = store;
|
||||
|
||||
autorun(
|
||||
async () => {
|
||||
const {
|
||||
reaction(
|
||||
() =>
|
||||
$calculation.$values.getValues([
|
||||
'product',
|
||||
'leasingPeriod',
|
||||
'leaseObjectUsed',
|
||||
'deliveryTime',
|
||||
'firstPaymentPerc',
|
||||
'lastPaymentPerc',
|
||||
]),
|
||||
async ({
|
||||
product,
|
||||
leasingPeriod,
|
||||
leaseObjectUsed,
|
||||
deliveryTime,
|
||||
firstPaymentPerc,
|
||||
lastPaymentPerc,
|
||||
} = $calculation.$values.values;
|
||||
|
||||
}) => {
|
||||
const currentDate = dayjs().utc(false).toISOString();
|
||||
|
||||
let {
|
||||
@ -74,6 +81,7 @@ export default function valuesReactions({ store, apolloClient }: ReactionsContex
|
||||
},
|
||||
{
|
||||
delay: 10,
|
||||
fireImmediately: true,
|
||||
}
|
||||
);
|
||||
|
||||
@ -138,4 +146,32 @@ export default function valuesReactions({ store, apolloClient }: ReactionsContex
|
||||
.setValue(baseRate?.value ?? null);
|
||||
}
|
||||
);
|
||||
|
||||
reaction(
|
||||
() => $calculation.element('selectRate').getValue(),
|
||||
async (rateId) => {
|
||||
if (!rateId) {
|
||||
$calculation.element('tbxCreditRate').resetValue();
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
const {
|
||||
data: { evo_rate },
|
||||
} = await apolloClient.query({
|
||||
query: CRMTypes.GetRateDocument,
|
||||
variables: {
|
||||
rateId,
|
||||
},
|
||||
});
|
||||
|
||||
if (evo_rate?.evo_base_rate === null || evo_rate?.evo_base_rate === undefined) {
|
||||
$calculation.element('tbxCreditRate').resetValue();
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
$calculation.element('tbxCreditRate').setValue(evo_rate?.evo_base_rate);
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
1
apps/web/process/create-kp/action.ts
Normal file
1
apps/web/process/create-kp/action.ts
Normal file
@ -0,0 +1 @@
|
||||
export function action() {}
|
||||
@ -1 +1,2 @@
|
||||
export default () => {};
|
||||
export * from './action';
|
||||
export * as reactions from './reactions';
|
||||
|
||||
19
apps/web/process/create-kp/reactions.ts
Normal file
19
apps/web/process/create-kp/reactions.ts
Normal file
@ -0,0 +1,19 @@
|
||||
import type { ProcessContext } from '../types';
|
||||
import { reaction } from 'mobx';
|
||||
|
||||
export function common({ store }: ProcessContext) {
|
||||
const { $calculation } = store;
|
||||
|
||||
reaction(
|
||||
() => $calculation.element('radioBalanceHolder').getValue(),
|
||||
(balanceHolder) => {
|
||||
if (balanceHolder) {
|
||||
if (balanceHolder === 100_000_001) {
|
||||
$calculation.element('cbxLastPaymentRedemption').setValue(true).block();
|
||||
} else {
|
||||
$calculation.element('cbxLastPaymentRedemption').unblock();
|
||||
}
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
@ -1,18 +1,12 @@
|
||||
import type { GetQuoteDataInput, GetQuoteDataOutput } from '../load-kp/types';
|
||||
/* eslint-disable @typescript-eslint/no-non-null-assertion */
|
||||
import type { GetQuoteInputData, GetQuoteProcessData } from '../load-kp/types';
|
||||
import initializeApollo from '@/apollo/client';
|
||||
import { defaultValues } from '@/config/tables/insurance-table';
|
||||
import type * as CRMTypes from '@/graphql/crm.types';
|
||||
import * as CRMTypes from '@/graphql/crm.types';
|
||||
import { gql } from '@apollo/client';
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
||||
const DEFAULT_FINGAP_ROW = defaultValues.find((x) => x.key === 'fingap')!;
|
||||
|
||||
const QUERY_GET_FINGAP_DATA_FROM_QUOTE = gql`
|
||||
query GetFingapDataFromQuote($quoteId: Uuid!) {
|
||||
const QUERY_GET_QUOTE_FINGAP_DATA = gql`
|
||||
query GetQuoteFingapData($quoteId: Uuid!) {
|
||||
quote(quoteId: $quoteId) {
|
||||
evo_fingap_accountid
|
||||
evo_fingap_payer
|
||||
evo_fingap_period
|
||||
evo_product_risks {
|
||||
evo_addproduct_typeid
|
||||
}
|
||||
@ -20,25 +14,15 @@ const QUERY_GET_FINGAP_DATA_FROM_QUOTE = gql`
|
||||
}
|
||||
`;
|
||||
|
||||
type QuoteFingapProcessData = {
|
||||
fingap: GetQuoteDataOutput['fingap'];
|
||||
insurance: {
|
||||
values: Pick<GetQuoteDataOutput['insurance']['values'], 'fingap'>;
|
||||
};
|
||||
};
|
||||
|
||||
export default async function getFingapDataFromKP({
|
||||
export async function getKPData({
|
||||
values: { quote: quoteId },
|
||||
}: GetQuoteDataInput): Promise<QuoteFingapProcessData> {
|
||||
}: GetQuoteInputData): Promise<GetQuoteProcessData> {
|
||||
const apolloClient = initializeApollo();
|
||||
|
||||
const {
|
||||
data: { quote },
|
||||
} = await apolloClient.query<
|
||||
CRMTypes.GetFingapDataFromQuoteQuery,
|
||||
CRMTypes.GetFingapDataFromQuoteQueryVariables
|
||||
>({
|
||||
query: QUERY_GET_FINGAP_DATA_FROM_QUOTE,
|
||||
} = await apolloClient.query({
|
||||
query: CRMTypes.GetQuoteFingapDataDocument,
|
||||
variables: {
|
||||
quoteId,
|
||||
},
|
||||
@ -55,15 +39,5 @@ export default async function getFingapDataFromKP({
|
||||
fingap: {
|
||||
keys,
|
||||
},
|
||||
insurance: {
|
||||
values: {
|
||||
fingap: {
|
||||
...DEFAULT_FINGAP_ROW,
|
||||
insTerm: quote?.evo_fingap_period || null,
|
||||
insuranceCompany: quote?.evo_fingap_accountid || null,
|
||||
insured: quote?.evo_fingap_payer || null,
|
||||
},
|
||||
},
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
2
apps/web/process/fingap/index.ts
Normal file
2
apps/web/process/fingap/index.ts
Normal file
@ -0,0 +1,2 @@
|
||||
export * from './get-kp-data';
|
||||
export * as reactions from './reactions';
|
||||
@ -4,7 +4,7 @@ import type { RequestFinGAP } from '@/api/core/types';
|
||||
import type { Risk } from '@/Components/Calculation/Form/Insurance/FinGAPTable/types';
|
||||
import { STALE_TIME } from '@/constants/request';
|
||||
import type * as CRMTypes from '@/graphql/crm.types';
|
||||
import type { ReactionsContext } from '@/process/types';
|
||||
import type { ProcessContext } from '@/process/types';
|
||||
import { gql } from '@apollo/client';
|
||||
import type { QueryFunctionContext } from '@tanstack/react-query';
|
||||
import dayjs from 'dayjs';
|
||||
@ -14,7 +14,7 @@ import { flatten } from 'tools/object';
|
||||
|
||||
dayjs.extend(utc);
|
||||
|
||||
export default function commonReactions({ store, apolloClient, queryClient }: ReactionsContext) {
|
||||
export default function reactions({ store, apolloClient, queryClient }: ProcessContext) {
|
||||
const { $calculation, $tables } = store;
|
||||
// Расчет итоговой суммы ФинГАП и запись в таблицу страхования
|
||||
reaction(
|
||||
|
||||
@ -1 +1,2 @@
|
||||
export { default as common } from './common';
|
||||
export { default as validation } from './validation';
|
||||
@ -1,7 +1,7 @@
|
||||
import type { ReactionsContext } from '@/process/types';
|
||||
import type { ProcessContext } from '@/process/types';
|
||||
import { reaction } from 'mobx';
|
||||
|
||||
export default function validationReactions({ store }: ReactionsContext) {
|
||||
export default function reactions({ store }: ProcessContext) {
|
||||
const { $tables } = store;
|
||||
|
||||
reaction(
|
||||
@ -19,6 +19,10 @@ export default function validationReactions({ store }: ReactionsContext) {
|
||||
invalid: finGAPInsuranceCompany !== null && hasPaymentsErrors,
|
||||
message: 'Неверно заполнены платежи',
|
||||
});
|
||||
|
||||
if (hasPaymentsErrors) {
|
||||
$tables.fingap.clear();
|
||||
}
|
||||
},
|
||||
{
|
||||
fireImmediately: true,
|
||||
|
||||
99
apps/web/process/gibdd/get-kp-data.ts
Normal file
99
apps/web/process/gibdd/get-kp-data.ts
Normal file
@ -0,0 +1,99 @@
|
||||
/* eslint-disable @typescript-eslint/naming-convention */
|
||||
import type { GetQuoteInputData, GetQuoteProcessData } from '../load-kp/types';
|
||||
import helper from './lib/helper';
|
||||
import initializeApollo from '@/apollo/client';
|
||||
import defaultValues from '@/config/default-values';
|
||||
import * as CRMTypes from '@/graphql/crm.types';
|
||||
import { gql } from '@apollo/client';
|
||||
|
||||
const QUERY_GET_QUOTE_GIBDD_DATA = gql`
|
||||
query GetQuoteGibddData($quoteId: Uuid!) {
|
||||
quote(quoteId: $quoteId) {
|
||||
evo_db_accept_registration
|
||||
evo_object_registration
|
||||
evo_pts_type
|
||||
evo_vehicle_tax_year
|
||||
evo_vehicle_tax_approved
|
||||
evo_addproduct_types {
|
||||
evo_product_type
|
||||
evo_addproduct_typeid
|
||||
}
|
||||
evo_category_tr
|
||||
evo_vehicle_type_tax
|
||||
evo_regionid
|
||||
evo_townid
|
||||
evo_legal_regionid
|
||||
evo_legal_townid
|
||||
evo_registration_regionid
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
export async function getKPData({ values }: GetQuoteInputData): Promise<GetQuoteProcessData> {
|
||||
const { quote: quoteId, recalcWithRevision, lead: leadId, opportunity: opportunityId } = values;
|
||||
|
||||
const apolloClient = initializeApollo();
|
||||
|
||||
const {
|
||||
data: { quote },
|
||||
} = await apolloClient.query({
|
||||
query: CRMTypes.GetQuoteGibddDataDocument,
|
||||
variables: {
|
||||
quoteId,
|
||||
},
|
||||
});
|
||||
|
||||
const { getLegalRegion, getLegalTown, getRegion, getTown } = helper({
|
||||
apolloClient,
|
||||
});
|
||||
|
||||
const legalRegionId = await getLegalRegion({
|
||||
lead: leadId,
|
||||
opportunity: opportunityId,
|
||||
quote: quoteId,
|
||||
});
|
||||
|
||||
const legalTownId = await getLegalTown({
|
||||
lead: leadId,
|
||||
opportunity: opportunityId,
|
||||
quote: quoteId,
|
||||
regionId: legalRegionId,
|
||||
});
|
||||
|
||||
const regionId = await getRegion({
|
||||
lead: leadId,
|
||||
opportunity: opportunityId,
|
||||
quote: quoteId,
|
||||
});
|
||||
|
||||
const townId = await getTown({
|
||||
lead: leadId,
|
||||
opportunity: opportunityId,
|
||||
quote: quoteId,
|
||||
regionId,
|
||||
});
|
||||
|
||||
const registration = quote?.evo_addproduct_types?.find(
|
||||
(x) => x?.evo_product_type === 100_000_001
|
||||
)?.evo_addproduct_typeid;
|
||||
|
||||
return {
|
||||
values: {
|
||||
legalClientRegion: legalRegionId,
|
||||
legalClientTown: legalTownId,
|
||||
objectCategoryTax: quote?.evo_category_tr,
|
||||
objectRegionRegistration: quote?.evo_registration_regionid,
|
||||
objectRegistration: recalcWithRevision
|
||||
? quote?.evo_db_accept_registration
|
||||
: quote?.evo_object_registration,
|
||||
objectTypeTax: quote?.evo_vehicle_type_tax,
|
||||
regionRegistration: regionId,
|
||||
registration,
|
||||
townRegistration: townId,
|
||||
typePTS: quote?.evo_pts_type,
|
||||
vehicleTaxInYear:
|
||||
(recalcWithRevision ? quote?.evo_vehicle_tax_approved : quote?.evo_vehicle_tax_year) ??
|
||||
defaultValues.vehicleTaxInYear,
|
||||
},
|
||||
};
|
||||
}
|
||||
2
apps/web/process/gibdd/index.ts
Normal file
2
apps/web/process/gibdd/index.ts
Normal file
@ -0,0 +1,2 @@
|
||||
export * from './get-kp-data';
|
||||
export * as reactions from './reactions';
|
||||
288
apps/web/process/gibdd/lib/helper.ts
Normal file
288
apps/web/process/gibdd/lib/helper.ts
Normal file
@ -0,0 +1,288 @@
|
||||
/* eslint-disable @typescript-eslint/naming-convention */
|
||||
import * as CRMTypes from '@/graphql/crm.types';
|
||||
import type { ProcessContext } from '@/process/types';
|
||||
import type { CalculationValues } from '@/stores/calculation/values/types';
|
||||
import { gql } from '@apollo/client';
|
||||
|
||||
const QUERY_GET_QUOTE_REGION_TOWN = gql`
|
||||
query GetQuoteRegionTown($quoteId: Uuid!) {
|
||||
quote(quoteId: $quoteId) {
|
||||
evo_regionid
|
||||
evo_townid
|
||||
evo_legal_regionid
|
||||
evo_legal_townid
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
export default function helper({ apolloClient }: Pick<ProcessContext, 'apolloClient'>) {
|
||||
return {
|
||||
async getLegalRegion({
|
||||
lead: leadid,
|
||||
opportunity: opportunityid,
|
||||
quote: quoteId,
|
||||
}: Pick<CalculationValues, 'lead' | 'opportunity' | 'quote'>) {
|
||||
let regionId: string | null | undefined;
|
||||
|
||||
const {
|
||||
data: { evo_regions },
|
||||
} = await apolloClient.query({
|
||||
query: CRMTypes.GetRegionsDocument,
|
||||
});
|
||||
|
||||
if (leadid) {
|
||||
const {
|
||||
data: { lead },
|
||||
} = await apolloClient.query({
|
||||
query: CRMTypes.GetLeadDocument,
|
||||
variables: { leadid },
|
||||
});
|
||||
if (lead?.accountidData?.evo_address_legalidData?.evo_region_fias_id) {
|
||||
const region = evo_regions?.find(
|
||||
(x) =>
|
||||
x?.evo_fias_id === lead?.accountidData?.evo_address_legalidData?.evo_region_fias_id
|
||||
);
|
||||
regionId = region?.value;
|
||||
}
|
||||
}
|
||||
|
||||
if (opportunityid) {
|
||||
const {
|
||||
data: { opportunity },
|
||||
} = await apolloClient.query({
|
||||
query: CRMTypes.GetOpportunityDocument,
|
||||
variables: { opportunityid },
|
||||
});
|
||||
|
||||
if (!regionId && opportunity?.accountidData?.evo_address_legalidData?.evo_region_fias_id) {
|
||||
const region = evo_regions?.find(
|
||||
(x) =>
|
||||
x?.evo_fias_id ===
|
||||
opportunity?.accountidData?.evo_address_legalidData?.evo_region_fias_id
|
||||
);
|
||||
regionId = region?.value;
|
||||
}
|
||||
}
|
||||
|
||||
if (!regionId && quoteId) {
|
||||
const {
|
||||
data: { quote },
|
||||
} = await apolloClient.query<
|
||||
CRMTypes.GetQuoteRegionTownQuery,
|
||||
CRMTypes.GetQuoteRegionTownQueryVariables
|
||||
>({
|
||||
query: QUERY_GET_QUOTE_REGION_TOWN,
|
||||
variables: { quoteId },
|
||||
});
|
||||
regionId = quote?.evo_legal_regionid;
|
||||
}
|
||||
|
||||
return regionId;
|
||||
},
|
||||
|
||||
async getLegalTown({
|
||||
lead: leadid,
|
||||
opportunity: opportunityid,
|
||||
quote: quoteId,
|
||||
regionId,
|
||||
}: Pick<CalculationValues, 'lead' | 'opportunity' | 'quote'> & {
|
||||
regionId: string | null | undefined;
|
||||
}) {
|
||||
if (!regionId) {
|
||||
return null;
|
||||
}
|
||||
|
||||
let townId: string | null | undefined;
|
||||
|
||||
const {
|
||||
data: { evo_towns },
|
||||
} = await apolloClient.query({
|
||||
query: CRMTypes.GetTownsDocument,
|
||||
variables: { regionId },
|
||||
});
|
||||
|
||||
if (leadid) {
|
||||
const {
|
||||
data: { lead },
|
||||
} = await apolloClient.query({
|
||||
query: CRMTypes.GetLeadDocument,
|
||||
variables: { leadid },
|
||||
});
|
||||
if (lead?.accountidData?.evo_address_legalidData?.evo_city_fias_id) {
|
||||
const town = evo_towns?.find(
|
||||
(x) => x?.evo_fias_id === lead?.accountidData?.evo_address_legalidData?.evo_city_fias_id
|
||||
);
|
||||
townId = town?.value;
|
||||
}
|
||||
}
|
||||
|
||||
if (opportunityid) {
|
||||
const {
|
||||
data: { opportunity },
|
||||
} = await apolloClient.query({
|
||||
query: CRMTypes.GetOpportunityDocument,
|
||||
variables: { opportunityid },
|
||||
});
|
||||
|
||||
if (!townId && opportunity?.accountidData?.evo_address_legalidData?.evo_city_fias_id) {
|
||||
const town = evo_towns?.find(
|
||||
(x) =>
|
||||
x?.evo_fias_id ===
|
||||
opportunity?.accountidData?.evo_address_legalidData?.evo_city_fias_id
|
||||
);
|
||||
townId = town?.value;
|
||||
}
|
||||
}
|
||||
|
||||
if (!townId && quoteId) {
|
||||
const {
|
||||
data: { quote },
|
||||
} = await apolloClient.query<
|
||||
CRMTypes.GetQuoteRegionTownQuery,
|
||||
CRMTypes.GetQuoteRegionTownQueryVariables
|
||||
>({
|
||||
query: QUERY_GET_QUOTE_REGION_TOWN,
|
||||
variables: { quoteId },
|
||||
});
|
||||
townId = quote?.evo_legal_townid;
|
||||
}
|
||||
|
||||
return townId;
|
||||
},
|
||||
|
||||
async getRegion({
|
||||
lead: leadid,
|
||||
opportunity: opportunityid,
|
||||
quote: quoteId,
|
||||
}: Pick<CalculationValues, 'lead' | 'opportunity' | 'quote'>) {
|
||||
let regionId: string | null | undefined;
|
||||
|
||||
const {
|
||||
data: { evo_regions },
|
||||
} = await apolloClient.query({
|
||||
query: CRMTypes.GetRegionsDocument,
|
||||
});
|
||||
|
||||
if (leadid) {
|
||||
const {
|
||||
data: { lead },
|
||||
} = await apolloClient.query({
|
||||
query: CRMTypes.GetLeadDocument,
|
||||
variables: { leadid },
|
||||
});
|
||||
if (lead?.accountidData?.evo_address_legalidData?.evo_region_fias_id) {
|
||||
const region = evo_regions?.find(
|
||||
(x) =>
|
||||
x?.evo_fias_id === lead?.accountidData?.evo_address_legalidData?.evo_region_fias_id
|
||||
);
|
||||
regionId = region?.value;
|
||||
}
|
||||
}
|
||||
|
||||
if (opportunityid) {
|
||||
const {
|
||||
data: { opportunity },
|
||||
} = await apolloClient.query({
|
||||
query: CRMTypes.GetOpportunityDocument,
|
||||
variables: { opportunityid },
|
||||
});
|
||||
|
||||
if (!regionId && opportunity?.accountidData?.evo_address_legalidData?.evo_region_fias_id) {
|
||||
const region = evo_regions?.find(
|
||||
(x) =>
|
||||
x?.evo_fias_id ===
|
||||
opportunity?.accountidData?.evo_address_legalidData?.evo_region_fias_id
|
||||
);
|
||||
regionId = region?.value;
|
||||
}
|
||||
}
|
||||
|
||||
if (!regionId && quoteId) {
|
||||
const {
|
||||
data: { quote },
|
||||
} = await apolloClient.query<
|
||||
CRMTypes.GetQuoteRegionTownQuery,
|
||||
CRMTypes.GetQuoteRegionTownQueryVariables
|
||||
>({
|
||||
query: QUERY_GET_QUOTE_REGION_TOWN,
|
||||
variables: { quoteId },
|
||||
});
|
||||
regionId = quote?.evo_regionid;
|
||||
}
|
||||
|
||||
return regionId;
|
||||
},
|
||||
|
||||
async getTown({
|
||||
lead: leadid,
|
||||
opportunity: opportunityid,
|
||||
quote: quoteId,
|
||||
regionId,
|
||||
}: Pick<CalculationValues, 'lead' | 'opportunity' | 'quote'> & {
|
||||
regionId: string | null | undefined;
|
||||
}) {
|
||||
if (!regionId) {
|
||||
return null;
|
||||
}
|
||||
|
||||
let townId: string | null | undefined;
|
||||
|
||||
const {
|
||||
data: { evo_towns },
|
||||
} = await apolloClient.query({
|
||||
query: CRMTypes.GetTownsDocument,
|
||||
variables: { regionId },
|
||||
});
|
||||
|
||||
if (leadid) {
|
||||
const {
|
||||
data: { lead },
|
||||
} = await apolloClient.query({
|
||||
query: CRMTypes.GetLeadDocument,
|
||||
variables: { leadid },
|
||||
});
|
||||
if (lead?.accountidData?.evo_address_legalidData?.evo_city_fias_id) {
|
||||
const town = evo_towns?.find(
|
||||
(x) => x?.evo_fias_id === lead?.accountidData?.evo_address_legalidData?.evo_city_fias_id
|
||||
);
|
||||
townId = town?.value;
|
||||
}
|
||||
}
|
||||
|
||||
if (opportunityid) {
|
||||
const {
|
||||
data: { opportunity },
|
||||
} = await apolloClient.query({
|
||||
query: CRMTypes.GetOpportunityDocument,
|
||||
variables: { opportunityid },
|
||||
});
|
||||
|
||||
if (!townId && opportunity?.accountidData?.evo_address_legalidData?.evo_city_fias_id) {
|
||||
const town = evo_towns?.find(
|
||||
(x) =>
|
||||
x?.evo_fias_id ===
|
||||
opportunity?.accountidData?.evo_address_legalidData?.evo_city_fias_id
|
||||
);
|
||||
townId = town?.value;
|
||||
}
|
||||
}
|
||||
|
||||
if (quoteId) {
|
||||
const {
|
||||
data: { quote },
|
||||
} = await apolloClient.query<
|
||||
CRMTypes.GetQuoteRegionTownQuery,
|
||||
CRMTypes.GetQuoteRegionTownQueryVariables
|
||||
>({
|
||||
query: QUERY_GET_QUOTE_REGION_TOWN,
|
||||
variables: { quoteId },
|
||||
});
|
||||
if (!townId && quote?.evo_townid) {
|
||||
townId = quote?.evo_townid;
|
||||
}
|
||||
}
|
||||
|
||||
return townId;
|
||||
},
|
||||
};
|
||||
}
|
||||
592
apps/web/process/gibdd/reactions.ts
Normal file
592
apps/web/process/gibdd/reactions.ts
Normal file
@ -0,0 +1,592 @@
|
||||
/* eslint-disable @typescript-eslint/naming-convention */
|
||||
import type { ProcessContext } from '../types';
|
||||
import helper from './lib/helper';
|
||||
import { getTransTax } from '@/api/1c/query';
|
||||
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 type { QueryFunctionContext } from '@tanstack/react-query';
|
||||
import dayjs from 'dayjs';
|
||||
import utc from 'dayjs/plugin/utc';
|
||||
import { reaction } from 'mobx';
|
||||
import { makeDisposable, normalizeOptions } from 'tools';
|
||||
|
||||
dayjs.extend(utc);
|
||||
|
||||
export function common({ store, apolloClient, queryClient }: ProcessContext) {
|
||||
const { $calculation, $process } = store;
|
||||
|
||||
reaction(
|
||||
() => $calculation.element('selectLeaseObjectType').getValue(),
|
||||
async (leaseObjectTypeId) => {
|
||||
if (!leaseObjectTypeId) {
|
||||
$calculation.element('radioObjectRegistration').resetValue().unblock();
|
||||
|
||||
return;
|
||||
}
|
||||
const {
|
||||
data: { evo_leasingobject_type },
|
||||
} = await apolloClient.query({
|
||||
query: CRMTypes.GetLeaseObjectTypeDocument,
|
||||
variables: { leaseObjectTypeId },
|
||||
});
|
||||
|
||||
if (
|
||||
evo_leasingobject_type?.evo_id &&
|
||||
['6', '9', '10', '11'].includes(evo_leasingobject_type.evo_id)
|
||||
) {
|
||||
$calculation.element('radioObjectRegistration').setValue(100_000_000).block();
|
||||
} else {
|
||||
$calculation.element('radioObjectRegistration').unblock();
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
reaction(
|
||||
() => $calculation.$values.getValues(['objectRegistration', 'vehicleTaxInYear']),
|
||||
({ objectRegistration, vehicleTaxInYear }) => {
|
||||
if (objectRegistration === 100_000_001) {
|
||||
$calculation.element('tbxVehicleTaxInYear').unblock();
|
||||
} else {
|
||||
$calculation.element('tbxVehicleTaxInYear').resetValue().block();
|
||||
}
|
||||
$calculation.element('tbxVehicleTaxInYear').validate({
|
||||
invalid: objectRegistration === 100_000_001 && !(vehicleTaxInYear > 0),
|
||||
message: 'Значение должно быть больше 0',
|
||||
});
|
||||
}
|
||||
);
|
||||
|
||||
reaction(
|
||||
() => $calculation.$values.getValues(['objectRegistration', 'typePTS']),
|
||||
({ objectRegistration, typePTS }) => {
|
||||
if (objectRegistration === 100_000_001) {
|
||||
$calculation.element('radioTypePTS').unblock();
|
||||
} else {
|
||||
$calculation.element('radioTypePTS').resetValue().block();
|
||||
}
|
||||
$calculation.element('radioTypePTS').validate({
|
||||
invalid: objectRegistration === 100_000_001 && !typePTS,
|
||||
message: 'Не заполнено поле',
|
||||
});
|
||||
}
|
||||
);
|
||||
|
||||
makeDisposable(
|
||||
() =>
|
||||
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 },
|
||||
});
|
||||
|
||||
if (evo_leasingobject_type?.evo_vehicle_type_tax) {
|
||||
$calculation
|
||||
.element('selectObjectTypeTax')
|
||||
.setValue(evo_leasingobject_type?.evo_vehicle_type_tax);
|
||||
} else {
|
||||
$calculation.element('selectObjectTypeTax').resetValue();
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$calculation.element('selectObjectTypeTax').resetValue();
|
||||
}
|
||||
}
|
||||
),
|
||||
() => $process.has('LoadKP')
|
||||
);
|
||||
|
||||
reaction(
|
||||
() =>
|
||||
$calculation.$values.getValues([
|
||||
'leaseObjectType',
|
||||
'leaseObjectCategory',
|
||||
'typePTS',
|
||||
'objectRegistration',
|
||||
]),
|
||||
async ({
|
||||
leaseObjectType: leaseObjectTypeId,
|
||||
leaseObjectCategory,
|
||||
typePTS,
|
||||
objectRegistration,
|
||||
}) => {
|
||||
if (objectRegistration === 100_000_001 && typePTS === 100_000_001) {
|
||||
$calculation.element('selectObjectCategoryTax').unblock();
|
||||
if (leaseObjectTypeId) {
|
||||
const {
|
||||
data: { evo_leasingobject_type },
|
||||
} = await apolloClient.query({
|
||||
query: CRMTypes.GetLeaseObjectTypeDocument,
|
||||
variables: { leaseObjectTypeId },
|
||||
});
|
||||
if (leaseObjectCategory && leaseObjectCategory === evo_leasingobject_type?.evo_category) {
|
||||
$calculation
|
||||
.element('selectObjectCategoryTax')
|
||||
.setOptions(
|
||||
selectObjectCategoryTax.filter((option) =>
|
||||
evo_leasingobject_type?.evo_category_tr?.includes(option.value)
|
||||
)
|
||||
);
|
||||
} else {
|
||||
$calculation.element('selectObjectCategoryTax').resetOptions();
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$calculation.element('selectObjectCategoryTax').resetValue().block();
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
reaction(
|
||||
() => $calculation.$values.getValues(['leasingPeriod', 'vehicleTaxInYear']),
|
||||
({ leasingPeriod, vehicleTaxInYear }) => {
|
||||
if (vehicleTaxInYear > 0) {
|
||||
$calculation
|
||||
.element('tbxVehicleTaxInLeasingPeriod')
|
||||
.setValue((vehicleTaxInYear / 12) * leasingPeriod);
|
||||
} else {
|
||||
$calculation.element('tbxVehicleTaxInLeasingPeriod').resetValue();
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
const mapObjectTypeTaxToCategory = {
|
||||
100_000_000: 'D',
|
||||
100_000_001: 'B',
|
||||
100_000_002: 'C',
|
||||
100_000_003: 'T',
|
||||
100_000_004: 'A',
|
||||
};
|
||||
|
||||
function getCarCategory(objectTypeTax: number) {
|
||||
return mapObjectTypeTaxToCategory[objectTypeTax as keyof typeof mapObjectTypeTaxToCategory];
|
||||
}
|
||||
|
||||
makeDisposable(
|
||||
() =>
|
||||
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();
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
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,
|
||||
},
|
||||
context
|
||||
);
|
||||
const { tax, error } = await queryClient.fetchQuery(['1c', 'trans-tax'], request, {
|
||||
staleTime: STALE_TIME,
|
||||
});
|
||||
|
||||
if (!error && tax) {
|
||||
$calculation.element('tbxVehicleTaxInYear').setValue(tax);
|
||||
} else {
|
||||
$calculation.element('tbxVehicleTaxInYear').resetValue();
|
||||
}
|
||||
} else {
|
||||
$calculation.element('tbxVehicleTaxInYear').resetValue();
|
||||
}
|
||||
}
|
||||
),
|
||||
() => $process.has('LoadKP')
|
||||
);
|
||||
|
||||
reaction(
|
||||
() =>
|
||||
$calculation.$values.getValues([
|
||||
'objectRegionRegistration',
|
||||
'objectRegistration',
|
||||
'regionRegistration',
|
||||
'typePTS',
|
||||
'leaseObjectCategory',
|
||||
'leaseObjectType',
|
||||
]),
|
||||
async ({
|
||||
objectRegistration,
|
||||
objectRegionRegistration: objectRegionRegistrationId,
|
||||
regionRegistration: regionRegistrationId,
|
||||
typePTS,
|
||||
leaseObjectCategory,
|
||||
leaseObjectType,
|
||||
}) => {
|
||||
if (!objectRegionRegistrationId || !regionRegistrationId) {
|
||||
$calculation.element('selectRegistration').resetValue();
|
||||
|
||||
return;
|
||||
}
|
||||
const currentDate = dayjs().utc(false).toISOString();
|
||||
|
||||
const {
|
||||
data: { evo_region },
|
||||
} = await apolloClient.query({
|
||||
query: CRMTypes.GetRegionDocument,
|
||||
variables: { regionId: objectRegionRegistrationId },
|
||||
});
|
||||
|
||||
const {
|
||||
data: { evo_addproduct_types },
|
||||
} = await apolloClient.query({
|
||||
query: CRMTypes.GetRegistrationTypesDocument,
|
||||
variables: { currentDate },
|
||||
});
|
||||
|
||||
const options = evo_addproduct_types
|
||||
?.filter(
|
||||
(x) =>
|
||||
x?.evo_leasingobject_types?.find(
|
||||
(evo_leasingobject_type) =>
|
||||
evo_leasingobject_type?.evo_leasingobject_typeid === leaseObjectType
|
||||
) &&
|
||||
x.evo_whom_register === objectRegistration &&
|
||||
Boolean(
|
||||
leaseObjectCategory === 100_000_001
|
||||
? x.evo_towtruck === true || x.evo_towtruck === false
|
||||
: x.evo_towtruck === false
|
||||
) &&
|
||||
x.evo_gibdd_region === (objectRegionRegistrationId === regionRegistrationId) &&
|
||||
Boolean(typePTS && x.evo_pts_type?.includes(typePTS)) &&
|
||||
Boolean(
|
||||
x.evo_accountid &&
|
||||
evo_region?.accounts?.some(
|
||||
(evo_region_account) => evo_region_account?.accountid === x.evo_accountid
|
||||
)
|
||||
)
|
||||
)
|
||||
.map((x) => ({
|
||||
...x,
|
||||
label: `${x?.label} (${x?.evo_graph_price} руб.)`,
|
||||
}));
|
||||
|
||||
$calculation.element('selectRegistration').setOptions(normalizeOptions(options));
|
||||
}
|
||||
);
|
||||
|
||||
reaction(
|
||||
() => $calculation.element('selectRegistration').getValue(),
|
||||
async (registrationId) => {
|
||||
if (!registrationId) {
|
||||
$calculation.element('labelRegistrationDescription').resetValue();
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
const {
|
||||
data: { evo_addproduct_type },
|
||||
} = await apolloClient.query({
|
||||
query: CRMTypes.GetAddProductTypeDocument,
|
||||
variables: { addproductTypeId: registrationId },
|
||||
});
|
||||
|
||||
if (evo_addproduct_type?.evo_description) {
|
||||
$calculation
|
||||
.element('labelRegistrationDescription')
|
||||
.setValue(evo_addproduct_type?.evo_description);
|
||||
} else {
|
||||
$calculation.element('labelRegistrationDescription').resetValue();
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
reaction(
|
||||
() => $calculation.element('selectLegalClientRegion').getValue(),
|
||||
async (regionId) => {
|
||||
if (!regionId) {
|
||||
$calculation.element('selectLegalClientTown').resetOptions();
|
||||
|
||||
return;
|
||||
}
|
||||
const {
|
||||
data: { evo_towns },
|
||||
} = await apolloClient.query({
|
||||
query: CRMTypes.GetTownsDocument,
|
||||
variables: { regionId },
|
||||
});
|
||||
|
||||
$calculation.element('selectLegalClientTown').setOptions(normalizeOptions(evo_towns));
|
||||
}
|
||||
);
|
||||
|
||||
reaction(
|
||||
() => $calculation.$values.getValues(['regionRegistration', 'objectRegistration']),
|
||||
async ({ regionRegistration: regionId, objectRegistration }) => {
|
||||
if (!regionId) {
|
||||
$calculation.element('selectTownRegistration').resetOptions();
|
||||
|
||||
return;
|
||||
}
|
||||
const {
|
||||
data: { evo_towns },
|
||||
} = await apolloClient.query({
|
||||
query: CRMTypes.GetTownsDocument,
|
||||
variables: { regionId },
|
||||
});
|
||||
|
||||
if (objectRegistration === 100_000_001) {
|
||||
const towns = evo_towns?.filter((x) => x?.evo_businessunit_evolution === true);
|
||||
$calculation.element('selectTownRegistration').setOptions(normalizeOptions(towns));
|
||||
} else {
|
||||
$calculation.element('selectTownRegistration').setOptions(normalizeOptions(evo_towns));
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
const { getLegalRegion, getLegalTown, getRegion, getTown } = helper({ apolloClient });
|
||||
|
||||
reaction(
|
||||
() => $calculation.$values.getValues(['lead', 'opportunity']),
|
||||
async ({ lead, opportunity }) => {
|
||||
if (!lead && !opportunity) {
|
||||
$calculation.element('selectLegalClientRegion').resetValue().unblock();
|
||||
$calculation.element('selectRegionRegistration').resetValue().unblock();
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
const quote = $calculation.element('selectQuote').getValue();
|
||||
|
||||
const legalRegionId = await getLegalRegion({
|
||||
lead,
|
||||
opportunity,
|
||||
quote,
|
||||
});
|
||||
if (legalRegionId) {
|
||||
$calculation.element('selectLegalClientRegion').setValue(legalRegionId).block();
|
||||
} else {
|
||||
$calculation.element('selectLegalClientRegion').resetValue().unblock();
|
||||
}
|
||||
|
||||
const regionId = await getRegion({
|
||||
lead,
|
||||
opportunity,
|
||||
quote,
|
||||
});
|
||||
if (regionId) {
|
||||
$calculation.element('selectRegionRegistration').setValue(regionId).block();
|
||||
} else {
|
||||
$calculation.element('selectRegionRegistration').resetValue().unblock();
|
||||
}
|
||||
},
|
||||
{
|
||||
delay: 10,
|
||||
}
|
||||
);
|
||||
|
||||
reaction(
|
||||
() => $calculation.element('selectLegalClientRegion').getValue(),
|
||||
async (regionId) => {
|
||||
if (!regionId) {
|
||||
$calculation.element('selectLegalClientTown').resetValue().unblock();
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
const lead = $calculation.element('selectLead').getValue();
|
||||
const opportunity = $calculation.element('selectOpportunity').getValue();
|
||||
const quote = $calculation.element('selectQuote').getValue();
|
||||
|
||||
const townId = await getLegalTown({
|
||||
lead,
|
||||
opportunity,
|
||||
quote,
|
||||
regionId,
|
||||
});
|
||||
if (townId) {
|
||||
$calculation.element('selectLegalClientTown').setValue(townId).block();
|
||||
} else {
|
||||
$calculation.element('selectLegalClientTown').resetValue().unblock();
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
reaction(
|
||||
() => $calculation.$values.getValues(['regionRegistration', 'objectRegistration']),
|
||||
async ({ regionRegistration: regionId, objectRegistration }) => {
|
||||
if (!regionId) {
|
||||
$calculation.element('selectTownRegistration').resetValue().unblock();
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
const lead = $calculation.element('selectLead').getValue();
|
||||
const opportunity = $calculation.element('selectOpportunity').getValue();
|
||||
const quote = $calculation.element('selectQuote').getValue();
|
||||
|
||||
const townId = await getTown({
|
||||
lead,
|
||||
opportunity,
|
||||
quote,
|
||||
regionId,
|
||||
});
|
||||
|
||||
if (townId && objectRegistration === 100_000_000) {
|
||||
$calculation.element('selectTownRegistration').setValue(townId).block();
|
||||
} else {
|
||||
$calculation.element('selectTownRegistration').resetValue().unblock();
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
reaction(
|
||||
() => $calculation.element('radioObjectRegistration').getValue(),
|
||||
async (objectRegistration) => {
|
||||
const {
|
||||
data: { evo_regions },
|
||||
} = await apolloClient.query({
|
||||
query: CRMTypes.GetRegionsDocument,
|
||||
});
|
||||
|
||||
if (objectRegistration === 100_000_001) {
|
||||
const regions = evo_regions?.filter((x) => x?.evo_businessunit_evolution === true);
|
||||
$calculation.element('selectRegionRegistration').setOptions(normalizeOptions(regions));
|
||||
} else {
|
||||
$calculation.element('selectRegionRegistration').setOptions(normalizeOptions(evo_regions));
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
export function validation({ store, apolloClient }: ProcessContext) {
|
||||
const { $calculation } = store;
|
||||
|
||||
reaction(
|
||||
() => $calculation.$values.getValues(['leaseObjectCategory', 'maxMass']),
|
||||
({ leaseObjectCategory, maxMass }) => {
|
||||
$calculation.element('tbxMaxMass').validate({
|
||||
invalid: leaseObjectCategory === 100_000_001 && maxMass > 3500,
|
||||
message: 'При категории ТС = В Разрешенная макс.масса не может быть больше 3500 кг',
|
||||
});
|
||||
$calculation.element('tbxMaxMass').validate({
|
||||
invalid: leaseObjectCategory === 100_000_002 && maxMass <= 3500,
|
||||
message: 'При категории ТС = С Разрешенная макс.масса не может быть меньше 3500 кг',
|
||||
});
|
||||
}
|
||||
);
|
||||
|
||||
{
|
||||
const validationHelper = new ValidationHelper();
|
||||
reaction(
|
||||
() =>
|
||||
$calculation.$values.getValues([
|
||||
'typePTS',
|
||||
'objectRegistration',
|
||||
'objectCategoryTax',
|
||||
'leaseObjectType',
|
||||
]),
|
||||
async ({
|
||||
leaseObjectType: leaseObjectTypeId,
|
||||
typePTS,
|
||||
objectRegistration,
|
||||
objectCategoryTax,
|
||||
}) => {
|
||||
if (!leaseObjectTypeId) {
|
||||
validationHelper.removeErrors();
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
const {
|
||||
data: { evo_leasingobject_type },
|
||||
} = await apolloClient.query({
|
||||
query: CRMTypes.GetLeaseObjectTypeDocument,
|
||||
variables: { leaseObjectTypeId },
|
||||
});
|
||||
|
||||
$calculation.element('selectObjectCategoryTax').validate({
|
||||
helper: validationHelper,
|
||||
invalid:
|
||||
objectRegistration === 100_000_001 &&
|
||||
typePTS === 100_000_001 &&
|
||||
objectCategoryTax === null &&
|
||||
Boolean(evo_leasingobject_type?.evo_category_tr?.length),
|
||||
message: 'Необходимо из ЭПТС указать Категорию в соответствии с ТР ТС 018/2011',
|
||||
});
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
{
|
||||
const validationHelper = new ValidationHelper();
|
||||
reaction(
|
||||
() => $calculation.$values.getValues(['leaseObjectType', 'insNSIB']),
|
||||
async ({ insNSIB, leaseObjectType: leaseObjectTypeId }) => {
|
||||
if (!leaseObjectTypeId) {
|
||||
validationHelper.removeErrors();
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
const {
|
||||
data: { evo_leasingobject_type },
|
||||
} = await apolloClient.query({
|
||||
query: CRMTypes.GetLeaseObjectTypeDocument,
|
||||
variables: { leaseObjectTypeId },
|
||||
});
|
||||
|
||||
$calculation.element('selectInsNSIB').validate({
|
||||
helper: validationHelper,
|
||||
invalid: evo_leasingobject_type?.evo_id === '11' && !insNSIB,
|
||||
message: 'Страхование НСИБ обязательно для мотоциклистов',
|
||||
});
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
@ -1,18 +1,21 @@
|
||||
import injectDefaultReactions from './default';
|
||||
import type { Process } from '@/process/types';
|
||||
import { useStore } from '@/stores/hooks';
|
||||
import { trpcPureClient } from '@/trpc/client';
|
||||
import { useApolloClient } from '@apollo/client';
|
||||
import { useQueryClient } from '@tanstack/react-query';
|
||||
|
||||
export function useReactions() {
|
||||
export function useProcess({ reactions }: Process) {
|
||||
const store = useStore();
|
||||
const apolloClient = useApolloClient();
|
||||
const queryClient = useQueryClient();
|
||||
|
||||
injectDefaultReactions({
|
||||
Object.keys(reactions).forEach((name) => {
|
||||
const injector = reactions[name];
|
||||
injector({
|
||||
apolloClient,
|
||||
queryClient,
|
||||
store,
|
||||
trpcClient: trpcPureClient,
|
||||
});
|
||||
});
|
||||
}
|
||||
@ -1,26 +0,0 @@
|
||||
import type { User } from '@/api/user/types';
|
||||
import type { GetOwnerDataQuery, GetOwnerDataQueryVariables } from '@/graphql/crm.types';
|
||||
import type { ApolloClient } from '@apollo/client';
|
||||
import { gql } from '@apollo/client';
|
||||
|
||||
const QUERY_GET_OWNER_DATA = gql`
|
||||
query GetOwnerData($domainname: String) {
|
||||
selectLead: leads(owner_domainname: $domainname) {
|
||||
label: fullname
|
||||
value: leadid
|
||||
}
|
||||
selectOpportunity: opportunities(owner_domainname: $domainname) {
|
||||
label: name
|
||||
value: opportunityid
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
export async function getOwnerData({ query }: ApolloClient<object>, user: User) {
|
||||
return query<GetOwnerDataQuery, GetOwnerDataQueryVariables>({
|
||||
query: QUERY_GET_OWNER_DATA,
|
||||
variables: {
|
||||
domainname: user?.domainName,
|
||||
},
|
||||
});
|
||||
}
|
||||
@ -1,3 +0,0 @@
|
||||
export { useInsuranceData } from './get-insurance-data';
|
||||
export { useMainData } from './get-main-data';
|
||||
export { getOwnerData } from './get-owner-data';
|
||||
44
apps/web/process/init/get-initial-data.ts
Normal file
44
apps/web/process/init/get-initial-data.ts
Normal file
@ -0,0 +1,44 @@
|
||||
/* eslint-disable @typescript-eslint/naming-convention */
|
||||
import type { User } from '@/api/user/types';
|
||||
import * as CRMTypes from '@/graphql/crm.types';
|
||||
import type { ApolloClient } from '@apollo/client';
|
||||
|
||||
export async function getInitialData({ query }: ApolloClient<object>, user: User) {
|
||||
const {
|
||||
data: { leads },
|
||||
} = await query({ query: CRMTypes.GetLeadsDocument, variables: { domainname: user.domainName } });
|
||||
|
||||
const {
|
||||
data: { opportunities },
|
||||
} = await query({
|
||||
query: CRMTypes.GetOpportunitiesDocument,
|
||||
variables: { domainname: user.domainName },
|
||||
});
|
||||
|
||||
const {
|
||||
data: { transactioncurrencies },
|
||||
} = await query({
|
||||
query: CRMTypes.GetTransactionCurrenciesDocument,
|
||||
});
|
||||
|
||||
const transactioncurrency_rub = transactioncurrencies?.find((x) => x?.isocurrencycode === 'RUB');
|
||||
|
||||
if (transactioncurrency_rub?.transactioncurrencyid)
|
||||
await query({
|
||||
query: CRMTypes.GetTransactionCurrencyDocument,
|
||||
variables: {
|
||||
currencyid: transactioncurrency_rub?.transactioncurrencyid,
|
||||
},
|
||||
});
|
||||
|
||||
return {
|
||||
options: {
|
||||
selectLead: leads,
|
||||
selectOpportunity: opportunities,
|
||||
selectSupplierCurrency: transactioncurrencies,
|
||||
},
|
||||
values: {
|
||||
supplierCurrency: transactioncurrency_rub?.transactioncurrencyid ?? null,
|
||||
},
|
||||
};
|
||||
}
|
||||
@ -1,7 +1,7 @@
|
||||
/* eslint-disable canonical/sort-keys */
|
||||
import * as CRMTypes from '@/graphql/crm.types';
|
||||
import { useStore } from '@/stores/hooks';
|
||||
import { gql, useApolloClient } from '@apollo/client';
|
||||
import { useApolloClient } from '@apollo/client';
|
||||
import dayjs from 'dayjs';
|
||||
import utc from 'dayjs/plugin/utc';
|
||||
import { useEffect } from 'react';
|
||||
@ -9,21 +9,6 @@ import { normalizeOptions } from 'tools';
|
||||
|
||||
dayjs.extend(utc);
|
||||
|
||||
const QUERY_GET_ADDPRODUCT_TYPES = gql`
|
||||
query GetAddproductTypes($currentDate: DateTime) {
|
||||
evo_addproduct_types(
|
||||
statecode: 0
|
||||
evo_datefrom_param: { lte: $currentDate }
|
||||
evo_dateto_param: { gte: $currentDate }
|
||||
) {
|
||||
label: evo_name
|
||||
value: evo_addproduct_typeid
|
||||
evo_graph_price
|
||||
evo_product_type
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
const currentDate = dayjs().utc(false).toISOString();
|
||||
|
||||
/**
|
||||
@ -32,17 +17,6 @@ const currentDate = dayjs().utc(false).toISOString();
|
||||
* @param {*} onCompleted
|
||||
*/
|
||||
function getMainData({ query }, onCompleted) {
|
||||
query({
|
||||
query: CRMTypes.GetTransactionCurrenciesDocument,
|
||||
variables: {
|
||||
currentDate,
|
||||
},
|
||||
}).then(({ data }) => {
|
||||
onCompleted({
|
||||
selectSupplierCurrency: data?.transactioncurrencies,
|
||||
});
|
||||
});
|
||||
|
||||
query({
|
||||
query: CRMTypes.GetLeaseObjectTypesDocument,
|
||||
variables: {
|
||||
@ -50,7 +24,7 @@ function getMainData({ query }, onCompleted) {
|
||||
},
|
||||
}).then(({ data }) => {
|
||||
onCompleted({
|
||||
selectLeaseObjectType: data?.evo_baseproducts,
|
||||
selectLeaseObjectType: data?.evo_leasingobject_types,
|
||||
});
|
||||
});
|
||||
|
||||
@ -124,17 +98,17 @@ function getMainData({ query }, onCompleted) {
|
||||
});
|
||||
|
||||
query({
|
||||
query: QUERY_GET_ADDPRODUCT_TYPES,
|
||||
query: CRMTypes.GetAddproductTypesDocument,
|
||||
variables: {
|
||||
currentDate,
|
||||
},
|
||||
}).then(({ data }) => {
|
||||
const selectRegistration = data.evo_addproduct_types
|
||||
?.filter((x) => x?.evo_product_type === 100_000_001)
|
||||
.map((x) => ({
|
||||
...x,
|
||||
label: `${x?.label} (${x?.evo_graph_price} руб.)`,
|
||||
}));
|
||||
// const selectRegistration = data.evo_addproduct_types
|
||||
// ?.filter((x) => x?.evo_product_type === 100_000_001)
|
||||
// .map((x) => ({
|
||||
// ...x,
|
||||
// label: `${x?.label} (${x?.evo_graph_price} руб.)`,
|
||||
// }));
|
||||
|
||||
const selectTechnicalCard = data.evo_addproduct_types
|
||||
?.filter((x) => x?.evo_product_type === 100_000_000)
|
||||
@ -166,7 +140,7 @@ function getMainData({ query }, onCompleted) {
|
||||
);
|
||||
|
||||
onCompleted({
|
||||
selectRegistration,
|
||||
// selectRegistration,
|
||||
selectTechnicalCard,
|
||||
selectTelematic,
|
||||
selectTracker,
|
||||
3
apps/web/process/init/index.js
Normal file
3
apps/web/process/init/index.js
Normal file
@ -0,0 +1,3 @@
|
||||
export * from './get-initial-data';
|
||||
export * from './get-insurance-data';
|
||||
export * from './get-main-data';
|
||||
@ -1,41 +0,0 @@
|
||||
import * as calculateReactions from '../../calculate/reactions';
|
||||
import * as configurator from '../../configurator/reactions';
|
||||
import * as fingapReactions from '../../fingap/reactions';
|
||||
import * as leadOpportunityReactions from '../../lead-opportunity/reactions';
|
||||
import * as leasingObject from '../../leasing-object/reactions';
|
||||
import * as leasingWithoutKaskoReactions from '../../leasing-without-kasko/reactions';
|
||||
import paymentsReactions from '../../payments/reactions';
|
||||
import * as priceReactions from '../../price/reactions';
|
||||
import * as subsidyReactions from '../../subsidy/reactions';
|
||||
import * as agentsReactions from '../../supplier-agent/reactions/agents';
|
||||
import leasebackReactions from '../../supplier-agent/reactions/leaseback';
|
||||
import * as supplierReactions from '../../supplier-agent/reactions/supplier';
|
||||
import setInitialValuesReactions from '../set-values/reactions';
|
||||
import loadKpReactions from '@/process/load-kp/reactions';
|
||||
|
||||
export default function injectDefaultReactions(context) {
|
||||
leadOpportunityReactions.common(context);
|
||||
leadOpportunityReactions.urls(context);
|
||||
paymentsReactions(context);
|
||||
calculateReactions.validation(context);
|
||||
supplierReactions.commonReactions(context);
|
||||
supplierReactions.validationReactions(context);
|
||||
agentsReactions.fillReactions(context);
|
||||
agentsReactions.commonReactions(context);
|
||||
agentsReactions.validationReactions(context);
|
||||
leasebackReactions(context);
|
||||
priceReactions.computed(context);
|
||||
priceReactions.common(context);
|
||||
fingapReactions.common(context);
|
||||
fingapReactions.validation(context);
|
||||
setInitialValuesReactions(context);
|
||||
loadKpReactions(context);
|
||||
leasingWithoutKaskoReactions.common(context);
|
||||
subsidyReactions.computedReactions(context);
|
||||
subsidyReactions.commonReactions(context);
|
||||
leasingObject.common(context);
|
||||
leasingObject.validation(context);
|
||||
configurator.filters(context);
|
||||
configurator.values(context);
|
||||
configurator.validation(context);
|
||||
}
|
||||
@ -1,28 +0,0 @@
|
||||
/* eslint-disable @typescript-eslint/naming-convention */
|
||||
import { GetTransactionCurrenciesDocument } from '@/graphql/crm.types';
|
||||
import type { ReactionsContext } from '@/process/types';
|
||||
import { when } from 'mobx';
|
||||
|
||||
export default function setInitialValuesReactions({ store, apolloClient }: ReactionsContext) {
|
||||
const { $calculation } = store;
|
||||
|
||||
when(
|
||||
() => $calculation.$options.getOptions('selectSupplierCurrency').length > 0,
|
||||
async () => {
|
||||
const {
|
||||
data: { transactioncurrencies },
|
||||
} = await apolloClient.query({
|
||||
query: GetTransactionCurrenciesDocument,
|
||||
});
|
||||
|
||||
const transactioncurrency_rub = transactioncurrencies?.find(
|
||||
(x) => x?.isocurrencycode === 'RUB'
|
||||
);
|
||||
if (transactioncurrency_rub) {
|
||||
$calculation
|
||||
.element('selectSupplierCurrency')
|
||||
.setValue(transactioncurrency_rub.transactioncurrencyid);
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
64
apps/web/process/insurance/get-kp-data.ts
Normal file
64
apps/web/process/insurance/get-kp-data.ts
Normal file
@ -0,0 +1,64 @@
|
||||
/* eslint-disable @typescript-eslint/no-non-null-assertion */
|
||||
import type { GetQuoteInputData, GetQuoteProcessData } from '../load-kp/types';
|
||||
import initializeApollo from '@/apollo/client';
|
||||
import * as insuranceTable from '@/config/tables/insurance-table';
|
||||
import * as CRMTypes from '@/graphql/crm.types';
|
||||
import { gql } from '@apollo/client';
|
||||
|
||||
const { DEFAULT_FINGAP_ROW, DEFAULT_KASKO_ROW, DEFAULT_OSAGO_ROW } = insuranceTable;
|
||||
|
||||
const QUERY_GET_QUOTE_INSURANCE_DATA = gql`
|
||||
query GetQuoteInsuranceData($quoteId: Uuid!) {
|
||||
quote(quoteId: $quoteId) {
|
||||
evo_osago_accountid
|
||||
evo_osago_payer
|
||||
evo_osago_price
|
||||
evo_kasko_accountid
|
||||
evo_kasko_payer
|
||||
evo_kasko_price
|
||||
evo_insurance_period
|
||||
evo_fingap_accountid
|
||||
evo_fingap_payer
|
||||
evo_fingap_period
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
export async function getKPData({
|
||||
values: { quote: quoteId },
|
||||
}: GetQuoteInputData): Promise<GetQuoteProcessData> {
|
||||
const apolloClient = initializeApollo();
|
||||
|
||||
const {
|
||||
data: { quote },
|
||||
} = await apolloClient.query({
|
||||
query: CRMTypes.GetQuoteInsuranceDataDocument,
|
||||
variables: {
|
||||
quoteId,
|
||||
},
|
||||
});
|
||||
|
||||
return {
|
||||
insurance: {
|
||||
values: {
|
||||
fingap: Object.assign(DEFAULT_FINGAP_ROW, {
|
||||
insTerm: quote?.evo_fingap_period,
|
||||
insuranceCompany: quote?.evo_fingap_accountid,
|
||||
insured: quote?.evo_fingap_payer,
|
||||
}),
|
||||
kasko: Object.assign(DEFAULT_KASKO_ROW, {
|
||||
insCost: quote?.evo_kasko_price,
|
||||
insTerm: quote?.evo_insurance_period,
|
||||
insuranceCompany: quote?.evo_kasko_accountid,
|
||||
insured: quote?.evo_kasko_payer,
|
||||
}),
|
||||
osago: Object.assign(DEFAULT_OSAGO_ROW, {
|
||||
insCost: quote?.evo_osago_price,
|
||||
insTerm: quote?.evo_insurance_period,
|
||||
insuranceCompany: quote?.evo_osago_accountid,
|
||||
insured: quote?.evo_osago_payer,
|
||||
}),
|
||||
},
|
||||
},
|
||||
};
|
||||
}
|
||||
1
apps/web/process/insurance/index.ts
Normal file
1
apps/web/process/insurance/index.ts
Normal file
@ -0,0 +1 @@
|
||||
export * from './get-kp-data';
|
||||
1
apps/web/process/lead-opportunity/index.ts
Normal file
1
apps/web/process/lead-opportunity/index.ts
Normal file
@ -0,0 +1 @@
|
||||
export * as reactions from './reactions';
|
||||
@ -1,10 +1,10 @@
|
||||
import * as CRMTypes from '@/graphql/crm.types';
|
||||
import type { ReactionsContext } from '@/process/types';
|
||||
import type { ProcessContext } from '@/process/types';
|
||||
import { reaction } from 'mobx';
|
||||
import { normalizeOptions } from 'tools/entity';
|
||||
import { makeDisposable } from 'tools/mobx';
|
||||
|
||||
export default function commonReactions({ store, apolloClient }: ReactionsContext) {
|
||||
export default function reactions({ store, apolloClient }: ProcessContext) {
|
||||
const { $calculation, $process } = store;
|
||||
|
||||
/**
|
||||
@ -110,4 +110,28 @@ export default function commonReactions({ store, apolloClient }: ReactionsContex
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
reaction(
|
||||
() => $calculation.element('selectLead').getValue(),
|
||||
async (leadid) => {
|
||||
if (!leadid) {
|
||||
$calculation.element('tbxINNForCalc').resetValue();
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
const {
|
||||
data: { lead },
|
||||
} = await apolloClient.query({
|
||||
query: CRMTypes.GetLeadDocument,
|
||||
variables: { leadid },
|
||||
});
|
||||
|
||||
if (lead?.evo_inn) {
|
||||
$calculation.element('tbxINNForCalc').setValue(Number.parseInt(lead?.evo_inn, 10));
|
||||
} else {
|
||||
$calculation.element('tbxINNForCalc').resetValue();
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
@ -1,11 +1,11 @@
|
||||
/* eslint-disable no-negated-condition */
|
||||
import type { Elements } from '@/Components/Calculation/config/map/values';
|
||||
import type { ReactionsContext } from '@/process/types';
|
||||
import type { ProcessContext } from '@/process/types';
|
||||
import type { DocumentNode } from '@apollo/client';
|
||||
import { gql } from '@apollo/client';
|
||||
import { reaction } from 'mobx';
|
||||
|
||||
export default function urlsReactions({ store, apolloClient }: ReactionsContext) {
|
||||
export default function reactions({ store, apolloClient }: ProcessContext) {
|
||||
const { $calculation } = store;
|
||||
|
||||
/**
|
||||
|
||||
@ -1,55 +1,76 @@
|
||||
/* eslint-disable @typescript-eslint/naming-convention */
|
||||
import type { GetQuoteDataInput, GetQuoteDataOutput } from '../load-kp/types';
|
||||
import type { GetQuoteInputData, GetQuoteProcessData } from '../load-kp/types';
|
||||
import initializeApollo from '@/apollo/client';
|
||||
import type * as CRMTypes from '@/graphql/crm.types';
|
||||
import defaultValues from '@/config/default-values';
|
||||
import * as CRMTypes from '@/graphql/crm.types';
|
||||
import { gql } from '@apollo/client';
|
||||
|
||||
const QUERY_GET_LEASING_OBJECT_DATA_FROM_QUOTE = gql`
|
||||
query GetLeasingObjectDataFromQuote($quoteId: Uuid!) {
|
||||
const QUERY_GET_QUOTE_LEASING_OBJECT_DATA = gql`
|
||||
query GetQuoteLeasingObjectData($quoteId: Uuid!) {
|
||||
quote(quoteId: $quoteId) {
|
||||
evo_brandid
|
||||
evo_modelid
|
||||
evo_category
|
||||
evo_delivery_time
|
||||
evo_engine_hours
|
||||
evo_engine_type
|
||||
evo_engine_volume
|
||||
evo_equipmentid
|
||||
evo_leasingobject_typeid
|
||||
evo_leasingobject_used
|
||||
evo_max_mass
|
||||
evo_max_speed
|
||||
evo_mileage
|
||||
evo_modelid
|
||||
evo_object_count
|
||||
evo_power
|
||||
evo_recalc_limit
|
||||
evo_seats
|
||||
evo_trailer
|
||||
evo_use_for
|
||||
evo_vin
|
||||
evo_year
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
export type Quote = NonNullable<CRMTypes.GetLeasingObjectDataFromQuoteQuery['quote']>;
|
||||
|
||||
type QuoteLeasingObjectProcessData = {
|
||||
values: Partial<GetQuoteDataOutput['values']>;
|
||||
};
|
||||
|
||||
export default async function getLeasingObjectDataFromKP({
|
||||
values: { quote: quoteId },
|
||||
}: GetQuoteDataInput): Promise<QuoteLeasingObjectProcessData> {
|
||||
export async function getKPData({
|
||||
values: { quote: quoteId, recalcWithRevision },
|
||||
}: GetQuoteInputData): Promise<GetQuoteProcessData> {
|
||||
const apolloClient = initializeApollo();
|
||||
|
||||
const {
|
||||
data: { quote },
|
||||
} = await apolloClient.query<
|
||||
CRMTypes.GetLeasingObjectDataFromQuoteQuery,
|
||||
CRMTypes.GetLeasingObjectDataFromQuoteQueryVariables
|
||||
>({
|
||||
query: QUERY_GET_LEASING_OBJECT_DATA_FROM_QUOTE,
|
||||
} = await apolloClient.query({
|
||||
query: CRMTypes.GetQuoteLeasingObjectDataDocument,
|
||||
variables: {
|
||||
quoteId,
|
||||
},
|
||||
});
|
||||
|
||||
if (!quote) {
|
||||
throw new Error('Quote is empty');
|
||||
}
|
||||
|
||||
const { evo_brandid, evo_modelid, evo_equipmentid, evo_leasingobject_typeid } = quote;
|
||||
|
||||
return {
|
||||
values: {
|
||||
brand: evo_brandid,
|
||||
configuration: evo_equipmentid,
|
||||
leaseObjectType: evo_leasingobject_typeid,
|
||||
model: evo_modelid,
|
||||
brand: quote?.evo_brandid,
|
||||
configuration: quote?.evo_equipmentid,
|
||||
countSeats: quote?.evo_seats ?? defaultValues.countSeats,
|
||||
deliveryTime: quote?.evo_delivery_time,
|
||||
engineHours: quote?.evo_engine_hours ?? defaultValues.engineHours,
|
||||
engineType: quote?.evo_engine_type,
|
||||
engineVolume: quote?.evo_engine_volume ?? defaultValues.engineVolume,
|
||||
leaseObjectCategory: quote?.evo_category,
|
||||
leaseObjectCount:
|
||||
(recalcWithRevision ? quote?.evo_recalc_limit : quote?.evo_object_count) ??
|
||||
defaultValues.leaseObjectCount,
|
||||
leaseObjectMotorPower: quote?.evo_power ?? defaultValues.leaseObjectMotorPower,
|
||||
leaseObjectType: quote?.evo_leasingobject_typeid,
|
||||
leaseObjectUseFor: quote?.evo_use_for,
|
||||
leaseObjectUsed: quote?.evo_leasingobject_used ?? defaultValues.leaseObjectUsed,
|
||||
leaseObjectYear: quote?.evo_year ?? defaultValues.leaseObjectYear,
|
||||
maxMass: quote?.evo_max_mass ?? defaultValues.maxMass,
|
||||
maxSpeed: quote?.evo_max_speed ?? defaultValues.maxSpeed,
|
||||
mileage: quote?.evo_mileage ?? defaultValues.mileage,
|
||||
model: quote?.evo_modelid,
|
||||
vin: quote?.evo_vin,
|
||||
withTrailer: quote?.evo_trailer ?? defaultValues.withTrailer,
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
2
apps/web/process/leasing-object/index.ts
Normal file
2
apps/web/process/leasing-object/index.ts
Normal file
@ -0,0 +1,2 @@
|
||||
export * from './get-kp-data';
|
||||
export * as reactions from './reactions';
|
||||
@ -1,26 +1,22 @@
|
||||
/* eslint-disable @typescript-eslint/naming-convention */
|
||||
import * as CRMTypes from '@/graphql/crm.types';
|
||||
import type { ReactionsContext } from '@/process/types';
|
||||
import type { ProcessContext } from '@/process/types';
|
||||
import { reaction } from 'mobx';
|
||||
import { intersects } from 'radash';
|
||||
import { normalizeOptions } from 'tools';
|
||||
|
||||
export default function commonReactions({ store, apolloClient }: ReactionsContext) {
|
||||
export default function reactions({ store, apolloClient }: ProcessContext) {
|
||||
const { $calculation } = store;
|
||||
|
||||
reaction(
|
||||
() => {
|
||||
const { brand, subsidy, importProgram, leaseObjectType } = $calculation.$values.values;
|
||||
|
||||
return {
|
||||
brandId: brand,
|
||||
importProgramId: importProgram,
|
||||
leaseObjectTypeId: leaseObjectType,
|
||||
subsidyId: subsidy,
|
||||
};
|
||||
},
|
||||
() => $calculation.$values.getValues(['brand', 'importProgram', 'leaseObjectType', 'subsidy']),
|
||||
async ({
|
||||
brand: brandId,
|
||||
importProgram: importProgramId,
|
||||
leaseObjectType: leaseObjectTypeId,
|
||||
subsidy: subsidyId,
|
||||
// eslint-disable-next-line sonarjs/cognitive-complexity
|
||||
async ({ brandId, subsidyId, importProgramId, leaseObjectTypeId }) => {
|
||||
}) => {
|
||||
if (!brandId) {
|
||||
$calculation.element('selectModel').reset();
|
||||
|
||||
@ -31,9 +27,7 @@ export default function commonReactions({ store, apolloClient }: ReactionsContex
|
||||
data: { evo_models },
|
||||
} = await apolloClient.query({
|
||||
query: CRMTypes.GetModelsDocument,
|
||||
variables: {
|
||||
brandId,
|
||||
},
|
||||
variables: { brandId },
|
||||
});
|
||||
|
||||
let models = evo_models;
|
||||
@ -46,18 +40,16 @@ export default function commonReactions({ store, apolloClient }: ReactionsContex
|
||||
|
||||
if (leaseObjectTypeId) {
|
||||
const {
|
||||
data: { leaseObjectType },
|
||||
data: { evo_leasingobject_type },
|
||||
} = await apolloClient.query({
|
||||
query: CRMTypes.GetLeaseObjectTypeDocument,
|
||||
variables: {
|
||||
leaseObjectTypeId,
|
||||
},
|
||||
variables: { leaseObjectTypeId },
|
||||
});
|
||||
|
||||
models = models?.filter((model) => {
|
||||
if (
|
||||
model?.evo_vehicle_type &&
|
||||
leaseObjectType?.evo_vehicle_type?.includes(model.evo_vehicle_type)
|
||||
evo_leasingobject_type?.evo_vehicle_type?.includes(model.evo_vehicle_type)
|
||||
) {
|
||||
return model;
|
||||
}
|
||||
@ -71,9 +63,7 @@ export default function commonReactions({ store, apolloClient }: ReactionsContex
|
||||
data: { evo_subsidy: subsidy },
|
||||
} = await apolloClient.query({
|
||||
query: CRMTypes.GetSubsidyDocument,
|
||||
variables: {
|
||||
subsidyId,
|
||||
},
|
||||
variables: { subsidyId },
|
||||
});
|
||||
|
||||
models = models?.filter((model) => {
|
||||
@ -96,9 +86,7 @@ export default function commonReactions({ store, apolloClient }: ReactionsContex
|
||||
data: { importProgram },
|
||||
} = await apolloClient.query({
|
||||
query: CRMTypes.GetImportProgramDocument,
|
||||
variables: {
|
||||
importProgramId,
|
||||
},
|
||||
variables: { importProgramId },
|
||||
});
|
||||
|
||||
models = models?.filter((model) => {
|
||||
@ -122,18 +110,14 @@ export default function commonReactions({ store, apolloClient }: ReactionsContex
|
||||
);
|
||||
|
||||
reaction(
|
||||
() => {
|
||||
const { product, subsidy, importProgram, leaseObjectType } = $calculation.$values.values;
|
||||
|
||||
return {
|
||||
importProgramId: importProgram,
|
||||
leaseObjectTypeId: leaseObjectType,
|
||||
productId: product,
|
||||
subsidyId: subsidy,
|
||||
};
|
||||
},
|
||||
// eslint-disable-next-line sonarjs/cognitive-complexity
|
||||
async ({ productId, subsidyId, importProgramId, leaseObjectTypeId }) => {
|
||||
() =>
|
||||
$calculation.$values.getValues(['importProgram', 'leaseObjectType', 'product', 'subsidy']),
|
||||
async ({
|
||||
importProgram: importProgramId,
|
||||
leaseObjectType: leaseObjectTypeId,
|
||||
product: productId,
|
||||
subsidy: subsidyId,
|
||||
}) => {
|
||||
const {
|
||||
data: { evo_brands },
|
||||
} = await apolloClient.query({
|
||||
@ -153,9 +137,7 @@ export default function commonReactions({ store, apolloClient }: ReactionsContex
|
||||
data: { evo_baseproduct },
|
||||
} = await apolloClient.query({
|
||||
query: CRMTypes.GetProductDocument,
|
||||
variables: {
|
||||
productId,
|
||||
},
|
||||
variables: { productId },
|
||||
});
|
||||
|
||||
brands = brands?.filter(
|
||||
@ -169,21 +151,19 @@ export default function commonReactions({ store, apolloClient }: ReactionsContex
|
||||
|
||||
if (leaseObjectTypeId) {
|
||||
const {
|
||||
data: { leaseObjectType },
|
||||
data: { evo_leasingobject_type },
|
||||
} = await apolloClient.query({
|
||||
query: CRMTypes.GetLeaseObjectTypeDocument,
|
||||
variables: {
|
||||
leaseObjectTypeId,
|
||||
},
|
||||
variables: { leaseObjectTypeId },
|
||||
});
|
||||
|
||||
brands = brands?.filter(
|
||||
(brand) =>
|
||||
brand?.evo_vehicle_type?.length &&
|
||||
leaseObjectType?.evo_vehicle_type &&
|
||||
evo_leasingobject_type?.evo_vehicle_type &&
|
||||
intersects(
|
||||
brand.evo_vehicle_type?.filter((x) => x > 0),
|
||||
leaseObjectType?.evo_vehicle_type
|
||||
evo_leasingobject_type?.evo_vehicle_type
|
||||
)
|
||||
);
|
||||
}
|
||||
@ -193,9 +173,7 @@ export default function commonReactions({ store, apolloClient }: ReactionsContex
|
||||
data: { evo_subsidy: subsidy },
|
||||
} = await apolloClient.query({
|
||||
query: CRMTypes.GetSubsidyDocument,
|
||||
variables: {
|
||||
subsidyId,
|
||||
},
|
||||
variables: { subsidyId },
|
||||
});
|
||||
|
||||
brands = brands?.filter(
|
||||
@ -212,9 +190,7 @@ export default function commonReactions({ store, apolloClient }: ReactionsContex
|
||||
data: { importProgram },
|
||||
} = await apolloClient.query({
|
||||
query: CRMTypes.GetImportProgramDocument,
|
||||
variables: {
|
||||
importProgramId,
|
||||
},
|
||||
variables: { importProgramId },
|
||||
});
|
||||
|
||||
brands = brands?.filter(
|
||||
@ -253,12 +229,180 @@ export default function commonReactions({ store, apolloClient }: ReactionsContex
|
||||
data: { evo_equipments },
|
||||
} = await apolloClient.query({
|
||||
query: CRMTypes.GetConfigurationsDocument,
|
||||
variables: {
|
||||
modelId,
|
||||
},
|
||||
variables: { modelId },
|
||||
});
|
||||
|
||||
$calculation.element('selectConfiguration').setOptions(normalizeOptions(evo_equipments));
|
||||
}
|
||||
);
|
||||
|
||||
reaction(
|
||||
() => $calculation.element('cbxLeaseObjectUsed').getValue(),
|
||||
(leaseObjectUsed) => {
|
||||
if (leaseObjectUsed) {
|
||||
$calculation.element('tbxLeaseObjectCount').setValue(1).block();
|
||||
} else {
|
||||
$calculation.element('tbxLeaseObjectCount').unblock();
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
reaction(
|
||||
() => $calculation.element('selectLeaseObjectType').getValue(),
|
||||
async (leaseObjectTypeId) => {
|
||||
if (!leaseObjectTypeId) {
|
||||
$calculation.element('cbxWithTrailer').resetValue();
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
const {
|
||||
data: { evo_leasingobject_type },
|
||||
} = await apolloClient.query({
|
||||
query: CRMTypes.GetLeaseObjectTypeDocument,
|
||||
variables: { leaseObjectTypeId },
|
||||
});
|
||||
|
||||
$calculation.element('cbxWithTrailer').setValue(evo_leasingobject_type?.evo_id === '7');
|
||||
}
|
||||
);
|
||||
|
||||
reaction(
|
||||
() => $calculation.$values.getValues(['model', 'configuration']),
|
||||
async ({ model: modelId, configuration: configurationId }) => {
|
||||
$calculation.element('labelDepreciationGroup').resetValue();
|
||||
|
||||
if (configurationId) {
|
||||
const {
|
||||
data: { evo_equipment },
|
||||
} = await apolloClient.query({
|
||||
query: CRMTypes.GetConfigurationDocument,
|
||||
variables: { configurationId },
|
||||
});
|
||||
|
||||
if (evo_equipment?.evo_impairment_groupidData?.evo_name) {
|
||||
$calculation
|
||||
.element('labelDepreciationGroup')
|
||||
.setValue(evo_equipment?.evo_impairment_groupidData?.evo_name);
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (modelId) {
|
||||
const {
|
||||
data: { evo_model },
|
||||
} = await apolloClient.query({
|
||||
query: CRMTypes.GetModelDocument,
|
||||
variables: { modelId },
|
||||
});
|
||||
|
||||
if (evo_model?.evo_impairment_groupidData?.evo_name) {
|
||||
$calculation
|
||||
.element('labelDepreciationGroup')
|
||||
.setValue(evo_model?.evo_impairment_groupidData?.evo_name);
|
||||
}
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
reaction(
|
||||
() => $calculation.element('selectLeaseObjectCategory').getValue(),
|
||||
(leaseObjectCategory) => {
|
||||
if (
|
||||
leaseObjectCategory !== null &&
|
||||
[100_000_001, 100_000_003].includes(leaseObjectCategory)
|
||||
) {
|
||||
$calculation.element('cbxWithTrailer').setValue(false).block();
|
||||
} else {
|
||||
$calculation.element('cbxWithTrailer').unblock();
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
reaction(
|
||||
() => $calculation.$values.getValues(['brand', 'model', 'leaseObjectUsed']),
|
||||
async ({ brand: brandId, model: modelId, leaseObjectUsed }) => {
|
||||
const tbxImporterRewardPerc = $calculation.element('tbxImporterRewardPerc');
|
||||
const tbxImporterRewardRub = $calculation.element('tbxImporterRewardRub');
|
||||
|
||||
if (leaseObjectUsed) {
|
||||
tbxImporterRewardPerc.resetValue();
|
||||
tbxImporterRewardRub.resetValue();
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
if (modelId) {
|
||||
const {
|
||||
data: { evo_model },
|
||||
} = await apolloClient.query({
|
||||
query: CRMTypes.GetModelDocument,
|
||||
variables: { modelId },
|
||||
});
|
||||
|
||||
if (evo_model?.evo_importer_reward_perc) {
|
||||
tbxImporterRewardPerc.setValue(evo_model?.evo_importer_reward_perc);
|
||||
} else {
|
||||
tbxImporterRewardPerc.resetValue();
|
||||
}
|
||||
|
||||
if (evo_model?.evo_importer_reward_rub) {
|
||||
tbxImporterRewardRub.setValue(evo_model?.evo_importer_reward_rub);
|
||||
} else {
|
||||
tbxImporterRewardRub.resetValue();
|
||||
}
|
||||
} else if (brandId) {
|
||||
const {
|
||||
data: { evo_brand },
|
||||
} = await apolloClient.query({
|
||||
query: CRMTypes.GetBrandDocument,
|
||||
variables: { brandId },
|
||||
});
|
||||
|
||||
if (evo_brand?.evo_importer_reward_perc) {
|
||||
tbxImporterRewardPerc.setValue(evo_brand?.evo_importer_reward_perc);
|
||||
} else {
|
||||
tbxImporterRewardPerc.resetValue();
|
||||
}
|
||||
|
||||
if (evo_brand?.evo_importer_reward_rub) {
|
||||
tbxImporterRewardRub.setValue(evo_brand?.evo_importer_reward_rub);
|
||||
} else {
|
||||
tbxImporterRewardRub.resetValue();
|
||||
}
|
||||
} else {
|
||||
tbxImporterRewardPerc.resetValue();
|
||||
tbxImporterRewardRub.resetValue();
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
reaction(
|
||||
() => $calculation.element('selectLeaseObjectType').getValue(),
|
||||
async (leaseObjectTypeId) => {
|
||||
if (!leaseObjectTypeId) {
|
||||
$calculation.element('selectLeaseObjectCategory').resetValue();
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
const {
|
||||
data: { evo_leasingobject_type },
|
||||
} = await apolloClient.query({
|
||||
query: CRMTypes.GetLeaseObjectTypeDocument,
|
||||
variables: {
|
||||
leaseObjectTypeId,
|
||||
},
|
||||
});
|
||||
|
||||
if (evo_leasingobject_type?.evo_category) {
|
||||
$calculation
|
||||
.element('selectLeaseObjectCategory')
|
||||
.setValue(evo_leasingobject_type?.evo_category);
|
||||
} else {
|
||||
$calculation.element('selectLeaseObjectCategory').resetValue();
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
2
apps/web/process/leasing-object/reactions/index.ts
Normal file
2
apps/web/process/leasing-object/reactions/index.ts
Normal file
@ -0,0 +1,2 @@
|
||||
export { default as common } from './common';
|
||||
export { default as validation } from './validation';
|
||||
@ -1,7 +1,10 @@
|
||||
import type { ReactionsContext } from '@/process/types';
|
||||
import { autorun } from 'mobx';
|
||||
/* eslint-disable @typescript-eslint/naming-convention */
|
||||
import * as CRMTypes from '@/graphql/crm.types';
|
||||
import type { ProcessContext } from '@/process/types';
|
||||
import ValidationHelper from '@/stores/validation/helper';
|
||||
import { autorun, reaction } from 'mobx';
|
||||
|
||||
export default function validationReactions({ store }: ReactionsContext) {
|
||||
export default function reactions({ store, apolloClient }: ProcessContext) {
|
||||
const { $calculation } = store;
|
||||
|
||||
/**
|
||||
@ -20,4 +23,142 @@ export default function validationReactions({ store }: ReactionsContext) {
|
||||
delay: 10,
|
||||
}
|
||||
);
|
||||
|
||||
reaction(
|
||||
() =>
|
||||
$calculation.$values.getValues([
|
||||
'leaseObjectType',
|
||||
'engineVolume',
|
||||
'engineType',
|
||||
'leaseObjectMotorPower',
|
||||
]),
|
||||
async ({
|
||||
engineType,
|
||||
engineVolume,
|
||||
leaseObjectType: leaseObjectTypeId,
|
||||
leaseObjectMotorPower,
|
||||
}) => {
|
||||
if (!leaseObjectTypeId) {
|
||||
$calculation.element('selectEngineType').unblock();
|
||||
$calculation.element('tbxEngineVolume').unblock();
|
||||
$calculation.element('tbxLeaseObjectMotorPower').unblock();
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
const {
|
||||
data: { evo_leasingobject_type },
|
||||
} = await apolloClient.query({
|
||||
query: CRMTypes.GetLeaseObjectTypeDocument,
|
||||
variables: {
|
||||
leaseObjectTypeId,
|
||||
},
|
||||
});
|
||||
|
||||
if (evo_leasingobject_type?.evo_id === '8') {
|
||||
$calculation.element('selectEngineType').resetValue().block();
|
||||
$calculation.element('tbxEngineVolume').resetValue().block();
|
||||
$calculation.element('tbxLeaseObjectMotorPower').resetValue().block();
|
||||
} else {
|
||||
$calculation.element('selectEngineType').unblock();
|
||||
$calculation.element('tbxEngineVolume').unblock();
|
||||
$calculation.element('tbxLeaseObjectMotorPower').unblock();
|
||||
}
|
||||
|
||||
const isNotTrailer =
|
||||
evo_leasingobject_type?.evo_id !== null && evo_leasingobject_type?.evo_id !== '8';
|
||||
|
||||
$calculation.element('tbxEngineVolume').validate({
|
||||
invalid: isNotTrailer && engineVolume <= 0,
|
||||
message: 'Не заполнено поле',
|
||||
});
|
||||
$calculation.element('selectEngineType').validate({
|
||||
invalid: isNotTrailer && !engineType,
|
||||
message: 'Не заполнено поле',
|
||||
});
|
||||
$calculation.element('tbxLeaseObjectMotorPower').validate({
|
||||
invalid: isNotTrailer && leaseObjectMotorPower <= 0,
|
||||
message: 'Не заполнено поле',
|
||||
});
|
||||
}
|
||||
);
|
||||
|
||||
{
|
||||
const validationHelper = new ValidationHelper();
|
||||
|
||||
reaction(
|
||||
() => $calculation.$values.getValues(['leaseObjectType', 'countSeats', 'maxMass']),
|
||||
async ({ countSeats, leaseObjectType: leaseObjectTypeId, maxMass }) => {
|
||||
if (!leaseObjectTypeId) {
|
||||
validationHelper.removeErrors();
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
const {
|
||||
data: { evo_leasingobject_type },
|
||||
} = await apolloClient.query({
|
||||
query: CRMTypes.GetLeaseObjectTypeDocument,
|
||||
variables: {
|
||||
leaseObjectTypeId,
|
||||
},
|
||||
});
|
||||
|
||||
$calculation.element('tbxCountSeats').validate({
|
||||
helper: validationHelper,
|
||||
invalid: evo_leasingobject_type?.evo_id === '1' && countSeats >= 9,
|
||||
message: 'Количество мест должно быть меньше 9',
|
||||
});
|
||||
|
||||
$calculation.element('tbxCountSeats').validate({
|
||||
helper: validationHelper,
|
||||
invalid:
|
||||
(evo_leasingobject_type?.evo_id === '4' || evo_leasingobject_type?.evo_id === '5') &&
|
||||
countSeats <= 8,
|
||||
message: 'Количество мест должно быть больше 8',
|
||||
});
|
||||
|
||||
$calculation.element('tbxMaxMass').validate({
|
||||
helper: validationHelper,
|
||||
invalid: evo_leasingobject_type?.evo_id === '2' && maxMass <= 0,
|
||||
message: 'Не заполнено поле',
|
||||
});
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
{
|
||||
const validationHelper = new ValidationHelper();
|
||||
|
||||
reaction(
|
||||
() => $calculation.$values.getValues(['leaseObjectType', 'leaseObjectCategory']),
|
||||
async ({ leaseObjectCategory, leaseObjectType: leaseObjectTypeId }) => {
|
||||
if (!leaseObjectTypeId) {
|
||||
validationHelper.removeErrors();
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
const {
|
||||
data: { evo_leasingobject_type },
|
||||
} = await apolloClient.query({
|
||||
query: CRMTypes.GetLeaseObjectTypeDocument,
|
||||
variables: {
|
||||
leaseObjectTypeId,
|
||||
},
|
||||
});
|
||||
|
||||
$calculation.element('selectLeaseObjectCategory').validate({
|
||||
helper: validationHelper,
|
||||
invalid:
|
||||
!leaseObjectCategory &&
|
||||
Boolean(
|
||||
evo_leasingobject_type?.evo_id &&
|
||||
!['6', '9', '10'].includes(evo_leasingobject_type?.evo_id)
|
||||
),
|
||||
message: 'Не заполнено поле',
|
||||
});
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
1
apps/web/process/leasing-without-kasko/index.ts
Normal file
1
apps/web/process/leasing-without-kasko/index.ts
Normal file
@ -0,0 +1 @@
|
||||
export * as reactions from './reactions';
|
||||
@ -1,11 +1,11 @@
|
||||
/* eslint-disable canonical/sort-keys */
|
||||
/* eslint-disable @typescript-eslint/naming-convention */
|
||||
import type * as CRMTypes from '@/graphql/crm.types';
|
||||
import type { ReactionsContext } from '@/process/types';
|
||||
import type { ProcessContext } from '@/process/types';
|
||||
import { gql } from '@apollo/client';
|
||||
import dayjs from 'dayjs';
|
||||
import utc from 'dayjs/plugin/utc';
|
||||
import { autorun, reaction } from 'mobx';
|
||||
import { reaction } from 'mobx';
|
||||
import { uid } from 'radash';
|
||||
import { normalizeOptions } from 'tools';
|
||||
import notification from 'ui/elements/notification';
|
||||
@ -42,7 +42,7 @@ const QUERY_GET_LEASING_WITHOUT_KASKO_OPTIONS = gql`
|
||||
}
|
||||
`;
|
||||
|
||||
export default function commonReactions({ store, apolloClient }: ReactionsContext) {
|
||||
export function common({ store, apolloClient }: ProcessContext) {
|
||||
const { $calculation, $tables } = store;
|
||||
|
||||
reaction(
|
||||
@ -73,7 +73,28 @@ export default function commonReactions({ store, apolloClient }: ReactionsContex
|
||||
}
|
||||
);
|
||||
|
||||
autorun(async () => {
|
||||
reaction(
|
||||
() =>
|
||||
$calculation.$values.getValues([
|
||||
'plPriceRub',
|
||||
'discountRub',
|
||||
'importProgramSum',
|
||||
'leasingPeriod',
|
||||
'addEquipmentPrice',
|
||||
'leaseObjectType',
|
||||
'firstPaymentPerc',
|
||||
'model',
|
||||
]),
|
||||
async ({
|
||||
plPriceRub,
|
||||
discountRub,
|
||||
importProgramSum,
|
||||
leasingPeriod,
|
||||
addEquipmentPrice,
|
||||
leaseObjectType,
|
||||
firstPaymentPerc,
|
||||
model: modelId,
|
||||
}) => {
|
||||
const currentDate = dayjs().utc(false).toISOString();
|
||||
|
||||
const {
|
||||
@ -88,39 +109,31 @@ export default function commonReactions({ store, apolloClient }: ReactionsContex
|
||||
},
|
||||
});
|
||||
|
||||
const {
|
||||
plPriceRub,
|
||||
discountRub,
|
||||
importProgramSum,
|
||||
leasingPeriod,
|
||||
addEquipmentPrice,
|
||||
leaseObjectType,
|
||||
firstPaymentPerc,
|
||||
model: modelId,
|
||||
} = $calculation.$values.values;
|
||||
|
||||
const price = plPriceRub - discountRub - importProgramSum + addEquipmentPrice;
|
||||
const options = evo_addproduct_types?.filter(
|
||||
(x) =>
|
||||
x?.evo_max_period &&
|
||||
x.evo_max_period >= leasingPeriod &&
|
||||
x?.evo_min_period &&
|
||||
x.evo_min_period <= leasingPeriod &&
|
||||
x?.evo_max_price &&
|
||||
x.evo_max_price >= plPriceRub - discountRub - importProgramSum + addEquipmentPrice &&
|
||||
x?.evo_min_price &&
|
||||
x.evo_min_price <= plPriceRub - discountRub - importProgramSum + addEquipmentPrice &&
|
||||
x &&
|
||||
Boolean(x.evo_max_period !== null && x.evo_max_period >= leasingPeriod) &&
|
||||
Boolean(x.evo_min_period !== null && x.evo_min_period <= leasingPeriod) &&
|
||||
Boolean(x.evo_max_price !== null && x.evo_max_price >= price) &&
|
||||
Boolean(x.evo_min_price !== null && x.evo_min_price <= price) &&
|
||||
x.evo_leasingobject_types?.find(
|
||||
(evo_leasingobject_type) =>
|
||||
evo_leasingobject_type?.evo_leasingobject_typeid === leaseObjectType
|
||||
) &&
|
||||
x.evo_visible_calc &&
|
||||
x.evo_min_first_payment_perc &&
|
||||
x.evo_min_first_payment_perc <= firstPaymentPerc &&
|
||||
x.evo_max_first_payment_perc &&
|
||||
x.evo_max_first_payment_perc >= firstPaymentPerc &&
|
||||
Boolean(
|
||||
x.evo_min_first_payment_perc !== null &&
|
||||
x.evo_min_first_payment_perc <= firstPaymentPerc
|
||||
) &&
|
||||
Boolean(
|
||||
x.evo_max_first_payment_perc !== null &&
|
||||
x.evo_max_first_payment_perc >= firstPaymentPerc
|
||||
) &&
|
||||
!x.evo_models?.map((evo_model) => evo_model?.evo_modelid).includes(modelId)
|
||||
);
|
||||
|
||||
$calculation.element('selectLeasingWithoutKasko').setOptions(normalizeOptions(options));
|
||||
});
|
||||
}
|
||||
);
|
||||
}
|
||||
@ -1 +0,0 @@
|
||||
export { default as common } from './common';
|
||||
2
apps/web/process/load-kp/index.ts
Normal file
2
apps/web/process/load-kp/index.ts
Normal file
@ -0,0 +1,2 @@
|
||||
export * as reactions from './reactions';
|
||||
export * from './types';
|
||||
@ -1,18 +1,16 @@
|
||||
import type { ReactionsContext } from '@/process/types';
|
||||
import extend from '@/stores/tables/insurance/tools';
|
||||
import type { ProcessContext } from '@/process/types';
|
||||
import { reaction } from 'mobx';
|
||||
import { pick } from 'radash';
|
||||
import message from 'ui/elements/message';
|
||||
|
||||
const key = 'KP_LOADING_INFO';
|
||||
|
||||
export default function loadKpReactions({ store, trpcClient }: ReactionsContext) {
|
||||
export function common({ store, trpcClient }: ProcessContext) {
|
||||
const { $calculation, $process, $tables } = store;
|
||||
|
||||
reaction(
|
||||
() => $calculation.element('selectQuote').getValue(),
|
||||
(quoteId) => {
|
||||
if (!quoteId) return;
|
||||
if (!quoteId || $process.has('LoadKP')) return;
|
||||
|
||||
$process.add('LoadKP');
|
||||
|
||||
@ -23,42 +21,39 @@ export default function loadKpReactions({ store, trpcClient }: ReactionsContext)
|
||||
key,
|
||||
});
|
||||
|
||||
const { recalcWithRevision } = $calculation.$values.values;
|
||||
|
||||
trpcClient.quote.getData
|
||||
.query({
|
||||
values: {
|
||||
quote: quoteId,
|
||||
recalcWithRevision,
|
||||
...$calculation.$values.getValues(['recalcWithRevision', 'lead', 'opportunity']),
|
||||
},
|
||||
})
|
||||
.then(({ values, payments, insurance, fingap }) => {
|
||||
const savedValues = pick($calculation.$values.values, [
|
||||
const savedValues = $calculation.$values.getValues([
|
||||
'lead',
|
||||
'opportunity',
|
||||
'quote',
|
||||
'leadUrl',
|
||||
'opportunityUrl',
|
||||
'quoteUrl',
|
||||
'recalcWithRevision',
|
||||
]);
|
||||
|
||||
$calculation.$values.setValues({
|
||||
values: {
|
||||
...values,
|
||||
...savedValues,
|
||||
},
|
||||
});
|
||||
|
||||
$tables.payments.setValues(payments.values);
|
||||
|
||||
if (insurance.values.osago) {
|
||||
extend($tables.insurance).setRowValues(insurance.values.osago);
|
||||
$tables.insurance.row('osago').setValues(insurance.values.osago);
|
||||
}
|
||||
if (insurance.values.kasko) {
|
||||
extend($tables.insurance).setRowValues(insurance.values.kasko);
|
||||
$tables.insurance.row('kasko').setValues(insurance.values.kasko);
|
||||
}
|
||||
if (insurance.values.fingap) {
|
||||
extend($tables.insurance).setRowValues(insurance.values.fingap);
|
||||
$tables.insurance.row('fingap').setValues(insurance.values.fingap);
|
||||
}
|
||||
|
||||
if (fingap) $tables.fingap.setSelectedKeys(fingap.keys);
|
||||
@ -73,6 +68,7 @@ export default function loadKpReactions({ store, trpcClient }: ReactionsContext)
|
||||
content: `Ошибка во время загрузки КП ${quoteName}`,
|
||||
key,
|
||||
});
|
||||
$calculation.element('selectQuote').resetValue();
|
||||
})
|
||||
.finally(() => {
|
||||
$process.delete('LoadKP');
|
||||
|
||||
@ -5,30 +5,48 @@ import PaymentsSchema from '@/config/schema/payments';
|
||||
import ValuesSchema from '@/config/schema/values';
|
||||
import { z } from 'zod';
|
||||
|
||||
const { quote, recalcWithRevision } = ValuesSchema.shape;
|
||||
const InputValuesSchema = z.object({
|
||||
const { quote, recalcWithRevision, lead, opportunity } = ValuesSchema.shape;
|
||||
|
||||
export const GetQuoteInputDataSchema = z
|
||||
.object({
|
||||
values: z
|
||||
.object({
|
||||
lead,
|
||||
opportunity,
|
||||
quote: quote.unwrap(),
|
||||
recalcWithRevision,
|
||||
});
|
||||
export const GetQuoteDataInputSchema = z
|
||||
.object({
|
||||
values: InputValuesSchema.required(),
|
||||
})
|
||||
.required(),
|
||||
})
|
||||
.strict();
|
||||
export type GetQuoteDataInput = z.infer<typeof GetQuoteDataInputSchema>;
|
||||
|
||||
export type GetQuoteInputData = z.infer<typeof GetQuoteInputDataSchema>;
|
||||
|
||||
const FinGAPSchema = z.object({
|
||||
keys: z.array(RiskSchema.shape.key),
|
||||
});
|
||||
|
||||
const InsuranceSchema = z.object({
|
||||
values: z.record(KeysSchema, RowSchema),
|
||||
});
|
||||
export const GetQuoteDataOutputSchema = z
|
||||
|
||||
export const GetQuoteOutputDataSchema = z
|
||||
.object({
|
||||
fingap: FinGAPSchema.optional(),
|
||||
insurance: InsuranceSchema.required(),
|
||||
fingap: FinGAPSchema,
|
||||
insurance: InsuranceSchema,
|
||||
payments: PaymentsSchema,
|
||||
values: ValuesSchema,
|
||||
})
|
||||
.strict();
|
||||
export type GetQuoteDataOutput = z.infer<typeof GetQuoteDataOutputSchema>;
|
||||
|
||||
export type GetQuoteOutputData = z.infer<typeof GetQuoteOutputDataSchema>;
|
||||
|
||||
export const GetQuoteProcessDataSchema = GetQuoteOutputDataSchema.omit({
|
||||
values: true,
|
||||
})
|
||||
.extend({
|
||||
values: ValuesSchema.partial(),
|
||||
})
|
||||
.partial();
|
||||
|
||||
export type GetQuoteProcessData = z.infer<typeof GetQuoteProcessDataSchema>;
|
||||
|
||||
@ -1,11 +1,12 @@
|
||||
import type { GetQuoteDataInput, GetQuoteDataOutput } from '../load-kp/types';
|
||||
import type { GetQuoteInputData, GetQuoteProcessData } from '../load-kp/types';
|
||||
import initializeApollo from '@/apollo/client';
|
||||
import type * as CRMTypes from '@/graphql/crm.types';
|
||||
import defaultValues from '@/config/default-values';
|
||||
import * as CRMTypes from '@/graphql/crm.types';
|
||||
import { gql } from '@apollo/client';
|
||||
import { sort } from 'radash';
|
||||
|
||||
const QUERY_GET_PAYMENTS_DATA_FROM_QUOTE = gql`
|
||||
query GetPaymentsDataFromQuote($quoteId: Uuid!) {
|
||||
const QUERY_GET_QUOTE_PAYMENTS_DATA = gql`
|
||||
query GetQuotePaymentsData($quoteId: Uuid!) {
|
||||
quote(quoteId: $quoteId) {
|
||||
evo_period
|
||||
evo_accept_period
|
||||
@ -26,23 +27,15 @@ const QUERY_GET_PAYMENTS_DATA_FROM_QUOTE = gql`
|
||||
}
|
||||
`;
|
||||
|
||||
type QuotePaymentsProcessData = {
|
||||
payments: GetQuoteDataOutput['payments'];
|
||||
values: Partial<GetQuoteDataOutput['values']>;
|
||||
};
|
||||
|
||||
export default async function getPaymentsDataFromKP({
|
||||
export async function getKPData({
|
||||
values: { quote: quoteId, recalcWithRevision },
|
||||
}: GetQuoteDataInput): Promise<QuotePaymentsProcessData> {
|
||||
}: GetQuoteInputData): Promise<GetQuoteProcessData> {
|
||||
const apolloClient = initializeApollo();
|
||||
|
||||
const {
|
||||
data: { quote },
|
||||
} = await apolloClient.query<
|
||||
CRMTypes.GetPaymentsDataFromQuoteQuery,
|
||||
CRMTypes.GetPaymentsDataFromQuoteQueryVariables
|
||||
>({
|
||||
query: QUERY_GET_PAYMENTS_DATA_FROM_QUOTE,
|
||||
} = await apolloClient.query({
|
||||
query: CRMTypes.GetQuotePaymentsDataDocument,
|
||||
variables: {
|
||||
quoteId,
|
||||
},
|
||||
@ -65,18 +58,19 @@ export default async function getPaymentsDataFromKP({
|
||||
return {
|
||||
payments: {
|
||||
values: [
|
||||
quote?.evo_first_payment_perc || 0,
|
||||
quote?.evo_first_payment_perc ?? 0,
|
||||
...paymentsValues,
|
||||
quote?.evo_last_payment_perc || 0,
|
||||
quote?.evo_last_payment_perc ?? 0,
|
||||
],
|
||||
},
|
||||
values: {
|
||||
firstPaymentPerc: quote?.evo_first_payment_perc || 0,
|
||||
graphType: quote?.evo_graph_type ?? undefined,
|
||||
firstPaymentPerc: quote?.evo_first_payment_perc ?? defaultValues.firstPaymentPerc,
|
||||
graphType: quote?.evo_graph_type,
|
||||
highSeasonStart: quote?.evo_high_season,
|
||||
lastPaymentPerc: quote?.evo_last_payment_perc || 0,
|
||||
lastPaymentPerc: quote?.evo_last_payment_perc ?? defaultValues.lastPaymentPerc,
|
||||
leasingPeriod,
|
||||
parmentsDecreasePercent: quote?.evo_payments_decrease_perc || 0,
|
||||
parmentsDecreasePercent:
|
||||
quote?.evo_payments_decrease_perc ?? defaultValues.parmentsDecreasePercent,
|
||||
seasonType: quote?.evo_seasons_type,
|
||||
},
|
||||
};
|
||||
|
||||
2
apps/web/process/payments/index.ts
Normal file
2
apps/web/process/payments/index.ts
Normal file
@ -0,0 +1,2 @@
|
||||
export * from './get-kp-data';
|
||||
export * as reactions from './reactions';
|
||||
@ -1,22 +1,16 @@
|
||||
import { SEASONS_PERIOD_NUMBER, SEASONS_PERIODS } from './lib/seasons-constants';
|
||||
import { SEASONS_PERIOD_NUMBER, SEASONS_PERIODS } from './seasons-constants';
|
||||
import { MIN_PAYMENT } from '@/constants/values';
|
||||
import type RootStore from '@/stores/root';
|
||||
import { counting, max, min, shift, sort } from 'radash';
|
||||
import { areEqual, isSorted } from 'tools/array';
|
||||
|
||||
// eslint-disable-next-line sonarjs/cognitive-complexity
|
||||
export default function validatePaymentsTable({ $calculation, $tables }: RootStore) {
|
||||
switch ($calculation.element('radioGraphType').getValue()) {
|
||||
// Дегрессия
|
||||
case 100_000_001: {
|
||||
if (!$calculation.element('selectSeasonType').getValue()) {
|
||||
return 'Не выбран тип дегрессии';
|
||||
}
|
||||
/**
|
||||
* в таблице платежей в столбце Соотношение платежей
|
||||
* для строк с 2 до "Срок лизинга-1" минимальное значение должно быть равно 3
|
||||
*/
|
||||
{
|
||||
const MIN_PAYMENT = 3;
|
||||
const leasingPeriod = $calculation.element('tbxLeasingPeriod').getValue();
|
||||
const targetPayments = $tables.payments.values.slice(1, leasingPeriod - 1);
|
||||
|
||||
@ -25,6 +19,13 @@ export default function validatePaymentsTable({ $calculation, $tables }: RootSto
|
||||
}
|
||||
}
|
||||
|
||||
switch ($calculation.element('radioGraphType').getValue()) {
|
||||
// Дегрессия
|
||||
case 100_000_001: {
|
||||
if (!$calculation.element('selectSeasonType').getValue()) {
|
||||
return 'Не выбран тип дегрессии';
|
||||
}
|
||||
|
||||
/**
|
||||
* при Дегрессии все значения не должны быть равны друг другу
|
||||
* + что при Легком старте 2,3 и 4 платежи не должны быть равны 100
|
||||
@ -62,7 +63,7 @@ export default function validatePaymentsTable({ $calculation, $tables }: RootSto
|
||||
const targetPayments = $tables.payments.values.slice(1, 4);
|
||||
|
||||
if ((max(targetPayments) || 0) - (min(targetPayments) || 0) > 10) {
|
||||
return 'Указана очень жесткая дегрессия';
|
||||
return 'Указана очень жесткая дегрессия. На 2-4 платежах Соотношение платежа должен отличаться не более чем на 10%';
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,10 +1,9 @@
|
||||
import * as seasonsConstants from './lib/seasons-constants';
|
||||
import * as seasonsTools from './lib/seasons-tools';
|
||||
import validatePaymentsTable from './validation';
|
||||
import * as seasonsConstants from '../lib/seasons-constants';
|
||||
import * as seasonsTools from '../lib/seasons-tools';
|
||||
import { selectHighSeasonStart } from '@/config/default-options';
|
||||
import type { ReactionsContext } from '@/process/types';
|
||||
import { MIN_PAYMENT } from '@/constants/values';
|
||||
import type { ProcessContext } from '@/process/types';
|
||||
import type { Row } from '@/stores/tables/payments/types';
|
||||
import ValidationHelper from '@/stores/validation/helper';
|
||||
import { comparer, reaction, toJS } from 'mobx';
|
||||
import { shift } from 'radash';
|
||||
import { difference } from 'tools/array';
|
||||
@ -21,7 +20,7 @@ const {
|
||||
const { DEFAULT_SEASONS_VALUES, FORBIDDEN_HIGH_SEASON_START, SEASONS_PERIOD_NUMBER } =
|
||||
seasonsConstants;
|
||||
|
||||
export default function paymentsReactions({ store }: ReactionsContext) {
|
||||
export default function reactions({ store }: ProcessContext) {
|
||||
const { $calculation, $tables, $process } = store;
|
||||
|
||||
reaction(
|
||||
@ -114,7 +113,8 @@ export default function paymentsReactions({ store }: ReactionsContext) {
|
||||
length: leasingPeriod - 2,
|
||||
},
|
||||
(_, k) => {
|
||||
const payment = 100 * (parmentsDecreasePercent / 100) ** k;
|
||||
let payment = 100 * (parmentsDecreasePercent / 100) ** k;
|
||||
if (payment < MIN_PAYMENT) payment = MIN_PAYMENT;
|
||||
|
||||
return {
|
||||
status: 'Disabled',
|
||||
@ -351,26 +351,19 @@ export default function paymentsReactions({ store }: ReactionsContext) {
|
||||
makeDisposable(
|
||||
() =>
|
||||
reaction(
|
||||
() => {
|
||||
() => toJS($tables.payments.values),
|
||||
(nextPayments, prevPayments) => {
|
||||
const graphType = $calculation.element('radioGraphType').getValue();
|
||||
const payments = toJS($tables.payments.values);
|
||||
const degressionType = $calculation.element('selectSeasonType').getValue();
|
||||
|
||||
return {
|
||||
degressionType,
|
||||
graphType,
|
||||
payments,
|
||||
};
|
||||
},
|
||||
(nextParams, prevParams) => {
|
||||
if (nextParams.graphType === 100_000_001 && nextParams.degressionType === 100_000_007) {
|
||||
const changes = difference(nextParams.payments, prevParams.payments);
|
||||
if (graphType === 100_000_001 && degressionType === 100_000_007) {
|
||||
const changes = difference(nextPayments, prevPayments);
|
||||
|
||||
if (changes === null || changes.length > 1) return;
|
||||
if (!changes?.length || changes.length > 1) return;
|
||||
|
||||
const [changeIndex] = changes;
|
||||
const value = nextParams.payments[changeIndex];
|
||||
const payments = nextParams.payments.slice(1, -1).map((payment, i) => {
|
||||
const value = nextPayments[changeIndex];
|
||||
const payments = nextPayments.slice(1, -1).map((payment, i) => {
|
||||
if (i <= changeIndex - 2) return payment;
|
||||
|
||||
return value;
|
||||
@ -539,39 +532,11 @@ export default function paymentsReactions({ store }: ReactionsContext) {
|
||||
() => $process.has('LoadKP')
|
||||
);
|
||||
|
||||
/**
|
||||
* Валидация
|
||||
*/
|
||||
const validationHelper = new ValidationHelper();
|
||||
|
||||
reaction(
|
||||
() => $calculation.element('radioGraphType').getValue(),
|
||||
() => {
|
||||
const payments = toJS($tables.payments.values);
|
||||
const graphType = $calculation.element('radioGraphType').getValue();
|
||||
const seasonType = $calculation.element('selectSeasonType').getValue();
|
||||
const highSeasonStart = $calculation.element('selectHighSeasonStart').getValue();
|
||||
const leasingPeriod = $calculation.element('tbxLeasingPeriod').getValue();
|
||||
|
||||
return {
|
||||
graphType,
|
||||
highSeasonStart,
|
||||
leasingPeriod,
|
||||
payments,
|
||||
seasonType,
|
||||
};
|
||||
},
|
||||
() => {
|
||||
validationHelper.removeErrors();
|
||||
const errorText = validatePaymentsTable(store);
|
||||
|
||||
if (errorText) {
|
||||
const removeError = $tables.payments.validation.addError(errorText);
|
||||
validationHelper.add(removeError);
|
||||
}
|
||||
},
|
||||
{
|
||||
delay: 50,
|
||||
equals: comparer.structural,
|
||||
$calculation.element('selectSeasonType').resetValue();
|
||||
$calculation.element('selectHighSeasonStart').resetValue();
|
||||
}
|
||||
);
|
||||
}
|
||||
2
apps/web/process/payments/reactions/index.ts
Normal file
2
apps/web/process/payments/reactions/index.ts
Normal file
@ -0,0 +1,2 @@
|
||||
export { default as common } from './common';
|
||||
export { default as validation } from './validation';
|
||||
64
apps/web/process/payments/reactions/validation.ts
Normal file
64
apps/web/process/payments/reactions/validation.ts
Normal file
@ -0,0 +1,64 @@
|
||||
import validatePaymentsTable from '../lib/validation';
|
||||
import { MIN_LASTPAYMENT_NSIB } from '@/constants/values';
|
||||
import type { ProcessContext } from '@/process/types';
|
||||
import ValidationHelper from '@/stores/validation/helper';
|
||||
import { comparer, reaction, toJS } from 'mobx';
|
||||
|
||||
export default function reactions({ store }: ProcessContext) {
|
||||
const { $calculation, $tables } = store;
|
||||
|
||||
const validationHelper = new ValidationHelper();
|
||||
|
||||
reaction(
|
||||
() => {
|
||||
const payments = toJS($tables.payments.values);
|
||||
const graphType = $calculation.element('radioGraphType').getValue();
|
||||
const seasonType = $calculation.element('selectSeasonType').getValue();
|
||||
const highSeasonStart = $calculation.element('selectHighSeasonStart').getValue();
|
||||
const leasingPeriod = $calculation.element('tbxLeasingPeriod').getValue();
|
||||
|
||||
return {
|
||||
graphType,
|
||||
highSeasonStart,
|
||||
leasingPeriod,
|
||||
payments,
|
||||
seasonType,
|
||||
};
|
||||
},
|
||||
() => {
|
||||
validationHelper.removeErrors();
|
||||
|
||||
const errorText = validatePaymentsTable(store);
|
||||
|
||||
if (errorText) {
|
||||
$tables.payments.validate({
|
||||
helper: validationHelper,
|
||||
invalid: errorText !== null,
|
||||
message: errorText,
|
||||
});
|
||||
}
|
||||
},
|
||||
{
|
||||
delay: 50,
|
||||
equals: comparer.structural,
|
||||
}
|
||||
);
|
||||
|
||||
reaction(
|
||||
() => {
|
||||
const lastPaymentRub = $calculation.element('tbxLastPaymentRub').getValue();
|
||||
const insNSIB = $calculation.element('selectInsNSIB').getValue();
|
||||
|
||||
return {
|
||||
insNSIB,
|
||||
lastPaymentRub,
|
||||
};
|
||||
},
|
||||
({ lastPaymentRub, insNSIB }) => {
|
||||
$calculation.element('tbxLastPaymentRub').validate({
|
||||
invalid: Boolean(insNSIB) && lastPaymentRub < MIN_LASTPAYMENT_NSIB,
|
||||
message: `Последний платеж меньше ${MIN_LASTPAYMENT_NSIB} руб. не может быть при наличии НСИБ, укажите большее значение`,
|
||||
});
|
||||
}
|
||||
);
|
||||
}
|
||||
@ -1,42 +1,37 @@
|
||||
import type { GetQuoteDataInput, GetQuoteDataOutput } from '../load-kp/types';
|
||||
import type { GetQuoteInputData, GetQuoteProcessData } from '../load-kp/types';
|
||||
import initializeApollo from '@/apollo/client';
|
||||
import type * as CRMTypes from '@/graphql/crm.types';
|
||||
import defaultValues from '@/config/default-values';
|
||||
import * as CRMTypes from '@/graphql/crm.types';
|
||||
import { gql } from '@apollo/client';
|
||||
|
||||
const QUERY_GET_PRICE_DATA_FROM_QUOTE = gql`
|
||||
query GetPriceDataFromQuote($quoteId: Uuid!) {
|
||||
const QUERY_GET_QUOTE_PRICE_DATA = gql`
|
||||
query GetQuotePriceData($quoteId: Uuid!) {
|
||||
quote(quoteId: $quoteId) {
|
||||
evo_supplier_currency_price
|
||||
evo_price_without_nds_supplier_currency
|
||||
evo_nds_in_price_supplier_currency
|
||||
evo_last_payment_rub
|
||||
evo_last_payment_calc
|
||||
evo_transactioncurrencyid
|
||||
evo_discount_supplier_currency
|
||||
evo_discount_perc
|
||||
evo_comission_perc
|
||||
evo_comission_rub
|
||||
evo_sale_bonus
|
||||
evo_comission_perc
|
||||
evo_discount_perc
|
||||
evo_discount_supplier_currency
|
||||
evo_first_payment_perc
|
||||
evo_last_payment_calc
|
||||
evo_last_payment_perc
|
||||
evo_last_payment_rub
|
||||
evo_nds_in_price_supplier_currency
|
||||
evo_price_without_nds_supplier_currency
|
||||
evo_supplier_currency_price
|
||||
evo_transactioncurrencyid
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
type QuotePaymentsProcessData = {
|
||||
values: Partial<GetQuoteDataOutput['values']>;
|
||||
};
|
||||
|
||||
export default async function getPriceDataFromKP({
|
||||
export async function getKPData({
|
||||
values: { quote: quoteId },
|
||||
}: GetQuoteDataInput): Promise<QuotePaymentsProcessData> {
|
||||
}: GetQuoteInputData): Promise<GetQuoteProcessData> {
|
||||
const apolloClient = initializeApollo();
|
||||
|
||||
const {
|
||||
data: { quote },
|
||||
} = await apolloClient.query<
|
||||
CRMTypes.GetPriceDataFromQuoteQuery,
|
||||
CRMTypes.GetPriceDataFromQuoteQueryVariables
|
||||
>({
|
||||
query: QUERY_GET_PRICE_DATA_FROM_QUOTE,
|
||||
} = await apolloClient.query({
|
||||
query: CRMTypes.GetQuotePriceDataDocument,
|
||||
variables: {
|
||||
quoteId,
|
||||
},
|
||||
@ -44,17 +39,19 @@ export default async function getPriceDataFromKP({
|
||||
|
||||
return {
|
||||
values: {
|
||||
VATInLeaseObjectPrice: quote?.evo_nds_in_price_supplier_currency || 0,
|
||||
comissionPerc: quote?.evo_comission_perc || 0,
|
||||
comissionRub: quote?.evo_comission_rub || 0,
|
||||
lastPaymentRub: quote?.evo_last_payment_rub || 0,
|
||||
VATInLeaseObjectPrice:
|
||||
quote?.evo_nds_in_price_supplier_currency ?? defaultValues.VATInLeaseObjectPrice,
|
||||
comissionPerc: quote?.evo_comission_perc ?? defaultValues.comissionPerc,
|
||||
// comissionRub: quote?.evo_comission_rub ,
|
||||
firstPaymentPerc: quote?.evo_first_payment_perc ?? defaultValues.firstPaymentPerc,
|
||||
// lastPaymentRub: quote?.evo_last_payment_rub ,
|
||||
lastPaymentPerc: quote?.evo_last_payment_perc ?? defaultValues.lastPaymentPerc,
|
||||
lastPaymentRule: quote?.evo_last_payment_calc,
|
||||
leaseObjectPrice: quote?.evo_supplier_currency_price || 0,
|
||||
leaseObjectPriceWthtVAT: quote?.evo_price_without_nds_supplier_currency || 0,
|
||||
saleBonus: quote?.evo_sale_bonus || 0,
|
||||
leaseObjectPrice: quote?.evo_supplier_currency_price ?? defaultValues.leaseObjectPrice,
|
||||
// leaseObjectPriceWthtVAT: quote?.evo_price_without_nds_supplier_currency ,
|
||||
supplierCurrency: quote?.evo_transactioncurrencyid,
|
||||
supplierDiscountPerc: quote?.evo_discount_perc || 0,
|
||||
supplierDiscountRub: quote?.evo_discount_supplier_currency || 0,
|
||||
supplierDiscountPerc: quote?.evo_discount_perc ?? defaultValues.supplierDiscountPerc,
|
||||
// supplierDiscountRub: quote?.evo_discount_supplier_currency ,
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
2
apps/web/process/price/index.ts
Normal file
2
apps/web/process/price/index.ts
Normal file
@ -0,0 +1,2 @@
|
||||
export * from './get-kp-data';
|
||||
export * as reactions from './reactions';
|
||||
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