process/init: добавили addproducttypes
This commit is contained in:
parent
a569586052
commit
9a4f9d8323
20
process/init/__generated__/GetAddproductTypes.ts
generated
Normal file
20
process/init/__generated__/GetAddproductTypes.ts
generated
Normal file
@ -0,0 +1,20 @@
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
// @generated
|
||||
// This file was automatically generated and should not be edited.
|
||||
|
||||
// ====================================================
|
||||
// GraphQL query operation: GetAddproductTypes
|
||||
// ====================================================
|
||||
|
||||
export interface GetAddproductTypes_evo_addproduct_types {
|
||||
__typename: "evo_addproduct_type";
|
||||
label: string | null;
|
||||
value: any | null;
|
||||
evo_graph_price: any | null;
|
||||
evo_product_type: number | null;
|
||||
}
|
||||
|
||||
export interface GetAddproductTypes {
|
||||
evo_addproduct_types: (GetAddproductTypes_evo_addproduct_types | null)[] | null;
|
||||
}
|
||||
@ -6,6 +6,7 @@ import utc from 'dayjs/plugin/utc';
|
||||
import { getDomainName } from 'services/user/tools';
|
||||
import type { User } from 'services/user/types';
|
||||
import { normalizeOptions } from 'tools/entity';
|
||||
import type { GetAddproductTypes } from './__generated__/GetAddproductTypes';
|
||||
import type { GetInsuranceData } from './__generated__/GetInsuranceData';
|
||||
import type { GetMainOptions } from './__generated__/GetMainOptions';
|
||||
import type { GetOwnerData, GetOwnerDataVariables } from './__generated__/GetOwnerData';
|
||||
@ -85,6 +86,17 @@ const QUERY_GET_REGIONS = gql`
|
||||
}
|
||||
`;
|
||||
|
||||
const QUERY_GET_ADDPRODUCT_TYPES = gql`
|
||||
query GetAddproductTypes {
|
||||
evo_addproduct_types(statecode: 0) {
|
||||
label: evo_name
|
||||
value: evo_addproduct_typeid
|
||||
evo_graph_price
|
||||
evo_product_type
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
const QUERY_GET_INSURANCE_DATA = gql`
|
||||
query GetInsuranceData($evo_account_type: [Int!]) {
|
||||
osago: accounts(
|
||||
@ -175,6 +187,30 @@ export async function getCRMData(apolloClient: ApolloClient<NormalizedCache>, us
|
||||
const selectObjectRegionRegistration = regions.evo_regions;
|
||||
const selectLegalClientRegion = regions.evo_regions;
|
||||
|
||||
const { data: addproductTypes } = await apolloClient.query<GetAddproductTypes>({
|
||||
query: QUERY_GET_ADDPRODUCT_TYPES,
|
||||
});
|
||||
|
||||
const selectRegistration = addproductTypes.evo_addproduct_types?.filter(
|
||||
(x) => x?.evo_product_type === 100_000_001
|
||||
);
|
||||
|
||||
const selectTechnicalCard = addproductTypes.evo_addproduct_types?.filter(
|
||||
(x) => x?.evo_product_type === 100_000_000
|
||||
);
|
||||
|
||||
const selectTelematic = addproductTypes.evo_addproduct_types?.filter(
|
||||
(x) => x?.evo_product_type === 100_000_004
|
||||
);
|
||||
|
||||
const selectTracker = addproductTypes.evo_addproduct_types?.filter(
|
||||
(x) => x?.evo_product_type === 100_000_003
|
||||
);
|
||||
|
||||
const selectNSIB = addproductTypes.evo_addproduct_types?.filter(
|
||||
(x) => x?.evo_product_type === 100_000_002
|
||||
);
|
||||
|
||||
return {
|
||||
options: {
|
||||
selectLead,
|
||||
@ -185,6 +221,11 @@ export async function getCRMData(apolloClient: ApolloClient<NormalizedCache>, us
|
||||
selectRegionRegistration,
|
||||
selectObjectRegionRegistration,
|
||||
selectLegalClientRegion,
|
||||
selectRegistration,
|
||||
selectTechnicalCard,
|
||||
selectTelematic,
|
||||
selectTracker,
|
||||
selectNSIB,
|
||||
},
|
||||
tables: {
|
||||
insurance: insuranceData,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user