В разделе ELT в таблицу "ОСАГО" добавить изменения в формирование списка СК - должны отображаться записи Контрагентов, у которых "Тип полиса" evo_type_ins_policy содержит "ОСАГО" 100 000 001 И ("ID Наш расчет ОСАГО" evo_osago_id содержит данные или "ID ELT ОСАГО" evo_id_elt_osago содержит данные).

В массив записей надо добавить признак "metodCalc", который заполняется следующим образом:

если в Контрагенте поле "ID ELT ОСАГО"  evo_id_elt_osago содержит данные, то указывается "ELT"
если в Контрагенте поле "ID Наш расчет ОСАГО" evo_osago_id  содержит данные, то указывается "CRM"
иначе указывается null
    "osago": {
      "id": "YUGORIA",
      "key": "a48b3d07-7b40-eb11-bae6-00155d088a12",
      "message": "",
      "name": "ГСК ЮГОРИЯ",
      "numCalc": 3890624,
      "requestId": "",
      "skCalcId": "0",
      "status": null,
      "sum": 28243.98,
      "totalFranchise": 0

       "methodCalc": CRM

В момент нажатия кнопки "Расчет ОСАГО по ELT" (отдельную кнопку не делаем, т.к. проверки на расчет ЕЛТ должны и тут действовать) необходимо добавить развилку:

если у записи "metodCalc": ELT, то отправляется запрос в ELT по текущей логике
если у записи "metodCalc": CRM, то ищется запись Типа дополнительных продуктов evo_addproduct_type, у которой:
"Статус" statecode = активная

И "Тип продукта" evo_product_type = ОСАГО 100 000 008

И "Отображать для расчета в ЛК" evo_visible_calc = Да

И "Провайдер услуг"  evo_accountid = "key" данной записи

И "Начало действия" evo_datefrom меньше или равно текущей даты

И "Окончание действия" evo_dateto больше или равно текущей даты

И "Категория ТС" evo_category = значению из поля Категория ТС на форме (значение "Не выбрано" на форме должно быть равно "пусто" в поле карточки)

И "Min мощность, л.с." evo_min_power меньше или равна значению из поля Мощность на форме

И "Max мощность, л.с." evo_max_power больше или равна значению из поля Мощность на форме

И "Min количество мест" evo_min_seats_count меньше или равна значению из поля Количество мест на форме

И "Max количество мест" evo_max_seats_count если больше или равна значению из поля Количество мест на форме

И "Min Разрешенная макс.масса, кг" evo_min_mass меньше или равна значению из поля Разрешенная макс.масса на форме

И "Max Разрешенная макс.масса, кг" evo_max_mass больше или равна значению из поля Разрешенная макс.масса на форме

Если найдена одна запись,то в массиве записываются  значения:

"numCalc" = значение поля evo_addproduct_type.evo_id ID,
"sum"= evo_addproduct_type.evo_graph_price_withoutnds Стоимость (закладываем в график), без НДС, руб.,
"totalFranchise" = 0
Если не найдена такая запись, то в массиве записываются  значения:

"numCalc" = null,
"sum"= 0.00,
"totalFranchise" = 0
Если найдено несколько записей, то берем последнюю по дате создания и по ней записываем в массив значения:

"numCalc" = значение поля evo_addproduct_type.evo_id ID,
"sum"= evo_addproduct_type.evo_graph_price_withoutnds Стоимость (закладываем в график), без НДС, руб.,
"totalFranchise" = 0
This commit is contained in:
vchikalkin 2024-03-26 11:14:03 +03:00
parent a0e6c4ff2f
commit 8836b358c2
7 changed files with 5193 additions and 162 deletions

View File

@ -1,7 +1,8 @@
/* eslint-disable no-negated-condition */
/* eslint-disable sonarjs/cognitive-complexity */
import { PolicyTable, ReloadButton, Validation } from './Components';
import { columns } from './lib/config';
import { makeEltOsagoRequest } from './lib/make-request';
import { makeEltOsagoRequest, makeOwnOsagoRequest } from './lib/make-request';
import type { Row, StoreSelector } from './types';
import { getEltOsago } from '@/api/elt/query';
import { MAX_INSURANCE, MIN_INSURANCE } from '@/constants/values';
@ -40,56 +41,83 @@ export const Osago = observer(() => {
.getOptions('insuranceCompany')
.map((x) => x.value)
);
osagoCompanyIds.forEach((key) => {
const row = $tables.elt.osago.getRow(key);
if (row) {
row.status = 'fetching';
$tables.elt.osago.setRow(row);
makeEltOsagoRequest({ apolloClient, store }, row)
.then((payload) =>
getEltOsago(payload, { signal: $tables.elt.osago.abortController.signal })
)
.then((res) => {
if (res) {
const { numCalc, premiumSum = 0, message, skCalcId } = res;
let { error } = res;
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)}`;
}
if (row.metodCalc === 'CRM') {
makeOwnOsagoRequest({ apolloClient, store }, row).then((res) => {
if (!res) {
$tables.elt.osago.setRow({
key,
message: error || message,
numCalc,
skCalcId,
status: error ? 'error' : null,
sum: premiumSum,
message:
'Для получения расчета ОСАГО следует использовать калькулятор ЭЛТ или Индивидуальный запрос',
numCalc: undefined,
skCalcId: undefined,
status: 'error',
sum: 0,
totalFranchise: 0,
});
} else {
$tables.elt.osago.setRow({
key,
message: null,
numCalc: res.evo_id || undefined,
status: null,
sum: res.evo_graph_price_withoutnds || undefined,
});
}
})
.catch((error) => {
const _err = error as Error;
$tables.elt.osago.setRow({
...initialData,
key,
message: _err.message || String(error),
status: 'error',
});
});
} else {
makeEltOsagoRequest({ apolloClient, store }, row)
.then((payload) =>
getEltOsago(payload, { signal: $tables.elt.osago.abortController.signal })
)
.then((res) => {
if (res) {
const { message, numCalc, premiumSum = 0, skCalcId } = res;
let { error } = res;
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) => {
const _err = error as Error;
$tables.elt.osago.setRow({
...initialData,
key,
message: _err.message || String(error),
status: 'error',
});
});
}
}
});
}, [$tables.elt.osago, $tables.insurance, apolloClient, init, store]);

View File

@ -4,7 +4,56 @@ 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 { getCurrentISODate } from '@/utils/date';
import dayjs from 'dayjs';
import { first, sort } from 'radash';
export async function makeOwnOsagoRequest(
{ store, apolloClient }: Pick<ProcessContext, 'apolloClient' | 'store'>,
row: Row
): Promise<NonNullable<CRMTypes.GetOsagoAddproductTypesQuery['evo_addproduct_types']>[number]> {
const currentDate = getCurrentISODate();
const {
data: { evo_addproduct_types },
} = await apolloClient.query({
query: CRMTypes.GetOsagoAddproductTypesDocument,
variables: { currentDate },
});
if (!evo_addproduct_types) return null;
const { leaseObjectCategory, leaseObjectMotorPower, countSeats, maxMass } =
store.$calculation.$values.getValues([
'leaseObjectCategory',
'leaseObjectMotorPower',
'countSeats',
'maxMass',
]);
const filteredTypes = evo_addproduct_types.filter(
(type) =>
type?.evo_accountid === row.key &&
type.evo_visible_calc &&
type.evo_category === leaseObjectCategory &&
type.evo_min_power !== null &&
type.evo_max_power !== null &&
type.evo_min_power <= leaseObjectMotorPower &&
type.evo_max_power >= leaseObjectMotorPower &&
type.evo_min_seats_count !== null &&
type.evo_max_seats_count !== null &&
type.evo_min_seats_count <= countSeats &&
type.evo_max_seats_count >= countSeats &&
type.evo_min_mass !== null &&
type.evo_max_mass !== null &&
type.evo_min_mass <= maxMass &&
type.evo_max_mass >= maxMass
);
const sortedTypes = sort(filteredTypes, (type) => dayjs(type?.createdon).date());
return first(sortedTypes) || null;
}
const getSpecified = (value: unknown) => value !== null && value !== undefined;

View File

@ -272,8 +272,9 @@ export const RowSchema = z.object({
id: z.string(),
key: z.string(),
message: z.string().nullable(),
metodCalc: z.union([z.literal('CRM'), z.literal('ELT')]),
name: z.string(),
numCalc: z.number(),
numCalc: z.number().or(z.string()),
requestId: z.string(),
skCalcId: z.string(),
status: z.string().nullable(),

View File

@ -847,6 +847,29 @@ query GetLeasingWithoutKaskoTypes($currentDate: DateTime) {
}
}
query GetOsagoAddproductTypes($currentDate: DateTime) {
evo_addproduct_types(
statecode: 0
evo_product_type: 100000008
evo_datefrom_param: { lte: $currentDate }
evo_dateto_param: { gte: $currentDate }
) {
evo_product_type
evo_visible_calc
evo_accountid
createdon
evo_category
evo_min_power
evo_max_power
evo_min_seats_count
evo_max_seats_count
evo_min_mass
evo_max_mass
evo_graph_price_withoutnds
evo_id
}
}
query GetInsuranceCompany($accountId: Uuid!) {
account(accountid: $accountId) {
evo_osago_with_kasko
@ -865,6 +888,7 @@ query GetInsuranceCompanies {
evo_id_elt_osago
evo_id_elt
evo_id_elt_smr
evo_osago_id
}
}

File diff suppressed because it is too large Load Diff

View File

@ -443,6 +443,13 @@ export type GetLeasingWithoutKaskoTypesQueryVariables = Exact<{
export type GetLeasingWithoutKaskoTypesQuery = { __typename?: 'Query', evo_addproduct_types: Array<{ __typename?: 'evo_addproduct_type', evo_product_type: number | null, evo_min_period: number | null, evo_max_period: number | null, evo_min_price: number | null, evo_max_price: number | null, evo_visible_calc: boolean | null, evo_min_first_payment_perc: number | null, evo_max_first_payment_perc: number | null, evo_graph_price: number | null, label: string | null, value: string | null, evo_leasingobject_types: Array<{ __typename?: 'evo_leasingobject_type', evo_leasingobject_typeid: string | null } | null> | null, evo_models: Array<{ __typename?: 'evo_model', evo_modelid: string | null } | null> | null } | null> | null };
export type GetOsagoAddproductTypesQueryVariables = Exact<{
currentDate: InputMaybe<Scalars['DateTime']['input']>;
}>;
export type GetOsagoAddproductTypesQuery = { __typename?: 'Query', evo_addproduct_types: Array<{ __typename?: 'evo_addproduct_type', evo_product_type: number | null, evo_visible_calc: boolean | null, evo_accountid: string | null, createdon: string | null, evo_category: number | null, evo_min_power: number | null, evo_max_power: number | null, evo_min_seats_count: number | null, evo_max_seats_count: number | null, evo_min_mass: number | null, evo_max_mass: number | null, evo_graph_price_withoutnds: number | null, evo_id: string | null } | null> | null };
export type GetInsuranceCompanyQueryVariables = Exact<{
accountId: Scalars['Uuid']['input'];
}>;
@ -453,7 +460,7 @@ export type GetInsuranceCompanyQuery = { __typename?: 'Query', account: { __type
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, 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 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, evo_osago_id: string | null, value: string | null, label: string | null } | null> | null };
export type GetRolesQueryVariables = Exact<{
roleName: InputMaybe<Scalars['String']['input']>;
@ -515,6 +522,7 @@ 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 GetOsagoAddproductTypesDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetOsagoAddproductTypes"},"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":"100000008"}},{"kind":"Argument","name":{"kind":"Name","value":"evo_datefrom_param"},"value":{"kind":"ObjectValue","fields":[{"kind":"ObjectField","name":{"kind":"Name","value":"lte"},"value":{"kind":"Variable","name":{"kind":"Name","value":"currentDate"}}}]}},{"kind":"Argument","name":{"kind":"Name","value":"evo_dateto_param"},"value":{"kind":"ObjectValue","fields":[{"kind":"ObjectField","name":{"kind":"Name","value":"gte"},"value":{"kind":"Variable","name":{"kind":"Name","value":"currentDate"}}}]}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"evo_product_type"}},{"kind":"Field","name":{"kind":"Name","value":"evo_visible_calc"}},{"kind":"Field","name":{"kind":"Name","value":"evo_accountid"}},{"kind":"Field","name":{"kind":"Name","value":"createdon"}},{"kind":"Field","name":{"kind":"Name","value":"evo_category"}},{"kind":"Field","name":{"kind":"Name","value":"evo_min_power"}},{"kind":"Field","name":{"kind":"Name","value":"evo_max_power"}},{"kind":"Field","name":{"kind":"Name","value":"evo_min_seats_count"}},{"kind":"Field","name":{"kind":"Name","value":"evo_max_seats_count"}},{"kind":"Field","name":{"kind":"Name","value":"evo_min_mass"}},{"kind":"Field","name":{"kind":"Name","value":"evo_max_mass"}},{"kind":"Field","name":{"kind":"Name","value":"evo_graph_price_withoutnds"}},{"kind":"Field","name":{"kind":"Name","value":"evo_id"}}]}}]}}]} as unknown as DocumentNode<GetOsagoAddproductTypesQuery, GetOsagoAddproductTypesQueryVariables>;
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 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"}},{"kind":"Field","name":{"kind":"Name","value":"evo_osago_id"}}]}}]}}]} 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>;

View File

@ -50,11 +50,16 @@ export default function helper({
name: x?.label,
})) || []) as Row[],
osago: (accounts
?.filter((x) => x?.evo_type_ins_policy?.includes(100_000_001) && x?.evo_id_elt_osago)
?.filter(
(x) =>
x?.evo_type_ins_policy?.includes(100_000_001) &&
(x?.evo_id_elt_osago || x.evo_osago_id)
)
.map((x) => ({
...defaultRow,
id: x?.evo_id_elt_osago,
id: x?.evo_id_elt_osago || x?.evo_osago_id,
key: x?.value,
metodCalc: x?.evo_osago_id ? 'CRM' : 'ELT',
name: x?.label,
})) || []) as Row[],
};