merge migration/elt

This commit is contained in:
vchikalkin 2023-05-12 11:34:09 +03:00
parent a2471a0ca8
commit 5615f16d67
43 changed files with 2286 additions and 49 deletions

4
.env
View File

@ -9,4 +9,6 @@ URL_CRM_CREATEKP_DIRECT=
URL_CRM_DOWNLOADKP_BASE=
URL_CORE_FINGAP_DIRECT=
URL_CORE_CALCULATE_DIRECT=
URL_1C_TRANSTAX_DIRECT=
URL_1C_TRANSTAX_DIRECT=
URL_ELT_OSAGO_DIRECT=
URL_ELT_KASKO_DIRECT=

View File

@ -0,0 +1,54 @@
import type { columns } from '../lib/config';
import type { Row, StoreSelector } from '../types';
import { useStore } from '@/stores/hooks';
import { observer } from 'mobx-react-lite';
import { message, Table } from 'ui/antd';
export const PolicyTable = observer(
({
storeSelector,
onSelectRow,
...props
}: {
columns: typeof columns;
onSelectRow: (row: Row) => void;
storeSelector: StoreSelector;
}) => {
const { $tables, $process } = useStore();
const { getRows, setSelectedKey, getSelectedRow } = storeSelector($tables.elt);
return (
<Table
size="small"
pagination={false}
dataSource={getRows}
scroll={{
x: true,
}}
rowSelection={{
getCheckboxProps: (record) => ({
disabled:
!record.sum || record.status !== null || getRows.some((x) => x.status === 'fetching'),
}),
hideSelectAll: true,
onSelect: (record) => {
if (record.sum > 0) {
$process.add('ELT');
setSelectedKey(record.key);
onSelectRow(record);
message.success({ content: 'Выбранный расчет ЭЛТ применен', key: record.key });
$process.delete('ELT');
}
},
selectedRowKeys: getSelectedRow ? [getSelectedRow.key] : [],
type: 'radio',
}}
expandable={{
expandedRowRender: (record) => record.message,
rowExpandable: (record) => Boolean(record.message),
}}
{...props}
/>
);
}
);

View File

@ -0,0 +1,26 @@
import type { StoreSelector } from '../types';
import { useStore } from '@/stores/hooks';
import { observer } from 'mobx-react-lite';
import { Button } from 'ui/antd';
import { ReloadOutlined } from 'ui/elements/icons';
import { Flex } from 'ui/grid';
export const ReloadButton = observer(
({ storeSelector, onClick }: { onClick: () => void; storeSelector: StoreSelector }) => {
const { $tables } = useStore();
const { validation, getRows: rows } = storeSelector($tables.elt);
const hasErrors = validation.hasErrors;
return (
<Flex justifyContent="center">
<Button
onClick={onClick}
disabled={hasErrors || rows.some((x) => x.status === 'fetching')}
shape="circle"
icon={<ReloadOutlined />}
/>
</Flex>
);
}
);

View File

@ -0,0 +1,23 @@
import type { StoreSelector } from '../types';
import { useStore } from '@/stores/hooks';
import { observer } from 'mobx-react-lite';
import { Alert } from 'ui/antd';
export const Validation = observer(({ storeSelector }: { storeSelector: StoreSelector }) => {
const { $tables, $process } = useStore();
const { validation } = storeSelector($tables.elt);
const errors = validation.getErrors();
if (errors?.length) {
return (
<Alert
type={$process.has('Unlimited') ? 'warning' : 'error'}
banner
message={errors[0].message}
/>
);
}
return null;
});

View File

@ -0,0 +1,3 @@
export * from './PolicyTable';
export * from './ReloadButton';
export * from './Validation';

View File

@ -0,0 +1,156 @@
/* eslint-disable sonarjs/cognitive-complexity */
import { PolicyTable, ReloadButton, Validation } from './Components';
import { columns } from './lib/config';
import { makeEltKaskoRequest } from './lib/make-request';
import type { Row, StoreSelector } from './types';
import { getEltKasko } from '@/api/elt/query';
import { STALE_TIME } from '@/constants/request';
import { MAX_FRANCHISE, MAX_INSURANCE, MIN_INSURANCE } from '@/constants/values';
import { useStore } from '@/stores/hooks';
import { useApolloClient } from '@apollo/client';
import type { QueryFunctionContext } from '@tanstack/react-query';
import { useQueries } from '@tanstack/react-query';
import { Flex } from 'ui/grid';
const storeSelector: StoreSelector = ({ kasko }) => kasko;
export function Kasko() {
const store = useStore();
const { $tables, $calculation } = store;
const rows = $tables.elt.kasko.getRows;
const apolloClient = useApolloClient();
const queries = useQueries({
queries: rows.map((row) => {
const { id, key } = row;
return {
enabled: false,
initialData: { ...row, error: '', kaskoSum: 0, sum: 0 },
queryFn: async (context: QueryFunctionContext) => {
const payload = await makeEltKaskoRequest({ apolloClient, store }, row);
const res = await getEltKasko(payload, context);
const companyRes = res[id];
return { ...companyRes, id, key };
},
queryKey: ['elt', 'kasko', id],
refetchOnWindowFocus: false,
staleTime: STALE_TIME,
};
}),
});
async function handleOnClick() {
const fetchingRows = rows.map((x) => ({ ...x, status: 'fetching', sum: 0 }));
$tables.elt.kasko.setRows(fetchingRows);
queries.forEach(({ refetch, data }) => {
refetch()
.then((res) => {
if (res.data) {
const {
key,
kaskoSum = 0,
message,
skCalcId,
totalFranchise = 0,
requestId,
} = res.data;
let { error } = res.data;
if (totalFranchise > MAX_FRANCHISE) {
error ||= `Франшиза по страховке превышает максимально допустимое значение: ${Intl.NumberFormat(
'ru',
{
currency: 'RUB',
style: 'currency',
}
).format(MAX_FRANCHISE)}`;
}
if (kaskoSum > MAX_INSURANCE) {
error ||= `Сумма по страховке превышает максимально допустимое значение по стоимости КАСКО: ${Intl.NumberFormat(
'ru',
{
currency: 'RUB',
style: 'currency',
}
).format(MAX_INSURANCE)}`;
}
if (kaskoSum < MIN_INSURANCE) {
error ||= `Сумма по страховке не должна быть меньше допустимого значения по стоимости КАСКО: ${Intl.NumberFormat(
'ru',
{
currency: 'RUB',
style: 'currency',
}
).format(MIN_INSURANCE)}`;
}
$tables.elt.kasko.setRow({
key,
message: error || message,
numCalc: 0,
requestId,
skCalcId,
status: error ? 'error' : null,
sum: kaskoSum,
totalFranchise,
});
}
})
.catch((error) => {
if (data?.key)
$tables.elt.kasko.setRow({
key: data?.key,
message: error,
numCalc: 0,
requestId: '',
skCalcId: '',
status: 'error',
sum: 0,
totalFranchise: 0,
});
});
});
}
function handleOnSelectRow(row: Row) {
$tables.insurance.row('kasko').column('insuranceCompany').setValue(row.key);
$tables.insurance.row('kasko').column('insCost').setValue(row.sum);
$calculation.element('tbxInsFranchise').setValue(row.totalFranchise);
}
type Column = (typeof columns)[number];
const kaskoColumns = columns.map((column: Column) => {
if (column.key === 'name') {
return {
...column,
title: 'Страховая компания КАСКО',
};
}
if (column.key === 'status') {
return {
...column,
title: <ReloadButton storeSelector={storeSelector} onClick={() => handleOnClick()} />,
};
}
return column;
});
return (
<Flex flexDirection="column">
<Validation storeSelector={storeSelector} />
<PolicyTable
storeSelector={storeSelector}
columns={kaskoColumns}
onSelectRow={(row) => handleOnSelectRow(row)}
/>
</Flex>
);
}

View File

@ -0,0 +1,134 @@
/* eslint-disable sonarjs/cognitive-complexity */
import { PolicyTable, ReloadButton, Validation } from './Components';
import { columns } from './lib/config';
import { makeEltOsagoRequest } from './lib/make-request';
import type { Row, StoreSelector } from './types';
import { getEltOsago } from '@/api/elt/query';
import { STALE_TIME } from '@/constants/request';
import { MAX_INSURANCE, MIN_INSURANCE } from '@/constants/values';
import { useStore } from '@/stores/hooks';
import { useApolloClient } from '@apollo/client';
import type { QueryFunctionContext } from '@tanstack/react-query';
import { useQueries } from '@tanstack/react-query';
import { Flex } from 'ui/grid';
const storeSelector: StoreSelector = ({ osago }) => osago;
export function Osago() {
const store = useStore();
const { $tables } = store;
const rows = $tables.elt.osago.getRows;
const apolloClient = useApolloClient();
const queries = useQueries({
queries: rows.map((row) => {
const { id, key } = row;
return {
enabled: false,
initialData: { ...row, error: '', premiumSum: 0 },
queryFn: async (context: QueryFunctionContext) => {
const payload = await makeEltOsagoRequest({ apolloClient, store }, row);
const res = await getEltOsago(payload, context);
const companyRes = res[id];
return { ...companyRes, id, key };
},
queryKey: ['elt', 'osago', id],
refetchOnWindowFocus: false,
staleTime: STALE_TIME,
};
}),
});
async function handleOnClick() {
const fetchingRows = rows.map((x) => ({ ...x, status: 'fetching', sum: 0 }));
$tables.elt.osago.setRows(fetchingRows);
queries.forEach(({ refetch, data }) => {
refetch()
.then((res) => {
if (res.data) {
const { key, numCalc, premiumSum = 0, message, skCalcId } = res.data;
let { error } = res.data;
if (premiumSum > MAX_INSURANCE) {
error ||= `Сумма по страховке превышает максимально допустимое значение по стоимости ОСАГО: ${Intl.NumberFormat(
'ru',
{
currency: 'RUB',
style: 'currency',
}
).format(MAX_INSURANCE)}`;
}
if (premiumSum < MIN_INSURANCE) {
error ||= `Сумма по страховке не должна быть меньше допустимого значения по стоимости ОСАГО: ${Intl.NumberFormat(
'ru',
{
currency: 'RUB',
style: 'currency',
}
).format(MIN_INSURANCE)}`;
}
$tables.elt.osago.setRow({
key,
message: error || message,
numCalc,
skCalcId,
status: error ? 'error' : null,
sum: premiumSum,
});
}
})
.catch((error) => {
if (data?.key)
$tables.elt.osago.setRow({
key: data?.key,
message: error,
numCalc: 0,
skCalcId: '',
status: 'error',
sum: 0,
});
});
});
}
function handleOnSelectRow(row: Row) {
$tables.insurance.row('osago').column('insuranceCompany').setValue(row.key);
$tables.insurance.row('osago').column('insCost').setValue(row.sum);
}
type Column = (typeof columns)[number];
const osagoColumns = columns.map((column: Column) => {
if (column.key === 'name') {
return {
...column,
title: 'Страховая компания ОСАГО',
};
}
if (column.key === 'status') {
return {
...column,
title: <ReloadButton storeSelector={storeSelector} onClick={() => handleOnClick()} />,
};
}
return column;
});
return (
<Flex flexDirection="column">
<Validation storeSelector={storeSelector} />
<PolicyTable
storeSelector={storeSelector}
columns={osagoColumns}
onSelectRow={(row) => handleOnSelectRow(row)}
/>
</Flex>
);
}

View File

@ -0,0 +1,20 @@
import { Kasko } from './Kasko';
import { Osago } from './Osago';
const id = 'elt';
const title = 'ЭЛТ';
function ELT() {
return (
<>
<Osago />
<Kasko />
</>
);
}
export default {
Component: ELT,
id,
title,
};

View File

@ -0,0 +1,59 @@
import type { RowSchema } from '@/config/schema/elt';
import type { ColumnsType } from 'antd/lib/table';
import { CloseOutlined, LoadingOutlined } from 'ui/elements/icons';
import { Flex } from 'ui/grid';
import type { z } from 'zod';
type Row = z.infer<typeof RowSchema>;
const formatter = Intl.NumberFormat('ru', {
currency: 'RUB',
style: 'currency',
}).format;
export const columns: ColumnsType<Row> = [
{
dataIndex: 'name',
key: 'name',
title: 'Страховая компания',
width: '50%',
},
{
dataIndex: 'sum',
key: 'sum',
render: formatter,
sortDirections: ['descend', 'ascend'],
sorter: (a, b) => a.sum - b.sum,
title: 'Сумма',
width: '20%',
},
{
dataIndex: 'totalFranchise',
key: 'totalFranchise',
render: formatter,
title: 'Франшиза',
width: '20%',
},
{
dataIndex: 'status',
key: 'status',
render: (_, record) => {
if (record.status === 'fetching')
return (
<Flex justifyContent="center">
<LoadingOutlined spin />
</Flex>
);
if (record.status === 'error')
return (
<Flex justifyContent="center">
<CloseOutlined />
</Flex>
);
return false;
},
title: undefined,
width: '5%',
},
];

View File

