Compare commits
55 Commits
dev
...
release/dy
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5d2fddade4 | ||
|
|
c2e383256f | ||
|
|
5eb0639fbe | ||
|
|
6e9dfb547e | ||
|
|
ac76f7dcdb | ||
|
|
192bb089a0 | ||
|
|
dcf93644c8 | ||
|
|
2ea1b1bd69 | ||
|
|
e9ca1cc752 | ||
|
|
3661b468d5 | ||
|
|
29fdb70509 | ||
|
|
65b4c95779 | ||
|
|
42beeb4a84 | ||
|
|
6818adf1bd | ||
|
|
b96cc16be3 | ||
|
|
decabd6157 | ||
|
|
d8c3bcdd17 | ||
|
|
7664e71506 | ||
|
|
f5890c94b2 | ||
|
|
b99cad781e | ||
|
|
d0856f95af | ||
|
|
7349478fe9 | ||
|
|
359a9d4921 | ||
|
|
e3961af777 | ||
|
|
89ee797fc7 | ||
|
|
9940bf8bbb | ||
|
|
34153fa21a | ||
|
|
67749c1ed5 | ||
|
|
e5e4ca5857 | ||
|
|
5aad257058 | ||
|
|
b87c22b6ed | ||
|
|
07ca9a5b2a | ||
|
|
b1cacc06a1 | ||
|
|
854ea375bd | ||
|
|
ca96097bf9 | ||
|
|
f57c38264c | ||
|
|
95b6dec872 | ||
|
|
f63a6ac96b | ||
|
|
c18875f369 | ||
|
|
16b7188773 | ||
|
|
13cd93338f | ||
|
|
7d5be83e4c | ||
|
|
ef4f7b2547 | ||
|
|
747fe1fa3f | ||
|
|
dd1bab5ffc | ||
|
|
2ae4d87b4d | ||
|
|
1797c13718 | ||
|
|
7578460878 | ||
|
|
9f80956145 | ||
|
|
83031218ea | ||
|
|
9c3f2bbd78 | ||
|
|
01111a6f0b | ||
|
|
030a630681 | ||
|
|
5ee420dde6 | ||
|
|
8f80ed5446 |
@ -9,7 +9,7 @@ RUN apk add --no-cache libc6-compat
|
|||||||
RUN apk update
|
RUN apk update
|
||||||
# Set working directory
|
# Set working directory
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
RUN pnpm add -g turbo dotenv-cli
|
RUN pnpm add -g turbo@1.12.4 dotenv-cli
|
||||||
COPY . .
|
COPY . .
|
||||||
RUN turbo prune --scope=api --docker
|
RUN turbo prune --scope=api --docker
|
||||||
|
|
||||||
|
|||||||
@ -16,7 +16,7 @@ generates:
|
|||||||
object: true
|
object: true
|
||||||
defaultValue: true
|
defaultValue: true
|
||||||
scalars:
|
scalars:
|
||||||
Uuid: string
|
UUID: string
|
||||||
Decimal: number
|
Decimal: number
|
||||||
DateTime: string
|
DateTime: string
|
||||||
# exclude: './graphql/crm.schema.graphql'
|
# exclude: './graphql/crm.schema.graphql'
|
||||||
|
|||||||
19
apps/web/@types/errors.ts
Normal file
19
apps/web/@types/errors.ts
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
import elementsToValues from '@/Components/Calculation/config/map/values';
|
||||||
|
|
||||||
|
export const ERR_ELT_KASKO = 'ERR_ELT_KASKO';
|
||||||
|
export const ERR_ELT_OSAGO = 'ERR_ELT_OSAGO';
|
||||||
|
export const ERR_FINGAP_TABLE = 'ERR_FINGAP_TABLE';
|
||||||
|
export const ERR_INSURANCE_TABLE = 'ERR_INSURANCE_TABLE';
|
||||||
|
export const ERR_PAYMENTS_TABLE = 'ERR_PAYMENTS_TABLE';
|
||||||
|
|
||||||
|
export const ERROR_TABLE_KEYS = [
|
||||||
|
ERR_ELT_KASKO,
|
||||||
|
ERR_ELT_OSAGO,
|
||||||
|
ERR_FINGAP_TABLE,
|
||||||
|
ERR_INSURANCE_TABLE,
|
||||||
|
ERR_PAYMENTS_TABLE,
|
||||||
|
];
|
||||||
|
|
||||||
|
export const ERROR_ELEMENTS_KEYS = Object.keys(elementsToValues);
|
||||||
|
|
||||||
|
export const ERROR_KEYS = [...ERROR_ELEMENTS_KEYS, ...ERROR_TABLE_KEYS];
|
||||||
@ -7,7 +7,7 @@ export const rows: FormTabRows = [
|
|||||||
{
|
{
|
||||||
title: 'Регистрация',
|
title: 'Регистрация',
|
||||||
},
|
},
|
||||||
[['radioObjectRegistration', 'radioTypePTS'], { gridTemplateColumns: ['1fr 1fr'] }],
|
[['radioObjectRegistration', 'radioTypePTS'], { gridTemplateColumns: ['1fr', '1fr 1fr'] }],
|
||||||
[['selectRegionRegistration', 'selectTownRegistration', 'selectObjectRegionRegistration']],
|
[['selectRegionRegistration', 'selectTownRegistration', 'selectObjectRegionRegistration']],
|
||||||
[['selectObjectCategoryTax', 'selectObjectTypeTax', 'tbxVehicleTaxInYear']],
|
[['selectObjectCategoryTax', 'selectObjectTypeTax', 'tbxVehicleTaxInYear']],
|
||||||
[['tbxLeaseObjectYear', 'tbxLeaseObjectMotorPower', 'tbxVehicleTaxInLeasingPeriod']],
|
[['tbxLeaseObjectYear', 'tbxLeaseObjectMotorPower', 'tbxVehicleTaxInLeasingPeriod']],
|
||||||
|
|||||||
@ -4,7 +4,7 @@ import type { Row } from '../types';
|
|||||||
import type { RequestEltKasko, RequestEltOsago } from '@/api/elt/types';
|
import type { RequestEltKasko, RequestEltOsago } from '@/api/elt/types';
|
||||||
import * as CRMTypes from '@/graphql/crm.types';
|
import * as CRMTypes from '@/graphql/crm.types';
|
||||||
import type { ProcessContext } from '@/process/types';
|
import type { ProcessContext } from '@/process/types';
|
||||||
import { getCurrentISODate } from '@/utils/date';
|
import { getCurrentDateString } from '@/utils/date';
|
||||||
import dayjs from 'dayjs';
|
import dayjs from 'dayjs';
|
||||||
import { first, sort } from 'radash';
|
import { first, sort } from 'radash';
|
||||||
|
|
||||||
@ -12,7 +12,7 @@ export async function makeOwnOsagoRequest(
|
|||||||
{ store, apolloClient }: Pick<ProcessContext, 'apolloClient' | 'store'>,
|
{ store, apolloClient }: Pick<ProcessContext, 'apolloClient' | 'store'>,
|
||||||
row: Row
|
row: Row
|
||||||
): Promise<NonNullable<CRMTypes.GetOsagoAddproductTypesQuery['evo_addproduct_types']>[number]> {
|
): Promise<NonNullable<CRMTypes.GetOsagoAddproductTypesQuery['evo_addproduct_types']>[number]> {
|
||||||
const currentDate = getCurrentISODate();
|
const currentDate = getCurrentDateString();
|
||||||
|
|
||||||
const {
|
const {
|
||||||
data: { evo_addproduct_types },
|
data: { evo_addproduct_types },
|
||||||
|
|||||||
@ -1,13 +1,14 @@
|
|||||||
import type { FormTabRows } from '../../lib/render-rows';
|
import type { FormTabRows } from '../../lib/render-rows';
|
||||||
|
import { transformRowsForMobile } from '../lib/utils';
|
||||||
|
|
||||||
export const id = 'insurance';
|
export const id = 'insurance';
|
||||||
export const title = 'Страхование';
|
export const title = 'Страхование';
|
||||||
|
|
||||||
export const rows: FormTabRows = [
|
export const rows: FormTabRows = [
|
||||||
[['tbxLeaseObjectYear', 'selectLeaseObjectUseFor', 'selectLegalClientRegion']],
|
[['tbxLeaseObjectYear', 'selectLeaseObjectUseFor', 'selectLegalClientRegion']],
|
||||||
[['selectEngineType', 'tbxInsFranchise', 'selectLegalClientTown']],
|
[['tbxMileage', 'tbxInsFranchise', 'selectLegalClientTown']],
|
||||||
[['selectLeaseObjectCategory', 'tbxMileage']],
|
[['selectGPSBrand', 'cbxWithTrailer', 'selectInsNSIB']],
|
||||||
[['tbxLeaseObjectMotorPower', 'cbxWithTrailer', 'selectGPSBrand']],
|
[['selectGPSModel', 'cbxInsDecentral', 'selectLeasingWithoutKasko']],
|
||||||
[['tbxEngineVolume', 'cbxInsDecentral', 'selectGPSModel']],
|
|
||||||
[['selectLeasingWithoutKasko', 'selectInsNSIB']],
|
|
||||||
];
|
];
|
||||||
|
|
||||||
|
export const mobileRows = transformRowsForMobile(rows);
|
||||||
|
|||||||
@ -1,15 +1,15 @@
|
|||||||
import renderFormRows from '../../lib/render-rows';
|
import renderFormRows from '../../lib/render-rows';
|
||||||
import { id, rows, title } from './config';
|
import { id, mobileRows, rows, title } from './config';
|
||||||
import FinGAPTable from './FinGAPTable';
|
import FinGAPTable from './FinGAPTable';
|
||||||
import InsuranceTable from './InsuranceTable';
|
import InsuranceTable from './InsuranceTable';
|
||||||
|
import { Media } from '@/styles/media';
|
||||||
import { Flex } from 'ui/grid';
|
import { Flex } from 'ui/grid';
|
||||||
|
|
||||||
function Insurance() {
|
function Insurance() {
|
||||||
const renderedRows = renderFormRows(rows);
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Flex flexDirection="column">
|
<Flex flexDirection="column">
|
||||||
{renderedRows}
|
<Media lessThan="laptop">{renderFormRows(mobileRows)}</Media>
|
||||||
|
<Media greaterThanOrEqual="laptop">{renderFormRows(rows)}</Media>
|
||||||
<InsuranceTable />
|
<InsuranceTable />
|
||||||
<FinGAPTable />
|
<FinGAPTable />
|
||||||
</Flex>
|
</Flex>
|
||||||
|
|||||||
@ -1,4 +1,5 @@
|
|||||||
import type { FormTabRows } from '../../lib/render-rows';
|
import type { FormTabRows } from '../../lib/render-rows';
|
||||||
|
import { transformRowsForMobile } from '../lib/utils';
|
||||||
|
|
||||||
export const id = 'leasing-object';
|
export const id = 'leasing-object';
|
||||||
export const title = 'ПЛ';
|
export const title = 'ПЛ';
|
||||||
@ -16,3 +17,5 @@ export const rows: FormTabRows = [
|
|||||||
[['selectLeaseObjectCategory', 'tbxEngineVolume', 'tbxMileage']],
|
[['selectLeaseObjectCategory', 'tbxEngineVolume', 'tbxMileage']],
|
||||||
[['tbxMaxMass', 'tbxEngineHours', 'tbxVIN']],
|
[['tbxMaxMass', 'tbxEngineHours', 'tbxVIN']],
|
||||||
];
|
];
|
||||||
|
|
||||||
|
export const mobileRows = transformRowsForMobile(rows);
|
||||||
|
|||||||
@ -1,8 +1,14 @@
|
|||||||
import renderFormRows from '../../lib/render-rows';
|
import renderFormRows from '../../lib/render-rows';
|
||||||
import { id, rows, title } from './config';
|
import { id, mobileRows, rows, title } from './config';
|
||||||
|
import { Media } from '@/styles/media';
|
||||||
|
|
||||||
function LeasingObject() {
|
function LeasingObject() {
|
||||||
return renderFormRows(rows);
|
return (
|
||||||
|
<>
|
||||||
|
<Media lessThan="laptop">{renderFormRows(mobileRows)}</Media>
|
||||||
|
<Media greaterThanOrEqual="laptop">{renderFormRows(rows)}</Media>
|
||||||
|
</>
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
|||||||
@ -1,4 +1,5 @@
|
|||||||
import type { FormTabRows } from '../../lib/render-rows';
|
import type { FormTabRows } from '../../lib/render-rows';
|
||||||
|
import { transformRowsForMobile } from '../lib/utils';
|
||||||
|
|
||||||
export const id = 'supplier-agent';
|
export const id = 'supplier-agent';
|
||||||
export const title = 'Поставщик/агент';
|
export const title = 'Поставщик/агент';
|
||||||
@ -20,3 +21,5 @@ export const rows: FormTabRows = [
|
|||||||
[['selectCalcBrokerRewardCondition', 'selectFinDepartmentRewardCondtion'], defaultRowStyle],
|
[['selectCalcBrokerRewardCondition', 'selectFinDepartmentRewardCondtion'], defaultRowStyle],
|
||||||
[['tbxCalcBrokerRewardSum', 'tbxFinDepartmentRewardSumm'], defaultRowStyle],
|
[['tbxCalcBrokerRewardSum', 'tbxFinDepartmentRewardSumm'], defaultRowStyle],
|
||||||
];
|
];
|
||||||
|
|
||||||
|
export const mobileRows = transformRowsForMobile(rows);
|
||||||
|
|||||||
@ -1,8 +1,14 @@
|
|||||||
import renderFormRows from '../../lib/render-rows';
|
import renderFormRows from '../../lib/render-rows';
|
||||||
import { id, rows, title } from './config';
|
import { id, mobileRows, rows, title } from './config';
|
||||||
|
import { Media } from '@/styles/media';
|
||||||
|
|
||||||
function Leasing() {
|
function Leasing() {
|
||||||
return renderFormRows(rows);
|
return (
|
||||||
|
<>
|
||||||
|
<Media lessThan="laptop">{renderFormRows(mobileRows)}</Media>
|
||||||
|
<Media greaterThanOrEqual="laptop">{renderFormRows(rows)}</Media>
|
||||||
|
</>
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
|||||||
@ -8,7 +8,9 @@ import Payments from './Payments';
|
|||||||
import SupplierAgent from './SupplierAgent';
|
import SupplierAgent from './SupplierAgent';
|
||||||
import Unlimited from './Unlimited';
|
import Unlimited from './Unlimited';
|
||||||
import Background from '@/Components/Layout/Background';
|
import Background from '@/Components/Layout/Background';
|
||||||
|
import { useStore } from '@/stores/hooks';
|
||||||
import { min } from '@/styles/mq';
|
import { min } from '@/styles/mq';
|
||||||
|
import { memo } from 'react';
|
||||||
import styled from 'styled-components';
|
import styled from 'styled-components';
|
||||||
import { Tabs } from 'ui/elements';
|
import { Tabs } from 'ui/elements';
|
||||||
|
|
||||||
@ -44,20 +46,23 @@ const ComponentWrapper = styled.div`
|
|||||||
}
|
}
|
||||||
`;
|
`;
|
||||||
|
|
||||||
export function Form({ prune }) {
|
export const Form = memo(() => {
|
||||||
|
const { $process } = useStore();
|
||||||
|
|
||||||
|
const filteredTabs =
|
||||||
|
$process.has('Unlimited') === false ? formTabs.filter((x) => x.id !== 'unlimited') : formTabs;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Wrapper>
|
<Wrapper>
|
||||||
<Tabs type="card" tabBarGutter="5px">
|
<Tabs type="card" tabBarGutter="5px">
|
||||||
{formTabs
|
{filteredTabs.map(({ Component, id, title }) => (
|
||||||
.filter((tab) => !prune?.includes(tab.id))
|
<Tabs.TabPane tab={title} key={id}>
|
||||||
.map(({ Component, id, title }) => (
|
<ComponentWrapper>
|
||||||
<Tabs.TabPane tab={title} key={id}>
|
<Component />
|
||||||
<ComponentWrapper>
|
</ComponentWrapper>
|
||||||
<Component />
|
</Tabs.TabPane>
|
||||||
</ComponentWrapper>
|
))}
|
||||||
</Tabs.TabPane>
|
|
||||||
))}
|
|
||||||
</Tabs>
|
</Tabs>
|
||||||
</Wrapper>
|
</Wrapper>
|
||||||
);
|
);
|
||||||
}
|
});
|
||||||
|
|||||||
32
apps/web/Components/Calculation/Form/lib/utils.js
Normal file
32
apps/web/Components/Calculation/Form/lib/utils.js
Normal file
@ -0,0 +1,32 @@
|
|||||||
|
/**
|
||||||
|
*
|
||||||
|
* @param {import('../../lib/render-rows').FormTabRows} rows
|
||||||
|
* @returns {import('../../lib/render-rows').FormTabRows}
|
||||||
|
*/
|
||||||
|
export function transformRowsForMobile(rows) {
|
||||||
|
const mobileRows = [];
|
||||||
|
let columnGroups = {};
|
||||||
|
|
||||||
|
rows.forEach((row) => {
|
||||||
|
if (Array.isArray(row)) {
|
||||||
|
row[0].forEach((item, index) => {
|
||||||
|
if (!columnGroups[index]) {
|
||||||
|
columnGroups[index] = [];
|
||||||
|
}
|
||||||
|
columnGroups[index].push(item);
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
Object.values(columnGroups).forEach((group) => {
|
||||||
|
mobileRows.push([group, { gridTemplateColumns: '1fr' }]);
|
||||||
|
});
|
||||||
|
columnGroups = {};
|
||||||
|
mobileRows.push(row);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
Object.values(columnGroups).forEach((group) => {
|
||||||
|
mobileRows.push([group, { gridTemplateColumns: '1fr' }]);
|
||||||
|
});
|
||||||
|
|
||||||
|
return mobileRows;
|
||||||
|
}
|
||||||
@ -42,7 +42,7 @@ const Wrapper = styled(Background)`
|
|||||||
}
|
}
|
||||||
`;
|
`;
|
||||||
|
|
||||||
export const Output = observer(() => {
|
export const Output = observer(({ tabs }) => {
|
||||||
const { $results } = useStore();
|
const { $results } = useStore();
|
||||||
const [activeKey, setActiveKey] = useState(undefined);
|
const [activeKey, setActiveKey] = useState(undefined);
|
||||||
const { hasErrors } = useErrors();
|
const { hasErrors } = useErrors();
|
||||||
@ -52,15 +52,15 @@ export const Output = observer(() => {
|
|||||||
setActiveKey('payments-table');
|
setActiveKey('payments-table');
|
||||||
}
|
}
|
||||||
|
|
||||||
if (hasErrors) {
|
if (!tabs && hasErrors) {
|
||||||
setActiveKey('validation');
|
setActiveKey('validation');
|
||||||
}
|
}
|
||||||
}, [$results.payments.length, hasErrors]);
|
}, [$results.payments.length, hasErrors, tabs]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Wrapper>
|
<Wrapper>
|
||||||
<Tabs
|
<Tabs
|
||||||
items={items}
|
items={tabs ? items.filter((x) => x.key !== 'validation') : items}
|
||||||
activeKey={activeKey}
|
activeKey={activeKey}
|
||||||
onChange={(key) => {
|
onChange={(key) => {
|
||||||
setActiveKey(key);
|
setActiveKey(key);
|
||||||
|
|||||||
@ -18,8 +18,8 @@ export const mainRows: FormTabRows = [
|
|||||||
[
|
[
|
||||||
['btnCreateKP', 'linkDownloadKp'],
|
['btnCreateKP', 'linkDownloadKp'],
|
||||||
{
|
{
|
||||||
gap: [0, '10px'],
|
gap: ['10px'],
|
||||||
gridTemplateColumns: ['1fr', '1fr 1fr'],
|
gridTemplateColumns: ['1fr 1fr'],
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
];
|
];
|
||||||
@ -41,8 +41,8 @@ export const unlimitedMainRows: FormTabRows = [
|
|||||||
[
|
[
|
||||||
['btnCreateKP', 'linkDownloadKp'],
|
['btnCreateKP', 'linkDownloadKp'],
|
||||||
{
|
{
|
||||||
gap: [0, '10px'],
|
gap: ['10px'],
|
||||||
gridTemplateColumns: ['1fr', '1fr 1fr'],
|
gridTemplateColumns: ['1fr 1fr'],
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
];
|
];
|
||||||
|
|||||||
@ -3,6 +3,7 @@ import * as config from './config';
|
|||||||
import Background from '@/Components/Layout/Background';
|
import Background from '@/Components/Layout/Background';
|
||||||
import { useStore } from '@/stores/hooks';
|
import { useStore } from '@/stores/hooks';
|
||||||
import { min } from '@/styles/mq';
|
import { min } from '@/styles/mq';
|
||||||
|
import { memo } from 'react';
|
||||||
import styled from 'styled-components';
|
import styled from 'styled-components';
|
||||||
|
|
||||||
const Wrapper = styled(Background)`
|
const Wrapper = styled(Background)`
|
||||||
@ -17,7 +18,7 @@ const Wrapper = styled(Background)`
|
|||||||
}
|
}
|
||||||
`;
|
`;
|
||||||
|
|
||||||
export function Settings() {
|
export const Settings = memo(() => {
|
||||||
const { $process } = useStore();
|
const { $process } = useStore();
|
||||||
|
|
||||||
const mainRows = $process.has('Unlimited')
|
const mainRows = $process.has('Unlimited')
|
||||||
@ -33,4 +34,4 @@ export function Settings() {
|
|||||||
{paramsRows}
|
{paramsRows}
|
||||||
</Wrapper>
|
</Wrapper>
|
||||||
);
|
);
|
||||||
}
|
});
|
||||||
|
|||||||
19
apps/web/Components/Calculation/Validation/index.jsx
Normal file
19
apps/web/Components/Calculation/Validation/index.jsx
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
import Validation from '../Output/Validation';
|
||||||
|
import Background from '@/Components/Layout/Background';
|
||||||
|
import { min } from '@/styles/mq';
|
||||||
|
import { memo } from 'react';
|
||||||
|
import styled from 'styled-components';
|
||||||
|
|
||||||
|
const Wrapper = styled(Background)`
|
||||||
|
padding: 4px 10px;
|
||||||
|
|
||||||
|
${min('laptop')} {
|
||||||
|
padding: 4px 18px;
|
||||||
|
}
|
||||||
|
`;
|
||||||
|
|
||||||
|
export const Component = memo(() => (
|
||||||
|
<Wrapper>
|
||||||
|
<Validation.Component />
|
||||||
|
</Wrapper>
|
||||||
|
));
|
||||||
@ -1,4 +0,0 @@
|
|||||||
export * from './Form';
|
|
||||||
export * from './Layout';
|
|
||||||
export * from './Output';
|
|
||||||
export * from './Settings';
|
|
||||||
101
apps/web/Components/Calculation/index.tsx
Normal file
101
apps/web/Components/Calculation/index.tsx
Normal file
@ -0,0 +1,101 @@
|
|||||||
|
import { Form } from './Form';
|
||||||
|
import { Layout } from './Layout';
|
||||||
|
import { Output } from './Output';
|
||||||
|
import { Settings } from './Settings';
|
||||||
|
import { Component as Validation } from './Validation';
|
||||||
|
import { Notification } from '@/Components/Common';
|
||||||
|
import { NavigationBar, Tabs } from '@/Components/Layout/Navigation';
|
||||||
|
import { NavigationProvider } from '@/context/navigation';
|
||||||
|
import { useErrors, useResults } from '@/stores/hooks';
|
||||||
|
import { Media } from '@/styles/media';
|
||||||
|
import { getPageTitle } from '@/utils/page';
|
||||||
|
import { observer } from 'mobx-react-lite';
|
||||||
|
import Head from 'next/head';
|
||||||
|
import styled from 'styled-components';
|
||||||
|
import { Badge } from 'ui/elements';
|
||||||
|
import {
|
||||||
|
BarChartOutlined,
|
||||||
|
CalculatorOutlined,
|
||||||
|
ProfileOutlined,
|
||||||
|
WarningOutlined,
|
||||||
|
} from 'ui/elements/icons';
|
||||||
|
|
||||||
|
const defaultIconStyle = { fontSize: '1.2rem' };
|
||||||
|
|
||||||
|
const StyledBadge = styled(Badge)`
|
||||||
|
color: unset !important;
|
||||||
|
`;
|
||||||
|
|
||||||
|
export const tabs = [
|
||||||
|
{
|
||||||
|
Component: Settings,
|
||||||
|
Icon: () => <ProfileOutlined style={defaultIconStyle} />,
|
||||||
|
key: 'settings',
|
||||||
|
title: 'Интерес/Расчет',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
Component: Form,
|
||||||
|
Icon: () => <CalculatorOutlined style={defaultIconStyle} />,
|
||||||
|
key: 'form',
|
||||||
|
title: 'Параметры',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
Component: Output,
|
||||||
|
Icon: observer(() => {
|
||||||
|
const { hasResults } = useResults();
|
||||||
|
|
||||||
|
return (
|
||||||
|
<StyledBadge status="success" dot={hasResults}>
|
||||||
|
<BarChartOutlined style={defaultIconStyle} />
|
||||||
|
</StyledBadge>
|
||||||
|
);
|
||||||
|
}),
|
||||||
|
key: 'output',
|
||||||
|
title: 'Результаты',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
Component: Validation,
|
||||||
|
Icon: observer(() => {
|
||||||
|
const { hasErrors } = useErrors();
|
||||||
|
|
||||||
|
return (
|
||||||
|
<StyledBadge status="error" dot={hasErrors}>
|
||||||
|
<WarningOutlined style={defaultIconStyle} />
|
||||||
|
</StyledBadge>
|
||||||
|
);
|
||||||
|
}),
|
||||||
|
key: 'errors',
|
||||||
|
title: 'Ошибки',
|
||||||
|
},
|
||||||
|
];
|
||||||
|
|
||||||
|
type ContentProps = {
|
||||||
|
readonly initHooks: () => void;
|
||||||
|
readonly title: string;
|
||||||
|
};
|
||||||
|
|
||||||
|
export function Content({ initHooks, title }: ContentProps) {
|
||||||
|
initHooks();
|
||||||
|
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
<Head>
|
||||||
|
<title>{getPageTitle(title)}</title>
|
||||||
|
</Head>
|
||||||
|
<Notification />
|
||||||
|
<Media lessThan="laptop">
|
||||||
|
<NavigationProvider>
|
||||||
|
<Tabs tabs={tabs} />
|
||||||
|
<NavigationBar />
|
||||||
|
</NavigationProvider>
|
||||||
|
</Media>
|
||||||
|
<Media greaterThanOrEqual="laptop">
|
||||||
|
<Layout>
|
||||||
|
<Form />
|
||||||
|
<Settings />
|
||||||
|
<Output />
|
||||||
|
</Layout>
|
||||||
|
</Media>
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
}
|
||||||
@ -1,4 +1,7 @@
|
|||||||
/* eslint-disable import/no-mutable-exports */
|
/* eslint-disable import/no-mutable-exports */
|
||||||
|
import { ERROR_KEYS } from '@/@types/errors';
|
||||||
|
import { Media } from '@/styles/media';
|
||||||
|
import { getDevice } from '@/utils/device';
|
||||||
import type { MessageInstance } from 'antd/es/message/interface';
|
import type { MessageInstance } from 'antd/es/message/interface';
|
||||||
import type { NotificationInstance } from 'antd/es/notification/interface';
|
import type { NotificationInstance } from 'antd/es/notification/interface';
|
||||||
import type { ReactNode } from 'react';
|
import type { ReactNode } from 'react';
|
||||||
@ -7,9 +10,44 @@ import { message as antdMessage, notification as antdNotification } from 'ui/ele
|
|||||||
export let message: Readonly<MessageInstance>;
|
export let message: Readonly<MessageInstance>;
|
||||||
export let notification: Readonly<NotificationInstance>;
|
export let notification: Readonly<NotificationInstance>;
|
||||||
|
|
||||||
export function Notification({ children }: { readonly children: ReactNode }) {
|
function createWrapper<T extends NotificationInstance, M extends MessageInstance>(
|
||||||
|
notificationObj: T,
|
||||||
|
messageObj: M
|
||||||
|
): T {
|
||||||
|
const handler: ProxyHandler<T> = {
|
||||||
|
get(target, prop, receiver) {
|
||||||
|
const notificationMethod = target[prop as keyof T];
|
||||||
|
const messageMethod = messageObj[prop as keyof M];
|
||||||
|
|
||||||
|
if (typeof notificationMethod === 'function' && typeof messageMethod === 'function') {
|
||||||
|
return function (...args: any[]) {
|
||||||
|
const device = getDevice();
|
||||||
|
|
||||||
|
if (device?.isMobile) {
|
||||||
|
if (typeof args[0] === 'object') {
|
||||||
|
if (ERROR_KEYS.includes(args[0].key)) return;
|
||||||
|
args[0].content = args[0].description || args[0].message;
|
||||||
|
}
|
||||||
|
|
||||||
|
messageMethod.apply(messageObj, args);
|
||||||
|
}
|
||||||
|
|
||||||
|
notificationMethod.apply(target, args);
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
return Reflect.get(target, prop, receiver);
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
return new Proxy(notificationObj, handler);
|
||||||
|
}
|
||||||
|
|
||||||
|
export function Notification({ children }: { readonly children?: ReactNode }) {
|
||||||
|
const device = getDevice();
|
||||||
|
|
||||||
const [messageApi, messageContextHolder] = antdMessage.useMessage({
|
const [messageApi, messageContextHolder] = antdMessage.useMessage({
|
||||||
duration: 1.2,
|
duration: device?.isMobile ? 1.5 : 1.2,
|
||||||
maxCount: 3,
|
maxCount: 3,
|
||||||
top: 70,
|
top: 70,
|
||||||
});
|
});
|
||||||
@ -21,12 +59,12 @@ export function Notification({ children }: { readonly children: ReactNode }) {
|
|||||||
});
|
});
|
||||||
|
|
||||||
message = messageApi;
|
message = messageApi;
|
||||||
notification = notificationApi;
|
notification = createWrapper(notificationApi, messageApi);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
{messageContextHolder}
|
{messageContextHolder}
|
||||||
{notificationContextHolder}
|
<Media greaterThanOrEqual="laptop">{notificationContextHolder}</Media>
|
||||||
{children}
|
{children}
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
|
|||||||
@ -10,7 +10,7 @@ const UserText = styled.span`
|
|||||||
padding: 0;
|
padding: 0;
|
||||||
text-transform: uppercase;
|
text-transform: uppercase;
|
||||||
color: #fff;
|
color: #fff;
|
||||||
font-size: 0.5rem;
|
font-size: 0.55rem;
|
||||||
font-family: 'Montserrat';
|
font-family: 'Montserrat';
|
||||||
font-weight: 500;
|
font-weight: 500;
|
||||||
line-height: 1;
|
line-height: 1;
|
||||||
|
|||||||
@ -49,7 +49,7 @@ const items: MenuProps['items'] = [
|
|||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
export function AppNavigation() {
|
export function AppMenu() {
|
||||||
const { pathname } = useRouter();
|
const { pathname } = useRouter();
|
||||||
|
|
||||||
return (
|
return (
|
||||||
64
apps/web/Components/Layout/Navigation.jsx
Normal file
64
apps/web/Components/Layout/Navigation.jsx
Normal file
@ -0,0 +1,64 @@
|
|||||||
|
import { NavigationContext } from '@/context/navigation';
|
||||||
|
import { useContext, useEffect } from 'react';
|
||||||
|
import styled from 'styled-components';
|
||||||
|
import { Flex } from 'ui/grid';
|
||||||
|
|
||||||
|
const Container = styled.div`
|
||||||
|
background-color: white;
|
||||||
|
bottom: 0;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: row;
|
||||||
|
gap: 10px;
|
||||||
|
height: 46px;
|
||||||
|
justify-content: space-around;
|
||||||
|
position: fixed;
|
||||||
|
width: 100%;
|
||||||
|
border-top: 1px solid rgba(5, 5, 5, 0.06);
|
||||||
|
z-index: 999999;
|
||||||
|
`;
|
||||||
|
|
||||||
|
const TabButton = styled.button`
|
||||||
|
background: ${({ active }) => (active ? 'var(--color-primary)' : 'white')};
|
||||||
|
color: ${({ active }) => (active ? 'white' : 'black')};
|
||||||
|
border-radius: 2px 2px 0 0;
|
||||||
|
border: none;
|
||||||
|
cursor: pointer;
|
||||||
|
height: 100%;
|
||||||
|
width: 100%;
|
||||||
|
font-size: 0.75rem;
|
||||||
|
`;
|
||||||
|
|
||||||
|
export function NavigationBar() {
|
||||||
|
const { currentTab, setCurrentTab, tabsList } = useContext(NavigationContext);
|
||||||
|
|
||||||
|
return (
|
||||||
|
<Container>
|
||||||
|
{tabsList.map(({ Icon, key, title }) => (
|
||||||
|
<TabButton key={key} active={key === currentTab} onClick={() => setCurrentTab(key)}>
|
||||||
|
<Flex flexDirection="column" alignItems="center">
|
||||||
|
<Icon />
|
||||||
|
{title}
|
||||||
|
</Flex>
|
||||||
|
</TabButton>
|
||||||
|
))}
|
||||||
|
</Container>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
const Display = styled.div`
|
||||||
|
display: ${(props) => (props.visible ? 'block' : 'none')};
|
||||||
|
`;
|
||||||
|
|
||||||
|
export function Tabs({ tabs }) {
|
||||||
|
const { currentTab, setTabsList } = useContext(NavigationContext);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
setTabsList(tabs);
|
||||||
|
}, [setTabsList, tabs]);
|
||||||
|
|
||||||
|
return tabs.map(({ Component, key }) => (
|
||||||
|
<Display key={key} visible={key === currentTab}>
|
||||||
|
<Component key={key} tabs />
|
||||||
|
</Display>
|
||||||
|
));
|
||||||
|
}
|
||||||
@ -1,11 +1,15 @@
|
|||||||
import Header from './Header';
|
import Header from './Header';
|
||||||
import { AppNavigation } from './Navigation';
|
import { AppMenu } from './Menu';
|
||||||
import { min } from '@/styles/mq';
|
import { max, min } from '@/styles/mq';
|
||||||
import styled from 'styled-components';
|
import styled from 'styled-components';
|
||||||
|
|
||||||
const Main = styled.main`
|
const Main = styled.main`
|
||||||
margin: 8px 0;
|
margin: 8px 0;
|
||||||
|
|
||||||
|
${max('laptop')} {
|
||||||
|
margin-bottom: calc(46px + 8px); // height of the navigation bar
|
||||||
|
}
|
||||||
|
|
||||||
${min('desktop-xl')} {
|
${min('desktop-xl')} {
|
||||||
margin: 8px 10%;
|
margin: 8px 10%;
|
||||||
}
|
}
|
||||||
@ -15,7 +19,7 @@ export default function Layout({ children, user }) {
|
|||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<Header />
|
<Header />
|
||||||
{user?.admin ? <AppNavigation /> : false}
|
{user?.admin ? <AppMenu /> : false}
|
||||||
<Main>{children}</Main>
|
<Main>{children}</Main>
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
|
|||||||
@ -9,7 +9,7 @@ RUN apk add --no-cache libc6-compat
|
|||||||
RUN apk update
|
RUN apk update
|
||||||
# Set working directory
|
# Set working directory
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
RUN pnpm add -g turbo dotenv-cli
|
RUN pnpm add -g turbo@1.12.4 dotenv-cli
|
||||||
COPY . .
|
COPY . .
|
||||||
RUN turbo prune --scope=web --docker
|
RUN turbo prune --scope=web --docker
|
||||||
|
|
||||||
|
|||||||
@ -1,20 +1,20 @@
|
|||||||
import { link } from './link';
|
import { createLink } from './link';
|
||||||
import { ApolloClient, InMemoryCache } from '@apollo/client';
|
import { ApolloClient, InMemoryCache } from '@apollo/client';
|
||||||
import { isServer } from 'tools/common';
|
import { isServer } from 'tools/common';
|
||||||
|
|
||||||
/** @type {import('@apollo/client').ApolloClient<import('@apollo/client').NormalizedCacheObject>} */
|
/** @type {import('@apollo/client').ApolloClient<import('@apollo/client').NormalizedCacheObject>} */
|
||||||
let apolloClient;
|
let apolloClient;
|
||||||
|
|
||||||
function createApolloClient() {
|
function createApolloClient(headers) {
|
||||||
return new ApolloClient({
|
return new ApolloClient({
|
||||||
cache: new InMemoryCache(),
|
cache: new InMemoryCache(),
|
||||||
link,
|
link: createLink(headers),
|
||||||
ssrMode: isServer(),
|
ssrMode: isServer(),
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
export default function initializeApollo(initialState = null) {
|
export default function initializeApollo(initialState, headers) {
|
||||||
const _apolloClient = apolloClient ?? createApolloClient();
|
const _apolloClient = apolloClient ?? createApolloClient(headers);
|
||||||
|
|
||||||
// If your page has Next.js data fetching methods that use Apollo Client, the initial state
|
// If your page has Next.js data fetching methods that use Apollo Client, the initial state
|
||||||
// gets hydrated here
|
// gets hydrated here
|
||||||
|
|||||||
@ -1,86 +1,121 @@
|
|||||||
/* eslint-disable sonarjs/cognitive-complexity */
|
/* eslint-disable sonarjs/cognitive-complexity */
|
||||||
import { message } from '@/Components/Common/Notification';
|
import { message } from '@/Components/Common/Notification';
|
||||||
|
import { publicRuntimeConfigSchema } from '@/config/schema/runtime-config';
|
||||||
import getUrls from '@/config/urls';
|
import getUrls from '@/config/urls';
|
||||||
import { ApolloLink, from, HttpLink } from '@apollo/client';
|
import { ApolloLink, from, HttpLink } from '@apollo/client';
|
||||||
|
import { setContext } from '@apollo/client/link/context';
|
||||||
import { onError } from '@apollo/client/link/error';
|
import { onError } from '@apollo/client/link/error';
|
||||||
import { getCurrentScope } from '@sentry/nextjs';
|
import { getCurrentScope } from '@sentry/nextjs';
|
||||||
|
import getConfig from 'next/config';
|
||||||
import { isServer } from 'tools';
|
import { isServer } from 'tools';
|
||||||
|
|
||||||
const { URL_CRM_GRAPHQL } = getUrls();
|
export function createLink(headers) {
|
||||||
|
const { URL_CRM_GRAPHQL } = getUrls();
|
||||||
|
|
||||||
const modifyDataLink = new ApolloLink((operation, forward) => {
|
const modifyDataLink = new ApolloLink((operation, forward) => {
|
||||||
const context = operation?.getContext();
|
const context = operation?.getContext();
|
||||||
|
|
||||||
return forward(operation).map((response) => {
|
return forward(operation).map((response) => {
|
||||||
if (!context?.disableModify) {
|
if (!context?.disableModify) {
|
||||||
if (Object.keys(response?.data).includes('evo_addproduct_types')) {
|
if (Object.keys(response?.data).includes('evo_addproduct_types')) {
|
||||||
response.data.evo_addproduct_types = response.data.evo_addproduct_types.map(
|
response.data.evo_addproduct_types = response.data.evo_addproduct_types.map(
|
||||||
(evo_addproduct_type) => {
|
(evo_addproduct_type) => {
|
||||||
if (evo_addproduct_type.evo_graph_price)
|
if (evo_addproduct_type.evo_graph_price)
|
||||||
|
return {
|
||||||
|
...evo_addproduct_type,
|
||||||
|
label: `${evo_addproduct_type.label} (${evo_addproduct_type.evo_graph_price} руб.)`,
|
||||||
|
};
|
||||||
|
|
||||||
|
return evo_addproduct_type;
|
||||||
|
}
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (Object.keys(response?.data).includes('evo_equipments')) {
|
||||||
|
response.data.evo_equipments = response.data.evo_equipments.map((evo_equipment) => {
|
||||||
|
if (evo_equipment.evo_start_production_year)
|
||||||
return {
|
return {
|
||||||
...evo_addproduct_type,
|
...evo_equipment,
|
||||||
label: `${evo_addproduct_type.label} (${evo_addproduct_type.evo_graph_price} руб.)`,
|
label: `${evo_equipment.label} (${evo_equipment.evo_start_production_year})`,
|
||||||
};
|
};
|
||||||
|
|
||||||
return evo_addproduct_type;
|
return evo_equipment;
|
||||||
}
|
});
|
||||||
);
|
}
|
||||||
|
|
||||||
|
if (operation.operationName === 'GetInsuranceCompanies') {
|
||||||
|
response.data.accounts = response.data.accounts.map((account) => {
|
||||||
|
const substring = account.label.match(/"(.+)"/u);
|
||||||
|
if (substring)
|
||||||
|
return {
|
||||||
|
...account,
|
||||||
|
label: substring ? substring[1].replaceAll('"', '').trim() : account.label,
|
||||||
|
};
|
||||||
|
|
||||||
|
return account;
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Object.keys(response?.data).includes('evo_equipments')) {
|
return response;
|
||||||
response.data.evo_equipments = response.data.evo_equipments.map((evo_equipment) => {
|
});
|
||||||
if (evo_equipment.evo_start_production_year)
|
});
|
||||||
return {
|
|
||||||
...evo_equipment,
|
|
||||||
label: `${evo_equipment.label} (${evo_equipment.evo_start_production_year})`,
|
|
||||||
};
|
|
||||||
|
|
||||||
return evo_equipment;
|
const httpLink = new HttpLink({
|
||||||
});
|
uri: URL_CRM_GRAPHQL,
|
||||||
}
|
});
|
||||||
|
|
||||||
if (operation.operationName === 'GetInsuranceCompanies') {
|
const authLink = setContext((_, { headers: existingHeaders }) => {
|
||||||
response.data.accounts = response.data.accounts.map((account) => {
|
if (process.env.NODE_ENV === 'development') {
|
||||||
const substring = account.label.match(/"(.+)"/u);
|
const { publicRuntimeConfig } = getConfig();
|
||||||
if (substring)
|
const { DEV_AUTH_TOKEN } = publicRuntimeConfigSchema.parse(publicRuntimeConfig);
|
||||||
return {
|
|
||||||
...account,
|
|
||||||
label: substring ? substring[1].replaceAll('"', '').trim() : account.label,
|
|
||||||
};
|
|
||||||
|
|
||||||
return account;
|
if (DEV_AUTH_TOKEN)
|
||||||
});
|
return {
|
||||||
}
|
headers: {
|
||||||
|
...existingHeaders,
|
||||||
|
authorization: `Bearer ${DEV_AUTH_TOKEN}`,
|
||||||
|
},
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
return response;
|
if (isServer()) {
|
||||||
|
return {
|
||||||
|
headers: {
|
||||||
|
...existingHeaders,
|
||||||
|
authorization: headers?.authorization,
|
||||||
|
},
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
return {
|
||||||
|
headers: {
|
||||||
|
...existingHeaders,
|
||||||
|
},
|
||||||
|
};
|
||||||
});
|
});
|
||||||
});
|
|
||||||
|
|
||||||
const httpLink = new HttpLink({
|
const key = 'APOLLO_GRAPHQL';
|
||||||
uri: URL_CRM_GRAPHQL,
|
|
||||||
});
|
|
||||||
|
|
||||||
const key = 'APOLLO_GRAPHQL';
|
const errorLink = onError(({ graphQLErrors, networkError, operation, response }) => {
|
||||||
|
const scope = getCurrentScope();
|
||||||
|
scope.setTag('operationName', operation.operationName);
|
||||||
|
|
||||||
const errorLink = onError(({ graphQLErrors, networkError, operation, response }) => {
|
if (!isServer()) {
|
||||||
const scope = getCurrentScope();
|
message.error({
|
||||||
scope.setTag('operationName', operation.operationName);
|
content: `Ошибка во время загрузки данных из CRM`,
|
||||||
|
key,
|
||||||
|
onClick: () => message.destroy(key),
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
if (!isServer()) {
|
scope.setExtras({
|
||||||
message.error({
|
graphQLErrors,
|
||||||
content: `Ошибка во время загрузки данных из CRM`,
|
networkError,
|
||||||
key,
|
operation,
|
||||||
onClick: () => message.destroy(key),
|
response,
|
||||||
});
|
});
|
||||||
}
|
|
||||||
|
|
||||||
scope.setExtras({
|
|
||||||
graphQLErrors,
|
|
||||||
networkError,
|
|
||||||
operation,
|
|
||||||
response,
|
|
||||||
});
|
});
|
||||||
});
|
|
||||||
|
|
||||||
export const link = from([errorLink, modifyDataLink, httpLink]);
|
return from([authLink, errorLink, modifyDataLink, httpLink]);
|
||||||
|
}
|
||||||
|
|||||||
@ -11,6 +11,7 @@ const envSchema = z.object({
|
|||||||
URL_CACHE_GET_QUERIES_DIRECT: z.string().default('http://api:3001/proxy/get-queries'),
|
URL_CACHE_GET_QUERIES_DIRECT: z.string().default('http://api:3001/proxy/get-queries'),
|
||||||
URL_CACHE_GET_QUERY_DIRECT: z.string().default('http://api:3001/proxy/get-query'),
|
URL_CACHE_GET_QUERY_DIRECT: z.string().default('http://api:3001/proxy/get-query'),
|
||||||
URL_CACHE_RESET_QUERIES_DIRECT: z.string().default('http://api:3001/proxy/reset'),
|
URL_CACHE_RESET_QUERIES_DIRECT: z.string().default('http://api:3001/proxy/reset'),
|
||||||
|
DEV_AUTH_TOKEN: z.string().optional(),
|
||||||
URL_CORE_CALCULATE_DIRECT: z.string(),
|
URL_CORE_CALCULATE_DIRECT: z.string(),
|
||||||
URL_CORE_FINGAP_DIRECT: z.string(),
|
URL_CORE_FINGAP_DIRECT: z.string(),
|
||||||
URL_CRM_CREATEKP_DIRECT: z.string(),
|
URL_CRM_CREATEKP_DIRECT: z.string(),
|
||||||
|
|||||||
@ -2,6 +2,7 @@ const envSchema = require('./env');
|
|||||||
|
|
||||||
const publicRuntimeConfigSchema = envSchema.pick({
|
const publicRuntimeConfigSchema = envSchema.pick({
|
||||||
BASE_PATH: true,
|
BASE_PATH: true,
|
||||||
|
DEV_AUTH_TOKEN: true,
|
||||||
SENTRY_DSN: true,
|
SENTRY_DSN: true,
|
||||||
SENTRY_ENVIRONMENT: true,
|
SENTRY_ENVIRONMENT: true,
|
||||||
USE_DEV_COLORS: true,
|
USE_DEV_COLORS: true,
|
||||||
@ -9,6 +10,7 @@ const publicRuntimeConfigSchema = envSchema.pick({
|
|||||||
|
|
||||||
const serverRuntimeConfigSchema = envSchema.pick({
|
const serverRuntimeConfigSchema = envSchema.pick({
|
||||||
BASE_PATH: true,
|
BASE_PATH: true,
|
||||||
|
DEV_AUTH_TOKEN: true,
|
||||||
PORT: true,
|
PORT: true,
|
||||||
SENTRY_DSN: true,
|
SENTRY_DSN: true,
|
||||||
SENTRY_ENVIRONMENT: true,
|
SENTRY_ENVIRONMENT: true,
|
||||||
|
|||||||
34
apps/web/context/navigation.tsx
Normal file
34
apps/web/context/navigation.tsx
Normal file
@ -0,0 +1,34 @@
|
|||||||
|
import { createContext, useEffect, useMemo, useState } from 'react';
|
||||||
|
|
||||||
|
type Tab = {
|
||||||
|
icon: JSX.Element;
|
||||||
|
key: string;
|
||||||
|
title: string;
|
||||||
|
useShowBadge?: () => boolean;
|
||||||
|
};
|
||||||
|
|
||||||
|
type NavigationContextType = {
|
||||||
|
currentTab: string;
|
||||||
|
setCurrentTab: (tab: string) => void;
|
||||||
|
setTabsList: (list: Tab[]) => void;
|
||||||
|
tabsList: Tab[];
|
||||||
|
};
|
||||||
|
|
||||||
|
export const NavigationContext = createContext<NavigationContextType>({} as NavigationContextType);
|
||||||
|
|
||||||
|
export function NavigationProvider({ children }: { readonly children: React.ReactNode }) {
|
||||||
|
const [currentTab, setCurrentTab] = useState('');
|
||||||
|
const [tabsList, setTabsList] = useState<Tab[]>([]);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
const defaultTab = tabsList.at(0);
|
||||||
|
if (defaultTab) setCurrentTab(defaultTab.key);
|
||||||
|
}, [tabsList]);
|
||||||
|
|
||||||
|
const value = useMemo(
|
||||||
|
() => ({ currentTab, setCurrentTab, setTabsList, tabsList }),
|
||||||
|
[currentTab, setCurrentTab, setTabsList, tabsList]
|
||||||
|
);
|
||||||
|
|
||||||
|
return <NavigationContext.Provider value={value}>{children}</NavigationContext.Provider>;
|
||||||
|
}
|
||||||
@ -8,7 +8,7 @@ query GetTransactionCurrencies {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
query GetTransactionCurrency($currencyid: Uuid!) {
|
query GetTransactionCurrency($currencyid: UUID!) {
|
||||||
transactioncurrency(transactioncurrencyid: $currencyid) {
|
transactioncurrency(transactioncurrencyid: $currencyid) {
|
||||||
currencysymbol
|
currencysymbol
|
||||||
isocurrencycode
|
isocurrencycode
|
||||||
@ -17,20 +17,33 @@ query GetTransactionCurrency($currencyid: Uuid!) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
query GetCurrencyChanges($currentDate: DateTime) {
|
query GetCurrencyChanges($currentDate: DateTime) {
|
||||||
evo_currencychanges(statecode: 0, evo_coursedate_param: { eq: $currentDate }) {
|
evo_currencychanges(
|
||||||
|
filterConditionGroup: {
|
||||||
|
andFilterConditions: [
|
||||||
|
{ filterConditionInt: { fieldName: "statecode", eq: 0 } }
|
||||||
|
{ filterConditionDateTime: { fieldName: "evo_coursedate", eq: $currentDate } }
|
||||||
|
]
|
||||||
|
}
|
||||||
|
) {
|
||||||
evo_currencychange
|
evo_currencychange
|
||||||
evo_ref_transactioncurrency
|
evo_ref_transactioncurrency
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
query GetLeads($domainname: String) {
|
query GetLeads($domainname: String) {
|
||||||
leads(owner_domainname: $domainname) {
|
systemusers(
|
||||||
label: fullname
|
filterConditionGroup: {
|
||||||
value: leadid
|
andFilterConditions: { filterConditionString: { fieldName: "domainname", eq: $domainname } }
|
||||||
|
}
|
||||||
|
) {
|
||||||
|
leads(orderby: { fieldName: "createdon", sortingType: DESC }) {
|
||||||
|
label: fullname
|
||||||
|
value: leadid
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
query GetLead($leadid: Uuid!) {
|
query GetLead($leadid: UUID!) {
|
||||||
lead(leadid: $leadid) {
|
lead(leadid: $leadid) {
|
||||||
evo_agent_accountid
|
evo_agent_accountid
|
||||||
evo_double_agent_accountid
|
evo_double_agent_accountid
|
||||||
@ -52,7 +65,7 @@ query GetLead($leadid: Uuid!) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
query GetOpportunity($opportunityid: Uuid!) {
|
query GetOpportunity($opportunityid: UUID!) {
|
||||||
opportunity(opportunityid: $opportunityid) {
|
opportunity(opportunityid: $opportunityid) {
|
||||||
evo_leadid
|
evo_leadid
|
||||||
accountidData {
|
accountidData {
|
||||||
@ -67,14 +80,28 @@ query GetOpportunity($opportunityid: Uuid!) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
query GetOpportunities($domainname: String) {
|
query GetOpportunities($domainname: String) {
|
||||||
opportunities(owner_domainname: $domainname) {
|
systemusers(
|
||||||
label: name
|
filterConditionGroup: {
|
||||||
value: opportunityid
|
andFilterConditions: { filterConditionString: { fieldName: "domainname", eq: $domainname } }
|
||||||
|
}
|
||||||
|
) {
|
||||||
|
opportunities(orderby: { fieldName: "createdon", sortingType: DESC }) {
|
||||||
|
label: name
|
||||||
|
value: opportunityid
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
query GetQuotes($leadid: Uuid!) {
|
query GetQuotes($leadid: UUID!) {
|
||||||
quotes(evo_leadid: $leadid) {
|
quotes(
|
||||||
|
filterConditionGroup: {
|
||||||
|
andFilterConditions: [
|
||||||
|
{ filterConditionGuid: { fieldName: "evo_leadid", eq: $leadid } }
|
||||||
|
{ filterConditionInt: { fieldName: "statecode", eq: 0 } }
|
||||||
|
]
|
||||||
|
}
|
||||||
|
orderby: { fieldName: "createdon", sortingType: DESC }
|
||||||
|
) {
|
||||||
label: evo_quotename
|
label: evo_quotename
|
||||||
value: quoteid
|
value: quoteid
|
||||||
evo_recalc_limit
|
evo_recalc_limit
|
||||||
@ -85,8 +112,8 @@ query GetQuotes($leadid: Uuid!) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
query GetQuote($quoteId: Uuid!) {
|
query GetQuote($quoteId: UUID!) {
|
||||||
quote(quoteId: $quoteId) {
|
quote(quoteid: $quoteId) {
|
||||||
evo_baseproductid
|
evo_baseproductid
|
||||||
evo_one_year_insurance
|
evo_one_year_insurance
|
||||||
evo_min_change_price
|
evo_min_change_price
|
||||||
@ -113,8 +140,8 @@ query GetQuote($quoteId: Uuid!) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
query GetQuoteData($quoteId: Uuid!) {
|
query GetQuoteData($quoteId: UUID!) {
|
||||||
quote(quoteId: $quoteId) {
|
quote(quoteid: $quoteId) {
|
||||||
evo_addproduct_types {
|
evo_addproduct_types {
|
||||||
evo_product_type
|
evo_product_type
|
||||||
evo_addproduct_typeid
|
evo_addproduct_typeid
|
||||||
@ -268,9 +295,13 @@ query GetQuoteData($quoteId: Uuid!) {
|
|||||||
|
|
||||||
query GetTarifs($currentDate: DateTime) {
|
query GetTarifs($currentDate: DateTime) {
|
||||||
evo_tarifs(
|
evo_tarifs(
|
||||||
statecode: 0
|
filterConditionGroup: {
|
||||||
evo_datefrom_param: { lte: $currentDate }
|
andFilterConditions: [
|
||||||
evo_dateto_param: { gte: $currentDate }
|
{ filterConditionInt: { fieldName: "statecode", eq: 0 } }
|
||||||
|
{ filterConditionDateTime: { fieldName: "evo_datefrom", lte: $currentDate } }
|
||||||
|
{ filterConditionDateTime: { fieldName: "evo_dateto", gte: $currentDate } }
|
||||||
|
]
|
||||||
|
}
|
||||||
) {
|
) {
|
||||||
label: evo_name
|
label: evo_name
|
||||||
value: evo_tarifid
|
value: evo_tarifid
|
||||||
@ -293,7 +324,7 @@ query GetTarifs($currentDate: DateTime) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
query GetTarif($tarifId: Uuid!) {
|
query GetTarif($tarifId: UUID!) {
|
||||||
evo_tarif(evo_tarifid: $tarifId) {
|
evo_tarif(evo_tarifid: $tarifId) {
|
||||||
label: evo_name
|
label: evo_name
|
||||||
value: evo_tarifid
|
value: evo_tarifid
|
||||||
@ -316,9 +347,13 @@ query GetTarif($tarifId: Uuid!) {
|
|||||||
|
|
||||||
query GetRates($currentDate: DateTime) {
|
query GetRates($currentDate: DateTime) {
|
||||||
evo_rates(
|
evo_rates(
|
||||||
statecode: 0
|
filterConditionGroup: {
|
||||||
evo_datefrom_param: { lte: $currentDate }
|
andFilterConditions: [
|
||||||
evo_dateto_param: { gte: $currentDate }
|
{ filterConditionInt: { fieldName: "statecode", eq: 0 } }
|
||||||
|
{ filterConditionDateTime: { fieldName: "evo_datefrom", lte: $currentDate } }
|
||||||
|
{ filterConditionDateTime: { fieldName: "evo_dateto", gte: $currentDate } }
|
||||||
|
]
|
||||||
|
}
|
||||||
) {
|
) {
|
||||||
label: evo_name
|
label: evo_name
|
||||||
value: evo_rateid
|
value: evo_rateid
|
||||||
@ -330,7 +365,7 @@ query GetRates($currentDate: DateTime) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
query GetRate($rateId: Uuid!) {
|
query GetRate($rateId: UUID!) {
|
||||||
evo_rate(evo_rateid: $rateId) {
|
evo_rate(evo_rateid: $rateId) {
|
||||||
evo_base_rate
|
evo_base_rate
|
||||||
evo_credit_period
|
evo_credit_period
|
||||||
@ -341,10 +376,14 @@ query GetRate($rateId: Uuid!) {
|
|||||||
|
|
||||||
query GetProducts($currentDate: DateTime) {
|
query GetProducts($currentDate: DateTime) {
|
||||||
evo_baseproducts(
|
evo_baseproducts(
|
||||||
statecode: 0
|
filterConditionGroup: {
|
||||||
evo_relation: [100000000]
|
andFilterConditions: [
|
||||||
evo_datefrom_param: { lte: $currentDate }
|
{ filterConditionInt: { fieldName: "statecode", eq: 0 } }
|
||||||
evo_dateto_param: { gte: $currentDate }
|
{ filterConditionDateTime: { fieldName: "evo_datefrom", lte: $currentDate } }
|
||||||
|
{ filterConditionDateTime: { fieldName: "evo_dateto", gte: $currentDate } }
|
||||||
|
{ filterConditionMultyPicklist: { fieldName: "evo_relation", oneof: [100000000] } }
|
||||||
|
]
|
||||||
|
}
|
||||||
) {
|
) {
|
||||||
label: evo_name
|
label: evo_name
|
||||||
value: evo_baseproductid
|
value: evo_baseproductid
|
||||||
@ -355,7 +394,7 @@ query GetProducts($currentDate: DateTime) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
query GetProduct($productId: Uuid!) {
|
query GetProduct($productId: UUID!) {
|
||||||
evo_baseproduct(evo_baseproductid: $productId) {
|
evo_baseproduct(evo_baseproductid: $productId) {
|
||||||
evo_leasingobject_types {
|
evo_leasingobject_types {
|
||||||
evo_leasingobject_typeid
|
evo_leasingobject_typeid
|
||||||
@ -381,9 +420,13 @@ query GetProduct($productId: Uuid!) {
|
|||||||
|
|
||||||
query GetSubsidies($currentDate: DateTime) {
|
query GetSubsidies($currentDate: DateTime) {
|
||||||
evo_subsidies(
|
evo_subsidies(
|
||||||
statecode: 0
|
filterConditionGroup: {
|
||||||
evo_datefrom_param: { lte: $currentDate }
|
andFilterConditions: [
|
||||||
evo_dateto_param: { gte: $currentDate }
|
{ filterConditionInt: { fieldName: "statecode", eq: 0 } }
|
||||||
|
{ filterConditionDateTime: { fieldName: "evo_datefrom", lte: $currentDate } }
|
||||||
|
{ filterConditionDateTime: { fieldName: "evo_dateto", gte: $currentDate } }
|
||||||
|
]
|
||||||
|
}
|
||||||
) {
|
) {
|
||||||
label: evo_name
|
label: evo_name
|
||||||
value: evo_subsidyid
|
value: evo_subsidyid
|
||||||
@ -391,7 +434,7 @@ query GetSubsidies($currentDate: DateTime) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
query GetSubsidy($subsidyId: Uuid!) {
|
query GetSubsidy($subsidyId: UUID!) {
|
||||||
evo_subsidy(evo_subsidyid: $subsidyId) {
|
evo_subsidy(evo_subsidyid: $subsidyId) {
|
||||||
evo_leasingobject_types {
|
evo_leasingobject_types {
|
||||||
evo_leasingobject_typeid
|
evo_leasingobject_typeid
|
||||||
@ -413,7 +456,7 @@ query GetSubsidy($subsidyId: Uuid!) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
query GetImportProgram($importProgramId: Uuid!) {
|
query GetImportProgram($importProgramId: UUID!) {
|
||||||
importProgram: evo_subsidy(evo_subsidyid: $importProgramId) {
|
importProgram: evo_subsidy(evo_subsidyid: $importProgramId) {
|
||||||
evo_leasingobject_types {
|
evo_leasingobject_types {
|
||||||
evo_leasingobject_typeid
|
evo_leasingobject_typeid
|
||||||
@ -431,7 +474,7 @@ query GetImportProgram($importProgramId: Uuid!) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
query GetRegions {
|
query GetRegions {
|
||||||
evo_regions {
|
evo_regions(orderby: { fieldName: "evo_name", sortingType: ASC }) {
|
||||||
label: evo_name
|
label: evo_name
|
||||||
value: evo_regionid
|
value: evo_regionid
|
||||||
evo_fias_id
|
evo_fias_id
|
||||||
@ -439,7 +482,7 @@ query GetRegions {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
query GetRegion($regionId: Uuid!) {
|
query GetRegion($regionId: UUID!) {
|
||||||
evo_region(evo_regionid: $regionId) {
|
evo_region(evo_regionid: $regionId) {
|
||||||
evo_oktmo
|
evo_oktmo
|
||||||
accounts {
|
accounts {
|
||||||
@ -449,8 +492,16 @@ query GetRegion($regionId: Uuid!) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
query GetTowns($regionId: Uuid!) {
|
query GetTowns($regionId: UUID!) {
|
||||||
evo_towns(evo_regionid: $regionId) {
|
evo_towns(
|
||||||
|
filterConditionGroup: {
|
||||||
|
andFilterConditions: [
|
||||||
|
{ filterConditionGuid: { fieldName: "evo_regionid", eq: $regionId } }
|
||||||
|
{ filterConditionInt: { fieldName: "statecode", eq: 0 } }
|
||||||
|
]
|
||||||
|
}
|
||||||
|
orderby: { fieldName: "evo_name", sortingType: ASC }
|
||||||
|
) {
|
||||||
evo_fias_id
|
evo_fias_id
|
||||||
label: evo_name
|
label: evo_name
|
||||||
value: evo_townid
|
value: evo_townid
|
||||||
@ -458,22 +509,33 @@ query GetTowns($regionId: Uuid!) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
query GetTown($townId: Uuid!) {
|
query GetTown($townId: UUID!) {
|
||||||
evo_town(evo_townid: $townId) {
|
evo_town(evo_townid: $townId) {
|
||||||
evo_kladr_id
|
evo_kladr_id
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
query GetGPSBrands {
|
query GetGPSBrands {
|
||||||
evo_gps_brands(statecode: 0) {
|
evo_gps_brands(
|
||||||
|
filterConditionGroup: {
|
||||||
|
andFilterConditions: { filterConditionInt: { fieldName: "statecode", eq: 0 } }
|
||||||
|
}
|
||||||
|
) {
|
||||||
label: evo_name
|
label: evo_name
|
||||||
value: evo_gps_brandid
|
value: evo_gps_brandid
|
||||||
evo_id
|
evo_id
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
query GetGPSModels($gpsBrandId: Uuid!) {
|
query GetGPSModels($gpsBrandId: UUID!) {
|
||||||
evo_gps_models(evo_gps_brandid: $gpsBrandId) {
|
evo_gps_models(
|
||||||
|
filterConditionGroup: {
|
||||||
|
andFilterConditions: [
|
||||||
|
{ filterConditionGuid: { fieldName: "evo_gps_brandid", eq: $gpsBrandId } }
|
||||||
|
{ filterConditionInt: { fieldName: "statecode", eq: 0 } }
|
||||||
|
]
|
||||||
|
}
|
||||||
|
) {
|
||||||
label: evo_name
|
label: evo_name
|
||||||
value: evo_gps_modelid
|
value: evo_gps_modelid
|
||||||
evo_id
|
evo_id
|
||||||
@ -481,14 +543,18 @@ query GetGPSModels($gpsBrandId: Uuid!) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
query GetLeaseObjectTypes {
|
query GetLeaseObjectTypes {
|
||||||
evo_leasingobject_types(statecode: 0) {
|
evo_leasingobject_types(
|
||||||
|
filterConditionGroup: {
|
||||||
|
andFilterConditions: { filterConditionInt: { fieldName: "statecode", eq: 0 } }
|
||||||
|
}
|
||||||
|
) {
|
||||||
label: evo_name
|
label: evo_name
|
||||||
value: evo_leasingobject_typeid
|
value: evo_leasingobject_typeid
|
||||||
evo_leasingobject_typeid
|
evo_leasingobject_typeid
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
query GetLeaseObjectType($leaseObjectTypeId: Uuid!) {
|
query GetLeaseObjectType($leaseObjectTypeId: UUID!) {
|
||||||
evo_leasingobject_type(evo_leasingobject_typeid: $leaseObjectTypeId) {
|
evo_leasingobject_type(evo_leasingobject_typeid: $leaseObjectTypeId) {
|
||||||
evo_vehicle_type
|
evo_vehicle_type
|
||||||
evo_id
|
evo_id
|
||||||
@ -508,7 +574,12 @@ query GetLeaseObjectType($leaseObjectTypeId: Uuid!) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
query GetBrands {
|
query GetBrands {
|
||||||
evo_brands(statecode: 0) {
|
evo_brands(
|
||||||
|
filterConditionGroup: {
|
||||||
|
andFilterConditions: { filterConditionInt: { fieldName: "statecode", eq: 0 } }
|
||||||
|
}
|
||||||
|
orderby: { fieldName: "evo_name", sortingType: ASC }
|
||||||
|
) {
|
||||||
label: evo_name
|
label: evo_name
|
||||||
value: evo_brandid
|
value: evo_brandid
|
||||||
evo_brandid
|
evo_brandid
|
||||||
@ -516,7 +587,7 @@ query GetBrands {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
query GetBrand($brandId: Uuid!) {
|
query GetBrand($brandId: UUID!) {
|
||||||
evo_brand(evo_brandid: $brandId) {
|
evo_brand(evo_brandid: $brandId) {
|
||||||
evo_id
|
evo_id
|
||||||
evo_importer_reward_perc
|
evo_importer_reward_perc
|
||||||
@ -526,8 +597,16 @@ query GetBrand($brandId: Uuid!) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
query GetModels($brandId: Uuid!) {
|
query GetModels($brandId: UUID!) {
|
||||||
evo_models(statecode: 0, evo_brandid: $brandId) {
|
evo_models(
|
||||||
|
filterConditionGroup: {
|
||||||
|
andFilterConditions: [
|
||||||
|
{ filterConditionInt: { fieldName: "statecode", eq: 0 } }
|
||||||
|
{ filterConditionGuid: { fieldName: "evo_brandid", eq: $brandId } }
|
||||||
|
]
|
||||||
|
}
|
||||||
|
orderby: { fieldName: "evo_name", sortingType: ASC }
|
||||||
|
) {
|
||||||
label: evo_name
|
label: evo_name
|
||||||
value: evo_modelid
|
value: evo_modelid
|
||||||
evo_modelid
|
evo_modelid
|
||||||
@ -537,7 +616,7 @@ query GetModels($brandId: Uuid!) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
query GetModel($modelId: Uuid!) {
|
query GetModel($modelId: UUID!) {
|
||||||
evo_model(evo_modelid: $modelId) {
|
evo_model(evo_modelid: $modelId) {
|
||||||
evo_impairment_groupidData {
|
evo_impairment_groupidData {
|
||||||
evo_name
|
evo_name
|
||||||
@ -554,15 +633,22 @@ query GetModel($modelId: Uuid!) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
query GetConfigurations($modelId: Uuid!) {
|
query GetConfigurations($modelId: UUID!) {
|
||||||
evo_equipments(statecode: 0, evo_modelid: $modelId) {
|
evo_equipments(
|
||||||
|
filterConditionGroup: {
|
||||||
|
andFilterConditions: [
|
||||||
|
{ filterConditionInt: { fieldName: "statecode", eq: 0 } }
|
||||||
|
{ filterConditionGuid: { fieldName: "evo_modelid", eq: $modelId } }
|
||||||
|
]
|
||||||
|
}
|
||||||
|
) {
|
||||||
label: evo_name
|
label: evo_name
|
||||||
value: evo_equipmentid
|
value: evo_equipmentid
|
||||||
evo_start_production_year
|
evo_start_production_year
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
query GetConfiguration($configurationId: Uuid!) {
|
query GetConfiguration($configurationId: UUID!) {
|
||||||
evo_equipment(evo_equipmentid: $configurationId) {
|
evo_equipment(evo_equipmentid: $configurationId) {
|
||||||
evo_impairment_groupidData {
|
evo_impairment_groupidData {
|
||||||
evo_name
|
evo_name
|
||||||
@ -571,7 +657,7 @@ query GetConfiguration($configurationId: Uuid!) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
query GetDealers {
|
query GetDealers {
|
||||||
dealers: accounts(evo_account_type: [100000001], statecode: 0, evo_legal_form: 100000001) {
|
dealers {
|
||||||
label: name
|
label: name
|
||||||
value: accountid
|
value: accountid
|
||||||
accountid
|
accountid
|
||||||
@ -579,16 +665,16 @@ query GetDealers {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
query GetDealer($dealerId: Uuid!) {
|
query GetDealer($dealerId: UUID!) {
|
||||||
dealer: account(accountid: $dealerId) {
|
dealer(accountid: $dealerId) {
|
||||||
evo_return_leasing_dealer
|
evo_return_leasing_dealer
|
||||||
evo_broker_accountid
|
evo_broker_accountid
|
||||||
evo_supplier_financing_accept
|
evo_supplier_financing_accept
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
query GetDealerPersons($dealerId: Uuid!) {
|
query GetDealerPersons($dealerId: UUID!) {
|
||||||
dealerPersons: salon_providers(statecode: 0, salonaccountid: $dealerId) {
|
dealerPersons: dealer_persons(salonaccountid: $dealerId) {
|
||||||
label: name
|
label: name
|
||||||
value: accountid
|
value: accountid
|
||||||
accountid
|
accountid
|
||||||
@ -598,27 +684,43 @@ query GetDealerPersons($dealerId: Uuid!) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
query GetDealerPerson($dealerPersonId: Uuid!) {
|
query GetDealerPerson($dealerPersonId: UUID!) {
|
||||||
account(accountid: $dealerPersonId) {
|
dealer_person(accountid: $dealerPersonId) {
|
||||||
evo_supplier_type
|
evo_supplier_type
|
||||||
evo_supplier_financing_accept
|
evo_supplier_financing_accept
|
||||||
|
evo_return_leasing_dealer
|
||||||
|
evo_broker_accountid
|
||||||
|
evo_supplier_financing_accept
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
query GetAgent($agentid: Uuid!) {
|
query GetAgent($agentid: UUID!) {
|
||||||
agent: account(accountid: $agentid) {
|
agent(accountid: $agentid) {
|
||||||
label: name
|
label: name
|
||||||
value: accountid
|
value: accountid
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
query GetRewardConditions($agentid: Uuid!, $currentDate: DateTime) {
|
query GetRewardConditions($agentid: UUID!, $currentDate: DateTime) {
|
||||||
evo_reward_conditions(
|
evo_reward_conditions(
|
||||||
evo_agent_accountid: $agentid
|
filterConditionGroup: {
|
||||||
evo_datefrom_param: { lte: $currentDate }
|
andFilterConditionGroup: [
|
||||||
evo_dateto_param: { gte: $currentDate }
|
{
|
||||||
statecode: 0
|
orFilterConditions: [
|
||||||
evo_agency_agreementid_param: { has: true }
|
{ filterConditionDateTime: { fieldName: "evo_dateto", gte: $currentDate } }
|
||||||
|
{ filterConditionDateTime: { fieldName: "evo_dateto", eq: null } }
|
||||||
|
]
|
||||||
|
}
|
||||||
|
{
|
||||||
|
andFilterConditions: [
|
||||||
|
{ filterConditionGuid: { fieldName: "evo_agent_accountid", eq: $agentid } }
|
||||||
|
{ filterConditionDateTime: { fieldName: "evo_datefrom", lte: $currentDate } }
|
||||||
|
{ filterConditionInt: { fieldName: "statecode", eq: 0 } }
|
||||||
|
{ filterConditionGuid: { fieldName: "evo_agency_agreementid", neq: null } }
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
) {
|
) {
|
||||||
label: evo_name
|
label: evo_name
|
||||||
value: evo_reward_conditionid
|
value: evo_reward_conditionid
|
||||||
@ -627,7 +729,7 @@ query GetRewardConditions($agentid: Uuid!, $currentDate: DateTime) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
query GetRewardCondition($conditionId: Uuid!) {
|
query GetRewardCondition($conditionId: UUID!) {
|
||||||
evo_reward_condition(evo_reward_conditionid: $conditionId) {
|
evo_reward_condition(evo_reward_conditionid: $conditionId) {
|
||||||
evo_reward_summ
|
evo_reward_summ
|
||||||
evo_reduce_reward
|
evo_reduce_reward
|
||||||
@ -642,16 +744,27 @@ query GetRewardCondition($conditionId: Uuid!) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
query GetSotCoefficientType($evo_id: String) {
|
query GetSotCoefficientType($evo_id: String) {
|
||||||
evo_sot_coefficient_type(evo_id: $evo_id) {
|
evo_sot_coefficient_types(
|
||||||
|
filterConditionGroup: {
|
||||||
|
andFilterConditions: [
|
||||||
|
{ filterConditionString: { fieldName: "evo_id", eq: $evo_id } }
|
||||||
|
{ filterConditionInt: { fieldName: "statecode", eq: 0 } }
|
||||||
|
]
|
||||||
|
}
|
||||||
|
) {
|
||||||
evo_sot_coefficient_typeid
|
evo_sot_coefficient_typeid
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
query GetCoefficients($currentDate: DateTime) {
|
query GetCoefficients($currentDate: DateTime) {
|
||||||
evo_coefficients(
|
evo_coefficients(
|
||||||
statecode: 0
|
filterConditionGroup: {
|
||||||
evo_datefrom_param: { lte: $currentDate }
|
andFilterConditions: [
|
||||||
evo_dateto_param: { gte: $currentDate }
|
{ filterConditionDateTime: { fieldName: "evo_datefrom", lte: $currentDate } }
|
||||||
|
{ filterConditionDateTime: { fieldName: "evo_dateto", gte: $currentDate } }
|
||||||
|
{ filterConditionInt: { fieldName: "statecode", eq: 0 } }
|
||||||
|
]
|
||||||
|
}
|
||||||
) {
|
) {
|
||||||
evo_job_titleid
|
evo_job_titleid
|
||||||
evo_sot_coefficient_typeid
|
evo_sot_coefficient_typeid
|
||||||
@ -677,7 +790,11 @@ query GetCoefficients($currentDate: DateTime) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
query GetSystemUser($domainname: String) {
|
query GetSystemUser($domainname: String) {
|
||||||
systemuser(domainname: $domainname) {
|
systemusers(
|
||||||
|
filterConditionGroup: {
|
||||||
|
filterCondition: { filterConditionString: { fieldName: "domainname", eq: $domainname } }
|
||||||
|
}
|
||||||
|
) {
|
||||||
evo_job_titleid
|
evo_job_titleid
|
||||||
businessunitid
|
businessunitid
|
||||||
roles {
|
roles {
|
||||||
@ -695,9 +812,13 @@ fragment CoreAddProductTypesFields on evo_addproduct_type {
|
|||||||
|
|
||||||
query GetAddproductTypes($currentDate: DateTime) {
|
query GetAddproductTypes($currentDate: DateTime) {
|
||||||
evo_addproduct_types(
|
evo_addproduct_types(
|
||||||
statecode: 0
|
filterConditionGroup: {
|
||||||
evo_datefrom_param: { lte: $currentDate }
|
andFilterConditions: [
|
||||||
evo_dateto_param: { gte: $currentDate }
|
{ filterConditionInt: { fieldName: "statecode", eq: 0 } }
|
||||||
|
{ filterConditionDateTime: { fieldName: "evo_datefrom", lte: $currentDate } }
|
||||||
|
{ filterConditionDateTime: { fieldName: "evo_dateto", gte: $currentDate } }
|
||||||
|
]
|
||||||
|
}
|
||||||
) {
|
) {
|
||||||
...CoreAddProductTypesFields
|
...CoreAddProductTypesFields
|
||||||
evo_product_type
|
evo_product_type
|
||||||
@ -711,7 +832,7 @@ query GetAddproductTypes($currentDate: DateTime) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
query GetAddProductType($addproductTypeId: Uuid!) {
|
query GetAddProductType($addproductTypeId: UUID!) {
|
||||||
evo_addproduct_type(evo_addproduct_typeid: $addproductTypeId) {
|
evo_addproduct_type(evo_addproduct_typeid: $addproductTypeId) {
|
||||||
evo_description
|
evo_description
|
||||||
evo_helpcard_type
|
evo_helpcard_type
|
||||||
@ -735,10 +856,14 @@ query GetAddProductType($addproductTypeId: Uuid!) {
|
|||||||
|
|
||||||
query GetRegistrationTypes($currentDate: DateTime) {
|
query GetRegistrationTypes($currentDate: DateTime) {
|
||||||
evo_addproduct_types(
|
evo_addproduct_types(
|
||||||
statecode: 0
|
filterConditionGroup: {
|
||||||
evo_datefrom_param: { lte: $currentDate }
|
andFilterConditions: [
|
||||||
evo_dateto_param: { gte: $currentDate }
|
{ filterConditionInt: { fieldName: "statecode", eq: 0 } }
|
||||||
evo_product_type: 100000001
|
{ filterConditionDateTime: { fieldName: "evo_datefrom", lte: $currentDate } }
|
||||||
|
{ filterConditionDateTime: { fieldName: "evo_dateto", gte: $currentDate } }
|
||||||
|
{ filterConditionInt: { fieldName: "evo_product_type", eq: 100000001 } }
|
||||||
|
]
|
||||||
|
}
|
||||||
) {
|
) {
|
||||||
...CoreAddProductTypesFields
|
...CoreAddProductTypesFields
|
||||||
evo_leasingobject_types {
|
evo_leasingobject_types {
|
||||||
@ -754,10 +879,14 @@ query GetRegistrationTypes($currentDate: DateTime) {
|
|||||||
|
|
||||||
query GetTechnicalCards($currentDate: DateTime) {
|
query GetTechnicalCards($currentDate: DateTime) {
|
||||||
evo_addproduct_types(
|
evo_addproduct_types(
|
||||||
statecode: 0
|
filterConditionGroup: {
|
||||||
evo_datefrom_param: { lte: $currentDate }
|
andFilterConditions: [
|
||||||
evo_dateto_param: { gte: $currentDate }
|
{ filterConditionInt: { fieldName: "statecode", eq: 0 } }
|
||||||
evo_product_type: 100000000
|
{ filterConditionDateTime: { fieldName: "evo_datefrom", lte: $currentDate } }
|
||||||
|
{ filterConditionDateTime: { fieldName: "evo_dateto", gte: $currentDate } }
|
||||||
|
{ filterConditionInt: { fieldName: "evo_product_type", eq: 100000000 } }
|
||||||
|
]
|
||||||
|
}
|
||||||
) {
|
) {
|
||||||
...CoreAddProductTypesFields
|
...CoreAddProductTypesFields
|
||||||
evo_min_period
|
evo_min_period
|
||||||
@ -771,10 +900,14 @@ query GetTechnicalCards($currentDate: DateTime) {
|
|||||||
|
|
||||||
query GetFuelCards($currentDate: DateTime) {
|
query GetFuelCards($currentDate: DateTime) {
|
||||||
evo_addproduct_types(
|
evo_addproduct_types(
|
||||||
statecode: 0
|
filterConditionGroup: {
|
||||||
evo_datefrom_param: { lte: $currentDate }
|
andFilterConditions: [
|
||||||
evo_dateto_param: { gte: $currentDate }
|
{ filterConditionInt: { fieldName: "statecode", eq: 0 } }
|
||||||
evo_product_type: 100000005
|
{ filterConditionDateTime: { fieldName: "evo_datefrom", lte: $currentDate } }
|
||||||
|
{ filterConditionDateTime: { fieldName: "evo_dateto", gte: $currentDate } }
|
||||||
|
{ filterConditionInt: { fieldName: "evo_product_type", eq: 100000005 } }
|
||||||
|
]
|
||||||
|
}
|
||||||
) {
|
) {
|
||||||
...CoreAddProductTypesFields
|
...CoreAddProductTypesFields
|
||||||
evo_min_period
|
evo_min_period
|
||||||
@ -787,10 +920,14 @@ query GetFuelCards($currentDate: DateTime) {
|
|||||||
|
|
||||||
query GetTelematicTypes($currentDate: DateTime) {
|
query GetTelematicTypes($currentDate: DateTime) {
|
||||||
evo_addproduct_types(
|
evo_addproduct_types(
|
||||||
statecode: 0
|
filterConditionGroup: {
|
||||||
evo_datefrom_param: { lte: $currentDate }
|
andFilterConditions: [
|
||||||
evo_dateto_param: { gte: $currentDate }
|
{ filterConditionInt: { fieldName: "statecode", eq: 0 } }
|
||||||
evo_product_type: 100000004
|
{ filterConditionDateTime: { fieldName: "evo_datefrom", lte: $currentDate } }
|
||||||
|
{ filterConditionDateTime: { fieldName: "evo_dateto", gte: $currentDate } }
|
||||||
|
{ filterConditionInt: { fieldName: "evo_product_type", eq: 100000004 } }
|
||||||
|
]
|
||||||
|
}
|
||||||
) {
|
) {
|
||||||
...CoreAddProductTypesFields
|
...CoreAddProductTypesFields
|
||||||
evo_controls_program
|
evo_controls_program
|
||||||
@ -800,10 +937,14 @@ query GetTelematicTypes($currentDate: DateTime) {
|
|||||||
|
|
||||||
query GetTrackerTypes($currentDate: DateTime) {
|
query GetTrackerTypes($currentDate: DateTime) {
|
||||||
evo_addproduct_types(
|
evo_addproduct_types(
|
||||||
statecode: 0
|
filterConditionGroup: {
|
||||||
evo_datefrom_param: { lte: $currentDate }
|
andFilterConditions: [
|
||||||
evo_dateto_param: { gte: $currentDate }
|
{ filterConditionInt: { fieldName: "statecode", eq: 0 } }
|
||||||
evo_product_type: 100000003
|
{ filterConditionDateTime: { fieldName: "evo_datefrom", lte: $currentDate } }
|
||||||
|
{ filterConditionDateTime: { fieldName: "evo_dateto", gte: $currentDate } }
|
||||||
|
{ filterConditionInt: { fieldName: "evo_product_type", eq: 100000003 } }
|
||||||
|
]
|
||||||
|
}
|
||||||
) {
|
) {
|
||||||
...CoreAddProductTypesFields
|
...CoreAddProductTypesFields
|
||||||
evo_controls_program
|
evo_controls_program
|
||||||
@ -813,10 +954,14 @@ query GetTrackerTypes($currentDate: DateTime) {
|
|||||||
|
|
||||||
query GetInsNSIBTypes($currentDate: DateTime) {
|
query GetInsNSIBTypes($currentDate: DateTime) {
|
||||||
evo_addproduct_types(
|
evo_addproduct_types(
|
||||||
statecode: 0
|
filterConditionGroup: {
|
||||||
evo_datefrom_param: { lte: $currentDate }
|
andFilterConditions: [
|
||||||
evo_dateto_param: { gte: $currentDate }
|
{ filterConditionInt: { fieldName: "statecode", eq: 0 } }
|
||||||
evo_product_type: 100000002
|
{ filterConditionDateTime: { fieldName: "evo_datefrom", lte: $currentDate } }
|
||||||
|
{ filterConditionDateTime: { fieldName: "evo_dateto", gte: $currentDate } }
|
||||||
|
{ filterConditionInt: { fieldName: "evo_product_type", eq: 100000002 } }
|
||||||
|
]
|
||||||
|
}
|
||||||
) {
|
) {
|
||||||
...CoreAddProductTypesFields
|
...CoreAddProductTypesFields
|
||||||
evo_max_period
|
evo_max_period
|
||||||
@ -834,10 +979,14 @@ query GetInsNSIBTypes($currentDate: DateTime) {
|
|||||||
|
|
||||||
query GetLeasingWithoutKaskoTypes($currentDate: DateTime) {
|
query GetLeasingWithoutKaskoTypes($currentDate: DateTime) {
|
||||||
evo_addproduct_types(
|
evo_addproduct_types(
|
||||||
statecode: 0
|
filterConditionGroup: {
|
||||||
evo_product_type: 100000007
|
andFilterConditions: [
|
||||||
evo_datefrom_param: { lte: $currentDate }
|
{ filterConditionInt: { fieldName: "statecode", eq: 0 } }
|
||||||
evo_dateto_param: { gte: $currentDate }
|
{ filterConditionDateTime: { fieldName: "evo_datefrom", lte: $currentDate } }
|
||||||
|
{ filterConditionDateTime: { fieldName: "evo_dateto", gte: $currentDate } }
|
||||||
|
{ filterConditionInt: { fieldName: "evo_product_type", eq: 100000007 } }
|
||||||
|
]
|
||||||
|
}
|
||||||
) {
|
) {
|
||||||
...CoreAddProductTypesFields
|
...CoreAddProductTypesFields
|
||||||
evo_product_type
|
evo_product_type
|
||||||
@ -859,10 +1008,14 @@ query GetLeasingWithoutKaskoTypes($currentDate: DateTime) {
|
|||||||
|
|
||||||
query GetOsagoAddproductTypes($currentDate: DateTime) {
|
query GetOsagoAddproductTypes($currentDate: DateTime) {
|
||||||
evo_addproduct_types(
|
evo_addproduct_types(
|
||||||
statecode: 0
|
filterConditionGroup: {
|
||||||
evo_product_type: 100000008
|
andFilterConditions: [
|
||||||
evo_datefrom_param: { lte: $currentDate }
|
{ filterConditionInt: { fieldName: "statecode", eq: 0 } }
|
||||||
evo_dateto_param: { gte: $currentDate }
|
{ filterConditionDateTime: { fieldName: "evo_datefrom", lte: $currentDate } }
|
||||||
|
{ filterConditionDateTime: { fieldName: "evo_dateto", gte: $currentDate } }
|
||||||
|
{ filterConditionInt: { fieldName: "evo_product_type", eq: 100000008 } }
|
||||||
|
]
|
||||||
|
}
|
||||||
) {
|
) {
|
||||||
evo_product_type
|
evo_product_type
|
||||||
evo_visible_calc
|
evo_visible_calc
|
||||||
@ -880,8 +1033,8 @@ query GetOsagoAddproductTypes($currentDate: DateTime) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
query GetInsuranceCompany($accountId: Uuid!) {
|
query GetInsuranceCompany($accountId: UUID!) {
|
||||||
account(accountid: $accountId) {
|
account: insurance(accountid: $accountId) {
|
||||||
evo_osago_with_kasko
|
evo_osago_with_kasko
|
||||||
evo_legal_region_calc
|
evo_legal_region_calc
|
||||||
accountid
|
accountid
|
||||||
@ -889,7 +1042,7 @@ query GetInsuranceCompany($accountId: Uuid!) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
query GetInsuranceCompanies {
|
query GetInsuranceCompanies {
|
||||||
accounts(evo_account_type: [100000002], statecode: 0) {
|
accounts: insurances {
|
||||||
evo_type_ins_policy
|
evo_type_ins_policy
|
||||||
evo_evokasko_access
|
evo_evokasko_access
|
||||||
evo_inn
|
evo_inn
|
||||||
@ -903,7 +1056,11 @@ query GetInsuranceCompanies {
|
|||||||
}
|
}
|
||||||
|
|
||||||
query GetRoles($roleName: String) {
|
query GetRoles($roleName: String) {
|
||||||
roles(name: $roleName) {
|
roles(
|
||||||
|
filterConditionGroup: {
|
||||||
|
andFilterConditions: { filterConditionString: { fieldName: "name", eq: $roleName } }
|
||||||
|
}
|
||||||
|
) {
|
||||||
systemusers {
|
systemusers {
|
||||||
label: fullname
|
label: fullname
|
||||||
value: domainname
|
value: domainname
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@ -1,12 +1,14 @@
|
|||||||
import type * as CRMTypes from '@/graphql/crm.types';
|
import type * as CRMTypes from '@/graphql/crm.types';
|
||||||
|
|
||||||
function evo_baseproducts(evo_baseproducts: CRMTypes.GetProductsQuery['evo_baseproducts']) {
|
type SystemUser = NonNullable<CRMTypes.GetSystemUserQuery['systemusers']>[number];
|
||||||
|
|
||||||
|
function evo_baseproducts(baseproducts: CRMTypes.GetProductsQuery['evo_baseproducts']) {
|
||||||
return {
|
return {
|
||||||
filterBy: {
|
filterBy: {
|
||||||
systemuser(systemuser: CRMTypes.GetSystemUserQuery['systemuser']) {
|
systemuser(systemuser: SystemUser) {
|
||||||
if (!evo_baseproducts?.length || !systemuser) return [];
|
if (!baseproducts?.length || !systemuser) return [];
|
||||||
|
|
||||||
return evo_baseproducts?.filter(
|
return baseproducts?.filter(
|
||||||
(evo_baseproduct) =>
|
(evo_baseproduct) =>
|
||||||
!evo_baseproduct?.systemusers?.length ||
|
!evo_baseproduct?.systemusers?.length ||
|
||||||
evo_baseproduct?.systemusers?.some(
|
evo_baseproduct?.systemusers?.some(
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
@ -4,7 +4,7 @@
|
|||||||
"private": true,
|
"private": true,
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build": "next build",
|
"build": "next build",
|
||||||
"prebuild": "ts-node --project ./tsconfig.node.json ./scripts/generate-antd-css.ts",
|
"prebuild": "NODE_ENV=production ts-node --project ./tsconfig.node.json ./scripts/generate-antd-css.ts",
|
||||||
"dev": "next dev",
|
"dev": "next dev",
|
||||||
"predev": "ts-node --project ./tsconfig.node.json ./scripts/generate-antd-css.ts",
|
"predev": "ts-node --project ./tsconfig.node.json ./scripts/generate-antd-css.ts",
|
||||||
"lint": "next lint",
|
"lint": "next lint",
|
||||||
@ -16,6 +16,7 @@
|
|||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@apollo/client": "^3.9.5",
|
"@apollo/client": "^3.9.5",
|
||||||
|
"@artsy/fresnel": "^7.1.4",
|
||||||
"@fontsource/montserrat": "^4.5.14",
|
"@fontsource/montserrat": "^4.5.14",
|
||||||
"@sentry/nextjs": "^7.102.0",
|
"@sentry/nextjs": "^7.102.0",
|
||||||
"@sentry/node": "^7.102.0",
|
"@sentry/node": "^7.102.0",
|
||||||
@ -56,7 +57,7 @@
|
|||||||
"@vchikalkin/eslint-config-awesome": "^1.1.6",
|
"@vchikalkin/eslint-config-awesome": "^1.1.6",
|
||||||
"antd": "^5.14.2",
|
"antd": "^5.14.2",
|
||||||
"eslint": "^8.52.0",
|
"eslint": "^8.52.0",
|
||||||
"gql-sdl": "^1.0.0",
|
"gql-sdl": "^1.1.0",
|
||||||
"jest": "^29.4.3",
|
"jest": "^29.4.3",
|
||||||
"jest-environment-jsdom": "^29.3.1",
|
"jest-environment-jsdom": "^29.3.1",
|
||||||
"msw": "^1.1.0",
|
"msw": "^1.1.0",
|
||||||
|
|||||||
@ -4,13 +4,14 @@ import '../styles/antd-fix.css';
|
|||||||
import '../styles/antd.min.css';
|
import '../styles/antd.min.css';
|
||||||
import initializeQueryClient from '@/api/client';
|
import initializeQueryClient from '@/api/client';
|
||||||
import initializeApollo from '@/apollo/client';
|
import initializeApollo from '@/apollo/client';
|
||||||
import { Loading, Notification } from '@/Components/Common';
|
import { Loading } from '@/Components/Common';
|
||||||
import Layout from '@/Components/Layout';
|
import Layout from '@/Components/Layout';
|
||||||
import { theme } from '@/config/ui';
|
import { theme } from '@/config/ui';
|
||||||
import { usePageLoading } from '@/hooks';
|
import { usePageLoading } from '@/hooks';
|
||||||
import StoreProvider from '@/stores/Provider';
|
import StoreProvider from '@/stores/Provider';
|
||||||
import getColors from '@/styles/colors';
|
import getColors from '@/styles/colors';
|
||||||
import { GlobalStyle } from '@/styles/global-style';
|
import { GlobalStyle } from '@/styles/global-style';
|
||||||
|
import { MediaContextProvider } from '@/styles/media';
|
||||||
import { trpcClient } from '@/trpc/client';
|
import { trpcClient } from '@/trpc/client';
|
||||||
import { ApolloProvider } from '@apollo/client';
|
import { ApolloProvider } from '@apollo/client';
|
||||||
import { QueryClientProvider } from '@tanstack/react-query';
|
import { QueryClientProvider } from '@tanstack/react-query';
|
||||||
@ -54,11 +55,11 @@ function App({ Component, pageProps }) {
|
|||||||
},
|
},
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<Notification>
|
<MediaContextProvider>
|
||||||
<Layout {...pageProps}>
|
<Layout {...pageProps}>
|
||||||
{loading ? <Loading /> : <Component {...pageProps} />}
|
{loading ? <Loading /> : <Component {...pageProps} />}
|
||||||
</Layout>
|
</Layout>
|
||||||
</Notification>
|
</MediaContextProvider>
|
||||||
</AntdConfig>
|
</AntdConfig>
|
||||||
</QueryClientProvider>
|
</QueryClientProvider>
|
||||||
</ApolloProvider>
|
</ApolloProvider>
|
||||||
|
|||||||
@ -29,7 +29,7 @@ export async function getServerSideProps({ req }) {
|
|||||||
const { cookie = '' } = req.headers;
|
const { cookie = '' } = req.headers;
|
||||||
|
|
||||||
const queryClient = new QueryClient();
|
const queryClient = new QueryClient();
|
||||||
const apolloClient = initializeApollo();
|
const apolloClient = initializeApollo(null, req.headers);
|
||||||
const getUserType = makeGetUserType({ apolloClient, queryClient });
|
const getUserType = makeGetUserType({ apolloClient, queryClient });
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
|||||||
@ -1,34 +1,23 @@
|
|||||||
import initializeApollo from '@/apollo/client';
|
import initializeApollo from '@/apollo/client';
|
||||||
import * as Calculation from '@/Components/Calculation';
|
import { Content } from '@/Components/Calculation';
|
||||||
import { Error } from '@/Components/Common/Error';
|
import { Error } from '@/Components/Common/Error';
|
||||||
import * as hooks from '@/process/hooks';
|
import * as hooks from '@/process/hooks';
|
||||||
import { getPageTitle } from '@/utils/page';
|
|
||||||
import { makeGetUserType } from '@/utils/user';
|
import { makeGetUserType } from '@/utils/user';
|
||||||
import { dehydrate, QueryClient } from '@tanstack/react-query';
|
import { dehydrate, QueryClient } from '@tanstack/react-query';
|
||||||
import Head from 'next/head';
|
|
||||||
|
|
||||||
function Content() {
|
|
||||||
hooks.useSentryScope();
|
|
||||||
hooks.useMainData();
|
|
||||||
hooks.useInsuranceData();
|
|
||||||
hooks.useReactions();
|
|
||||||
|
|
||||||
return (
|
|
||||||
<Calculation.Layout>
|
|
||||||
<Head>
|
|
||||||
<title>{getPageTitle()}</title>
|
|
||||||
</Head>
|
|
||||||
<Calculation.Form prune={['unlimited']} />
|
|
||||||
<Calculation.Settings />
|
|
||||||
<Calculation.Output />
|
|
||||||
</Calculation.Layout>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
export default function Page(props) {
|
export default function Page(props) {
|
||||||
if (props.statusCode !== 200) return <Error {...props} />;
|
if (props.statusCode !== 200) return <Error {...props} />;
|
||||||
|
|
||||||
return <Content />;
|
return (
|
||||||
|
<Content
|
||||||
|
initHooks={() => {
|
||||||
|
hooks.useSentryScope();
|
||||||
|
hooks.useMainData();
|
||||||
|
hooks.useInsuranceData();
|
||||||
|
hooks.useReactions();
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @type {import('next').GetServerSideProps} */
|
/** @type {import('next').GetServerSideProps} */
|
||||||
@ -36,7 +25,7 @@ export async function getServerSideProps({ req }) {
|
|||||||
const { cookie = '' } = req.headers;
|
const { cookie = '' } = req.headers;
|
||||||
|
|
||||||
const queryClient = new QueryClient();
|
const queryClient = new QueryClient();
|
||||||
const apolloClient = initializeApollo();
|
const apolloClient = initializeApollo(null, req.headers);
|
||||||
const getUserType = makeGetUserType({ apolloClient, queryClient });
|
const getUserType = makeGetUserType({ apolloClient, queryClient });
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
|||||||
@ -1,35 +1,25 @@
|
|||||||
import initializeApollo from '@/apollo/client';
|
import initializeApollo from '@/apollo/client';
|
||||||
import * as Calculation from '@/Components/Calculation';
|
import { Content } from '@/Components/Calculation';
|
||||||
import { Error } from '@/Components/Common/Error';
|
import { Error } from '@/Components/Common/Error';
|
||||||
import * as hooks from '@/process/hooks';
|
import * as hooks from '@/process/hooks';
|
||||||
import { getPageTitle } from '@/utils/page';
|
|
||||||
import { makeGetUserType } from '@/utils/user';
|
import { makeGetUserType } from '@/utils/user';
|
||||||
import { dehydrate, QueryClient } from '@tanstack/react-query';
|
import { dehydrate, QueryClient } from '@tanstack/react-query';
|
||||||
import Head from 'next/head';
|
|
||||||
|
|
||||||
function Content() {
|
|
||||||
hooks.useSentryScope();
|
|
||||||
hooks.useMainData();
|
|
||||||
hooks.useGetUsers();
|
|
||||||
hooks.useInsuranceData();
|
|
||||||
hooks.useReactions();
|
|
||||||
|
|
||||||
return (
|
|
||||||
<Calculation.Layout>
|
|
||||||
<Head>
|
|
||||||
<title>{getPageTitle('Без ограничений')}</title>
|
|
||||||
</Head>
|
|
||||||
<Calculation.Form />
|
|
||||||
<Calculation.Settings />
|
|
||||||
<Calculation.Output />
|
|
||||||
</Calculation.Layout>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
export default function Page(props) {
|
export default function Page(props) {
|
||||||
if (props.statusCode !== 200) return <Error {...props} />;
|
if (props.statusCode !== 200) return <Error {...props} />;
|
||||||
|
|
||||||
return <Content />;
|
return (
|
||||||
|
<Content
|
||||||
|
title="Без ограничений"
|
||||||
|
initHooks={() => {
|
||||||
|
hooks.useSentryScope();
|
||||||
|
hooks.useMainData();
|
||||||
|
hooks.useGetUsers();
|
||||||
|
hooks.useInsuranceData();
|
||||||
|
hooks.useReactions();
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @type {import('next').GetServerSideProps} */
|
/** @type {import('next').GetServerSideProps} */
|
||||||
@ -37,7 +27,7 @@ export async function getServerSideProps({ req }) {
|
|||||||
const { cookie = '' } = req.headers;
|
const { cookie = '' } = req.headers;
|
||||||
|
|
||||||
const queryClient = new QueryClient();
|
const queryClient = new QueryClient();
|
||||||
const apolloClient = initializeApollo();
|
const apolloClient = initializeApollo(null, req.headers);
|
||||||
const getUserType = makeGetUserType({ apolloClient, queryClient });
|
const getUserType = makeGetUserType({ apolloClient, queryClient });
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
|||||||
@ -1,14 +1,12 @@
|
|||||||
import type { GetQuoteInputData, GetQuoteProcessData } from '../load-kp/types';
|
import type { GetQuoteInputData, GetQuoteProcessData } from '../load-kp/types';
|
||||||
import initializeApollo from '@/apollo/client';
|
|
||||||
import defaultValues from '@/config/default-values';
|
import defaultValues from '@/config/default-values';
|
||||||
import * as CRMTypes from '@/graphql/crm.types';
|
import * as CRMTypes from '@/graphql/crm.types';
|
||||||
|
|
||||||
export async function getKPData({
|
export async function getKPData({
|
||||||
values: { recalcWithRevision },
|
values: { recalcWithRevision },
|
||||||
quote,
|
quote,
|
||||||
|
ctx: { apolloClient },
|
||||||
}: GetQuoteInputData): Promise<GetQuoteProcessData> {
|
}: GetQuoteInputData): Promise<GetQuoteProcessData> {
|
||||||
const apolloClient = initializeApollo();
|
|
||||||
|
|
||||||
const registration =
|
const registration =
|
||||||
quote?.evo_addproduct_types?.find((x) => x?.evo_product_type === 100_000_001)
|
quote?.evo_addproduct_types?.find((x) => x?.evo_product_type === 100_000_001)
|
||||||
?.evo_addproduct_typeid ?? defaultValues.registration;
|
?.evo_addproduct_typeid ?? defaultValues.registration;
|
||||||
|
|||||||
@ -4,7 +4,7 @@ import type { ProcessContext } from '../types';
|
|||||||
import { createValidationSchema } from './validation';
|
import { createValidationSchema } from './validation';
|
||||||
import { selectRequirementTelematic } from '@/config/default-options';
|
import { selectRequirementTelematic } from '@/config/default-options';
|
||||||
import * as CRMTypes from '@/graphql/crm.types';
|
import * as CRMTypes from '@/graphql/crm.types';
|
||||||
import { getCurrentISODate } from '@/utils/date';
|
import { getCurrentDateString } from '@/utils/date';
|
||||||
import { normalizeOptions } from '@/utils/entity';
|
import { normalizeOptions } from '@/utils/entity';
|
||||||
import { debouncedReaction } from '@/utils/mobx';
|
import { debouncedReaction } from '@/utils/mobx';
|
||||||
import { reaction, toJS } from 'mobx';
|
import { reaction, toJS } from 'mobx';
|
||||||
@ -20,7 +20,7 @@ export default function reactions({ store, apolloClient }: ProcessContext) {
|
|||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const currentDate = getCurrentISODate();
|
const currentDate = getCurrentDateString();
|
||||||
|
|
||||||
const {
|
const {
|
||||||
data: { evo_addproduct_types },
|
data: { evo_addproduct_types },
|
||||||
@ -77,7 +77,7 @@ export default function reactions({ store, apolloClient }: ProcessContext) {
|
|||||||
reaction(
|
reaction(
|
||||||
() => $calculation.$values.getValues(['leasingPeriod', 'leaseObjectType']),
|
() => $calculation.$values.getValues(['leasingPeriod', 'leaseObjectType']),
|
||||||
async ({ leasingPeriod, leaseObjectType }) => {
|
async ({ leasingPeriod, leaseObjectType }) => {
|
||||||
const currentDate = getCurrentISODate();
|
const currentDate = getCurrentDateString();
|
||||||
|
|
||||||
const {
|
const {
|
||||||
data: { evo_addproduct_types },
|
data: { evo_addproduct_types },
|
||||||
@ -161,7 +161,7 @@ export default function reactions({ store, apolloClient }: ProcessContext) {
|
|||||||
leasingPeriod,
|
leasingPeriod,
|
||||||
plPriceRub,
|
plPriceRub,
|
||||||
}) => {
|
}) => {
|
||||||
const currentDate = getCurrentISODate();
|
const currentDate = getCurrentDateString();
|
||||||
|
|
||||||
const {
|
const {
|
||||||
data: { evo_addproduct_types },
|
data: { evo_addproduct_types },
|
||||||
@ -274,7 +274,7 @@ export default function reactions({ store, apolloClient }: ProcessContext) {
|
|||||||
leaseObjectType: leaseObjectTypeId,
|
leaseObjectType: leaseObjectTypeId,
|
||||||
engineType,
|
engineType,
|
||||||
}) => {
|
}) => {
|
||||||
const currentDate = getCurrentISODate();
|
const currentDate = getCurrentDateString();
|
||||||
const {
|
const {
|
||||||
data: { evo_addproduct_types: trackerTypes },
|
data: { evo_addproduct_types: trackerTypes },
|
||||||
} = await apolloClient.query({
|
} = await apolloClient.query({
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
import type { ValidationContext } from '../../types';
|
import type { ValidationContext } from '../../types';
|
||||||
import type { ElementsTypes } from '@/Components/Calculation/config/map/values';
|
import type { ElementsTypes } from '@/Components/Calculation/config/map/values';
|
||||||
import * as CRMTypes from '@/graphql/crm.types';
|
import * as CRMTypes from '@/graphql/crm.types';
|
||||||
import { getCurrentISODate } from '@/utils/date';
|
import { getCurrentDateString } from '@/utils/date';
|
||||||
|
|
||||||
export type ProductId = ElementsTypes['selectProduct'];
|
export type ProductId = ElementsTypes['selectProduct'];
|
||||||
|
|
||||||
@ -13,7 +13,7 @@ export default function helper({ apolloClient, user }: ValidationContext) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const {
|
const {
|
||||||
data: { systemuser },
|
data: { systemusers },
|
||||||
} = await apolloClient.query({
|
} = await apolloClient.query({
|
||||||
query: CRMTypes.GetSystemUserDocument,
|
query: CRMTypes.GetSystemUserDocument,
|
||||||
variables: {
|
variables: {
|
||||||
@ -21,11 +21,13 @@ export default function helper({ apolloClient, user }: ValidationContext) {
|
|||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
const systemuser = systemusers?.[0];
|
||||||
|
|
||||||
if (!systemuser?.evo_job_titleid) {
|
if (!systemuser?.evo_job_titleid) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
const currentDate = getCurrentISODate();
|
const currentDate = getCurrentDateString();
|
||||||
|
|
||||||
const {
|
const {
|
||||||
data: { evo_coefficients },
|
data: { evo_coefficients },
|
||||||
|
|||||||
@ -2,7 +2,6 @@
|
|||||||
/* eslint-disable complexity */
|
/* eslint-disable complexity */
|
||||||
import type { GetQuoteInputData, GetQuoteProcessData } from '../load-kp/types';
|
import type { GetQuoteInputData, GetQuoteProcessData } from '../load-kp/types';
|
||||||
import helper from './lib/helper';
|
import helper from './lib/helper';
|
||||||
import initializeApollo from '@/apollo/client';
|
|
||||||
import defaultValues from '@/config/default-values';
|
import defaultValues from '@/config/default-values';
|
||||||
import calculateHelper from '@/process/calculate/lib/helper';
|
import calculateHelper from '@/process/calculate/lib/helper';
|
||||||
import { getKPData as getKPDataPrice } from '@/process/price/get-kp-data';
|
import { getKPData as getKPDataPrice } from '@/process/price/get-kp-data';
|
||||||
@ -13,9 +12,10 @@ import { normalizeOptions } from '@/utils/entity';
|
|||||||
export async function getKPData({
|
export async function getKPData({
|
||||||
values,
|
values,
|
||||||
quote,
|
quote,
|
||||||
|
ctx,
|
||||||
}: GetQuoteInputData): Promise<GetQuoteProcessData> {
|
}: GetQuoteInputData): Promise<GetQuoteProcessData> {
|
||||||
|
const { apolloClient } = ctx;
|
||||||
const { recalcWithRevision } = values;
|
const { recalcWithRevision } = values;
|
||||||
const apolloClient = initializeApollo();
|
|
||||||
|
|
||||||
const leasingPeriod = recalcWithRevision
|
const leasingPeriod = recalcWithRevision
|
||||||
? Math.min(quote?.evo_period ?? 0, quote?.evo_accept_period ?? 0)
|
? Math.min(quote?.evo_period ?? 0, quote?.evo_accept_period ?? 0)
|
||||||
@ -61,8 +61,8 @@ export async function getKPData({
|
|||||||
let minPriceChange = quote?.evo_min_change_price ?? defaultValues.minPriceChange;
|
let minPriceChange = quote?.evo_min_change_price ?? defaultValues.minPriceChange;
|
||||||
|
|
||||||
if (!recalcWithRevision) {
|
if (!recalcWithRevision) {
|
||||||
const kpDataPrice = await getKPDataPrice({ quote, values });
|
const kpDataPrice = await getKPDataPrice({ ctx, quote, values });
|
||||||
const kpDataSubsidy = await getKPDataSubsidy({ quote, values });
|
const kpDataSubsidy = await getKPDataSubsidy({ ctx, quote, values });
|
||||||
|
|
||||||
const supplierCurrency = kpDataPrice.values?.supplierCurrency ?? defaultValues.supplierCurrency;
|
const supplierCurrency = kpDataPrice.values?.supplierCurrency ?? defaultValues.supplierCurrency;
|
||||||
const leaseObjectPrice = kpDataPrice.values?.leaseObjectPrice ?? defaultValues.leaseObjectPrice;
|
const leaseObjectPrice = kpDataPrice.values?.leaseObjectPrice ?? defaultValues.leaseObjectPrice;
|
||||||
|
|||||||
@ -3,7 +3,7 @@ import defaultValues from '@/config/default-values';
|
|||||||
import * as CRMTypes from '@/graphql/crm.types';
|
import * as CRMTypes from '@/graphql/crm.types';
|
||||||
import type { ProcessContext } from '@/process/types';
|
import type { ProcessContext } from '@/process/types';
|
||||||
import type { CalculationValues } from '@/stores/calculation/values/types';
|
import type { CalculationValues } from '@/stores/calculation/values/types';
|
||||||
import { getCurrentISODate } from '@/utils/date';
|
import { getCurrentDateString } from '@/utils/date';
|
||||||
import dayjs from 'dayjs';
|
import dayjs from 'dayjs';
|
||||||
import { first, sort } from 'radash';
|
import { first, sort } from 'radash';
|
||||||
|
|
||||||
@ -80,7 +80,7 @@ export default function helper({ apolloClient }: Pick<ProcessContext, 'apolloCli
|
|||||||
},
|
},
|
||||||
|
|
||||||
async getRates({ tarif: tarifId }: GetRatesInputValues) {
|
async getRates({ tarif: tarifId }: GetRatesInputValues) {
|
||||||
const currentDate = getCurrentISODate();
|
const currentDate = getCurrentDateString();
|
||||||
|
|
||||||
const {
|
const {
|
||||||
data: { evo_rates },
|
data: { evo_rates },
|
||||||
@ -138,7 +138,7 @@ export default function helper({ apolloClient }: Pick<ProcessContext, 'apolloCli
|
|||||||
floatingRate,
|
floatingRate,
|
||||||
partialVAT,
|
partialVAT,
|
||||||
}: GetTarifInputValues) {
|
}: GetTarifInputValues) {
|
||||||
const currentDate = getCurrentISODate();
|
const currentDate = getCurrentDateString();
|
||||||
|
|
||||||
const {
|
const {
|
||||||
data: { evo_tarifs = [] },
|
data: { evo_tarifs = [] },
|
||||||
|
|||||||
@ -4,7 +4,7 @@ import { crmTools } from '@/graphql/crm.tools';
|
|||||||
import * as CRMTypes from '@/graphql/crm.types';
|
import * as CRMTypes from '@/graphql/crm.types';
|
||||||
import { SEASON_TYPES } from '@/process/payments/lib/seasons-constants';
|
import { SEASON_TYPES } from '@/process/payments/lib/seasons-constants';
|
||||||
import type { ProcessContext } from '@/process/types';
|
import type { ProcessContext } from '@/process/types';
|
||||||
import { getCurrentISODate } from '@/utils/date';
|
import { getCurrentDateString } from '@/utils/date';
|
||||||
import { normalizeOptions } from '@/utils/entity';
|
import { normalizeOptions } from '@/utils/entity';
|
||||||
import { disposableReaction } from '@/utils/mobx';
|
import { disposableReaction } from '@/utils/mobx';
|
||||||
import { reaction } from 'mobx';
|
import { reaction } from 'mobx';
|
||||||
@ -355,7 +355,7 @@ export default function reactions({ store, apolloClient, user }: ProcessContext)
|
|||||||
reaction(
|
reaction(
|
||||||
() => $calculation.element('selectQuote').getValue(),
|
() => $calculation.element('selectQuote').getValue(),
|
||||||
async (quoteId) => {
|
async (quoteId) => {
|
||||||
const currentDate = getCurrentISODate();
|
const currentDate = getCurrentDateString();
|
||||||
|
|
||||||
let {
|
let {
|
||||||
data: { evo_baseproducts },
|
data: { evo_baseproducts },
|
||||||
@ -369,7 +369,7 @@ export default function reactions({ store, apolloClient, user }: ProcessContext)
|
|||||||
|
|
||||||
if (user && evo_baseproducts) {
|
if (user && evo_baseproducts) {
|
||||||
const {
|
const {
|
||||||
data: { systemuser },
|
data: { systemusers },
|
||||||
} = await apolloClient.query({
|
} = await apolloClient.query({
|
||||||
fetchPolicy: 'network-only',
|
fetchPolicy: 'network-only',
|
||||||
query: CRMTypes.GetSystemUserDocument,
|
query: CRMTypes.GetSystemUserDocument,
|
||||||
@ -378,9 +378,13 @@ export default function reactions({ store, apolloClient, user }: ProcessContext)
|
|||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
evo_baseproducts = crmTools
|
const systemuser = systemusers?.[0];
|
||||||
.evo_baseproducts(evo_baseproducts)
|
|
||||||
.filterBy.systemuser(systemuser);
|
if (systemuser) {
|
||||||
|
evo_baseproducts = crmTools
|
||||||
|
.evo_baseproducts(evo_baseproducts)
|
||||||
|
.filterBy.systemuser(systemuser);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!$calculation.element('cbxRecalcWithRevision').getValue()) {
|
if (!$calculation.element('cbxRecalcWithRevision').getValue()) {
|
||||||
|
|||||||
@ -16,23 +16,35 @@ export default function unlimitedReactions({ store, apolloClient }: ProcessConte
|
|||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const {
|
|
||||||
data: { leads },
|
|
||||||
} = await apolloClient.query({
|
|
||||||
query: CRMTypes.GetLeadsDocument,
|
|
||||||
variables: { domainname },
|
|
||||||
});
|
|
||||||
|
|
||||||
$calculation.element('selectLead').setOptions(normalizeOptions(leads));
|
{
|
||||||
|
const { data } = await apolloClient.query({
|
||||||
|
query: CRMTypes.GetLeadsDocument,
|
||||||
|
variables: { domainname },
|
||||||
|
});
|
||||||
|
|
||||||
const {
|
const systemuser = data?.systemusers?.[0];
|
||||||
data: { opportunities },
|
|
||||||
} = await apolloClient.query({
|
|
||||||
query: CRMTypes.GetOpportunitiesDocument,
|
|
||||||
variables: { domainname },
|
|
||||||
});
|
|
||||||
|
|
||||||
$calculation.element('selectOpportunity').setOptions(normalizeOptions(opportunities));
|
if (systemuser) {
|
||||||
|
const { leads } = systemuser;
|
||||||
|
|
||||||
|
$calculation.element('selectLead').setOptions(normalizeOptions(leads));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
const { data } = await apolloClient.query({
|
||||||
|
query: CRMTypes.GetOpportunitiesDocument,
|
||||||
|
variables: { domainname },
|
||||||
|
});
|
||||||
|
|
||||||
|
const systemuser = data?.systemusers?.[0];
|
||||||
|
|
||||||
|
if (systemuser) {
|
||||||
|
const { opportunities } = systemuser;
|
||||||
|
$calculation.element('selectOpportunity').setOptions(normalizeOptions(opportunities));
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,17 +1,18 @@
|
|||||||
/* eslint-disable @typescript-eslint/no-non-null-assertion */
|
/* eslint-disable @typescript-eslint/no-non-null-assertion */
|
||||||
import type { GetQuoteInputData, GetQuoteProcessData } from '../load-kp/types';
|
import type { GetQuoteInputData, GetQuoteProcessData } from '../load-kp/types';
|
||||||
import helper from './lib/helper';
|
import helper from './lib/helper';
|
||||||
import initializeApollo from '@/apollo/client';
|
|
||||||
import defaultValues from '@/config/default-values';
|
import defaultValues from '@/config/default-values';
|
||||||
import { getKPData as getKPDataPayments } from '@/process/payments/get-kp-data';
|
import { getKPData as getKPDataPayments } from '@/process/payments/get-kp-data';
|
||||||
import { getKPData as getKPDataPrice } from '@/process/price/get-kp-data';
|
import { getKPData as getKPDataPrice } from '@/process/price/get-kp-data';
|
||||||
import { createCurrencyUtility } from '@/utils/currency';
|
import { createCurrencyUtility } from '@/utils/currency';
|
||||||
import { QueryClient } from '@tanstack/react-query';
|
|
||||||
|
|
||||||
export async function getKPData({
|
export async function getKPData({
|
||||||
quote,
|
quote,
|
||||||
values,
|
values,
|
||||||
|
ctx,
|
||||||
}: GetQuoteInputData): Promise<GetQuoteProcessData> {
|
}: GetQuoteInputData): Promise<GetQuoteProcessData> {
|
||||||
|
const { apolloClient, queryClient } = ctx;
|
||||||
|
|
||||||
if (!quote?.evo_fingap_accountid) {
|
if (!quote?.evo_fingap_accountid) {
|
||||||
return {
|
return {
|
||||||
fingap: {
|
fingap: {
|
||||||
@ -21,13 +22,10 @@ export async function getKPData({
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
const apolloClient = initializeApollo();
|
|
||||||
const queryClient = new QueryClient();
|
|
||||||
|
|
||||||
const { getFingapRisks } = helper({ apolloClient, queryClient });
|
const { getFingapRisks } = helper({ apolloClient, queryClient });
|
||||||
|
|
||||||
const kpDataPrice = await getKPDataPrice({ quote, values });
|
const kpDataPrice = await getKPDataPrice({ ctx, quote, values });
|
||||||
const kpDataPayments = await getKPDataPayments({ quote, values });
|
const kpDataPayments = await getKPDataPayments({ ctx, quote, values });
|
||||||
|
|
||||||
const leaseObjectPrice = kpDataPrice.values?.leaseObjectPrice ?? defaultValues.leaseObjectPrice;
|
const leaseObjectPrice = kpDataPrice.values?.leaseObjectPrice ?? defaultValues.leaseObjectPrice;
|
||||||
const firstPaymentRub = kpDataPrice.values?.firstPaymentRub ?? defaultValues.firstPaymentRub;
|
const firstPaymentRub = kpDataPrice.values?.firstPaymentRub ?? defaultValues.firstPaymentRub;
|
||||||
|
|||||||
@ -6,7 +6,7 @@ import { STALE_TIME } from '@/constants/request';
|
|||||||
import * as CRMTypes from '@/graphql/crm.types';
|
import * as CRMTypes from '@/graphql/crm.types';
|
||||||
import type { ProcessContext } from '@/process/types';
|
import type { ProcessContext } from '@/process/types';
|
||||||
import type { CalculationValues } from '@/stores/calculation/values/types';
|
import type { CalculationValues } from '@/stores/calculation/values/types';
|
||||||
import { getCurrentISODate } from '@/utils/date';
|
import { getCurrentDateString } from '@/utils/date';
|
||||||
import type { QueryFunctionContext } from '@tanstack/react-query';
|
import type { QueryFunctionContext } from '@tanstack/react-query';
|
||||||
import { flatten } from 'tools/object';
|
import { flatten } from 'tools/object';
|
||||||
|
|
||||||
@ -38,7 +38,7 @@ export default function helper({
|
|||||||
} = await apolloClient.query({
|
} = await apolloClient.query({
|
||||||
query: CRMTypes.GetAddproductTypesDocument,
|
query: CRMTypes.GetAddproductTypesDocument,
|
||||||
variables: {
|
variables: {
|
||||||
currentDate: getCurrentISODate(),
|
currentDate: getCurrentDateString(),
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@ -1,17 +1,15 @@
|
|||||||
/* eslint-disable sonarjs/cognitive-complexity */
|
/* eslint-disable sonarjs/cognitive-complexity */
|
||||||
import type { GetQuoteInputData, GetQuoteProcessData } from '../load-kp/types';
|
import type { GetQuoteInputData, GetQuoteProcessData } from '../load-kp/types';
|
||||||
import helper from './lib/helper';
|
import helper from './lib/helper';
|
||||||
import initializeApollo from '@/apollo/client';
|
|
||||||
import defaultValues from '@/config/default-values';
|
import defaultValues from '@/config/default-values';
|
||||||
|
|
||||||
export async function getKPData({
|
export async function getKPData({
|
||||||
values,
|
values,
|
||||||
quote,
|
quote,
|
||||||
|
ctx: { apolloClient },
|
||||||
}: GetQuoteInputData): Promise<GetQuoteProcessData> {
|
}: GetQuoteInputData): Promise<GetQuoteProcessData> {
|
||||||
const { recalcWithRevision, lead: leadId, opportunity: opportunityId } = values;
|
const { recalcWithRevision, lead: leadId, opportunity: opportunityId } = values;
|
||||||
|
|
||||||
const apolloClient = initializeApollo();
|
|
||||||
|
|
||||||
const { getData } = helper({
|
const { getData } = helper({
|
||||||
apolloClient,
|
apolloClient,
|
||||||
});
|
});
|
||||||
|
|||||||
@ -6,7 +6,7 @@ import { getTransTax } from '@/api/1c/query';
|
|||||||
import { selectObjectCategoryTax } from '@/config/default-options';
|
import { selectObjectCategoryTax } from '@/config/default-options';
|
||||||
import { STALE_TIME } from '@/constants/request';
|
import { STALE_TIME } from '@/constants/request';
|
||||||
import * as CRMTypes from '@/graphql/crm.types';
|
import * as CRMTypes from '@/graphql/crm.types';
|
||||||
import { getCurrentISODate } from '@/utils/date';
|
import { getCurrentDateString } from '@/utils/date';
|
||||||
import { normalizeOptions } from '@/utils/entity';
|
import { normalizeOptions } from '@/utils/entity';
|
||||||
import { disposableReaction } from '@/utils/mobx';
|
import { disposableReaction } from '@/utils/mobx';
|
||||||
import dayjs from 'dayjs';
|
import dayjs from 'dayjs';
|
||||||
@ -250,7 +250,7 @@ export function common({ store, apolloClient, queryClient }: ProcessContext) {
|
|||||||
data: { evo_addproduct_types },
|
data: { evo_addproduct_types },
|
||||||
} = await apolloClient.query({
|
} = await apolloClient.query({
|
||||||
query: CRMTypes.GetRegistrationTypesDocument,
|
query: CRMTypes.GetRegistrationTypesDocument,
|
||||||
variables: { currentDate: getCurrentISODate() },
|
variables: { currentDate: getCurrentDateString() },
|
||||||
});
|
});
|
||||||
|
|
||||||
const options = evo_addproduct_types?.filter((x) => {
|
const options = evo_addproduct_types?.filter((x) => {
|
||||||
|
|||||||
@ -4,7 +4,7 @@ import { STALE_TIME } from '@/constants/request';
|
|||||||
import { crmTools } from '@/graphql/crm.tools';
|
import { crmTools } from '@/graphql/crm.tools';
|
||||||
import * as CRMTypes from '@/graphql/crm.types';
|
import * as CRMTypes from '@/graphql/crm.types';
|
||||||
import { useStore } from '@/stores/hooks';
|
import { useStore } from '@/stores/hooks';
|
||||||
import { getCurrentISODate } from '@/utils/date';
|
import { getCurrentDateString } from '@/utils/date';
|
||||||
import { normalizeOptions } from '@/utils/entity';
|
import { normalizeOptions } from '@/utils/entity';
|
||||||
import { useApolloClient } from '@apollo/client';
|
import { useApolloClient } from '@apollo/client';
|
||||||
import { useQuery } from '@tanstack/react-query';
|
import { useQuery } from '@tanstack/react-query';
|
||||||
@ -16,24 +16,34 @@ import { useEffect } from 'react';
|
|||||||
* @param {*} onCompleted
|
* @param {*} onCompleted
|
||||||
*/
|
*/
|
||||||
function getMainData({ query }, onCompleted, user) {
|
function getMainData({ query }, onCompleted, user) {
|
||||||
const currentDate = getCurrentISODate();
|
const currentDate = getCurrentDateString();
|
||||||
|
|
||||||
query({
|
query({
|
||||||
query: CRMTypes.GetLeadsDocument,
|
query: CRMTypes.GetLeadsDocument,
|
||||||
variables: { domainname: user.domainName },
|
variables: { domainname: user.domainName },
|
||||||
}).then(({ data }) => {
|
}).then(({ data }) => {
|
||||||
onCompleted({
|
const systemuser = data?.systemusers?.[0];
|
||||||
selectLead: data?.leads,
|
|
||||||
});
|
if (systemuser) {
|
||||||
|
const { leads } = systemuser;
|
||||||
|
onCompleted({
|
||||||
|
selectLead: leads,
|
||||||
|
});
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
query({
|
query({
|
||||||
query: CRMTypes.GetOpportunitiesDocument,
|
query: CRMTypes.GetOpportunitiesDocument,
|
||||||
variables: { domainname: user.domainName },
|
variables: { domainname: user.domainName },
|
||||||
}).then(({ data }) => {
|
}).then(({ data }) => {
|
||||||
onCompleted({
|
const systemuser = data?.systemusers?.[0];
|
||||||
selectOpportunity: data?.opportunities,
|
|
||||||
});
|
if (systemuser) {
|
||||||
|
const { opportunities } = systemuser;
|
||||||
|
onCompleted({
|
||||||
|
selectOpportunity: opportunities,
|
||||||
|
});
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
query({ query: CRMTypes.GetTransactionCurrenciesDocument }).then(({ data }) => {
|
query({ query: CRMTypes.GetTransactionCurrenciesDocument }).then(({ data }) => {
|
||||||
@ -46,16 +56,22 @@ function getMainData({ query }, onCompleted, user) {
|
|||||||
fetchPolicy: 'network-only',
|
fetchPolicy: 'network-only',
|
||||||
query: CRMTypes.GetSystemUserDocument,
|
query: CRMTypes.GetSystemUserDocument,
|
||||||
variables: { domainname: user?.domainName },
|
variables: { domainname: user?.domainName },
|
||||||
}).then(({ data: { systemuser } }) => {
|
}).then(({ data: { systemusers } }) => {
|
||||||
query({
|
const systemuser = systemusers?.[0];
|
||||||
fetchPolicy: 'network-only',
|
|
||||||
query: CRMTypes.GetProductsDocument,
|
if (systemuser) {
|
||||||
variables: { currentDate },
|
query({
|
||||||
}).then(({ data: { evo_baseproducts } }) => {
|
fetchPolicy: 'network-only',
|
||||||
onCompleted({
|
query: CRMTypes.GetProductsDocument,
|
||||||
selectProduct: crmTools.evo_baseproducts(evo_baseproducts).filterBy.systemuser(systemuser),
|
variables: { currentDate },
|
||||||
|
}).then(({ data: { evo_baseproducts } }) => {
|
||||||
|
onCompleted({
|
||||||
|
selectProduct: crmTools
|
||||||
|
.evo_baseproducts(evo_baseproducts)
|
||||||
|
.filterBy.systemuser(systemuser),
|
||||||
|
});
|
||||||
});
|
});
|
||||||
});
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
// query({
|
// query({
|
||||||
|
|||||||
@ -11,8 +11,9 @@ import { sum } from 'radash';
|
|||||||
export async function getKPData({
|
export async function getKPData({
|
||||||
values,
|
values,
|
||||||
quote,
|
quote,
|
||||||
|
ctx,
|
||||||
}: GetQuoteInputData): Promise<GetQuoteProcessData> {
|
}: GetQuoteInputData): Promise<GetQuoteProcessData> {
|
||||||
const kpDataFingap = await getKPDataFingap({ quote, values });
|
const kpDataFingap = await getKPDataFingap({ ctx, quote, values });
|
||||||
|
|
||||||
const risks = kpDataFingap.fingap?.risks;
|
const risks = kpDataFingap.fingap?.risks;
|
||||||
|
|
||||||
|
|||||||
@ -1,14 +1,12 @@
|
|||||||
import type { GetQuoteInputData, GetQuoteProcessData } from '../load-kp/types';
|
import type { GetQuoteInputData, GetQuoteProcessData } from '../load-kp/types';
|
||||||
import helper from './lib/helper';
|
import helper from './lib/helper';
|
||||||
import initializeApollo from '@/apollo/client';
|
|
||||||
import defaultValues from '@/config/default-values';
|
import defaultValues from '@/config/default-values';
|
||||||
|
|
||||||
export async function getKPData({
|
export async function getKPData({
|
||||||
values: { recalcWithRevision },
|
values: { recalcWithRevision },
|
||||||
quote,
|
quote,
|
||||||
|
ctx: { apolloClient },
|
||||||
}: GetQuoteInputData): Promise<GetQuoteProcessData> {
|
}: GetQuoteInputData): Promise<GetQuoteProcessData> {
|
||||||
const apolloClient = initializeApollo();
|
|
||||||
|
|
||||||
const brand = quote?.evo_brandid ?? defaultValues.brand;
|
const brand = quote?.evo_brandid ?? defaultValues.brand;
|
||||||
const model = quote?.evo_modelid ?? defaultValues.model;
|
const model = quote?.evo_modelid ?? defaultValues.model;
|
||||||
const leaseObjectUsed = quote?.evo_leasingobject_used ?? defaultValues.leaseObjectUsed;
|
const leaseObjectUsed = quote?.evo_leasingobject_used ?? defaultValues.leaseObjectUsed;
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
import { notification } from '@/Components/Common/Notification';
|
import { notification } from '@/Components/Common/Notification';
|
||||||
import * as CRMTypes from '@/graphql/crm.types';
|
import * as CRMTypes from '@/graphql/crm.types';
|
||||||
import type { ProcessContext } from '@/process/types';
|
import type { ProcessContext } from '@/process/types';
|
||||||
import { getCurrentISODate } from '@/utils/date';
|
import { getCurrentDateString } from '@/utils/date';
|
||||||
import { normalizeOptions } from '@/utils/entity';
|
import { normalizeOptions } from '@/utils/entity';
|
||||||
import { reaction } from 'mobx';
|
import { reaction } from 'mobx';
|
||||||
import { uid } from 'radash';
|
import { uid } from 'radash';
|
||||||
@ -64,7 +64,7 @@ export function common({ store, apolloClient }: ProcessContext) {
|
|||||||
firstPaymentPerc,
|
firstPaymentPerc,
|
||||||
model: modelId,
|
model: modelId,
|
||||||
}) => {
|
}) => {
|
||||||
const currentDate = getCurrentISODate();
|
const currentDate = getCurrentDateString();
|
||||||
|
|
||||||
const {
|
const {
|
||||||
data: { evo_addproduct_types },
|
data: { evo_addproduct_types },
|
||||||
|
|||||||
@ -64,7 +64,7 @@ export function createValidationSchema({ apolloClient }: ValidationContext) {
|
|||||||
|
|
||||||
if (dealerPersonId && quoteId && productId) {
|
if (dealerPersonId && quoteId && productId) {
|
||||||
const {
|
const {
|
||||||
data: { account: dealerPerson },
|
data: { dealer_person },
|
||||||
} = await apolloClient.query({
|
} = await apolloClient.query({
|
||||||
query: CRMTypes.GetDealerPersonDocument,
|
query: CRMTypes.GetDealerPersonDocument,
|
||||||
variables: { dealerPersonId },
|
variables: { dealerPersonId },
|
||||||
@ -79,7 +79,7 @@ export function createValidationSchema({ apolloClient }: ValidationContext) {
|
|||||||
|
|
||||||
const maxCondition1 =
|
const maxCondition1 =
|
||||||
leaseObjectUsed === false &&
|
leaseObjectUsed === false &&
|
||||||
dealerPerson?.evo_supplier_type !== 100_000_001 &&
|
dealer_person?.evo_supplier_type !== 100_000_001 &&
|
||||||
quote?.evo_max_price_change &&
|
quote?.evo_max_price_change &&
|
||||||
!partialVAT &&
|
!partialVAT &&
|
||||||
plPriceRub - discountRub + addEquipmentPrice - importProgramSum >
|
plPriceRub - discountRub + addEquipmentPrice - importProgramSum >
|
||||||
@ -87,14 +87,14 @@ export function createValidationSchema({ apolloClient }: ValidationContext) {
|
|||||||
|
|
||||||
const maxCondition2 =
|
const maxCondition2 =
|
||||||
leaseObjectUsed === false &&
|
leaseObjectUsed === false &&
|
||||||
dealerPerson?.evo_supplier_type !== 100_000_001 &&
|
dealer_person?.evo_supplier_type !== 100_000_001 &&
|
||||||
quote?.evo_max_price_change &&
|
quote?.evo_max_price_change &&
|
||||||
partialVAT &&
|
partialVAT &&
|
||||||
leaseObjectPriceWthtVAT >
|
leaseObjectPriceWthtVAT >
|
||||||
quote.evo_max_price_change - (quote.evo_nds_in_price_supplier_currency || 0);
|
quote.evo_max_price_change - (quote.evo_nds_in_price_supplier_currency || 0);
|
||||||
|
|
||||||
const maxCondition3 =
|
const maxCondition3 =
|
||||||
(leaseObjectUsed === true || dealerPerson?.evo_supplier_type === 100_000_001) &&
|
(leaseObjectUsed === true || dealer_person?.evo_supplier_type === 100_000_001) &&
|
||||||
quote?.evo_supplier_currency_price &&
|
quote?.evo_supplier_currency_price &&
|
||||||
plPriceRub - discountRub + addEquipmentPrice - importProgramSum >
|
plPriceRub - discountRub + addEquipmentPrice - importProgramSum >
|
||||||
quote.evo_supplier_currency_price -
|
quote.evo_supplier_currency_price -
|
||||||
|
|||||||
@ -1,6 +1,5 @@
|
|||||||
import type { GetQuoteInputData, GetQuoteProcessData } from '../load-kp/types';
|
import type { GetQuoteInputData, GetQuoteProcessData } from '../load-kp/types';
|
||||||
import helper from './lib/helper';
|
import helper from './lib/helper';
|
||||||
import initializeApollo from '@/apollo/client';
|
|
||||||
import defaultValues from '@/config/default-values';
|
import defaultValues from '@/config/default-values';
|
||||||
import { getKPData as getKPDataPrice } from '@/process/price/get-kp-data';
|
import { getKPData as getKPDataPrice } from '@/process/price/get-kp-data';
|
||||||
import { createCurrencyUtility } from '@/utils/currency';
|
import { createCurrencyUtility } from '@/utils/currency';
|
||||||
@ -8,10 +7,11 @@ import { createCurrencyUtility } from '@/utils/currency';
|
|||||||
export async function getKPData({
|
export async function getKPData({
|
||||||
values,
|
values,
|
||||||
quote,
|
quote,
|
||||||
|
ctx,
|
||||||
}: GetQuoteInputData): Promise<GetQuoteProcessData> {
|
}: GetQuoteInputData): Promise<GetQuoteProcessData> {
|
||||||
const apolloClient = initializeApollo();
|
const { apolloClient } = ctx;
|
||||||
|
|
||||||
const kpDataPrice = await getKPDataPrice({ quote, values });
|
const kpDataPrice = await getKPDataPrice({ ctx, quote, values });
|
||||||
const { RUB } = createCurrencyUtility({ apolloClient });
|
const { RUB } = createCurrencyUtility({ apolloClient });
|
||||||
|
|
||||||
const supplierCurrency = kpDataPrice.values?.supplierCurrency ?? defaultValues.supplierCurrency;
|
const supplierCurrency = kpDataPrice.values?.supplierCurrency ?? defaultValues.supplierCurrency;
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
import initializeApollo from '@/apollo/client';
|
|
||||||
import * as CRMTypes from '@/graphql/crm.types';
|
import * as CRMTypes from '@/graphql/crm.types';
|
||||||
|
import type { GetQuoteContext } from '@/server/routers/quote/types';
|
||||||
|
|
||||||
type Quote = NonNullable<CRMTypes.GetQuoteDataQuery['quote']>;
|
type Quote = NonNullable<CRMTypes.GetQuoteDataQuery['quote']>;
|
||||||
|
|
||||||
@ -19,39 +19,42 @@ type QuoteTotalFields =
|
|||||||
| 'evo_double_agent_reward_total'
|
| 'evo_double_agent_reward_total'
|
||||||
| 'evo_fin_department_reward_total';
|
| 'evo_fin_department_reward_total';
|
||||||
|
|
||||||
async function getRewardSum(
|
function makeGetRewardSum({ apolloClient }: GetQuoteContext) {
|
||||||
conditionId: string | null | undefined,
|
return async function (
|
||||||
quote: Quote,
|
conditionId: string | null | undefined,
|
||||||
quoteRewardSummField: keyof Pick<Quote, QuoteSumFields>,
|
quote: Quote,
|
||||||
quoteRewardTotalField: keyof Pick<Quote, QuoteTotalFields>
|
quoteRewardSummField: keyof Pick<Quote, QuoteSumFields>,
|
||||||
) {
|
quoteRewardTotalField: keyof Pick<Quote, QuoteTotalFields>
|
||||||
if (!conditionId) return 0;
|
) {
|
||||||
|
if (!conditionId) return 0;
|
||||||
|
|
||||||
const apolloClient = initializeApollo();
|
const {
|
||||||
const {
|
data: { evo_reward_condition },
|
||||||
data: { evo_reward_condition },
|
} = await apolloClient.query<
|
||||||
} = await apolloClient.query<
|
CRMTypes.GetRewardConditionQuery,
|
||||||
CRMTypes.GetRewardConditionQuery,
|
CRMTypes.GetRewardConditionQueryVariables
|
||||||
CRMTypes.GetRewardConditionQueryVariables
|
>({
|
||||||
>({
|
query: CRMTypes.GetRewardConditionDocument,
|
||||||
query: CRMTypes.GetRewardConditionDocument,
|
variables: {
|
||||||
variables: {
|
conditionId,
|
||||||
conditionId,
|
},
|
||||||
},
|
});
|
||||||
});
|
|
||||||
|
|
||||||
if (evo_reward_condition?.evo_calc_reward_rules === 100_000_001) {
|
if (evo_reward_condition?.evo_calc_reward_rules === 100_000_001) {
|
||||||
return quote[quoteRewardSummField];
|
return quote[quoteRewardSummField];
|
||||||
}
|
}
|
||||||
|
|
||||||
return quote[quoteRewardTotalField];
|
return quote[quoteRewardTotalField];
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
export default async function getSums(quote: Quote | null) {
|
export default async function getSums(quote: Quote | null, ctx: GetQuoteContext) {
|
||||||
if (!quote) {
|
if (!quote) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const getRewardSum = makeGetRewardSum(ctx);
|
||||||
|
|
||||||
const [
|
const [
|
||||||
dealerRewardSumm,
|
dealerRewardSumm,
|
||||||
dealerBrokerRewardSumm,
|
dealerBrokerRewardSumm,
|
||||||
|
|||||||
@ -3,8 +3,8 @@ import type { GetQuoteInputData, GetQuoteProcessData } from '../../load-kp/types
|
|||||||
import getSums from './get-sums';
|
import getSums from './get-sums';
|
||||||
import defaultValues from '@/config/default-values';
|
import defaultValues from '@/config/default-values';
|
||||||
|
|
||||||
export async function getKPData({ quote }: GetQuoteInputData): Promise<GetQuoteProcessData> {
|
export async function getKPData({ quote, ctx }: GetQuoteInputData): Promise<GetQuoteProcessData> {
|
||||||
const sums = await getSums(quote);
|
const sums = await getSums(quote, ctx);
|
||||||
|
|
||||||
return {
|
return {
|
||||||
values: {
|
values: {
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
import type { AgentsFields, AgentsRewardConditionsFields, AgentsSumFields } from './types';
|
import type { AgentsFields, AgentsRewardConditionsFields, AgentsSumFields } from './types';
|
||||||
import * as CRMTypes from '@/graphql/crm.types';
|
import * as CRMTypes from '@/graphql/crm.types';
|
||||||
import type RootStore from '@/stores/root';
|
import type RootStore from '@/stores/root';
|
||||||
import { getCurrentISODate } from '@/utils/date';
|
import { getCurrentDateString } from '@/utils/date';
|
||||||
import { normalizeOptions } from '@/utils/entity';
|
import { normalizeOptions } from '@/utils/entity';
|
||||||
import { disposableReaction } from '@/utils/mobx';
|
import { disposableReaction } from '@/utils/mobx';
|
||||||
import type { ApolloClient } from '@apollo/client';
|
import type { ApolloClient } from '@apollo/client';
|
||||||
@ -41,7 +41,7 @@ export function fillAgentRewardReaction(
|
|||||||
query: CRMTypes.GetRewardConditionsDocument,
|
query: CRMTypes.GetRewardConditionsDocument,
|
||||||
variables: {
|
variables: {
|
||||||
agentid,
|
agentid,
|
||||||
currentDate: getCurrentISODate(),
|
currentDate: getCurrentDateString(),
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@ -75,21 +75,21 @@ export function common({ store, apolloClient }: ProcessContext) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const {
|
const {
|
||||||
data: { dealer },
|
data: { dealer_person },
|
||||||
} = await apolloClient.query({
|
} = await apolloClient.query({
|
||||||
query: CRMTypes.GetDealerDocument,
|
query: CRMTypes.GetDealerPersonDocument,
|
||||||
variables: {
|
variables: {
|
||||||
dealerId: dealerPersonId,
|
dealerPersonId,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
if (dealer?.evo_broker_accountid) {
|
if (dealer_person?.evo_broker_accountid) {
|
||||||
const {
|
const {
|
||||||
data: { agent: dealerBroker },
|
data: { agent: dealerBroker },
|
||||||
} = await apolloClient.query<CRMTypes.GetAgentQuery, CRMTypes.GetAgentQueryVariables>({
|
} = await apolloClient.query<CRMTypes.GetAgentQuery, CRMTypes.GetAgentQueryVariables>({
|
||||||
query: CRMTypes.GetAgentDocument,
|
query: CRMTypes.GetAgentDocument,
|
||||||
variables: {
|
variables: {
|
||||||
agentid: dealer?.evo_broker_accountid,
|
agentid: dealer_person?.evo_broker_accountid,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@ -4,7 +4,7 @@ import type { ValidationContext } from '../types';
|
|||||||
import type { Elements } from '@/Components/Calculation/config/map/values';
|
import type { Elements } from '@/Components/Calculation/config/map/values';
|
||||||
import ValuesSchema from '@/config/schema/values';
|
import ValuesSchema from '@/config/schema/values';
|
||||||
import * as CRMTypes from '@/graphql/crm.types';
|
import * as CRMTypes from '@/graphql/crm.types';
|
||||||
import { getCurrentISODate } from '@/utils/date';
|
import { getCurrentDateString } from '@/utils/date';
|
||||||
import { normalizeOptions } from '@/utils/entity';
|
import { normalizeOptions } from '@/utils/entity';
|
||||||
import type { RefinementCtx } from 'zod';
|
import type { RefinementCtx } from 'zod';
|
||||||
import { z } from 'zod';
|
import { z } from 'zod';
|
||||||
@ -29,7 +29,7 @@ function helper({ apolloClient, ctx }: ValidationContext & { ctx: RefinementCtx
|
|||||||
query: CRMTypes.GetRewardConditionsDocument,
|
query: CRMTypes.GetRewardConditionsDocument,
|
||||||
variables: {
|
variables: {
|
||||||
agentid,
|
agentid,
|
||||||
currentDate: getCurrentISODate(),
|
currentDate: getCurrentDateString(),
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@ -1,9 +1,16 @@
|
|||||||
const run = require('tools/scripts');
|
const run = require('tools/scripts');
|
||||||
|
|
||||||
|
const PATH_CRM_GRAPHQL_SCHEMA = './graphql/crm.schema.graphql';
|
||||||
|
const { URL_CRM_GRAPHQL_DIRECT, DEV_AUTH_TOKEN } = process.env;
|
||||||
|
|
||||||
function downloadSchema() {
|
function downloadSchema() {
|
||||||
const { URL_CRM_GRAPHQL_DIRECT } = process.env;
|
const command1 = [
|
||||||
const PATH_CRM_GRAPHQL_SCHEMA = './graphql/crm.schema.graphql';
|
'gql-sdl',
|
||||||
const command1 = ['gql-sdl', URL_CRM_GRAPHQL_DIRECT, '-o', PATH_CRM_GRAPHQL_SCHEMA].join(' ');
|
URL_CRM_GRAPHQL_DIRECT,
|
||||||
|
`-H "Authorization: Bearer ${DEV_AUTH_TOKEN}"`,
|
||||||
|
'-o',
|
||||||
|
PATH_CRM_GRAPHQL_SCHEMA,
|
||||||
|
].join(' ');
|
||||||
run(command1, 'Download GraphQL Schema...');
|
run(command1, 'Download GraphQL Schema...');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -4,7 +4,7 @@ import type { inferAsyncReturnType } from '@trpc/server';
|
|||||||
import type { CreateNextContextOptions } from '@trpc/server/adapters/next';
|
import type { CreateNextContextOptions } from '@trpc/server/adapters/next';
|
||||||
|
|
||||||
export async function createContext({ req }: CreateNextContextOptions) {
|
export async function createContext({ req }: CreateNextContextOptions) {
|
||||||
const { cookie = '' } = req.headers;
|
const { cookie = '', authorization } = req.headers;
|
||||||
|
|
||||||
const user = await getUser({
|
const user = await getUser({
|
||||||
headers: {
|
headers: {
|
||||||
@ -16,6 +16,7 @@ export async function createContext({ req }: CreateNextContextOptions) {
|
|||||||
scope.setUser(user);
|
scope.setUser(user);
|
||||||
|
|
||||||
return {
|
return {
|
||||||
|
headers: { authorization },
|
||||||
user,
|
user,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@ -15,10 +15,10 @@ export const userMiddleware = t.middleware(async ({ ctx, next }) => {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
const apolloClient = initializeApollo();
|
const apolloClient = initializeApollo(null, ctx.headers);
|
||||||
|
|
||||||
const {
|
const {
|
||||||
data: { systemuser },
|
data: { systemusers },
|
||||||
} = await apolloClient.query({
|
} = await apolloClient.query({
|
||||||
query: CRMTypes.GetSystemUserDocument,
|
query: CRMTypes.GetSystemUserDocument,
|
||||||
variables: {
|
variables: {
|
||||||
@ -26,6 +26,8 @@ export const userMiddleware = t.middleware(async ({ ctx, next }) => {
|
|||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
const systemuser = systemusers?.at(0);
|
||||||
|
|
||||||
const unlimited = systemuser?.roles?.some((x) => x?.name && unlimitedRoles.includes(x.name));
|
const unlimited = systemuser?.roles?.some((x) => x?.name && unlimitedRoles.includes(x.name));
|
||||||
|
|
||||||
return next({
|
return next({
|
||||||
|
|||||||
@ -16,7 +16,7 @@ export const calculateRouter = router({
|
|||||||
.input(CalculateInputSchema)
|
.input(CalculateInputSchema)
|
||||||
.output(CalculateOutputSchema)
|
.output(CalculateOutputSchema)
|
||||||
.mutation(async ({ input, ctx }) => {
|
.mutation(async ({ input, ctx }) => {
|
||||||
const apolloClient = initializeApollo();
|
const apolloClient = initializeApollo(null, ctx.headers);
|
||||||
const queryClient = new QueryClient();
|
const queryClient = new QueryClient();
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
|||||||
@ -5,7 +5,7 @@ import { ESN, NSIB_MAX, VAT } from '@/constants/values';
|
|||||||
import * as CRMTypes from '@/graphql/crm.types';
|
import * as CRMTypes from '@/graphql/crm.types';
|
||||||
import helper from '@/process/calculate/lib/helper';
|
import helper from '@/process/calculate/lib/helper';
|
||||||
import { createCurrencyUtility } from '@/utils/currency';
|
import { createCurrencyUtility } from '@/utils/currency';
|
||||||
import { getCurrentISODate } from '@/utils/date';
|
import { getCurrentDateString } from '@/utils/date';
|
||||||
import dayjs from 'dayjs';
|
import dayjs from 'dayjs';
|
||||||
import utc from 'dayjs/plugin/utc';
|
import utc from 'dayjs/plugin/utc';
|
||||||
import { min, sum } from 'radash';
|
import { min, sum } from 'radash';
|
||||||
@ -76,7 +76,7 @@ export async function createRequestData({
|
|||||||
|
|
||||||
const currentDate = dayjs().utc(false);
|
const currentDate = dayjs().utc(false);
|
||||||
|
|
||||||
let systemuser: CRMTypes.GetSystemUserQuery['systemuser'] = null;
|
let systemuser: NonNullable<CRMTypes.GetSystemUserQuery['systemusers']>[number] = null;
|
||||||
|
|
||||||
if (user?.domainName) {
|
if (user?.domainName) {
|
||||||
const { data } = await apolloClient.query({
|
const { data } = await apolloClient.query({
|
||||||
@ -85,7 +85,7 @@ export async function createRequestData({
|
|||||||
domainname: user.domainName,
|
domainname: user.domainName,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
if (data.systemuser) systemuser = data.systemuser;
|
systemuser = data.systemusers?.at(0) ?? null;
|
||||||
}
|
}
|
||||||
|
|
||||||
async function getDeprecation() {
|
async function getDeprecation() {
|
||||||
@ -127,7 +127,7 @@ export async function createRequestData({
|
|||||||
await apolloClient.query({
|
await apolloClient.query({
|
||||||
query: CRMTypes.GetCoefficientsDocument,
|
query: CRMTypes.GetCoefficientsDocument,
|
||||||
variables: {
|
variables: {
|
||||||
currentDate: getCurrentISODate(),
|
currentDate: getCurrentDateString(),
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
).data.evo_coefficients
|
).data.evo_coefficients
|
||||||
|
|||||||
@ -59,10 +59,12 @@ export const quoteRouter = router({
|
|||||||
getQuote: protectedProcedure
|
getQuote: protectedProcedure
|
||||||
.input(GetQuoteInputDataSchema)
|
.input(GetQuoteInputDataSchema)
|
||||||
.output(GetQuoteOutputDataSchema)
|
.output(GetQuoteOutputDataSchema)
|
||||||
.query(async ({ input }) => {
|
.query(async ({ input, ctx }) => {
|
||||||
const { quote: quoteId } = input.values;
|
const { quote: quoteId } = input.values;
|
||||||
|
|
||||||
const apolloClient = initializeApollo();
|
const apolloClient = initializeApollo(null, ctx.headers);
|
||||||
|
const queryClient = new QueryClient();
|
||||||
|
|
||||||
const {
|
const {
|
||||||
data: { quote },
|
data: { quote },
|
||||||
} = await apolloClient.query({
|
} = await apolloClient.query({
|
||||||
@ -87,7 +89,16 @@ export const quoteRouter = router({
|
|||||||
addProduct,
|
addProduct,
|
||||||
createKpProcess,
|
createKpProcess,
|
||||||
eltProcess,
|
eltProcess,
|
||||||
].map(({ getKPData }) => getKPData({ ...input, quote }))
|
].map(({ getKPData }) =>
|
||||||
|
getKPData({
|
||||||
|
...input,
|
||||||
|
quote,
|
||||||
|
ctx: {
|
||||||
|
apolloClient,
|
||||||
|
queryClient,
|
||||||
|
},
|
||||||
|
})
|
||||||
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
const values = processData.reduce((obj, data) => ({ ...obj, ...data.values }), defaultValues);
|
const values = processData.reduce((obj, data) => ({ ...obj, ...data.values }), defaultValues);
|
||||||
@ -111,7 +122,7 @@ export const quoteRouter = router({
|
|||||||
.input(CreateQuoteInputDataSchema)
|
.input(CreateQuoteInputDataSchema)
|
||||||
.output(CreateQuoteOutputDataSchema)
|
.output(CreateQuoteOutputDataSchema)
|
||||||
.mutation(async ({ input, ctx }) => {
|
.mutation(async ({ input, ctx }) => {
|
||||||
const apolloClient = initializeApollo();
|
const apolloClient = initializeApollo(null, ctx.headers);
|
||||||
const queryClient = new QueryClient();
|
const queryClient = new QueryClient();
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
|||||||
@ -5,6 +5,8 @@ import { KeysSchema, RowSchema } from '@/config/schema/insurance';
|
|||||||
import PaymentsSchema from '@/config/schema/payments';
|
import PaymentsSchema from '@/config/schema/payments';
|
||||||
import ValuesSchema from '@/config/schema/values';
|
import ValuesSchema from '@/config/schema/values';
|
||||||
import type * as CRMTypes from '@/graphql/crm.types';
|
import type * as CRMTypes from '@/graphql/crm.types';
|
||||||
|
import type { ApolloClient, NormalizedCacheObject } from '@apollo/client';
|
||||||
|
import type { QueryClient } from '@tanstack/react-query';
|
||||||
import { z } from 'zod';
|
import { z } from 'zod';
|
||||||
|
|
||||||
const { quote, recalcWithRevision, lead, opportunity } = ValuesSchema.shape;
|
const { quote, recalcWithRevision, lead, opportunity } = ValuesSchema.shape;
|
||||||
@ -22,7 +24,13 @@ export const GetQuoteInputDataSchema = z
|
|||||||
})
|
})
|
||||||
.strict();
|
.strict();
|
||||||
|
|
||||||
|
export type GetQuoteContext = {
|
||||||
|
apolloClient: ApolloClient<NormalizedCacheObject>;
|
||||||
|
queryClient: QueryClient;
|
||||||
|
};
|
||||||
|
|
||||||
export type GetQuoteInputData = z.infer<typeof GetQuoteInputDataSchema> & {
|
export type GetQuoteInputData = z.infer<typeof GetQuoteInputDataSchema> & {
|
||||||
|
ctx: GetQuoteContext;
|
||||||
quote: CRMTypes.GetQuoteDataQuery['quote'];
|
quote: CRMTypes.GetQuoteDataQuery['quote'];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@ -6,9 +6,9 @@ import configuratorHelper from '@/process/configurator/lib/helper';
|
|||||||
import { createTRPCError } from '@/utils/trpc';
|
import { createTRPCError } from '@/utils/trpc';
|
||||||
|
|
||||||
export const tarifRouter = router({
|
export const tarifRouter = router({
|
||||||
getTarif: protectedProcedure.input(GetTarifInputSchema).query(async ({ input }) => {
|
getTarif: protectedProcedure.input(GetTarifInputSchema).query(async ({ input, ctx }) => {
|
||||||
try {
|
try {
|
||||||
const apolloClient = initializeApollo();
|
const apolloClient = initializeApollo(null, ctx.headers);
|
||||||
const { getTarifs } = configuratorHelper({ apolloClient });
|
const { getTarifs } = configuratorHelper({ apolloClient });
|
||||||
|
|
||||||
return getTarifs(input);
|
return getTarifs(input);
|
||||||
|
|||||||
@ -22,3 +22,11 @@ export function useErrors() {
|
|||||||
hasErrors: hasElementsErrors || hasPaymentsErrors || hasInsuranceErrors || hasFingapErrors,
|
hasErrors: hasElementsErrors || hasPaymentsErrors || hasInsuranceErrors || hasFingapErrors,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function useResults() {
|
||||||
|
const { $results } = useStore();
|
||||||
|
|
||||||
|
return {
|
||||||
|
hasResults: $results.payments.length > 0,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|||||||
9
apps/web/styles/media.ts
Normal file
9
apps/web/styles/media.ts
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
import { screens } from '@/config/ui';
|
||||||
|
import { createMedia } from '@artsy/fresnel';
|
||||||
|
|
||||||
|
const AppMedia = createMedia({
|
||||||
|
breakpoints: { ...screens, min: 0 },
|
||||||
|
});
|
||||||
|
|
||||||
|
export const mediaStyle = AppMedia.createMediaStyle();
|
||||||
|
export const { Media, MediaContextProvider } = AppMedia;
|
||||||
@ -1,4 +1,4 @@
|
|||||||
import { getCurrentISODate } from './date';
|
import { getCurrentDateString } from './date';
|
||||||
import * as CRMTypes from '@/graphql/crm.types';
|
import * as CRMTypes from '@/graphql/crm.types';
|
||||||
import type { ApolloClient } from '@apollo/client';
|
import type { ApolloClient } from '@apollo/client';
|
||||||
|
|
||||||
@ -33,7 +33,7 @@ export function createCurrencyUtility({ apolloClient }: Context) {
|
|||||||
fetchPolicy: 'network-only',
|
fetchPolicy: 'network-only',
|
||||||
query: CRMTypes.GetCurrencyChangesDocument,
|
query: CRMTypes.GetCurrencyChangesDocument,
|
||||||
variables: {
|
variables: {
|
||||||
currentDate: getCurrentISODate(),
|
currentDate: getCurrentDateString(),
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@ -11,6 +11,10 @@ export function getCurrentISODate() {
|
|||||||
return _currentDate().toISOString();
|
return _currentDate().toISOString();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function getCurrentDateString() {
|
||||||
|
return _currentDate().format('YYYY-MM-DD');
|
||||||
|
}
|
||||||
|
|
||||||
export function getCurrentDate() {
|
export function getCurrentDate() {
|
||||||
return _currentDate().toDate();
|
return _currentDate().toDate();
|
||||||
}
|
}
|
||||||
|
|||||||
11
apps/web/utils/device.ts
Normal file
11
apps/web/utils/device.ts
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
import { screens } from '@/config/ui';
|
||||||
|
|
||||||
|
export function getDevice() {
|
||||||
|
if (typeof window === 'undefined') return null;
|
||||||
|
|
||||||
|
const isMobile = window.innerWidth < screens.tablet;
|
||||||
|
|
||||||
|
return {
|
||||||
|
isMobile,
|
||||||
|
};
|
||||||
|
}
|
||||||
@ -31,7 +31,7 @@ export function makeGetUserType({ apolloClient, queryClient }: MakeGetUserTypePr
|
|||||||
);
|
);
|
||||||
|
|
||||||
const {
|
const {
|
||||||
data: { systemuser },
|
data: { systemusers },
|
||||||
} = await apolloClient.query({
|
} = await apolloClient.query({
|
||||||
fetchPolicy: 'network-only',
|
fetchPolicy: 'network-only',
|
||||||
query: CRMTypes.GetSystemUserDocument,
|
query: CRMTypes.GetSystemUserDocument,
|
||||||
@ -40,6 +40,8 @@ export function makeGetUserType({ apolloClient, queryClient }: MakeGetUserTypePr
|
|||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
const systemuser = systemusers?.[0];
|
||||||
|
|
||||||
const roles = systemuser?.roles ? sift(systemuser?.roles)?.map((x) => x?.name) : [];
|
const roles = systemuser?.roles ? sift(systemuser?.roles)?.map((x) => x?.name) : [];
|
||||||
|
|
||||||
return {
|
return {
|
||||||
|
|||||||
@ -3,8 +3,8 @@
|
|||||||
"version": "2.0.0",
|
"version": "2.0.0",
|
||||||
"private": true,
|
"private": true,
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build": "dotenv -e .env turbo run build",
|
"build": "turbo run build",
|
||||||
"prebuild": "dotenv -v NODE_ENV=production -e .env turbo run prebuild",
|
"prebuild": "turbo run prebuild",
|
||||||
"clean": "turbo run clean",
|
"clean": "turbo run clean",
|
||||||
"dev": "dotenv -e .env.local turbo run dev",
|
"dev": "dotenv -e .env.local turbo run dev",
|
||||||
"predev": "dotenv -e .env.local turbo run predev",
|
"predev": "dotenv -e .env.local turbo run predev",
|
||||||
|
|||||||
14
pnpm-lock.yaml
generated
14
pnpm-lock.yaml
generated
@ -126,6 +126,9 @@ importers:
|
|||||||
'@apollo/client':
|
'@apollo/client':
|
||||||
specifier: ^3.9.5
|
specifier: ^3.9.5
|
||||||
version: 3.9.5(@types/react@18.2.58)(graphql@16.8.1)(react-dom@18.2.0)(react@18.2.0)
|
version: 3.9.5(@types/react@18.2.58)(graphql@16.8.1)(react-dom@18.2.0)(react@18.2.0)
|
||||||
|
'@artsy/fresnel':
|
||||||
|
specifier: ^7.1.4
|
||||||
|
version: 7.1.4(react@18.2.0)
|
||||||
'@fontsource/montserrat':
|
'@fontsource/montserrat':
|
||||||
specifier: ^4.5.14
|
specifier: ^4.5.14
|
||||||
version: 4.5.14
|
version: 4.5.14
|
||||||
@ -242,7 +245,7 @@ importers:
|
|||||||
specifier: ^8.52.0
|
specifier: ^8.52.0
|
||||||
version: 8.57.0
|
version: 8.57.0
|
||||||
gql-sdl:
|
gql-sdl:
|
||||||
specifier: ^1.0.0
|
specifier: ^1.1.0
|
||||||
version: 1.1.0
|
version: 1.1.0
|
||||||
jest:
|
jest:
|
||||||
specifier: ^29.4.3
|
specifier: ^29.4.3
|
||||||
@ -557,6 +560,15 @@ packages:
|
|||||||
- encoding
|
- encoding
|
||||||
dev: true
|
dev: true
|
||||||
|
|
||||||
|
/@artsy/fresnel@7.1.4(react@18.2.0):
|
||||||
|
resolution: {integrity: sha512-qbUdxzlcI9Q9Ez+HfYDq7hlLoeFKC8EKcCckW+EltWu9SWL3px4QZIkr7NwYEz13q/nLvAlHMnbJ3TpSEEZ1zg==}
|
||||||
|
engines: {node: '>=12.20.2', yarn: 1.x.x}
|
||||||
|
peerDependencies:
|
||||||
|
react: '>=18.0.0'
|
||||||
|
dependencies:
|
||||||
|
react: 18.2.0
|
||||||
|
dev: false
|
||||||
|
|
||||||
/@babel/code-frame@7.23.5:
|
/@babel/code-frame@7.23.5:
|
||||||
resolution: {integrity: sha512-CgH3s1a96LipHCmSUmYFPwY7MNx8C3avkq7i4Wl3cfa662ldtUe4VM1TPXX70pfmrlWTb6jLqTYrZyT2ZTJBgA==}
|
resolution: {integrity: sha512-CgH3s1a96LipHCmSUmYFPwY7MNx8C3avkq7i4Wl3cfa662ldtUe4VM1TPXX70pfmrlWTb6jLqTYrZyT2ZTJBgA==}
|
||||||
engines: {node: '>=6.9.0'}
|
engines: {node: '>=6.9.0'}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user