@ -0,0 +1,715 @@
/* eslint-disable sonarjs/cognitive-complexity */
/* eslint-disable complexity */
import type { Row } from '../types';
import type { RequestEltKasko, RequestEltOsago } from '@/api/elt/types';
import * as CRMTypes from '@/graphql/crm.types';
import type { ProcessContext } from '@/process/types';
import dayjs from 'dayjs';
const getSpecified = (value: unknown) => value !== null && value !== undefined;
export async function makeEltOsagoRequest(
{ store, apolloClient }: Pick<ProcessContext, 'apolloClient' | 'store'>,
row: Row
): Promise<RequestEltOsago> {
const { $calculation, $tables } = store;
const currentDate = dayjs().toDate();
let kladr = '7700000000000';
if ($calculation.element('radioObjectRegistration').getValue() === 100_000_001) {
const townRegistrationId = $calculation.element('selectTownRegistration').getValue();
if (townRegistrationId) {
const {
data: { evo_town },
} = await apolloClient.query({
query: CRMTypes.GetTownDocument,
variables: { townId: townRegistrationId },
});
kladr = evo_town?.evo_kladr_id || kladr;
}
} else {
const {
data: { account: insuranceCompany },
} = await apolloClient.query({
query: CRMTypes.GetInsuranceCompanyDocument,
variables: { accountId: row.key },
});
if (insuranceCompany?.evo_legal_region_calc === true) {
const regionId = $calculation.element('selectLegalClientRegion').getValue();
let evo_region: CRMTypes.GetRegionQuery['evo_region'] = null;
if (regionId) {
const { data } = await apolloClient.query({
query: CRMTypes.GetRegionDocument,
variables: { regionId },
});
({ evo_region } = data);
}
const townId = $calculation.element('selectLegalClientRegion').getValue();
let evo_town: CRMTypes.GetTownQuery['evo_town'] = null;
if (townId) {
const { data } = await apolloClient.query({
query: CRMTypes.GetTownDocument,
variables: { townId },
});
({ evo_town } = data);
}
kladr = evo_town?.evo_kladr_id || evo_region?.evo_kladr_id || kladr;
}
}
let brandId = '';
const brand = $calculation.element('selectBrand').getValue();
if (brand) {
const {
data: { evo_brand },
} = await apolloClient.query({
query: CRMTypes.GetBrandDocument,
variables: { brandId: brand },
});
if (evo_brand?.evo_id) {
brandId = evo_brand.evo_id;
}
}
let modelId = '';
const model = $calculation.element('selectModel').getValue();
if (model) {
const {
data: { evo_model },
} = await apolloClient.query({
query: CRMTypes.GetModelDocument,
variables: { modelId: model },
});
if (evo_model?.evo_id) {
modelId = evo_model.evo_id;
}
}
let gpsMark = '';
const gpsBrandId = $calculation.element('selectGPSBrand').getValue();
if (gpsBrandId) {
const {
data: { evo_gps_brands },
} = await apolloClient.query({
query: CRMTypes.GetGpsBrandsDocument,
});
gpsMark = evo_gps_brands?.find((x) => x?.value === gpsBrandId)?.evo_id || gpsMark;
}
let gpsModel = '';
const gpsModelId = $calculation.element('selectGPSModel').getValue();
if (gpsModelId) {
const {
data: { evo_gps_models },
} = await apolloClient.query({
query: CRMTypes.GetGpsModelsDocument,
});
gpsModel = evo_gps_models?.find((x) => x?.value === gpsModelId)?.evo_id || gpsModel;
}
const vehicleYear = $calculation.element('tbxLeaseObjectYear').getValue().toString();
const leaseObjectCategory = $calculation.element('selectLeaseObjectCategory').getValue();
const vehiclePower = $calculation.element('tbxLeaseObjectMotorPower').getValue() || 0;
const mapCategory: Record<number, string> = {
100_000_000: 'A',
100_000_001: 'B',
100_000_002: 'C',
100_000_003: 'D',
100_000_004: 'ПРОЧИЕ ТС',
};
const category = (leaseObjectCategory && mapCategory[leaseObjectCategory]) || '0';
const leaseObjectUseFor = $calculation.element('selectLeaseObjectUseFor').getValue();
const maxMass = $calculation.element('tbxMaxMass').getValue();
const countSeats = $calculation.element('tbxCountSeats').getValue();
let subCategory = '0';
switch (leaseObjectCategory) {
case 100_000_001: {
if (leaseObjectUseFor === 100_000_001) {
subCategory = '11';
}
subCategory = '10';
break;
}
case 100_000_002: {
if (maxMass <= 16_000) {
subCategory = '20';
}
subCategory = '21';
break;
}
case 100_000_003: {
if (leaseObjectUseFor === 100_000_001) {
subCategory = '32';
}
if (countSeats <= 20) {
subCategory = '30';
}
subCategory = '31';
break;
}
case 100_000_004: {
subCategory = '22';
break;
}
case 100_000_000:
default: {
subCategory = '0';
break;
}
}
let seatingCapacity = 0;
if (leaseObjectCategory === 100_000_003) {
seatingCapacity = countSeats;
}
const seatingCapacitySpecified = getSpecified(seatingCapacity);
let maxAllowedMass = 0;
if (leaseObjectCategory === 100_000_002) {
maxAllowedMass = maxMass;
}
const maxAllowedMassSpecified = getSpecified(maxAllowedMass);
const useWithTrailer = $calculation.element('cbxWithTrailer').getValue();
const useWithTrailerSpecified = true;
const address = {
// district: '0',
city: 'Москва',
cityKladr: '7700000000000',
country: 'Россия',
flat: '337',
house: '8',
region: 'Москва',
resident: 1,
street: 'ул. Котляковская',
};
const owner = {
JuridicalName: 'ООО "ЛК "ЭВОЛЮЦИЯ"',
email: 'client@evoleasing.ru',
factAddress: address,
inn: '9724016636',
kpp: '772401001',
ogrn: '1207700245037',
opf: 1,
opfSpecified: true,
phone: '8 (800) 333-75-75',
registrationAddress: address,
subjectType: 1,
subjectTypeSpecified: true,
};
let inn = '9724016636';
const insured = $tables.insurance.row('osago').getValue('insured');
const leadid = $calculation.element('selectLead').getValue();
if (insured === 100_000_000 && leadid) {
const {
data: { lead },
} = await apolloClient.query({
query: CRMTypes.GetLeadDocument,
variables: { leadid },
});
inn = lead?.evo_inn || inn;
}
return {
ELTParams: {
FullDriversInfo: [
{
kbm: '3',
},
],
carInfo: {
mark: gpsMark,
model: gpsModel,
tsType: { category, subCategory },
useWithTrailer,
useWithTrailerSpecified,
vehicle: {
maxAllowedMass,
maxAllowedMassSpecified,
seatingCapacity,
seatingCapacitySpecified,
},
vehiclePower,
vehicleYear,
},
contractBeginDate: currentDate,
contractOptionId: 1,
contractStatusId: 13,
driversCount: 0,
duration: 12,
insurer: {
INN: inn,
SubjectType: 1,
SubjectTypeSpecified: true,
},
insurerType: 1,
lessee: {
SubjectType: 1,
SubjectTypeSpecified: true,
inn,
},
owner,
ownerType: 1,
tsToRegistrationPlace: 0,
},
companyIds: [row.id],
preparams: {
brandId,
kladr,
modelId,
},
};
}
export async function makeEltKaskoRequest(
{ store, apolloClient }: Pick<ProcessContext, 'apolloClient' | 'store'>,
row: Row
): Promise<RequestEltKasko> {
const { $calculation } = store;
const currentDate = dayjs().toDate();
const regionId = $calculation.element('selectLegalClientRegion').getValue();
let evo_region: CRMTypes.GetRegionQuery['evo_region'] = null;
if (regionId) {
const { data } = await apolloClient.query({
query: CRMTypes.GetRegionDocument,
variables: { regionId },
});
({ evo_region } = data);
}
const townId = $calculation.element('selectLegalClientTown').getValue();
let evo_town: CRMTypes.GetTownQuery['evo_town'] = null;
if (townId) {
const { data } = await apolloClient.query({
query: CRMTypes.GetTownDocument,
variables: { townId },
});
({ evo_town } = data);
}
const kladr = evo_town?.evo_kladr_id || evo_region?.evo_kladr_id || '';
const leaseObjectTypeId = $calculation.element('selectLeaseObjectType').getValue();
let evo_leasingobject_type: CRMTypes.GetLeaseObjectTypeQuery['evo_leasingobject_type'] = null;
if (leaseObjectTypeId) {
const { data } = await apolloClient.query({
query: CRMTypes.GetLeaseObjectTypeDocument,
variables: { leaseObjectTypeId },
});
({ evo_leasingobject_type } = data);
}
const leaseObjectCategory = $calculation.element('selectLeaseObjectCategory').getValue();
const brand = $calculation.element('selectBrand').getValue();
let evo_brand: CRMTypes.GetBrandQuery['evo_brand'] = null;
if (brand) {
const { data } = await apolloClient.query({
query: CRMTypes.GetBrandDocument,
variables: { brandId: brand },
});
({ evo_brand } = data);
}
const brandId = evo_brand?.evo_id || '';
const model = $calculation.element('selectModel').getValue();
let evo_model: CRMTypes.GetModelQuery['evo_model'] = null;
if (model) {
const { data } = await apolloClient.query({
query: CRMTypes.GetModelDocument,
variables: { modelId: model },
});
({ evo_model } = data);
}
const modelId = evo_model?.evo_id || '';
const leaseObjectUsed = $calculation.element('cbxLeaseObjectUsed').getValue();
const productId = $calculation.element('selectProduct').getValue();
let evo_baseproduct: CRMTypes.GetProductQuery['evo_baseproduct'] = null;
if (productId) {
const { data } = await apolloClient.query({
query: CRMTypes.GetProductDocument,
variables: { productId },
});
({ evo_baseproduct } = data);
}
const leaseObjectYear = $calculation.element('tbxLeaseObjectYear').getValue();
let isNew = true;
if (
leaseObjectUsed === true ||
(leaseObjectUsed === false &&
evo_baseproduct?.evo_sale_without_nds === true &&
leaseObjectYear !== currentDate.getFullYear())
) {
isNew = false;
}
const vehicleYear = leaseObjectYear;
let vehicleDate;
if (
leaseObjectUsed === true ||
(leaseObjectUsed === false &&
evo_baseproduct?.evo_sale_without_nds === true &&
leaseObjectYear !== currentDate.getFullYear())
) {
vehicleDate = new Date(`${vehicleYear}-01-01`);
}
const vehicleDateSpecified = getSpecified(vehicleDate);
const power = $calculation.element('tbxLeaseObjectMotorPower').getValue();
const powerSpecified = getSpecified(power);
let country = 0;
let countrySpecified = false;
if (
(leaseObjectCategory === 100_000_002 ||
(evo_leasingobject_type?.evo_id &&
['6', '9', '10', '8'].includes(evo_leasingobject_type?.evo_id))) &&
evo_brand?.evo_brand_owner === 100_000_001
) {
country = 1;
countrySpecified = true;
}
const mapEngineType: Record<number, string> = {
100_000_000: '0',
100_000_001: '1',
100_000_003: '2',
100_000_004: '3',
};
let engineType = '5';
const engineTypeValue = $calculation.element('selectEngineType').getValue();
if (engineTypeValue) {
engineType = mapEngineType[engineTypeValue] || '5';
}
const leasingPeriod = $calculation.element('tbxLeasingPeriod').getValue();
const duration = leasingPeriod < 12 ? 12 : leasingPeriod;
const cost =
$calculation.$values.getValue('plPriceRub') -
$calculation.$values.getValue('discountRub') -
$calculation.$values.getValue('importProgramSum') +
$calculation.$values.getValue('addEquipmentPrice');
let notConfirmedDamages = 0;
let notConfirmedDamagesSpecified = false;
let notConfirmedGlassesDamages = 0;
let notConfirmedGlassesDamagesSpecified = false;
let outsideRoads = false;
let outsideRoadsSpecified = false;
let selfIgnition = false;
let selfIgnitionSpecified = false;
if (
leaseObjectCategory === 100_000_002 ||
(evo_leasingobject_type?.evo_id && ['6', '9', '10'].includes(evo_leasingobject_type?.evo_id))
) {
notConfirmedGlassesDamages = 3;
notConfirmedGlassesDamagesSpecified = true;
notConfirmedDamages = 2;
notConfirmedDamagesSpecified = true;
selfIgnition = true;
selfIgnitionSpecified = getSpecified(selfIgnition);
outsideRoads = true;
outsideRoadsSpecified = true;
}
const franchise = row.totalFranchise;
const franchiseSpecified = getSpecified(franchise);
let puuMark = '';
const gpsBrandId = $calculation.element('selectGPSBrand').getValue();
if (gpsBrandId) {
const {
data: { evo_gps_brands },
} = await apolloClient.query({
query: CRMTypes.GetGpsBrandsDocument,
});
puuMark = evo_gps_brands?.find((x) => x?.value === gpsBrandId)?.evo_id || puuMark;
}
let puuModel = '';
const gpsModelId = $calculation.element('selectGPSModel').getValue();
if (gpsModelId) {
const {
data: { evo_gps_models },
} = await apolloClient.query({
query: CRMTypes.GetGpsModelsDocument,
});
puuModel = evo_gps_models?.find((x) => x?.value === gpsModelId)?.evo_id || puuModel;
}
const puuModelSpecified = getSpecified(puuModel);
let age = $calculation.element('tbxInsAgeDrivers').getValue();
let experience = $calculation.element('tbxInsExpDrivers').getValue();
const sex = '0';
let driversCount = 1;
const risk =
evo_leasingobject_type?.evo_id && ['6', '9', '10'].includes(evo_leasingobject_type?.evo_id)
? 3
: 0;
if ($calculation.element('cbxInsUnlimitDrivers').getValue()) {
age = 18;
experience = 0;
driversCount = 0;
}
const sexSpecified = getSpecified(sex);
let maxAllowedMass = 0;
if (leaseObjectCategory === 100_000_002) {
maxAllowedMass = $calculation.element('tbxMaxMass').getValue();
}
const maxAllowedMassSpecified = getSpecified(maxAllowedMass);
let mileage = 0;
if (leaseObjectUsed === true) {
mileage = $calculation.element('tbxMileage').getValue();
}
if (
leaseObjectUsed === false &&
evo_baseproduct?.evo_sale_without_nds === true &&
leaseObjectYear !== currentDate.getFullYear()
) {
mileage = 0;
}
let vin = '';
if (leaseObjectUsed === true) {
vin = $calculation.element('tbxVIN').getValue() || vin;
}
const mileageSpecified = getSpecified(mileage);
let vehicleUsage = 0;
const mapVehicleUsage: Record<number, number> = {
100_000_000: 0,
100_000_001: 1,
100_000_002: 5,
100_000_003: 5,
100_000_004: 2,
100_000_005: 6,
100_000_006: 5,
100_000_007: 4,
100_000_008: 4,
100_000_009: 0,
100_000_010: 0,
100_000_011: 3,
100_000_012: 3,
100_000_013: 9,
};
const leaseObjectUseFor = $calculation.element('selectLeaseObjectUseFor').getValue();
if (leaseObjectUseFor) {
vehicleUsage = mapVehicleUsage[leaseObjectUseFor] || 0;
}
const vehicleUsageSpecified = getSpecified(vehicleUsage);
let seatingCapacity = 0;
if (leaseObjectCategory === 100_000_003) {
seatingCapacity = $calculation.element('tbxCountSeats').getValue();
}
const seatingCapacitySpecified = getSpecified(seatingCapacity);
const mapCategory: Record<number, string> = {
100_000_000: 'A',
100_000_001: 'B',
// 100000002: 'C2',
100_000_003: 'D',
100_000_004: 'E1',
};
let category = '';
if (leaseObjectCategory) {
category = mapCategory[leaseObjectCategory];
}
if (leaseObjectCategory === 100_000_002)
switch (evo_leasingobject_type?.evo_id) {
case '7': {
category = 'C1';
break;
}
case '3': {
category = 'C3';
break;
}
default: {
category = 'C2';
break;
}
}
const classification =
leaseObjectCategory && [100_000_002, 100_000_003, 100_000_004].includes(leaseObjectCategory)
? '11635'
: '0';
let INN = '';
const leadid = $calculation.element('selectLead').getValue();
if (leadid) {
const {
data: { lead },
} = await apolloClient.query({
query: CRMTypes.GetLeadDocument,
variables: { leadid },
});
INN = lead?.evo_inn || INN;
}
const lesseSubjectType = (INN.length === 10 && 1) || (INN.length === 12 && 2) || 0;
const mapLeaseObjectUseForToIndustry: Record<number, number> = {
100_000_014: 30,
100_000_015: 15,
100_000_016: 3,
100_000_017: 26,
100_000_018: 2,
100_000_019: 6,
};
let specialMachineryIndustry = 0;
let specialMachineryMover = 0;
let specialMachineryType = 0;
if (evo_leasingobject_type?.evo_id && ['6', '9', '10'].includes(evo_leasingobject_type?.evo_id)) {
specialMachineryType = Number(evo_model?.evo_vehicle_body_typeidData?.evo_id_elt || 0);
specialMachineryIndustry = leaseObjectUseFor
? mapLeaseObjectUseForToIndustry[leaseObjectUseFor]
: specialMachineryIndustry;
specialMachineryMover = evo_model?.evo_running_gear === 100_000_001 ? 2 : 1;
}
return {
ELTParams: {
Insurer: {
SubjectType: 1,
SubjectTypeSpecified: true,
},
Lessee: {
INN,
SubjectType: lesseSubjectType,
SubjectTypeSpecified: true,
},
OfficialDealer: true,
OfficialDealerSpecified: true,
Owner: {
SubjectType: 1,
SubjectTypeSpecified: true,
},
PUUs: puuMark
? [
{
mark: puuMark,
model: puuModel,
modelSpecified: puuModelSpecified,
},
]
: [],
STOA: '0',
approvedDriving: 2,
approvedDrivingSpecified: true,
bankId: '245',
cost,
currency: 'RUR',
drivers: [{ age, experience, sex, sexSpecified }],
driversCount,
duration,
franchise,
franchiseSpecified,
isNew,
modification: {
KPPTypeId: 1,
country,
countrySpecified,
engineType,
engineVolume: 0,
engineVolumeSpecified: true,
power,
powerSpecified,
},
notConfirmedDamages,
notConfirmedDamagesSpecified,
notConfirmedGlassesDamages,
notConfirmedGlassesDamagesSpecified,
outsideRoads,
outsideRoadsSpecified,
payType: '0',
risk,
selfIgnition,
selfIgnitionSpecified,
ssType: '1',
usageStart: currentDate,
vehicle: {
category,
classification,
maxAllowedMass,
maxAllowedMassSpecified,
mileage,
mileageSpecified,
seatingCapacity,
seatingCapacitySpecified,
vehicleUsage,
vehicleUsageSpecified,
vin,
},
vehicleDate,
vehicleDateSpecified,
vehicleYear,
// FullDriversInfo: [
// {
// surname,
// name,
// patronymic,
// sex,
// sexSpecified,
// expertienceStart,
// },
// ],
},
companyIds: [row.id],
preparams: {
brandId,
kladr,
modelId,
specialMachinery: {
industry: specialMachineryIndustry,
industrySpecified: getSpecified(specialMachineryIndustry),
mover: specialMachineryMover,
moverSpecified: getSpecified(specialMachineryMover),
type: specialMachineryType,
typeSpecified: getSpecified(specialMachineryType),
},
},
};
}

View File

@ -0,0 +1,7 @@
import type { RowSchema } from '@/config/schema/elt';
import type ELTStore from '@/stores/tables/elt';
import type PolicyStore from '@/stores/tables/elt/policy';
import type { z } from 'zod';
export type Row = z.infer<typeof RowSchema>;
export type StoreSelector = (eltStore: ELTStore) => PolicyStore;

View File

@ -1,13 +1,38 @@
/* eslint-disable react/forbid-component-props */
/* eslint-disable canonical/sort-keys */
import { buildOptionComponent, buildValueComponent } from './builders';
import type * as Insurance from './types';
import { MAX_INSURANCE } from '@/constants/values';
import { useStore } from '@/stores/hooks';
import type { ColumnsType } from 'antd/lib/table';
import { observer } from 'mobx-react-lite';
import { parser } from 'tools/number';
import { InputNumber, Select } from 'ui/elements';
import { CheckOutlined } from 'ui/elements/icons';
import { createFormatter } from 'ui/elements/InputNumber';
export const columns: ColumnsType<Insurance.RowValues> = [
{
key: 'elt',
dataIndex: 'elt',
render: (_, record) => {
const Check = observer(() => {
const { $tables } = useStore();
if (
(record.key === 'osago' && $tables.elt.osago.getSelectedRow?.key) ||
(record.key === 'kasko' && $tables.elt.kasko.getSelectedRow?.key)
) {
return <CheckOutlined />;
}
return null;
});
return <Check />;
},
title: 'ЭЛТ',
width: '1%',
},
{
key: 'policyType',
dataIndex: 'policyType',
@ -17,12 +42,21 @@ export const columns: ColumnsType<Insurance.RowValues> = [
key: 'insuranceCompany',
dataIndex: 'insuranceCompany',
title: 'Страховая компания',
width: 300,
render: (_, record) => {
const Component = buildOptionComponent(record.key, Select, 'insuranceCompany');
return <Component optionFilterProp="label" showSearch />;
return (
<Component
optionFilterProp="label"
showSearch
style={{
width: '290px',
maxWidth: '290px',
}}
/>
);
},
width: '290px',
},
{
key: 'insured',
@ -37,7 +71,7 @@ export const columns: ColumnsType<Insurance.RowValues> = [
{
key: 'insCost',
dataIndex: 'insCost',
title: 'Стоимость за 1-й период',
title: 'Сумма за 1-й период',
render: (_, record) => {
const Component = buildValueComponent(record.key, InputNumber, 'insCost');
@ -50,9 +84,13 @@ export const columns: ColumnsType<Insurance.RowValues> = [
parser={parser}
precision={2}
step={1000}
style={{
width: '150px',
}}
/>
);
},
width: '150px',
},
{
key: 'insTerm',

View File

@ -1,5 +1,6 @@
import AddProduct from './AddProduct';
import CreateKP from './CreateKP';
import ELT from './ELT';
import Insurance from './Insurance';
import Leasing from './Leasing';
import LeasingObject from './LeasingObject';
@ -17,6 +18,7 @@ const formTabs = [
LeasingObject,
SupplierAgent,
Insurance,
ELT,
AddProduct,
CreateKP,
Unlimited,

View File

@ -13,11 +13,8 @@ export const Grid = styled(Box)`
grid-template-columns: 2fr 1fr;
}
${min('laptop-hd')} {
grid-template-columns: 2fr 1fr 1.5fr;
}
${min('desktop')} {
grid-template-columns: 2fr 1fr 1.5fr;
margin: 8px 5%;
}

View File

@ -1,4 +1,5 @@
import { RequestCalculateSchema, ResponseCalculateSchema } from '../core/types';
import { RowSchema as EltRowSchema } from '@/config/schema/elt';
import { RiskSchema } from '@/config/schema/fingap';
import { RowSchema } from '@/config/schema/insurance';
import ValuesSchema from '@/config/schema/values';
@ -20,6 +21,10 @@ export const RequestCreateKPSchema = z.object({
})
),
domainName: z.string(),
elt: z.object({
kasko: EltRowSchema.optional(),
osago: EltRowSchema.optional(),
}),
finGAP: RiskSchema.array(),
insurance: RowSchema.extend({ key: z.string() }).array(),
});

22
apps/web/api/elt/query.ts Normal file
View File

@ -0,0 +1,22 @@
import type * as ELT from './types';
import getUrls from '@/config/urls';
import type { QueryFunctionContext } from '@tanstack/react-query';
import axios from 'axios';
const { URL_ELT_KASKO, URL_ELT_OSAGO } = getUrls();
export async function getEltOsago(
payload: ELT.RequestEltOsago,
{ signal }: QueryFunctionContext
): Promise<ELT.ResponseEltOsago> {
return await axios
.post<ELT.ResponseEltOsago>(URL_ELT_OSAGO, payload, { signal })
.then((response) => response.data)
.catch((error) => error.response.data);
}
export async function getEltKasko(payload: ELT.RequestEltKasko, { signal }: QueryFunctionContext) {
const { data } = await axios.post<ELT.ResponseEltKasko>(URL_ELT_KASKO, payload, { signal });
return data;
}

12
apps/web/api/elt/types.ts Normal file
View File

@ -0,0 +1,12 @@
import type {
RequestEltKaskoSchema,
RequestEltOsagoSchema,
ResultEltKaskoSchema,
ResultEltOsagoSchema,
} from '@/config/schema/elt';
import type { z } from 'zod';
export type RequestEltOsago = z.infer<typeof RequestEltOsagoSchema>;
export type RequestEltKasko = z.infer<typeof RequestEltKaskoSchema>;
export type ResponseEltOsago = z.infer<typeof ResultEltOsagoSchema>;
export type ResponseEltKasko = z.infer<typeof ResultEltKaskoSchema>;

View File

@ -0,0 +1,288 @@
import { z } from 'zod';
export const RequestEltKaskoSchema = z.object({
ELTParams: z.object({
Insurer: z.object({
SubjectType: z.number(),
SubjectTypeSpecified: z.boolean(),
}),
Lessee: z.object({
INN: z.string(),
SubjectType: z.number(),
SubjectTypeSpecified: z.boolean(),
}),
OfficialDealer: z.boolean(),
OfficialDealerSpecified: z.boolean(),
Owner: z.object({
SubjectType: z.number(),
SubjectTypeSpecified: z.boolean(),
}),
PUUs: z.array(
z.object({
mark: z.string(),
model: z.string(),
modelSpecified: z.boolean(),
})
),
STOA: z.string(),
approvedDriving: z.number(),
approvedDrivingSpecified: z.boolean(),
bankId: z.string(),
cost: z.number(),
currency: z.string(),
drivers: z.array(
z.object({
age: z.number(),
experience: z.number(),
sex: z.string(),
sexSpecified: z.boolean(),
})
),
driversCount: z.number(),
duration: z.number(),
franchise: z.number(),
franchiseSpecified: z.boolean(),
isNew: z.boolean(),
modification: z.object({
KPPTypeId: z.number(),
country: z.number(),
countrySpecified: z.boolean(),
engineType: z.string(),
engineVolume: z.number(),
engineVolumeSpecified: z.boolean(),
power: z.number(),
powerSpecified: z.boolean(),
}),
notConfirmedDamages: z.number(),
notConfirmedDamagesSpecified: z.boolean(),
notConfirmedGlassesDamages: z.number(),
notConfirmedGlassesDamagesSpecified: z.boolean(),
outsideRoads: z.boolean(),
outsideRoadsSpecified: z.boolean(),
payType: z.string(),
risk: z.number(),
selfIgnition: z.boolean(),
selfIgnitionSpecified: z.boolean(),
ssType: z.string(),
usageStart: z.date(),
vehicle: z.object({
category: z.string(),
classification: z.string(),
maxAllowedMass: z.number(),
maxAllowedMassSpecified: z.boolean(),
mileage: z.number(),
mileageSpecified: z.boolean(),
seatingCapacity: z.number(),
seatingCapacitySpecified: z.boolean(),
vehicleUsage: z.number(),
vehicleUsageSpecified: z.boolean(),
vin: z.string(),
}),
vehicleDate: z.date().optional(),
vehicleDateSpecified: z.boolean(),
vehicleYear: z.number(),
}),
companyIds: z.array(z.string()),
preparams: z.object({
brandId: z.string(),
kladr: z.string(),
modelId: z.string(),
specialMachinery: z.object({
industry: z.number(),
industrySpecified: z.boolean(),
mover: z.number(),
moverSpecified: z.boolean(),
type: z.number(),
typeSpecified: z.boolean(),
}),
}),
});
export const ResultEltKaskoSchema = z.record(
z.object({
calcInfo: z.null(),
comment: z.null(),
doSum: z.number(),
error: z.string(),
errorType: z.null(),
gapSum: z.number(),
goSum: z.number(),
insuranceCompanyFranchise: z.object({ id: z.string(), value: z.string() }),
insuranceCompanyGo: z.object({ id: z.string(), value: z.string() }),
isNeedInspection: z.string(),
kaskoSum: z.number(),
kbmOsago: z.null(),
message: z.string(),
nsSum: z.number(),
options: z.array(
z.union([
z.object({
id: z.string(),
name: z.string(),
values: z.array(z.object({ id: z.string(), name: z.string() })),
}),
z.object({
id: z.string(),
name: z.string(),
values: z.array(z.object({ id: z.string(), name: z.null() })),
}),
z.object({
id: z.string(),
name: z.string(),
values: z.array(z.object({ id: z.null(), name: z.null() })),
}),
])
),
paymentPeriods: z.array(
z.object({
date: z.string(),
doSum: z.number(),
doSumSpecified: z.boolean(),
duration: z.number(),
durationSpecified: z.boolean(),
franchiseSum: z.number(),
franchiseSumSpecified: z.boolean(),
gapSum: z.number(),
gapSumSpecified: z.boolean(),
goSum: z.number(),
goSumSpecified: z.boolean(),
id: z.null(),
kaskoSum: z.number(),
kaskoSumSpecified: z.boolean(),
name: z.null(),
nsSum: z.number(),
nsSumSpecified: z.boolean(),
num: z.number(),
numSpecified: z.boolean(),
premiumSum: z.number(),
premiumSumSpecified: z.boolean(),
rate: z.number(),
rateSpecified: z.boolean(),
})
),
policyNumber: z.null(),
premiumSum: z.number(),
product: z.string(),
productId: z.string(),
program: z.string(),
programCode: z.string(),
programId: z.string(),
requestId: z.string(),
skCalcId: z.string(),
totalFranchise: z.number(),
totalFranchiseSpecified: z.boolean(),
unicusGUID: z.string(),
})
);
export const RequestEltOsagoSchema = z.object({
ELTParams: z.object({
FullDriversInfo: z.array(z.object({ kbm: z.string() })),
carInfo: z.object({
mark: z.string(),
model: z.string(),
tsType: z.object({ category: z.string(), subCategory: z.string() }),
useWithTrailer: z.boolean(),
useWithTrailerSpecified: z.boolean(),
vehicle: z.object({
maxAllowedMass: z.number(),
maxAllowedMassSpecified: z.boolean(),
seatingCapacity: z.number(),
seatingCapacitySpecified: z.boolean(),
}),
vehiclePower: z.number(),
vehicleYear: z.string(),
}),
contractBeginDate: z.date(),
contractOptionId: z.number(),
contractStatusId: z.number(),
driversCount: z.number(),
duration: z.number(),
insurer: z.object({
INN: z.string(),
SubjectType: z.number(),
SubjectTypeSpecified: z.boolean(),
}),
insurerType: z.number(),
lessee: z.object({
SubjectType: z.number(),
SubjectTypeSpecified: z.boolean(),
inn: z.string(),
}),
owner: z.object({
JuridicalName: z.string(),
email: z.string(),
factAddress: z.object({
city: z.string(),
cityKladr: z.string(),
country: z.string(),
flat: z.string(),
house: z.string(),
region: z.string(),
resident: z.number(),
street: z.string(),
}),
inn: z.string(),
kpp: z.string(),
ogrn: z.string(),
opf: z.number(),
opfSpecified: z.boolean(),
phone: z.string(),
registrationAddress: z.object({
city: z.string(),
cityKladr: z.string(),
country: z.string(),
flat: z.string(),
house: z.string(),
region: z.string(),
resident: z.number(),
street: z.string(),
}),
subjectType: z.number(),
subjectTypeSpecified: z.boolean(),
}),
ownerType: z.number(),
tsToRegistrationPlace: z.number(),
}),
companyIds: z.array(z.string()),
preparams: z.object({
brandId: z.string(),
kladr: z.string(),
modelId: z.string(),
}),
});
export const ResultEltOsagoSchema = z.record(
z.object({
calcInfo: z.array(
z.object({
itemName: z.string(),
value: z.number(),
valueSpecified: z.boolean(),
})
),
error: z.string(),
fullDriversInfo: z.array(z.unknown()),
kbm: z.object({ class: z.number(), value: z.number() }),
message: z.string(),
numCalc: z.number(),
premiumSum: z.number(),
prevoiusKBM: z.object({ class: z.number(), value: z.number() }),
rsaRequestId: z.string(),
skCalcId: z.string(),
tb: z.number(),
})
);
export const RowSchema = z.object({
id: z.string(),
key: z.string(),
message: z.string().nullable(),
name: z.string(),
numCalc: z.number(),
requestId: z.string(),
skCalcId: z.string(),
status: z.string().nullable(),
sum: z.number(),
totalFranchise: z.number(),
});

View File

@ -9,6 +9,8 @@ const envSchema = z.object({
URL_CRM_CREATEKP_DIRECT: z.string(),
URL_CRM_DOWNLOADKP_BASE: z.string(),
URL_CRM_GRAPHQL_DIRECT: z.string(),
URL_ELT_KASKO_DIRECT: z.string(),
URL_ELT_OSAGO_DIRECT: z.string(),
URL_GET_USER_DIRECT: z.string(),
USE_DEV_COLORS: z.unknown().optional().transform(Boolean),
});

View File

@ -14,6 +14,8 @@ const serverRuntimeConfigSchema = envSchema.pick({
URL_CRM_CREATEKP_DIRECT: true,
URL_CRM_DOWNLOADKP_BASE: true,
URL_CRM_GRAPHQL_DIRECT: true,
URL_ELT_KASKO_DIRECT: true,
URL_ELT_OSAGO_DIRECT: true,
URL_GET_USER_DIRECT: true,
});

View File

@ -4,7 +4,7 @@ const threshold = 0;
const screens = {
tablet: 768,
laptop: 1024,
'laptop-hd': 1280,
'laptop-m': 1280,
desktop: 1680,
'desktop-xl': 1921,
};

View File

@ -18,6 +18,8 @@ function getUrls() {
URL_CRM_CREATEKP_DIRECT,
URL_CRM_DOWNLOADKP_BASE,
PORT,
URL_ELT_KASKO_DIRECT,
URL_ELT_OSAGO_DIRECT,
} = serverRuntimeConfigSchema.parse(serverRuntimeConfig);
return {
@ -29,6 +31,8 @@ function getUrls() {
URL_CRM_CREATEKP: URL_CRM_CREATEKP_DIRECT,
URL_CRM_DOWNLOADKP_BASE,
URL_CRM_GRAPHQL: URL_CRM_GRAPHQL_DIRECT,
URL_ELT_KASKO: URL_ELT_KASKO_DIRECT,
URL_ELT_OSAGO: URL_ELT_OSAGO_DIRECT,
URL_GET_USER: URL_GET_USER_DIRECT,
};
}
@ -44,6 +48,8 @@ function getUrls() {
URL_CORE_FINGAP: withBasePath(urls.URL_CORE_FINGAP_PROXY),
URL_CRM_CREATEKP: withBasePath(urls.URL_CRM_CREATEKP_PROXY),
URL_CRM_GRAPHQL: withBasePath(urls.URL_CRM_GRAPHQL_PROXY),
URL_ELT_KASKO: withBasePath(urls.URL_ELT_KASKO_PROXY),
URL_ELT_OSAGO: withBasePath(urls.URL_ELT_OSAGO_PROXY),
URL_GET_USER: withBasePath(urls.URL_GET_USER_PROXY),
};
}

View File

@ -4,5 +4,7 @@ module.exports = {
URL_CORE_FINGAP_PROXY: '/api/core/fingap',
URL_CRM_CREATEKP_PROXY: '/api/crm/create-kp',
URL_CRM_GRAPHQL_PROXY: '/api/graphql/crm',
URL_ELT_KASKO_PROXY: '/api/elt/kasko',
URL_ELT_OSAGO_PROXY: '/api/elt/osago',
URL_GET_USER_PROXY: '/api/auth/user',
};

View File

@ -46,6 +46,7 @@ query GetLead($leadid: Uuid!) {
evo_region_fias_id
evo_city_fias_id
}
evo_okved
}
}
}
@ -58,6 +59,7 @@ query GetOpportunity($opportunityid: Uuid!) {
evo_region_fias_id
evo_city_fias_id
}
evo_okved
}
}
}
@ -274,6 +276,7 @@ query GetRegion($regionId: Uuid!) {
accounts {
accountid
}
evo_kladr_id
}
}
@ -286,10 +289,17 @@ query GetTowns($regionId: Uuid!) {
}
}
query GetTown($townId: Uuid!) {
evo_town(evo_townid: $townId) {
evo_kladr_id
}
}
query GetGPSBrands {
evo_gps_brands(statecode: 0) {
label: evo_name
value: evo_gps_brandid
evo_id
}
}
@ -297,6 +307,7 @@ query GetGPSModels($gpsBrandId: Uuid!) {
evo_gps_models(evo_gps_brandid: $gpsBrandId) {
label: evo_name
value: evo_gps_modelid
evo_id
}
}
@ -337,6 +348,7 @@ query GetBrand($brandId: Uuid!) {
evo_importer_reward_perc
evo_importer_reward_rub
evo_maximum_percentage_av
evo_brand_owner
}
}
@ -356,6 +368,11 @@ query GetModel($modelId: Uuid!) {
}
evo_importer_reward_perc
evo_importer_reward_rub
evo_id
evo_vehicle_body_typeidData {
evo_id_elt
}
evo_running_gear
}
}
@ -655,6 +672,8 @@ query GetLeasingWithoutKaskoTypes($currentDate: DateTime) {
query GetInsuranceCompany($accountId: Uuid!) {
account(accountid: $accountId) {
evo_osago_with_kasko
evo_legal_region_calc
accountid
}
}
@ -665,6 +684,9 @@ query GetInsuranceCompanies {
evo_inn
value: accountid
label: name
evo_id_elt_osago
evo_id_elt
evo_id_elt_smr
}
}

View File

@ -147,14 +147,14 @@ export type GetLeadQueryVariables = Exact<{
}>;
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 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_okved: string | null, 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, 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 GetOpportunityQuery = { __typename?: 'Query', opportunity: { __typename?: 'opportunity', evo_leadid: string | null, accountidData: { __typename?: 'account', evo_okved: string | null, 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']>;
@ -250,7 +250,7 @@ export type GetRegionQueryVariables = Exact<{
}>;
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 GetRegionQuery = { __typename?: 'Query', evo_region: { __typename?: 'evo_region', evo_oktmo: string | null, evo_kladr_id: string | null, accounts: Array<{ __typename?: 'account', accountid: string | null } | null> | null } | null };
export type GetTownsQueryVariables = Exact<{
regionId: Scalars['Uuid'];
@ -259,17 +259,24 @@ export type GetTownsQueryVariables = Exact<{
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 GetTownQueryVariables = Exact<{
townId: Scalars['Uuid'];
}>;
export type GetTownQuery = { __typename?: 'Query', evo_town: { __typename?: 'evo_town', evo_kladr_id: string | null } | null };
export type GetGpsBrandsQueryVariables = Exact<{ [key: string]: never; }>;
export type GetGpsBrandsQuery = { __typename?: 'Query', evo_gps_brands: Array<{ __typename?: 'evo_gps_brand', label: string | null, value: string | null } | null> | null };
export type GetGpsBrandsQuery = { __typename?: 'Query', evo_gps_brands: Array<{ __typename?: 'evo_gps_brand', evo_id: string | null, label: string | null, value: string | null } | null> | null };
export type GetGpsModelsQueryVariables = Exact<{
gpsBrandId: Scalars['Uuid'];
}>;
export type GetGpsModelsQuery = { __typename?: 'Query', evo_gps_models: Array<{ __typename?: 'evo_gps_model', label: string | null, value: string | null } | null> | null };
export type GetGpsModelsQuery = { __typename?: 'Query', evo_gps_models: Array<{ __typename?: 'evo_gps_model', evo_id: string | null, label: string | null, value: string | null } | null> | null };
export type GetLeaseObjectTypesQueryVariables = Exact<{ [key: string]: never; }>;
@ -293,7 +300,7 @@ export type GetBrandQueryVariables = Exact<{
}>;
export type GetBrandQuery = { __typename?: 'Query', evo_brand: { __typename?: 'evo_brand', evo_id: string | null, evo_importer_reward_perc: number | null, evo_importer_reward_rub: number | null, evo_maximum_percentage_av: number | null } | null };
export type GetBrandQuery = { __typename?: 'Query', evo_brand: { __typename?: 'evo_brand', evo_id: string | null, evo_importer_reward_perc: number | null, evo_importer_reward_rub: number | null, evo_maximum_percentage_av: number | null, evo_brand_owner: number | null } | null };
export type GetModelsQueryVariables = Exact<{
brandId: Scalars['Uuid'];
@ -307,7 +314,7 @@ export type GetModelQueryVariables = Exact<{
}>;
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 GetModelQuery = { __typename?: 'Query', evo_model: { __typename?: 'evo_model', evo_importer_reward_perc: number | null, evo_importer_reward_rub: number | null, evo_id: string | null, evo_running_gear: number | null, evo_impairment_groupidData: { __typename?: 'evo_impairment_group', evo_name: string | null } | null, evo_vehicle_body_typeidData: { __typename?: 'evo_vehicle_body_typeGraphQL', evo_id_elt: string | null } | null } | null };
export type GetConfigurationsQueryVariables = Exact<{
modelId: Scalars['Uuid'];
@ -462,12 +469,12 @@ export type GetInsuranceCompanyQueryVariables = Exact<{
}>;
export type GetInsuranceCompanyQuery = { __typename?: 'Query', account: { __typename?: 'account', evo_osago_with_kasko: boolean | null } | null };
export type GetInsuranceCompanyQuery = { __typename?: 'Query', account: { __typename?: 'account', evo_osago_with_kasko: boolean | null, evo_legal_region_calc: boolean | null, accountid: string | null } | null };
export type GetInsuranceCompaniesQueryVariables = Exact<{ [key: string]: never; }>;
export type GetInsuranceCompaniesQuery = { __typename?: 'Query', accounts: Array<{ __typename?: 'account', evo_type_ins_policy: Array<number> | null, evo_evokasko_access: boolean | null, evo_inn: string | null, value: string | null, label: string | null } | null> | null };
export type GetInsuranceCompaniesQuery = { __typename?: 'Query', accounts: Array<{ __typename?: 'account', evo_type_ins_policy: Array<number> | null, evo_evokasko_access: boolean | null, evo_inn: string | null, evo_id_elt_osago: string | null, evo_id_elt: string | null, evo_id_elt_smr: string | null, value: string | null, label: string | null } | null> | null };
export type GetRolesQueryVariables = Exact<{
roleName: InputMaybe<Scalars['String']>;
@ -504,6 +511,13 @@ export type GetQuoteCreateKpDataQueryVariables = Exact<{
export type GetQuoteCreateKpDataQuery = { __typename?: 'Query', quote: { __typename?: 'quote', evo_price_with_discount: boolean | null, evo_price_without_discount_quote: boolean | null, evo_cost_increace: boolean | null, evo_insurance: boolean | null, evo_registration_quote: boolean | null, evo_card_quote: boolean | null, evo_nsib_quote: boolean | null, evo_redemption_graph: boolean | null, evo_fingap_quote: boolean | null, evo_contact_name: string | null, evo_gender: number | null, evo_last_payment_redemption: boolean | null } | null };
export type GetQuoteEltDataQueryVariables = Exact<{
quoteId: Scalars['Uuid'];
}>;
export type GetQuoteEltDataQuery = { __typename?: 'Query', quote: { __typename?: 'quote', evo_kasko_accountid: string | null, evo_kasko_price: number | null, evo_id_elt_kasko: string | null, evo_id_kasko_calc: string | null, evo_franchise: number | null, evo_osago_accountid: string | null, evo_id_elt_osago: string | null, evo_osago_price: number | null, evo_leasingobject_typeid: string | null } | null };
export type GetQuoteFingapDataQueryVariables = Exact<{
quoteId: Scalars['Uuid'];
}>;
@ -600,8 +614,8 @@ export const GetTransactionCurrenciesDocument = {"kind":"Document","definitions"
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"}},{"kind":"Field","name":{"kind":"Name","value":"transactioncurrencyid"}}]}}]}}]} 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 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 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"}}]}},{"kind":"Field","name":{"kind":"Name","value":"evo_okved"}}]}}]}}]}}]} 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"}}]}},{"kind":"Field","name":{"kind":"Name","value":"evo_okved"}}]}}]}}]}}]} 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"}},{"kind":"Field","name":{"kind":"Name","value":"evo_recalc_limit"}},{"kind":"Field","name":{"kind":"Name","value":"evo_statuscodeidData"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"evo_id"}}]}},{"kind":"Field","name":{"kind":"Name","value":"evo_purchases_participation"}}]}}]}}]} as unknown as DocumentNode<GetQuotesQuery, GetQuotesQueryVariables>;
export const GetQuoteDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetQuote"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"quoteId"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"Uuid"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"quote"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"quoteId"},"value":{"kind":"Variable","name":{"kind":"Name","value":"quoteId"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"evo_baseproductid"}},{"kind":"Field","name":{"kind":"Name","value":"evo_one_year_insurance"}},{"kind":"Field","name":{"kind":"Name","value":"evo_min_change_price"}},{"kind":"Field","name":{"kind":"Name","value":"evo_max_price_change"}},{"kind":"Field","name":{"kind":"Name","value":"evo_discount_supplier_currency"}},{"kind":"Field","name":{"kind":"Name","value":"evo_equip_price"}},{"kind":"Field","name":{"kind":"Name","value":"evo_program_import_subsidy_sum"}},{"kind":"Field","name":{"kind":"Name","value":"evo_nds_in_price_supplier_currency"}},{"kind":"Field","name":{"kind":"Name","value":"evo_supplier_currency_price"}},{"kind":"Field","name":{"kind":"Name","value":"evo_approved_first_payment"}},{"kind":"Field","name":{"kind":"Name","value":"evo_recalc_limit"}},{"kind":"Field","name":{"kind":"Name","value":"evo_max_mass"}},{"kind":"Field","name":{"kind":"Name","value":"evo_seats"}},{"kind":"Field","name":{"kind":"Name","value":"evo_year"}},{"kind":"Field","name":{"kind":"Name","value":"evo_last_payment_perc"}},{"kind":"Field","name":{"kind":"Name","value":"evo_maximum_percentage_av"}}]}}]}}]} as unknown as DocumentNode<GetQuoteQuery, GetQuoteQueryVariables>;
@ -615,16 +629,17 @@ export const GetSubsidiesDocument = {"kind":"Document","definitions":[{"kind":"O
export const GetSubsidyDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetSubsidy"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"subsidyId"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"Uuid"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"evo_subsidy"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"evo_subsidyid"},"value":{"kind":"Variable","name":{"kind":"Name","value":"subsidyId"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"evo_leasingobject_types"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"evo_leasingobject_typeid"}}]}},{"kind":"Field","name":{"kind":"Name","value":"accounts"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"accountid"}}]}},{"kind":"Field","name":{"kind":"Name","value":"evo_brands"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"evo_brandid"}}]}},{"kind":"Field","name":{"kind":"Name","value":"evo_models"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"evo_modelid"}}]}},{"kind":"Field","name":{"kind":"Name","value":"evo_subsidy_summ"}},{"kind":"Field","name":{"kind":"Name","value":"evo_percent_subsidy"}},{"kind":"Field","name":{"kind":"Name","value":"evo_max_subsidy_summ"}},{"kind":"Field","name":{"kind":"Name","value":"evo_get_subsidy_payment"}},{"kind":"Field","name":{"kind":"Name","value":"evo_delivery_time"}}]}}]}}]} as unknown as DocumentNode<GetSubsidyQuery, GetSubsidyQueryVariables>;
export const GetImportProgramDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetImportProgram"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"importProgramId"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"Uuid"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"importProgram"},"name":{"kind":"Name","value":"evo_subsidy"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"evo_subsidyid"},"value":{"kind":"Variable","name":{"kind":"Name","value":"importProgramId"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"evo_leasingobject_types"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"evo_leasingobject_typeid"}}]}},{"kind":"Field","name":{"kind":"Name","value":"accounts"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"accountid"}}]}},{"kind":"Field","name":{"kind":"Name","value":"evo_brands"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"evo_brandid"}}]}},{"kind":"Field","name":{"kind":"Name","value":"evo_models"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"evo_modelid"}}]}}]}}]}}]} as unknown as DocumentNode<GetImportProgramQuery, GetImportProgramQueryVariables>;
export const GetRegionsDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetRegions"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"evo_regions"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"label"},"name":{"kind":"Name","value":"evo_name"}},{"kind":"Field","alias":{"kind":"Name","value":"value"},"name":{"kind":"Name","value":"evo_regionid"}},{"kind":"Field","name":{"kind":"Name","value":"evo_fias_id"}},{"kind":"Field","name":{"kind":"Name","value":"evo_businessunit_evolution"}}]}}]}}]} as unknown as DocumentNode<GetRegionsQuery, GetRegionsQueryVariables>;
export const GetRegionDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetRegion"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"regionId"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"Uuid"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"evo_region"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"evo_regionid"},"value":{"kind":"Variable","name":{"kind":"Name","value":"regionId"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"evo_oktmo"}},{"kind":"Field","name":{"kind":"Name","value":"accounts"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"accountid"}}]}}]}}]}}]} as unknown as DocumentNode<GetRegionQuery, GetRegionQueryVariables>;
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"}}]}},{"kind":"Field","name":{"kind":"Name","value":"evo_kladr_id"}}]}}]}}]} 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 GetGpsModelsDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetGPSModels"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"gpsBrandId"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"Uuid"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"evo_gps_models"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"evo_gps_brandid"},"value":{"kind":"Variable","name":{"kind":"Name","value":"gpsBrandId"}}}],"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_modelid"}}]}}]}}]} as unknown as DocumentNode<GetGpsModelsQuery, GetGpsModelsQueryVariables>;
export const GetTownDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetTown"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"townId"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"Uuid"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"evo_town"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"evo_townid"},"value":{"kind":"Variable","name":{"kind":"Name","value":"townId"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"evo_kladr_id"}}]}}]}}]} as unknown as DocumentNode<GetTownQuery, GetTownQueryVariables>;
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"}},{"kind":"Field","name":{"kind":"Name","value":"evo_id"}}]}}]}}]} as unknown as DocumentNode<GetGpsBrandsQuery, GetGpsBrandsQueryVariables>;
export const GetGpsModelsDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetGPSModels"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"gpsBrandId"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"Uuid"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"evo_gps_models"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"evo_gps_brandid"},"value":{"kind":"Variable","name":{"kind":"Name","value":"gpsBrandId"}}}],"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_modelid"}},{"kind":"Field","name":{"kind":"Name","value":"evo_id"}}]}}]}}]} as unknown as DocumentNode<GetGpsModelsQuery, GetGpsModelsQueryVariables>;
export const GetLeaseObjectTypesDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetLeaseObjectTypes"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"evo_leasingobject_types"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"statecode"},"value":{"kind":"IntValue","value":"0"}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"label"},"name":{"kind":"Name","value":"evo_name"}},{"kind":"Field","alias":{"kind":"Name","value":"value"},"name":{"kind":"Name","value":"evo_leasingobject_typeid"}},{"kind":"Field","name":{"kind":"Name","value":"evo_leasingobject_typeid"}}]}}]}}]} as unknown as DocumentNode<GetLeaseObjectTypesQuery, GetLeaseObjectTypesQueryVariables>;
export const GetLeaseObjectTypeDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetLeaseObjectType"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"leaseObjectTypeId"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"Uuid"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"evo_leasingobject_type"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"evo_leasingobject_typeid"},"value":{"kind":"Variable","name":{"kind":"Name","value":"leaseObjectTypeId"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"evo_vehicle_type"}},{"kind":"Field","name":{"kind":"Name","value":"evo_id"}},{"kind":"Field","name":{"kind":"Name","value":"evo_category"}},{"kind":"Field","name":{"kind":"Name","value":"evo_vehicle_type_tax"}},{"kind":"Field","name":{"kind":"Name","value":"evo_category_tr"}},{"kind":"Field","name":{"kind":"Name","value":"evo_expluatation_period1"}},{"kind":"Field","name":{"kind":"Name","value":"evo_expluatation_period2"}},{"kind":"Field","name":{"kind":"Name","value":"evo_depreciation_rate1"}},{"kind":"Field","name":{"kind":"Name","value":"evo_depreciation_rate2"}}]}}]}}]} as unknown as DocumentNode<GetLeaseObjectTypeQuery, GetLeaseObjectTypeQueryVariables>;
export const GetBrandsDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetBrands"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"evo_brands"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"statecode"},"value":{"kind":"IntValue","value":"0"}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"label"},"name":{"kind":"Name","value":"evo_name"}},{"kind":"Field","alias":{"kind":"Name","value":"value"},"name":{"kind":"Name","value":"evo_brandid"}},{"kind":"Field","name":{"kind":"Name","value":"evo_brandid"}},{"kind":"Field","name":{"kind":"Name","value":"evo_vehicle_type"}}]}}]}}]} as unknown as DocumentNode<GetBrandsQuery, GetBrandsQueryVariables>;
export const GetBrandDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetBrand"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"brandId"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"Uuid"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"evo_brand"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"evo_brandid"},"value":{"kind":"Variable","name":{"kind":"Name","value":"brandId"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"evo_id"}},{"kind":"Field","name":{"kind":"Name","value":"evo_importer_reward_perc"}},{"kind":"Field","name":{"kind":"Name","value":"evo_importer_reward_rub"}},{"kind":"Field","name":{"kind":"Name","value":"evo_maximum_percentage_av"}}]}}]}}]} as unknown as DocumentNode<GetBrandQuery, GetBrandQueryVariables>;
export const GetBrandDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetBrand"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"brandId"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"Uuid"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"evo_brand"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"evo_brandid"},"value":{"kind":"Variable","name":{"kind":"Name","value":"brandId"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"evo_id"}},{"kind":"Field","name":{"kind":"Name","value":"evo_importer_reward_perc"}},{"kind":"Field","name":{"kind":"Name","value":"evo_importer_reward_rub"}},{"kind":"Field","name":{"kind":"Name","value":"evo_maximum_percentage_av"}},{"kind":"Field","name":{"kind":"Name","value":"evo_brand_owner"}}]}}]}}]} as unknown as DocumentNode<GetBrandQuery, GetBrandQueryVariables>;
export const GetModelsDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetModels"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"brandId"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"Uuid"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"evo_models"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"statecode"},"value":{"kind":"IntValue","value":"0"}},{"kind":"Argument","name":{"kind":"Name","value":"evo_brandid"},"value":{"kind":"Variable","name":{"kind":"Name","value":"brandId"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"label"},"name":{"kind":"Name","value":"evo_name"}},{"kind":"Field","alias":{"kind":"Name","value":"value"},"name":{"kind":"Name","value":"evo_modelid"}},{"kind":"Field","name":{"kind":"Name","value":"evo_modelid"}},{"kind":"Field","name":{"kind":"Name","value":"evo_vehicle_type"}}]}}]}}]} as unknown as DocumentNode<GetModelsQuery, GetModelsQueryVariables>;
export const GetModelDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetModel"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"modelId"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"Uuid"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"evo_model"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"evo_modelid"},"value":{"kind":"Variable","name":{"kind":"Name","value":"modelId"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"evo_impairment_groupidData"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"evo_name"}}]}},{"kind":"Field","name":{"kind":"Name","value":"evo_importer_reward_perc"}},{"kind":"Field","name":{"kind":"Name","value":"evo_importer_reward_rub"}}]}}]}}]} as unknown as DocumentNode<GetModelQuery, GetModelQueryVariables>;
export const 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"}},{"kind":"Field","name":{"kind":"Name","value":"evo_id"}},{"kind":"Field","name":{"kind":"Name","value":"evo_vehicle_body_typeidData"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"evo_id_elt"}}]}},{"kind":"Field","name":{"kind":"Name","value":"evo_running_gear"}}]}}]}}]} as unknown as DocumentNode<GetModelQuery, GetModelQueryVariables>;
export const GetConfigurationsDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetConfigurations"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"modelId"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"Uuid"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"evo_equipments"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"statecode"},"value":{"kind":"IntValue","value":"0"}},{"kind":"Argument","name":{"kind":"Name","value":"evo_modelid"},"value":{"kind":"Variable","name":{"kind":"Name","value":"modelId"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"label"},"name":{"kind":"Name","value":"evo_name"}},{"kind":"Field","alias":{"kind":"Name","value":"value"},"name":{"kind":"Name","value":"evo_equipmentid"}},{"kind":"Field","name":{"kind":"Name","value":"evo_start_production_year"}}]}}]}}]} as unknown as DocumentNode<GetConfigurationsQuery, GetConfigurationsQueryVariables>;
export const GetConfigurationDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetConfiguration"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"configurationId"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"Uuid"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"evo_equipment"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"evo_equipmentid"},"value":{"kind":"Variable","name":{"kind":"Name","value":"configurationId"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"evo_impairment_groupidData"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"evo_name"}}]}}]}}]}}]} as unknown as DocumentNode<GetConfigurationQuery, GetConfigurationQueryVariables>;
export const GetDealersDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetDealers"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"dealers"},"name":{"kind":"Name","value":"accounts"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"evo_account_type"},"value":{"kind":"ListValue","values":[{"kind":"IntValue","value":"100000001"}]}},{"kind":"Argument","name":{"kind":"Name","value":"statecode"},"value":{"kind":"IntValue","value":"0"}},{"kind":"Argument","name":{"kind":"Name","value":"evo_legal_form"},"value":{"kind":"IntValue","value":"100000001"}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"label"},"name":{"kind":"Name","value":"name"}},{"kind":"Field","alias":{"kind":"Name","value":"value"},"name":{"kind":"Name","value":"accountid"}},{"kind":"Field","name":{"kind":"Name","value":"accountid"}},{"kind":"Field","name":{"kind":"Name","value":"evo_supplier_financing_accept"}}]}}]}}]} as unknown as DocumentNode<GetDealersQuery, GetDealersQueryVariables>;
@ -646,13 +661,14 @@ export const GetTelematicTypesDocument = {"kind":"Document","definitions":[{"kin
export const GetTrackerTypesDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetTrackerTypes"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"currentDate"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"DateTime"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"evo_addproduct_types"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"statecode"},"value":{"kind":"IntValue","value":"0"}},{"kind":"Argument","name":{"kind":"Name","value":"evo_datefrom_param"},"value":{"kind":"ObjectValue","fields":[{"kind":"ObjectField","name":{"kind":"Name","value":"lte"},"value":{"kind":"Variable","name":{"kind":"Name","value":"currentDate"}}}]}},{"kind":"Argument","name":{"kind":"Name","value":"evo_dateto_param"},"value":{"kind":"ObjectValue","fields":[{"kind":"ObjectField","name":{"kind":"Name","value":"gte"},"value":{"kind":"Variable","name":{"kind":"Name","value":"currentDate"}}}]}},{"kind":"Argument","name":{"kind":"Name","value":"evo_product_type"},"value":{"kind":"IntValue","value":"100000003"}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"CoreAddProductTypesFields"}},{"kind":"Field","name":{"kind":"Name","value":"evo_controls_program"}},{"kind":"Field","name":{"kind":"Name","value":"evo_visible_calc"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"CoreAddProductTypesFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"evo_addproduct_type"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"evo_graph_price"}},{"kind":"Field","alias":{"kind":"Name","value":"label"},"name":{"kind":"Name","value":"evo_name"}},{"kind":"Field","alias":{"kind":"Name","value":"value"},"name":{"kind":"Name","value":"evo_addproduct_typeid"}}]}}]} as unknown as DocumentNode<GetTrackerTypesQuery, GetTrackerTypesQueryVariables>;
export const GetInsNsibTypesDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetInsNSIBTypes"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"currentDate"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"DateTime"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"evo_addproduct_types"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"statecode"},"value":{"kind":"IntValue","value":"0"}},{"kind":"Argument","name":{"kind":"Name","value":"evo_datefrom_param"},"value":{"kind":"ObjectValue","fields":[{"kind":"ObjectField","name":{"kind":"Name","value":"lte"},"value":{"kind":"Variable","name":{"kind":"Name","value":"currentDate"}}}]}},{"kind":"Argument","name":{"kind":"Name","value":"evo_dateto_param"},"value":{"kind":"ObjectValue","fields":[{"kind":"ObjectField","name":{"kind":"Name","value":"gte"},"value":{"kind":"Variable","name":{"kind":"Name","value":"currentDate"}}}]}},{"kind":"Argument","name":{"kind":"Name","value":"evo_product_type"},"value":{"kind":"IntValue","value":"100000002"}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"CoreAddProductTypesFields"}},{"kind":"Field","name":{"kind":"Name","value":"evo_max_period"}},{"kind":"Field","name":{"kind":"Name","value":"evo_min_period"}},{"kind":"Field","name":{"kind":"Name","value":"evo_max_price"}},{"kind":"Field","name":{"kind":"Name","value":"evo_min_price"}},{"kind":"Field","name":{"kind":"Name","value":"evo_leasingobject_types"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"evo_leasingobject_typeid"}}]}},{"kind":"Field","name":{"kind":"Name","value":"evo_visible_calc"}},{"kind":"Field","name":{"kind":"Name","value":"evo_min_first_payment_perc"}},{"kind":"Field","name":{"kind":"Name","value":"evo_max_first_payment_perc"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"CoreAddProductTypesFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"evo_addproduct_type"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"evo_graph_price"}},{"kind":"Field","alias":{"kind":"Name","value":"label"},"name":{"kind":"Name","value":"evo_name"}},{"kind":"Field","alias":{"kind":"Name","value":"value"},"name":{"kind":"Name","value":"evo_addproduct_typeid"}}]}}]} as unknown as DocumentNode<GetInsNsibTypesQuery, GetInsNsibTypesQueryVariables>;
export const GetLeasingWithoutKaskoTypesDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetLeasingWithoutKaskoTypes"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"currentDate"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"DateTime"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"evo_addproduct_types"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"statecode"},"value":{"kind":"IntValue","value":"0"}},{"kind":"Argument","name":{"kind":"Name","value":"evo_product_type"},"value":{"kind":"IntValue","value":"100000007"}},{"kind":"Argument","name":{"kind":"Name","value":"evo_datefrom_param"},"value":{"kind":"ObjectValue","fields":[{"kind":"ObjectField","name":{"kind":"Name","value":"lte"},"value":{"kind":"Variable","name":{"kind":"Name","value":"currentDate"}}}]}},{"kind":"Argument","name":{"kind":"Name","value":"evo_dateto_param"},"value":{"kind":"ObjectValue","fields":[{"kind":"ObjectField","name":{"kind":"Name","value":"gte"},"value":{"kind":"Variable","name":{"kind":"Name","value":"currentDate"}}}]}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"CoreAddProductTypesFields"}},{"kind":"Field","name":{"kind":"Name","value":"evo_product_type"}},{"kind":"Field","name":{"kind":"Name","value":"evo_min_period"}},{"kind":"Field","name":{"kind":"Name","value":"evo_max_period"}},{"kind":"Field","name":{"kind":"Name","value":"evo_min_price"}},{"kind":"Field","name":{"kind":"Name","value":"evo_max_price"}},{"kind":"Field","name":{"kind":"Name","value":"evo_leasingobject_types"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"evo_leasingobject_typeid"}}]}},{"kind":"Field","name":{"kind":"Name","value":"evo_visible_calc"}},{"kind":"Field","name":{"kind":"Name","value":"evo_min_first_payment_perc"}},{"kind":"Field","name":{"kind":"Name","value":"evo_max_first_payment_perc"}},{"kind":"Field","name":{"kind":"Name","value":"evo_models"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"evo_modelid"}}]}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"CoreAddProductTypesFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"evo_addproduct_type"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"evo_graph_price"}},{"kind":"Field","alias":{"kind":"Name","value":"label"},"name":{"kind":"Name","value":"evo_name"}},{"kind":"Field","alias":{"kind":"Name","value":"value"},"name":{"kind":"Name","value":"evo_addproduct_typeid"}}]}}]} as unknown as DocumentNode<GetLeasingWithoutKaskoTypesQuery, GetLeasingWithoutKaskoTypesQueryVariables>;
export const GetInsuranceCompanyDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetInsuranceCompany"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"accountId"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"Uuid"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"account"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"accountid"},"value":{"kind":"Variable","name":{"kind":"Name","value":"accountId"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"evo_osago_with_kasko"}}]}}]}}]} as unknown as DocumentNode<GetInsuranceCompanyQuery, GetInsuranceCompanyQueryVariables>;
export const GetInsuranceCompaniesDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetInsuranceCompanies"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"accounts"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"evo_account_type"},"value":{"kind":"ListValue","values":[{"kind":"IntValue","value":"100000002"}]}},{"kind":"Argument","name":{"kind":"Name","value":"statecode"},"value":{"kind":"IntValue","value":"0"}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"evo_type_ins_policy"}},{"kind":"Field","name":{"kind":"Name","value":"evo_evokasko_access"}},{"kind":"Field","name":{"kind":"Name","value":"evo_inn"}},{"kind":"Field","alias":{"kind":"Name","value":"value"},"name":{"kind":"Name","value":"accountid"}},{"kind":"Field","alias":{"kind":"Name","value":"label"},"name":{"kind":"Name","value":"name"}}]}}]}}]} as unknown as DocumentNode<GetInsuranceCompaniesQuery, GetInsuranceCompaniesQueryVariables>;
export const GetInsuranceCompanyDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetInsuranceCompany"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"accountId"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"Uuid"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"account"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"accountid"},"value":{"kind":"Variable","name":{"kind":"Name","value":"accountId"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"evo_osago_with_kasko"}},{"kind":"Field","name":{"kind":"Name","value":"evo_legal_region_calc"}},{"kind":"Field","name":{"kind":"Name","value":"accountid"}}]}}]}}]} as unknown as DocumentNode<GetInsuranceCompanyQuery, GetInsuranceCompanyQueryVariables>;
export const GetInsuranceCompaniesDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetInsuranceCompanies"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"accounts"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"evo_account_type"},"value":{"kind":"ListValue","values":[{"kind":"IntValue","value":"100000002"}]}},{"kind":"Argument","name":{"kind":"Name","value":"statecode"},"value":{"kind":"IntValue","value":"0"}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"evo_type_ins_policy"}},{"kind":"Field","name":{"kind":"Name","value":"evo_evokasko_access"}},{"kind":"Field","name":{"kind":"Name","value":"evo_inn"}},{"kind":"Field","alias":{"kind":"Name","value":"value"},"name":{"kind":"Name","value":"accountid"}},{"kind":"Field","alias":{"kind":"Name","value":"label"},"name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"evo_id_elt_osago"}},{"kind":"Field","name":{"kind":"Name","value":"evo_id_elt"}},{"kind":"Field","name":{"kind":"Name","value":"evo_id_elt_smr"}}]}}]}}]} as unknown as DocumentNode<GetInsuranceCompaniesQuery, GetInsuranceCompaniesQueryVariables>;
export const GetRolesDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetRoles"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"roleName"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"roles"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"name"},"value":{"kind":"Variable","name":{"kind":"Name","value":"roleName"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"systemusers"},"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":"domainname"}}]}}]}}]}}]} as unknown as DocumentNode<GetRolesQuery, GetRolesQueryVariables>;
export const GetQuoteAddProductDataDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetQuoteAddProductData"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"quoteId"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"Uuid"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"quote"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"quoteId"},"value":{"kind":"Variable","name":{"kind":"Name","value":"quoteId"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"evo_addproduct_types"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"evo_product_type"}},{"kind":"Field","name":{"kind":"Name","value":"evo_addproduct_typeid"}}]}}]}}]}}]} as unknown as DocumentNode<GetQuoteAddProductDataQuery, GetQuoteAddProductDataQueryVariables>;
export const GetQuoteBonusDataDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetQuoteBonusData"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"quoteId"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"Uuid"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"quote"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"quoteId"},"value":{"kind":"Variable","name":{"kind":"Name","value":"quoteId"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"evo_sale_bonus"}}]}}]}}]} as unknown as DocumentNode<GetQuoteBonusDataQuery, GetQuoteBonusDataQueryVariables>;
export const GetQuoteConfiguratorDataDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetQuoteConfiguratorData"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"quoteId"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"Uuid"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"quote"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"quoteId"},"value":{"kind":"Variable","name":{"kind":"Name","value":"quoteId"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"evo_baseproductid"}},{"kind":"Field","name":{"kind":"Name","value":"evo_client_typeid"}},{"kind":"Field","name":{"kind":"Name","value":"evo_msfo_irr"}}]}}]}}]} as unknown as DocumentNode<GetQuoteConfiguratorDataQuery, GetQuoteConfiguratorDataQueryVariables>;
export const GetQuoteCreateKpDataDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetQuoteCreateKPData"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"quoteId"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"Uuid"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"quote"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"quoteId"},"value":{"kind":"Variable","name":{"kind":"Name","value":"quoteId"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"evo_price_with_discount"}},{"kind":"Field","name":{"kind":"Name","value":"evo_price_without_discount_quote"}},{"kind":"Field","name":{"kind":"Name","value":"evo_cost_increace"}},{"kind":"Field","name":{"kind":"Name","value":"evo_insurance"}},{"kind":"Field","name":{"kind":"Name","value":"evo_registration_quote"}},{"kind":"Field","name":{"kind":"Name","value":"evo_card_quote"}},{"kind":"Field","name":{"kind":"Name","value":"evo_nsib_quote"}},{"kind":"Field","name":{"kind":"Name","value":"evo_redemption_graph"}},{"kind":"Field","name":{"kind":"Name","value":"evo_fingap_quote"}},{"kind":"Field","name":{"kind":"Name","value":"evo_contact_name"}},{"kind":"Field","name":{"kind":"Name","value":"evo_gender"}},{"kind":"Field","name":{"kind":"Name","value":"evo_last_payment_redemption"}}]}}]}}]} as unknown as DocumentNode<GetQuoteCreateKpDataQuery, GetQuoteCreateKpDataQueryVariables>;
export const GetQuoteEltDataDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetQuoteEltData"},"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_kasko_accountid"}},{"kind":"Field","name":{"kind":"Name","value":"evo_kasko_price"}},{"kind":"Field","name":{"kind":"Name","value":"evo_id_elt_kasko"}},{"kind":"Field","name":{"kind":"Name","value":"evo_id_kasko_calc"}},{"kind":"Field","name":{"kind":"Name","value":"evo_franchise"}},{"kind":"Field","name":{"kind":"Name","value":"evo_osago_accountid"}},{"kind":"Field","name":{"kind":"Name","value":"evo_id_elt_osago"}},{"kind":"Field","name":{"kind":"Name","value":"evo_osago_price"}},{"kind":"Field","name":{"kind":"Name","value":"evo_leasingobject_typeid"}}]}}]}}]} as unknown as DocumentNode<GetQuoteEltDataQuery, GetQuoteEltDataQueryVariables>;
export const GetQuoteFingapDataDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetQuoteFingapData"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"quoteId"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"Uuid"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"quote"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"quoteId"},"value":{"kind":"Variable","name":{"kind":"Name","value":"quoteId"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"evo_product_risks"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"evo_addproduct_typeid"}}]}}]}}]}}]} as unknown as DocumentNode<GetQuoteFingapDataQuery, GetQuoteFingapDataQueryVariables>;
export const GetFinGapAddProductTypesDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetFinGAPAddProductTypes"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"currentDate"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"DateTime"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"evo_addproduct_types"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"statecode"},"value":{"kind":"IntValue","value":"0"}},{"kind":"Argument","name":{"kind":"Name","value":"evo_datefrom_param"},"value":{"kind":"ObjectValue","fields":[{"kind":"ObjectField","name":{"kind":"Name","value":"lte"},"value":{"kind":"Variable","name":{"kind":"Name","value":"currentDate"}}}]}},{"kind":"Argument","name":{"kind":"Name","value":"evo_dateto_param"},"value":{"kind":"ObjectValue","fields":[{"kind":"ObjectField","name":{"kind":"Name","value":"gte"},"value":{"kind":"Variable","name":{"kind":"Name","value":"currentDate"}}}]}},{"kind":"Argument","name":{"kind":"Name","value":"evo_product_type"},"value":{"kind":"IntValue","value":"100000006"}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"evo_addproduct_typeid"}},{"kind":"Field","name":{"kind":"Name","value":"evo_name"}},{"kind":"Field","name":{"kind":"Name","value":"evo_type_calc_cerebellum"}},{"kind":"Field","name":{"kind":"Name","value":"evo_cost_service_provider_withoutnds"}},{"kind":"Field","name":{"kind":"Name","value":"evo_addproduct_types"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"evo_addproduct_typeid"}}]}}]}}]}}]} as unknown as DocumentNode<GetFinGapAddProductTypesQuery, GetFinGapAddProductTypesQueryVariables>;
export const GetQuoteGibddDataDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetQuoteGibddData"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"quoteId"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"Uuid"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"quote"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"quoteId"},"value":{"kind":"Variable","name":{"kind":"Name","value":"quoteId"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"evo_db_accept_registration"}},{"kind":"Field","name":{"kind":"Name","value":"evo_object_registration"}},{"kind":"Field","name":{"kind":"Name","value":"evo_pts_type"}},{"kind":"Field","name":{"kind":"Name","value":"evo_vehicle_tax_year"}},{"kind":"Field","name":{"kind":"Name","value":"evo_vehicle_tax_approved"}},{"kind":"Field","name":{"kind":"Name","value":"evo_category_tr"}},{"kind":"Field","name":{"kind":"Name","value":"evo_vehicle_type_tax"}},{"kind":"Field","name":{"kind":"Name","value":"evo_regionid"}},{"kind":"Field","name":{"kind":"Name","value":"evo_townid"}},{"kind":"Field","name":{"kind":"Name","value":"evo_legal_regionid"}},{"kind":"Field","name":{"kind":"Name","value":"evo_legal_townid"}},{"kind":"Field","name":{"kind":"Name","value":"evo_registration_regionid"}},{"kind":"Field","name":{"kind":"Name","value":"evo_req_telematic"}},{"kind":"Field","name":{"kind":"Name","value":"evo_req_telematic_accept"}}]}}]}}]} as unknown as DocumentNode<GetQuoteGibddDataQuery, GetQuoteGibddDataQueryVariables>;

View File

@ -1,5 +1,6 @@
import getUrls from '@/config/urls';
import { rest } from 'msw';
const _ = require('radash');
const users = {
@ -12,37 +13,66 @@ const users = {
domain: 'EVOLEASING',
domainName: 'EVOLEASING\\akalinina',
},
vchikalkin: {
username: 'vchikalkin',
displayName: 'Влад Чикалкин',
mail: 'vchikalkin@evoleasing.ru',
domain: 'EVOLEASING',
department: 'IT',
position: 'Старший разработчик',
domainName: 'EVOLEASING\\vchikalkin',
},
// vchikalkin: {
// username: 'vchikalkin',
// displayName: 'Влад Чикалкин',
// mail: 'vchikalkin@evoleasing.ru',
// domain: 'EVOLEASING',
// department: 'IT',
// position: 'Старший разработчик',
// domainName: 'EVOLEASING\\vchikalkin',
// },
};
const { URL_GET_USER, URL_CORE_FINGAP, URL_1C_TRANSTAX } = getUrls();
const { URL_GET_USER, URL_CORE_FINGAP, URL_1C_TRANSTAX, URL_ELT_OSAGO, URL_ELT_KASKO } = getUrls();
export const handlers = [
rest.get(URL_GET_USER, (req, res, ctx) => {
return res(ctx.json(users.akalinina));
}),
rest.post(URL_CORE_FINGAP, (req, res, ctx) => {
return res(
rest.get(URL_GET_USER, (req, res, ctx) => res(ctx.json(users.akalinina))),
rest.post(URL_CORE_FINGAP, (req, res, ctx) => res(
ctx.json({
sum: _.random(100000, 200000),
premium: _.random(1000, 10000),
})
);
}),
rest.post(URL_1C_TRANSTAX, (req, res, ctx) => {
return res(
)),
rest.post(URL_1C_TRANSTAX, (req, res, ctx) => res(
ctx.json({
error: null,
tax: _.random(100000, 200000),
})
)),
rest.post(URL_ELT_OSAGO, async (req, res, ctx) => {
const companyId = (await req.json()).companyIds[0];
return res(
ctx.json({
[companyId]: {
numCalc: _.random(1000000, 3000000),
skCalcId: _.random(50000000, 60000000).toString(),
premiumSum: _.random(10000, 20000),
message: 'OSAGO Message',
},
})
);
}),
rest.post(URL_ELT_KASKO, async (req, res, ctx) => {
const companyId = (await req.json()).companyIds[0];
return res(
ctx.json({
[companyId]: {
requestId: _.random(3000000, 4000000).toString(),
skCalcId: _.random(50000000, 60000000).toString(),
message: 'KASKO Message',
premiumSum: _.random(100000, 200000),
kaskoSum: _.random(100000, 200000),
paymentPeriods: [
{
num: 1,
kaskoSum: _.random(100000, 200000),
},
],
totalFranchise: _.random(20000, 40000),
},
})
);
}),

View File

@ -56,6 +56,14 @@ const nextConfig = {
destination: env.URL_1C_TRANSTAX_DIRECT,
source: urls.URL_1C_TRANSTAX_PROXY,
},
{
destination: env.URL_ELT_KASKO_DIRECT,
source: urls.URL_ELT_KASKO_PROXY,
},
{
destination: env.URL_ELT_OSAGO_DIRECT,
source: urls.URL_ELT_OSAGO_PROXY,
},
...favicons.map((fileName) => buildFaviconRewrite(`/${fileName}`)),
];
},

View File

@ -28,8 +28,14 @@ export function action({ store, trpcClient, apolloClient }: ProcessContext) {
const paymentRelations = toJS($tables.payments.values);
const paymentSums = toJS($tables.payments.sums);
const elt = {
kasko: toJS($tables.elt.kasko.getSelectedRow),
osago: toJS($tables.elt.osago.getSelectedRow),
};
trpcClient.createQuote
.mutate({
elt,
fingap,
insurance: { values: insurance },
payments: { sums: paymentSums, values: paymentRelations },

View File

@ -0,0 +1,66 @@
import type { GetQuoteInputData, GetQuoteProcessData } from '../load-kp/types';
import initializeApollo from '@/apollo/client';
import * as CRMTypes from '@/graphql/crm.types';
import { gql } from '@apollo/client';
// eslint-disable-next-line @typescript-eslint/no-unused-vars
const QUERY_GET_QUOTE_ELT_DATA = gql`
query GetQuoteEltData($quoteId: Uuid!) {
quote(quoteId: $quoteId) {
evo_kasko_accountid
evo_kasko_price
evo_id_elt_kasko
evo_id_kasko_calc
evo_franchise
evo_osago_accountid
evo_id_elt_osago
evo_osago_price
evo_leasingobject_typeid
}
}
`;
export async function getKPData({
values: { quote: quoteId },
}: GetQuoteInputData): Promise<GetQuoteProcessData> {
const apolloClient = initializeApollo();
const {
data: { quote },
} = await apolloClient.query({
query: CRMTypes.GetQuoteEltDataDocument,
variables: {
quoteId,
},
});
const elt: NonNullable<GetQuoteProcessData['elt']> = { kasko: undefined, osago: undefined };
if (
quote?.evo_kasko_accountid &&
quote?.evo_id_elt_kasko &&
quote?.evo_id_kasko_calc &&
quote?.evo_kasko_price &&
quote?.evo_franchise
) {
elt.kasko = {
key: quote?.evo_kasko_accountid,
requestId: quote?.evo_id_elt_kasko,
skCalcId: quote?.evo_id_kasko_calc,
sum: quote?.evo_kasko_price,
totalFranchise: quote?.evo_franchise,
};
}
if (quote?.evo_osago_accountid && quote?.evo_id_elt_osago && quote?.evo_osago_price) {
elt.osago = {
key: quote?.evo_osago_accountid,
numCalc: Number.parseInt(quote?.evo_id_elt_osago, 10),
sum: quote?.evo_osago_price,
};
}
return {
elt,
};
}

View File

@ -0,0 +1,2 @@
export * from './get-kp-data';
export * as reactions from './reactions';

View File

@ -0,0 +1,74 @@
import type { ProcessContext } from '../../types';
import type { Row } from '@/Components/Calculation/Form/ELT/types';
import * as CRMTypes from '@/graphql/crm.types';
export default function helper({
apolloClient,
store,
}: Pick<ProcessContext, 'apolloClient' | 'store'>) {
const { $calculation } = store;
return {
async init() {
const {
data: { accounts },
} = await apolloClient.query({
query: CRMTypes.GetInsuranceCompaniesDocument,
});
let evo_leasingobject_type: CRMTypes.GetLeaseObjectTypeQuery['evo_leasingobject_type'];
const leaseObjectTypeId = $calculation.element('selectLeaseObjectType').getValue();
if (leaseObjectTypeId) {
const { data } = await apolloClient.query({
query: CRMTypes.GetLeaseObjectTypeDocument,
variables: {
leaseObjectTypeId,
},
});
({ evo_leasingobject_type } = data);
}
return {
kasko: (accounts
?.filter((x) =>
x?.evo_type_ins_policy?.includes(100_000_000) &&
evo_leasingobject_type?.evo_id &&
['6', '9', '10'].includes(evo_leasingobject_type?.evo_id)
? Boolean(x.evo_id_elt_smr)
: Boolean(x?.evo_id_elt)
)
.map((x) => ({
id:
evo_leasingobject_type?.evo_id &&
['6', '9', '10'].includes(evo_leasingobject_type?.evo_id)
? x?.evo_id_elt_smr
: x?.evo_id_elt,
key: x?.value,
message: null,
name: x?.label,
numCalc: 0,
requestId: '',
skCalcId: '',
status: null,
sum: 0,
totalFranchise: 0,
})) || []) as Row[],
osago: (accounts
?.filter((x) => x?.evo_type_ins_policy?.includes(100_000_001) && x?.evo_id_elt_osago)
.map((x) => ({
id: x?.evo_id_elt_osago,
key: x?.value,
message: null,
name: x?.label,
numCalc: 0,
requestId: '',
skCalcId: '',
status: null,
sum: 0,
totalFranchise: 0,
})) || []) as Row[],
};
},
};
}

View File

@ -0,0 +1,82 @@
import type { ProcessContext } from '../../types';
import helper from '../lib/helper';
import { disposableReaction } from '@/utils/mobx';
import { comparer, toJS } from 'mobx';
export default function reactions(context: ProcessContext) {
const { store } = context;
const { $calculation, $tables, $process } = store;
const { init } = helper(context);
disposableReaction(
() => $process.has('ELT') || $process.has('LoadKP'),
() => ({
values: $calculation.$values.getValues([
'leaseObjectType',
// osago
'townRegistration',
'legalClientTown',
'legalClientRegion',
'objectRegistration',
'townRegistration',
// kasko
'lead',
'opportunity',
'leaseObjectUseFor',
'leaseObjectCategory',
'insDecentral',
'leasingWithoutKasko',
'insAgeDrivers',
'insExpDrivers',
'vin',
]),
}),
async () => {
const initialValues = await init();
if (initialValues) {
$tables.elt.kasko.setRows(initialValues.kasko);
$tables.elt.osago.setRows(initialValues.osago);
}
},
{
delay: 10,
equals: comparer.shallow,
fireImmediately: true,
}
);
disposableReaction(
() => $process.has('ELT') || $process.has('LoadKP'),
() => {
const { insCost, insuranceCompany } = toJS($tables.insurance.row('kasko').getValues());
const insFranchise = $calculation.element('tbxInsFranchise').getValue();
return { insCost, insFranchise, insuranceCompany };
},
() => {
$tables.elt.kasko.resetSelectedKey();
},
{
delay: 10,
equals: comparer.shallow,
}
);
disposableReaction(
() => $process.has('ELT') || $process.has('LoadKP'),
() => {
const { insCost, insuranceCompany } = toJS($tables.insurance.row('osago').getValues());
return { insCost, insuranceCompany };
},
() => {
$tables.elt.osago.resetSelectedKey();
},
{
delay: 10,
equals: comparer.shallow,
}
);
}

View File

@ -0,0 +1,2 @@
export { default as common } from './common';
export * from './validation';

View File

@ -0,0 +1,4 @@
import { createValidationSchema } from '../validation';
import { createValidationReaction } from '@/process/tools';
export const validation = createValidationReaction(createValidationSchema);

View File

@ -0,0 +1,182 @@
/* eslint-disable sonarjs/cognitive-complexity */
/* eslint-disable complexity */
import type { ValidationContext } from '../types';
import ValuesSchema from '@/config/schema/values';
import * as CRMTypes from '@/graphql/crm.types';
import { z } from 'zod';
export function createValidationSchema({ apolloClient }: ValidationContext) {
return ValuesSchema.pick({
insDecentral: true,
lead: true,
leaseObjectCategory: true,
leaseObjectType: true,
leaseObjectUseFor: true,
leasingWithoutKasko: true,
legalClientRegion: true,
objectRegistration: true,
opportunity: true,
townRegistration: true,
}).superRefine(
async (
{
insDecentral,
leaseObjectCategory,
leaseObjectType: leaseObjectTypeId,
leaseObjectUseFor,
leasingWithoutKasko,
legalClientRegion,
townRegistration,
lead: leadid,
opportunity: opportunityid,
objectRegistration,
},
ctx
) => {
if (leaseObjectTypeId) {
const {
data: { evo_leasingobject_type },
} = await apolloClient.query({
query: CRMTypes.GetLeaseObjectTypeDocument,
variables: {
leaseObjectTypeId,
},
});
// Проверяем на мотоцикл
if (evo_leasingobject_type?.evo_id && ['11'].includes(evo_leasingobject_type?.evo_id)) {
ctx.addIssue({
code: z.ZodIssueCode.custom,
message:
'По данному Типу предмета лизинга возможен только индивидуальный запрос тарифов КАСКО и ОСАГО. Просьба обратиться на адрес strakhovka@evoleasing.ru',
path: ['eltKasko', 'eltOsago'],
});
}
if (
evo_leasingobject_type?.evo_id &&
!['1', '2', '3', '6', '7', '8', '9', '10'].includes(evo_leasingobject_type?.evo_id)
) {
ctx.addIssue({
code: z.ZodIssueCode.custom,
message: 'Для выбранной категории ТС расчет в ЭЛТ недоступен',
path: ['eltKasko', 'eltOsago'],
});
}
}
if (
leaseObjectUseFor &&
[100_000_001, 100_000_002, 100_000_003, 100_000_004, 100_000_006].includes(
leaseObjectUseFor
)
) {
ctx.addIssue({
code: z.ZodIssueCode.custom,
message:
'По данной цели использования возможен только индивидуальный запрос тарифов КАСКО и ОСАГО. Просьба обратиться на адрес strakhovka@evoleasing.ru',
path: ['eltKasko'],
});
}
if (objectRegistration === 100_000_000 && !legalClientRegion) {
ctx.addIssue({
code: z.ZodIssueCode.custom,
message: 'Не указан Регион по юр.адресу клиента',
path: ['eltKasko'],
});
}
if (objectRegistration === 100_000_001 && !townRegistration) {
ctx.addIssue({
code: z.ZodIssueCode.custom,
message: 'Не указан Город регистрации',
path: ['eltOsago'],
});
}
if (!leaseObjectCategory && leaseObjectTypeId) {
const {
data: { evo_leasingobject_type },
} = await apolloClient.query({
query: CRMTypes.GetLeaseObjectTypeDocument,
variables: {
leaseObjectTypeId,
},
});
if (
evo_leasingobject_type?.evo_id &&
!['6', '9', '10'].includes(evo_leasingobject_type?.evo_id)
) {
ctx.addIssue({
code: z.ZodIssueCode.custom,
message: 'Не указана категория ТС',
path: ['eltKasko'],
});
}
}
if (insDecentral) {
ctx.addIssue({
code: z.ZodIssueCode.custom,
message: 'Децентрализованное страхование не может быть расчитано в ЭЛТ',
path: ['eltKasko'],
});
}
if (leasingWithoutKasko) {
ctx.addIssue({
code: z.ZodIssueCode.custom,
message:
'Вы осуществляете расчет с Лизинг без КАСКО, расчет ЭЛТ в данном случае не требуется',
path: ['eltKasko'],
});
}
let okved: string | null | undefined;
if (leadid) {
const {
data: { lead },
} = await apolloClient.query({
query: CRMTypes.GetLeadDocument,
variables: { leadid },
});
okved = lead?.accountidData?.evo_okved;
}
if (!okved && opportunityid) {
const {
data: { opportunity },
} = await apolloClient.query({
query: CRMTypes.GetOpportunityDocument,
variables: { opportunityid },
});
okved = opportunity?.accountidData?.evo_okved;
}
if (
okved &&
[
'77.3',
'49.32',
'49.39',
'49.3',
'49.31',
'49.31.2',
'53.20.3',
'53.20.32',
'77.11',
].includes(okved)
) {
ctx.addIssue({
code: z.ZodIssueCode.custom,
message:
'По данному ОКВЭД Контрагента возможен только индивидуальный запрос тарифов КАСКО/ОСАГО. Просьба обратиться на адрес strakhovka@evoleasing.ru',
path: ['eltKasko'],
});
}
}
);
}

View File

@ -5,6 +5,7 @@ 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 elt from '@/process/elt';
import * as fingap from '@/process/fingap';
import * as gibdd from '@/process/gibdd';
import * as insurance from '@/process/insurance';
@ -55,4 +56,5 @@ export function useReactions(config: Config) {
useProcess(addProduct, config);
useProcess(insurance, config);
useProcess(recalc, config);
useProcess(elt, config);
}

View File

@ -1,3 +1,5 @@
/* eslint-disable sonarjs/cognitive-complexity */
import eltHelper from '../elt/lib/helper';
import type { ProcessContext } from '@/process/types';
import { reaction } from 'mobx';
import { omit } from 'radash';
@ -5,9 +7,11 @@ import { message } from 'ui/elements';
const key = 'KP_LOADING_INFO';
export function common({ store, trpcClient }: ProcessContext) {
export function common({ store, trpcClient, apolloClient }: ProcessContext) {
const { $calculation, $process, $tables } = store;
const { init: initElt } = eltHelper({ apolloClient, store });
reaction(
() => $calculation.$values.getValue('quote'),
() => {
@ -29,7 +33,7 @@ export function common({ store, trpcClient }: ProcessContext) {
...$calculation.$values.getValues(['lead', 'opportunity', 'recalcWithRevision']),
},
})
.then(({ values, payments, insurance, fingap }) => {
.then(({ values, payments, insurance, fingap, elt }) => {
$calculation.$values.setValues(
omit(values, [
'lead',
@ -59,6 +63,22 @@ export function common({ store, trpcClient }: ProcessContext) {
if (fingap) $tables.fingap.setSelectedKeys(fingap.keys);
initElt().then((initialValues) => {
if (initialValues) {
$tables.elt.kasko.setRows(initialValues.kasko);
$tables.elt.osago.setRows(initialValues.osago);
}
if (elt?.kasko) {
$tables.elt.kasko.setRow(elt.kasko);
$tables.elt.kasko.setSelectedKey(elt.kasko.key);
}
if (elt?.osago) {
$tables.elt.osago.setRow(elt.osago);
$tables.elt.osago.setSelectedKey(elt.osago.key);
}
});
message.success({
content: `КП ${quote.label} загружено`,
key,

View File

@ -52,13 +52,21 @@ export function createValidationReaction<T extends ZodTypeAny>(
if (validationResult.success === false) {
validationResult.error.errors.forEach(({ path, message }) => {
(path as Array<Elements & ('insurance' | 'payments')>).forEach((elementName) => {
(
path as Array<Elements & ('eltKasko' | 'eltOsago' | 'insurance' | 'payments')>
).forEach((elementName) => {
if (elementName === 'insurance') {
const removeError = $tables.insurance.setError({ key, message });
if (removeError) helper.add(removeError);
} else if (elementName === 'payments') {
const removeError = $tables.payments.setError({ key, message });
if (removeError) helper.add(removeError);
} else if (elementName === 'eltOsago') {
const removeError = $tables.elt.osago.validation.setError({ key, message });
if (removeError) helper.add(removeError);
} else if (elementName === 'eltKasko') {
const removeError = $tables.elt.kasko.validation.setError({ key, message });
if (removeError) helper.add(removeError);
} else {
const removeError = $calculation.element(elementName).setError({ key, message });
if (removeError) helper.add(removeError);

View File

@ -24,6 +24,7 @@ import * as addProduct from '@/process/add-product';
import * as bonuses from '@/process/bonuses';
import * as configurator from '@/process/configurator';
import * as createKpProcess from '@/process/create-kp';
import * as eltProcess from '@/process/elt';
import * as fingapProcess from '@/process/fingap';
import * as gibdd from '@/process/gibdd';
import * as insuranceProcess from '@/process/insurance';
@ -69,6 +70,7 @@ export const quoteRouter = router({
insuranceProcess,
addProduct,
createKpProcess,
eltProcess,
].map(({ getKPData }) => getKPData(input))
);
@ -76,12 +78,14 @@ export const quoteRouter = router({
const payments = processData.find((x) => x.payments)?.payments ?? defaultPayments;
const insurance = processData.find((x) => x.insurance)?.insurance ?? defaultInsurance;
const fingap = processData.find((x) => x.fingap)?.fingap ?? defaultFingap;
const elt = processData.find((x) => x.elt)?.elt;
return {
values,
payments,
insurance,
fingap,
elt,
};
}),
@ -144,6 +148,7 @@ export const quoteRouter = router({
preparedPayments: requestData.preparedPayments,
additionalData: requestData.additionalData,
},
elt: input.elt,
});
const createKPResult = await createKP(requestCreateKP);

View File

@ -1,5 +1,6 @@
/* eslint-disable zod/require-strict */
import { CalculateInputSchema } from '../calculate/types';
import { RowSchema as EltRowSchema } from '@/config/schema/elt';
import { RiskSchema } from '@/config/schema/fingap';
import { KeysSchema, RowSchema } from '@/config/schema/insurance';
import PaymentsSchema from '@/config/schema/payments';
@ -33,6 +34,22 @@ const InsuranceSchema = z.object({
export const GetQuoteOutputDataSchema = z
.object({
elt: z
.object({
kasko: EltRowSchema.pick({
key: true,
requestId: true,
skCalcId: true,
sum: true,
totalFranchise: true,
}).optional(),
osago: EltRowSchema.pick({
key: true,
numCalc: true,
sum: true,
}).optional(),
})
.optional(),
fingap: FinGAPSchema,
insurance: InsuranceSchema,
payments: PaymentsSchema,
@ -53,6 +70,10 @@ export const GetQuoteProcessDataSchema = GetQuoteOutputDataSchema.omit({
export type GetQuoteProcessData = z.infer<typeof GetQuoteProcessDataSchema>;
export const CreateQuoteInputDataSchema = CalculateInputSchema.extend({
elt: z.object({
kasko: EltRowSchema.optional(),
osago: EltRowSchema.optional(),
}),
fingap: RiskSchema.array(),
});

View File

@ -0,0 +1,29 @@
import PolicyStore from './policy';
import type RootStore from '@/stores/root';
export default class ELTStore {
public kasko: PolicyStore;
public osago: PolicyStore;
constructor(rootStore: RootStore) {
this.kasko = new PolicyStore({
rootStore,
validationConfig: {
err_key: 'ERR_ELT_KASKO',
err_title: 'ЭЛТ КАСКО',
},
});
this.osago = new PolicyStore({
rootStore,
validationConfig: {
err_key: 'ERR_ELT_OSAGO',
err_title: 'ЭЛТ ОСАГО',
},
});
}
public reset = () => {
this.kasko.reset();
this.osago.reset();
};
}

View File

@ -0,0 +1,80 @@
import type RootStore from '../../root';
import Validation from '../../validation';
import type { ValidationConfig } from '../../validation/types';
import type * as ELT from '@/Components/Calculation/Form/ELT/types';
import type { IObservableArray } from 'mobx';
import { makeAutoObservable, observable, reaction, toJS } from 'mobx';
import { notification } from 'ui/elements';
type ConstructorInput = {
rootStore: RootStore;
validationConfig: ValidationConfig;
};
export default class PolicyStore {
private root: RootStore;
public validation: Validation;
private rows: IObservableArray<ELT.Row>;
private selectedKey: string | null = null;
constructor({ rootStore, validationConfig }: ConstructorInput) {
this.rows = observable<ELT.Row>([]);
makeAutoObservable(this);
this.validation = new Validation(validationConfig, rootStore);
this.root = rootStore;
reaction(
() => toJS(this.rows),
() => {
this.resetSelectedKey();
}
);
reaction(
() => this.selectedKey,
(selectedKey) => {
if (!selectedKey) {
notification.open({
description: 'Расчеты ЭЛТ были сброшены',
key: validationConfig.err_key,
message: validationConfig.err_title,
type: 'warning',
});
}
}
);
}
public setRows = (rows: ELT.Row[]) => {
this.rows.replace(rows);
};
public setRow = (row: Partial<ELT.Row> & Pick<ELT.Row, 'key'>) => {
const index = this.rows.findIndex((x) => x.key === row.key);
if (index >= 0) this.rows[index] = { ...this.rows[index], ...row };
};
public get getRows() {
return toJS(this.rows);
}
public get hasErrors() {
return this.validation.hasErrors;
}
public setSelectedKey = (key: string) => {
this.selectedKey = key;
};
public resetSelectedKey = () => {
if (this.setSelectedKey !== null) this.selectedKey = null;
};
public get getSelectedRow() {
return this.rows.find((x) => x.key === this.selectedKey);
}
public reset = () => {
this.rows.clear();
};
}

View File

@ -1,3 +1,4 @@
import ELTStore from './elt';
import FinGAPTable from './fingap';
import InsuranceTable from './insurance';
import PaymentsTable from './payments';
@ -7,10 +8,12 @@ export default class TablesStore {
public payments: PaymentsTable;
public insurance: InsuranceTable;
public fingap: FinGAPTable;
public elt: ELTStore;
constructor(rootStore: RootStore) {
this.payments = new PaymentsTable(rootStore);
this.insurance = new InsuranceTable(rootStore);
this.fingap = new FinGAPTable(rootStore);
this.elt = new ELTStore(rootStore);
}
}