diff --git a/.eslintignore b/.eslintignore index f77e8ee..42f8f9f 100644 --- a/.eslintignore +++ b/.eslintignore @@ -7,4 +7,7 @@ package-lock.json coverage .eslintrc.js **/*.config.js -**/scripts \ No newline at end of file +**/scripts +packages/eslint-config-custom/* +**/package.json +turbo.json \ No newline at end of file diff --git a/.eslintrc.js b/.eslintrc.js index f49d5f7..394c784 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -1,10 +1,13 @@ module.exports = { root: true, // This tells ESLint to load the config from the package `eslint-config-custom` - extends: ['custom'], + extends: ['custom', 'custom/rules'], settings: { next: { - rootDir: ['apps/*/', 'packages/*/'], + rootDir: ['packages/web/'], + }, + react: { + version: 'detect', }, }, }; diff --git a/.vscode/settings.json b/.vscode/settings.json index 1224f8b..f1660f3 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -13,10 +13,18 @@ "editor.defaultFormatter": "esbenp.prettier-vscode", "editor.formatOnSave": true, "editor.codeActionsOnSave": { - "source.organizeImports": true, - "source.fixAll.eslint": true, - "source.fixAll.format": true + "source.fixAll": true, + "source.fixAll.eslint": true }, "workbench.editor.labelFormat": "short", - "eslint.workingDirectories": [{ "directory": "apps/web", "changeProcessCWD": true }] + "eslint.workingDirectories": [{ "directory": "apps/web", "changeProcessCWD": true }], + "eslint.validate": [ + "javascript", + "javascriptreact", + "json", + "typescript", + "typescriptreact", + "yaml" + ], + "eslint.lintTask.enable": true } diff --git a/apps/web/.eslintignore b/apps/web/.eslintignore index 2458be5..09515ea 100644 --- a/apps/web/.eslintignore +++ b/apps/web/.eslintignore @@ -1,5 +1,8 @@ .next public -*.config.js +apollo.config.js mocks -graphql \ No newline at end of file +graphql/crm.schema.graphql +graphql/crm.types.ts +package.json +next-env.d.ts \ No newline at end of file diff --git a/apps/web/.eslintrc.js b/apps/web/.eslintrc.js index 805a14e..5cb729c 100644 --- a/apps/web/.eslintrc.js +++ b/apps/web/.eslintrc.js @@ -1,6 +1,6 @@ module.exports = { root: true, - extends: ['custom'], + extends: ['custom', 'custom/rules'], parserOptions: { project: './tsconfig.json', tsconfigRootDir: __dirname, diff --git a/apps/web/Components/Calculation/Form/AddProduct/config.ts b/apps/web/Components/Calculation/Form/AddProduct/config.ts index 6881478..b010c5d 100644 --- a/apps/web/Components/Calculation/Form/AddProduct/config.ts +++ b/apps/web/Components/Calculation/Form/AddProduct/config.ts @@ -1,4 +1,3 @@ -/* eslint-disable object-curly-newline */ import type { FormTabRows } from '../../lib/render-rows'; export const id = 'add-product'; diff --git a/apps/web/Components/Calculation/Form/AddProduct/index.jsx b/apps/web/Components/Calculation/Form/AddProduct/index.jsx index 5972d31..03e8409 100644 --- a/apps/web/Components/Calculation/Form/AddProduct/index.jsx +++ b/apps/web/Components/Calculation/Form/AddProduct/index.jsx @@ -6,7 +6,7 @@ function Insurance() { } export default { + Component: Insurance, id, title, - Component: Insurance, }; diff --git a/apps/web/Components/Calculation/Form/CreateKP/config.ts b/apps/web/Components/Calculation/Form/CreateKP/config.ts index aa0958a..77ccd37 100644 --- a/apps/web/Components/Calculation/Form/CreateKP/config.ts +++ b/apps/web/Components/Calculation/Form/CreateKP/config.ts @@ -1,4 +1,3 @@ -/* eslint-disable object-curly-newline */ import type { FormTabRows } from '../../lib/render-rows'; export const id = 'create-kp'; diff --git a/apps/web/Components/Calculation/Form/CreateKP/index.jsx b/apps/web/Components/Calculation/Form/CreateKP/index.jsx index f5f13ad..956740c 100644 --- a/apps/web/Components/Calculation/Form/CreateKP/index.jsx +++ b/apps/web/Components/Calculation/Form/CreateKP/index.jsx @@ -6,7 +6,7 @@ function CreateKP() { } export default { + Component: CreateKP, id, title, - Component: CreateKP, }; diff --git a/apps/web/Components/Calculation/Form/Insurance/FinGAPTable/config.ts b/apps/web/Components/Calculation/Form/Insurance/FinGAPTable/config.ts index d993aed..30bfa7b 100644 --- a/apps/web/Components/Calculation/Form/Insurance/FinGAPTable/config.ts +++ b/apps/web/Components/Calculation/Form/Insurance/FinGAPTable/config.ts @@ -1,6 +1,6 @@ -/* eslint-disable import/prefer-default-export */ -import type { ColumnsType } from 'antd/lib/table'; +/* eslint-disable canonical/sort-keys */ import type { Risk } from './types'; +import type { ColumnsType } from 'antd/lib/table'; export const columns: ColumnsType = [ { diff --git a/apps/web/Components/Calculation/Form/Insurance/FinGAPTable/index.jsx b/apps/web/Components/Calculation/Form/Insurance/FinGAPTable/index.jsx index 21a8887..5ce9cb8 100644 --- a/apps/web/Components/Calculation/Form/Insurance/FinGAPTable/index.jsx +++ b/apps/web/Components/Calculation/Form/Insurance/FinGAPTable/index.jsx @@ -1,11 +1,11 @@ +import { columns } from './config'; +import { useStore } from '@/stores/hooks'; import { toJS } from 'mobx'; import { observer } from 'mobx-react-lite'; -import { useStore } from 'stores/hooks'; import styled from 'styled-components'; import { Flex } from 'ui'; import Alert from 'ui/elements/Alert'; import Table from 'ui/elements/Table'; -import { columns } from './config'; const Grid = styled(Flex)` flex-direction: column; @@ -23,7 +23,7 @@ const Validation = observer(() => { return null; }); -const FinGAPTable = observer(() => { +const FinGAP = observer(() => { const { $tables } = useStore(); const { fingap } = $tables; @@ -35,7 +35,6 @@ const FinGAPTable = observer(() => { columns={columns} dataSource={dataSource} rowSelection={{ - type: 'checkbox', onChange: (_, selectedRows) => { const selectedKeys = selectedRows.reduce((acc, row) => { acc.push(row.key); @@ -47,6 +46,7 @@ const FinGAPTable = observer(() => { fingap.setSelectedKeys(selectedKeys); }, selectedRowKeys, + type: 'checkbox', }} pagination={false} size="small" @@ -57,11 +57,11 @@ const FinGAPTable = observer(() => { ); }); -export default function () { +export default function FinGAPTable() { return ( - + ); } diff --git a/apps/web/Components/Calculation/Form/Insurance/FinGAPTable/types.ts b/apps/web/Components/Calculation/Form/Insurance/FinGAPTable/types.ts index 0438b92..19124b8 100644 --- a/apps/web/Components/Calculation/Form/Insurance/FinGAPTable/types.ts +++ b/apps/web/Components/Calculation/Form/Insurance/FinGAPTable/types.ts @@ -1,4 +1,4 @@ -import type { RiskSchema } from 'config/schema/fingap'; +import type { RiskSchema } from '@/config/schema/fingap'; import type { z } from 'zod'; export type Risk = z.infer; diff --git a/apps/web/Components/Calculation/Form/Insurance/InsuranceTable/builders.tsx b/apps/web/Components/Calculation/Form/Insurance/InsuranceTable/builders.tsx index 53acdc1..c7ffcef 100644 --- a/apps/web/Components/Calculation/Form/Insurance/InsuranceTable/builders.tsx +++ b/apps/web/Components/Calculation/Form/Insurance/InsuranceTable/builders.tsx @@ -1,8 +1,8 @@ -import { observer } from 'mobx-react-lite'; -import type { ComponentType } from 'react'; -import { useRow } from 'stores/tables/insurance/hooks'; import { useInsuranceValue } from './hooks'; import type { Values } from './types'; +import { useRow } from '@/stores/tables/insurance/hooks'; +import { observer } from 'mobx-react-lite'; +import type { ComponentType } from 'react'; export function buildOptionComponent( key: string, @@ -16,7 +16,7 @@ export function buildOptionComponent( const statuses = getStatus(valueName); return ( - + ); }); } @@ -31,6 +31,6 @@ export function buildValueComponent( const { getStatus } = useRow(key); const statuses = getStatus(valueName); - return ; + return ; }); } diff --git a/apps/web/Components/Calculation/Form/Insurance/InsuranceTable/config.tsx b/apps/web/Components/Calculation/Form/Insurance/InsuranceTable/config.tsx index 664b5ec..74d61fb 100644 --- a/apps/web/Components/Calculation/Form/Insurance/InsuranceTable/config.tsx +++ b/apps/web/Components/Calculation/Form/Insurance/InsuranceTable/config.tsx @@ -1,11 +1,11 @@ -/* eslint-disable import/prefer-default-export */ +/* eslint-disable canonical/sort-keys */ +import { buildOptionComponent, buildValueComponent } from './builders'; +import type * as Insurance from './types'; +import { MAX_INSURANCE } from '@/constants/values'; import type { ColumnsType } from 'antd/lib/table'; -import { MAX_INSURANCE } from 'constants/values'; import { formatter, parser } from 'tools/number'; import InputNumber from 'ui/elements/InputNumber'; import Select from 'ui/elements/Select'; -import { buildOptionComponent, buildValueComponent } from './builders'; -import type * as Insurance from './types'; export const columns: ColumnsType = [ { @@ -21,7 +21,7 @@ export const columns: ColumnsType = [ render: (_, record) => { const Component = buildOptionComponent(record.key, Select, 'insuranceCompany'); - return ; + return ; }, }, { @@ -43,13 +43,13 @@ export const columns: ColumnsType = [ return ( ); }, diff --git a/apps/web/Components/Calculation/Form/Insurance/InsuranceTable/hooks.js b/apps/web/Components/Calculation/Form/Insurance/InsuranceTable/hooks.js index 517a310..4dfd576 100644 --- a/apps/web/Components/Calculation/Form/Insurance/InsuranceTable/hooks.js +++ b/apps/web/Components/Calculation/Form/Insurance/InsuranceTable/hooks.js @@ -1,6 +1,5 @@ -/* eslint-disable import/prefer-default-export */ +import { useRow } from '@/stores/tables/insurance/hooks'; import { useEffect, useState } from 'react'; -import { useRow } from 'stores/tables/insurance/hooks'; import { useDebouncedCallback } from 'use-debounce'; export function useInsuranceValue(key, valueName) { @@ -8,24 +7,19 @@ export function useInsuranceValue(key, valueName) { const storeValue = row.getValue(valueName); - function setStoreValue(value) { - return row.setValue(valueName, value); + function setStoreValue(val) { + return row.setValue(valueName, val); } const [value, setValue] = useState(storeValue); - // eslint-disable-next-line object-curly-newline - const debouncedSetStoreValue = useDebouncedCallback(setStoreValue, 350, { maxWait: 1000 }); + const debouncedSetStoreValue = useDebouncedCallback(setStoreValue, 350, { maxWait: 1_000 }); - useEffect( - () => { - if (storeValue !== value) { - debouncedSetStoreValue(value); - } - }, - // eslint-disable-next-line react-hooks/exhaustive-deps - [value] - ); + useEffect(() => { + if (storeValue !== value) { + debouncedSetStoreValue(value); + } + }, [value]); useEffect(() => { setValue(storeValue); diff --git a/apps/web/Components/Calculation/Form/Insurance/InsuranceTable/index.jsx b/apps/web/Components/Calculation/Form/Insurance/InsuranceTable/index.jsx index bda8747..6cc6fde 100644 --- a/apps/web/Components/Calculation/Form/Insurance/InsuranceTable/index.jsx +++ b/apps/web/Components/Calculation/Form/Insurance/InsuranceTable/index.jsx @@ -1,10 +1,10 @@ +import { columns } from './config'; +import { useStore } from '@/stores/hooks'; import { observer } from 'mobx-react-lite'; -import { useStore } from 'stores/hooks'; import styled from 'styled-components'; import { Flex } from 'ui'; import Alert from 'ui/elements/Alert'; import Table from 'ui/elements/Table'; -import { columns } from './config'; const Grid = styled(Flex)` flex-direction: column; @@ -28,7 +28,7 @@ const Validation = observer(() => { return null; }); -const InsuranceTable = observer(() => { +const Insurance = observer(() => { const store = useStore(); const { values } = store.$tables.insurance; @@ -48,11 +48,11 @@ const InsuranceTable = observer(() => { ); }); -export default function () { +export default function InsuranceTable() { return ( - + ); } diff --git a/apps/web/Components/Calculation/Form/Insurance/InsuranceTable/types.ts b/apps/web/Components/Calculation/Form/Insurance/InsuranceTable/types.ts index 744cf3c..87c1847 100644 --- a/apps/web/Components/Calculation/Form/Insurance/InsuranceTable/types.ts +++ b/apps/web/Components/Calculation/Form/Insurance/InsuranceTable/types.ts @@ -1,4 +1,4 @@ -import type { KeysSchema, RowSchema } from 'config/schema/insurance'; +import type { KeysSchema, RowSchema } from '@/config/schema/insurance'; import type { BaseOption, Status } from 'ui/elements/types'; import type { z } from 'zod'; @@ -9,7 +9,7 @@ export type RowValues = z.infer; export type Values = Exclude; export type RowOptions = { - [ValueName in Values]: BaseOption[]; + [ValueName in Values]: Array>; }; export type RowStatuses = Record; diff --git a/apps/web/Components/Calculation/Form/Insurance/index.jsx b/apps/web/Components/Calculation/Form/Insurance/index.jsx index 57bfa8f..eab56cb 100644 --- a/apps/web/Components/Calculation/Form/Insurance/index.jsx +++ b/apps/web/Components/Calculation/Form/Insurance/index.jsx @@ -1,8 +1,8 @@ -import { Flex } from 'ui'; import renderFormRows from '../../lib/render-rows'; import { id, rows, title } from './config'; import FinGAPTable from './FinGAPTable'; import InsuranceTable from './InsuranceTable'; +import { Flex } from 'ui'; function Insurance() { const renderedRows = renderFormRows(rows); @@ -17,7 +17,7 @@ function Insurance() { } export default { + Component: Insurance, id, title, - Component: Insurance, }; diff --git a/apps/web/Components/Calculation/Form/Leasing/config.ts b/apps/web/Components/Calculation/Form/Leasing/config.ts index d51d72a..f23e0e4 100644 --- a/apps/web/Components/Calculation/Form/Leasing/config.ts +++ b/apps/web/Components/Calculation/Form/Leasing/config.ts @@ -1,4 +1,3 @@ -/* eslint-disable object-curly-newline */ import type { FormTabRows } from '../../lib/render-rows'; export const id = 'leasing'; diff --git a/apps/web/Components/Calculation/Form/Leasing/index.jsx b/apps/web/Components/Calculation/Form/Leasing/index.jsx index 51a59fc..2aa6e0c 100644 --- a/apps/web/Components/Calculation/Form/Leasing/index.jsx +++ b/apps/web/Components/Calculation/Form/Leasing/index.jsx @@ -6,7 +6,7 @@ function Leasing() { } export default { + Component: Leasing, id, title, - Component: Leasing, }; diff --git a/apps/web/Components/Calculation/Form/LeasingObject/config.ts b/apps/web/Components/Calculation/Form/LeasingObject/config.ts index c1398ab..f54f62f 100644 --- a/apps/web/Components/Calculation/Form/LeasingObject/config.ts +++ b/apps/web/Components/Calculation/Form/LeasingObject/config.ts @@ -1,4 +1,3 @@ -/* eslint-disable object-curly-newline */ import type { FormTabRows } from '../../lib/render-rows'; export const id = 'leasing-object'; diff --git a/apps/web/Components/Calculation/Form/LeasingObject/index.jsx b/apps/web/Components/Calculation/Form/LeasingObject/index.jsx index 7a42130..f039e20 100644 --- a/apps/web/Components/Calculation/Form/LeasingObject/index.jsx +++ b/apps/web/Components/Calculation/Form/LeasingObject/index.jsx @@ -6,7 +6,7 @@ function LeasingObject() { } export default { + Component: LeasingObject, id, title, - Component: LeasingObject, }; diff --git a/apps/web/Components/Calculation/Form/Payments/PaymentsParams.jsx b/apps/web/Components/Calculation/Form/Payments/PaymentsParams.jsx index ccca88d..2b362f0 100644 --- a/apps/web/Components/Calculation/Form/Payments/PaymentsParams.jsx +++ b/apps/web/Components/Calculation/Form/Payments/PaymentsParams.jsx @@ -1,8 +1,8 @@ -import { observer } from 'mobx-react-lite'; -import { useStore } from 'stores/hooks'; -import { Flex } from 'ui'; import elementsRender from '../../config/elements-render'; import { elements } from './config'; +import { useStore } from '@/stores/hooks'; +import { observer } from 'mobx-react-lite'; +import { Flex } from 'ui'; function PaymentsParams() { const renderedElements = elements.map((elementName) => { diff --git a/apps/web/Components/Calculation/Form/Payments/PaymentsTable/builders.tsx b/apps/web/Components/Calculation/Form/Payments/PaymentsTable/builders.tsx index 6dc13b8..ead1e62 100644 --- a/apps/web/Components/Calculation/Form/Payments/PaymentsTable/builders.tsx +++ b/apps/web/Components/Calculation/Form/Payments/PaymentsTable/builders.tsx @@ -1,14 +1,13 @@ -/* eslint-disable import/prefer-default-export */ +import { usePaymentValue } from './hooks'; +import { useRowStatus } from '@/stores/tables/payments/hooks'; import { observer } from 'mobx-react-lite'; import type { ComponentType } from 'react'; -import { useRowStatus } from 'stores/tables/payments/hooks'; -import { usePaymentValue } from './hooks'; export function buildValueComponent(index: number, Component: ComponentType) { return observer((props: T) => { const [value, setValue] = usePaymentValue(index); const status = useRowStatus(index); - return ; + return ; }); } diff --git a/apps/web/Components/Calculation/Form/Payments/PaymentsTable/config.tsx b/apps/web/Components/Calculation/Form/Payments/PaymentsTable/config.tsx index 3d50bcf..391e807 100644 --- a/apps/web/Components/Calculation/Form/Payments/PaymentsTable/config.tsx +++ b/apps/web/Components/Calculation/Form/Payments/PaymentsTable/config.tsx @@ -1,9 +1,8 @@ -/* eslint-disable import/prefer-default-export */ +/* eslint-disable canonical/sort-keys */ +import { buildValueComponent } from './builders'; import type { ColumnsType } from 'antd/lib/table'; import InputNumber from 'ui/elements/InputNumber'; -import { buildValueComponent } from './builders'; - type Payment = { key: number; num: number; @@ -27,10 +26,10 @@ export const columns: ColumnsType = [ return ( ); }, diff --git a/apps/web/Components/Calculation/Form/Payments/PaymentsTable/hooks.js b/apps/web/Components/Calculation/Form/Payments/PaymentsTable/hooks.js index 6ee7091..4cb3295 100644 --- a/apps/web/Components/Calculation/Form/Payments/PaymentsTable/hooks.js +++ b/apps/web/Components/Calculation/Form/Payments/PaymentsTable/hooks.js @@ -1,24 +1,18 @@ -/* eslint-disable import/prefer-default-export */ +import { useRowValue } from '@/stores/tables/payments/hooks'; import { useEffect, useState } from 'react'; -import { useRowValue } from 'stores/tables/payments/hooks'; import { useDebouncedCallback } from 'use-debounce'; export function usePaymentValue(index) { const [storeValue, setStoreValue] = useRowValue(index); const [value, setValue] = useState(storeValue); - // eslint-disable-next-line object-curly-newline - const debouncedSetStoreValue = useDebouncedCallback(setStoreValue, 350, { maxWait: 1000 }); + const debouncedSetStoreValue = useDebouncedCallback(setStoreValue, 350, { maxWait: 1_000 }); - useEffect( - () => { - if (storeValue !== value) { - debouncedSetStoreValue(value); - } - }, - // eslint-disable-next-line react-hooks/exhaustive-deps - [value] - ); + useEffect(() => { + if (storeValue !== value) { + debouncedSetStoreValue(value); + } + }, [value]); useEffect(() => { setValue(storeValue); diff --git a/apps/web/Components/Calculation/Form/Payments/PaymentsTable/index.jsx b/apps/web/Components/Calculation/Form/Payments/PaymentsTable/index.jsx index a297777..804ecbd 100644 --- a/apps/web/Components/Calculation/Form/Payments/PaymentsTable/index.jsx +++ b/apps/web/Components/Calculation/Form/Payments/PaymentsTable/index.jsx @@ -1,12 +1,12 @@ +import { columns } from './config'; +import { useStore } from '@/stores/hooks'; +import { min } from '@/styles/mq'; import { computed } from 'mobx'; import { observer } from 'mobx-react-lite'; -import { useStore } from 'stores/hooks'; import styled from 'styled-components'; -import { min } from 'styles/mq'; import Alert from 'ui/elements/Alert'; import Table from 'ui/elements/Table'; import { Box, Flex } from 'ui/grid'; -import { columns } from './config'; const Grid = styled(Flex)` flex-direction: column; diff --git a/apps/web/Components/Calculation/Form/Payments/index.jsx b/apps/web/Components/Calculation/Form/Payments/index.jsx index cfc8504..b2c00d6 100644 --- a/apps/web/Components/Calculation/Form/Payments/index.jsx +++ b/apps/web/Components/Calculation/Form/Payments/index.jsx @@ -1,8 +1,8 @@ -import { Box, Flex } from 'ui/grid'; import elementsRender from '../../config/elements-render'; import { id, title } from './config'; import PaymentsParams from './PaymentsParams'; import PaymentsTable from './PaymentsTable'; +import { Box, Flex } from 'ui/grid'; function Payments() { const radioGraphType = elementsRender.radioGraphType.render(); @@ -12,8 +12,8 @@ function Payments() { {radioGraphType} @@ -25,7 +25,7 @@ function Payments() { } export default { + Component: Payments, id, title, - Component: Payments, }; diff --git a/apps/web/Components/Calculation/Form/SupplierAgent/config.ts b/apps/web/Components/Calculation/Form/SupplierAgent/config.ts index a663a42..ceb720e 100644 --- a/apps/web/Components/Calculation/Form/SupplierAgent/config.ts +++ b/apps/web/Components/Calculation/Form/SupplierAgent/config.ts @@ -1,4 +1,3 @@ -/* eslint-disable object-curly-newline */ import type { FormTabRows } from '../../lib/render-rows'; export const id = 'supplier-agent'; diff --git a/apps/web/Components/Calculation/Form/SupplierAgent/index.jsx b/apps/web/Components/Calculation/Form/SupplierAgent/index.jsx index 51a59fc..2aa6e0c 100644 --- a/apps/web/Components/Calculation/Form/SupplierAgent/index.jsx +++ b/apps/web/Components/Calculation/Form/SupplierAgent/index.jsx @@ -6,7 +6,7 @@ function Leasing() { } export default { + Component: Leasing, id, title, - Component: Leasing, }; diff --git a/apps/web/Components/Calculation/Form/index.jsx b/apps/web/Components/Calculation/Form/index.jsx index 31e27f3..175cb11 100644 --- a/apps/web/Components/Calculation/Form/index.jsx +++ b/apps/web/Components/Calculation/Form/index.jsx @@ -1,7 +1,3 @@ -import Background from 'Components/Layout/Background'; -import styled from 'styled-components'; -import { min } from 'styles/mq'; -import Tabs from 'ui/elements/layout/Tabs'; import AddProduct from './AddProduct'; import CreateKP from './CreateKP'; import Insurance from './Insurance'; @@ -9,6 +5,10 @@ import Leasing from './Leasing'; import LeasingObject from './LeasingObject'; import Payments from './Payments'; import SupplierAgent from './SupplierAgent'; +import Background from '@/Components/Layout/Background'; +import { min } from '@/styles/mq'; +import styled from 'styled-components'; +import Tabs from 'ui/elements/layout/Tabs'; const formTabs = [Leasing, Payments, LeasingObject, SupplierAgent, Insurance, AddProduct, CreateKP]; diff --git a/apps/web/Components/Calculation/Settings/config.ts b/apps/web/Components/Calculation/Settings/config.ts index ee04751..8af3868 100644 --- a/apps/web/Components/Calculation/Settings/config.ts +++ b/apps/web/Components/Calculation/Settings/config.ts @@ -1,5 +1,3 @@ -/* eslint-disable import/prefer-default-export */ -/* eslint-disable object-curly-newline */ import type { FormTabRows } from '../lib/render-rows'; const defaultRowStyle = { gridTemplateColumns: '1fr' }; diff --git a/apps/web/Components/Calculation/Settings/index.jsx b/apps/web/Components/Calculation/Settings/index.jsx index 6b62612..35cfa80 100644 --- a/apps/web/Components/Calculation/Settings/index.jsx +++ b/apps/web/Components/Calculation/Settings/index.jsx @@ -1,8 +1,8 @@ -import Background from 'Components/Layout/Background'; -import styled from 'styled-components'; -import { min } from 'styles/mq'; import renderFormRows from '../lib/render-rows'; import { rows } from './config'; +import Background from '@/Components/Layout/Background'; +import { min } from '@/styles/mq'; +import styled from 'styled-components'; const Wrapper = styled(Background)` padding: 4px 10px; diff --git a/apps/web/Components/Calculation/addons/currency-addon.tsx b/apps/web/Components/Calculation/addons/currency-addon.tsx index 3b4cbc4..6f2ce8f 100644 --- a/apps/web/Components/Calculation/addons/currency-addon.tsx +++ b/apps/web/Components/Calculation/addons/currency-addon.tsx @@ -1,7 +1,7 @@ +import * as CRMTypes from '@/graphql/crm.types'; +import { useStore } from '@/stores/hooks'; import { useQuery } from '@apollo/client'; -import * as CRMTypes from 'graphql/crm.types'; import { observer } from 'mobx-react-lite'; -import { useStore } from 'stores/hooks'; const CurrencyAddon = observer(() => { const { $calculation } = useStore(); @@ -9,10 +9,11 @@ const CurrencyAddon = observer(() => { const currencyid = $calculation.element('selectSupplierCurrency').getValue(); const { data } = useQuery(CRMTypes.GetTransactionCurrencyDocument, { + skip: !currencyid, variables: { + // eslint-disable-next-line @typescript-eslint/no-non-null-assertion currencyid: currencyid!, }, - skip: !currencyid, }); return {data?.transactioncurrency?.currencysymbol}; diff --git a/apps/web/Components/Calculation/builders/build-action.tsx b/apps/web/Components/Calculation/builders/build-action.tsx index 5ae58d6..2cd6282 100644 --- a/apps/web/Components/Calculation/builders/build-action.tsx +++ b/apps/web/Components/Calculation/builders/build-action.tsx @@ -1,8 +1,7 @@ -/* eslint-disable react/jsx-no-bind */ +import type { Elements } from '../config/map/actions'; +import { useStatus } from '@/stores/calculation/statuses/hooks'; import { observer } from 'mobx-react-lite'; import type { ComponentType } from 'react'; -import { useStatus } from 'stores/calculation/statuses/hooks'; -import type { Elements } from '../config/map/actions'; type BuilderProps = { elementName: Elements; @@ -18,8 +17,8 @@ export default function buildAction( return ( import(`process/${actionName}`).then((module) => module.default())} status={status} - action={() => import(`process/${actionName}`).then((m) => m.default())} {...props} /> ); diff --git a/apps/web/Components/Calculation/builders/build-options.tsx b/apps/web/Components/Calculation/builders/build-options.tsx index 8849fd6..e08f34b 100644 --- a/apps/web/Components/Calculation/builders/build-options.tsx +++ b/apps/web/Components/Calculation/builders/build-options.tsx @@ -1,11 +1,11 @@ -import { observer } from 'mobx-react-lite'; -import type { ComponentType } from 'react'; -import { useOptions } from 'stores/calculation/options/hooks'; -import { useStatus } from 'stores/calculation/statuses/hooks'; -import { useValidation } from 'stores/calculation/validation/hooks'; -import type { Values } from 'stores/calculation/values/types'; import type { Elements } from '../config/map/values'; import { useStoreValue } from './hooks'; +import { useOptions } from '@/stores/calculation/options/hooks'; +import { useStatus } from '@/stores/calculation/statuses/hooks'; +import { useValidation } from '@/stores/calculation/validation/hooks'; +import type { Values } from '@/stores/calculation/values/types'; +import { observer } from 'mobx-react-lite'; +import type { ComponentType } from 'react'; type BuilderProps = { elementName: Elements; @@ -24,12 +24,12 @@ export default function buildOptions( return ( ); diff --git a/apps/web/Components/Calculation/builders/build-readonly.tsx b/apps/web/Components/Calculation/builders/build-readonly.tsx index 91edb0f..825f566 100644 --- a/apps/web/Components/Calculation/builders/build-readonly.tsx +++ b/apps/web/Components/Calculation/builders/build-readonly.tsx @@ -1,9 +1,9 @@ +import type { Elements } from '../config/map/values'; +import { useStatus } from '@/stores/calculation/statuses/hooks'; +import { useValue } from '@/stores/calculation/values/hooks'; +import type { Values } from '@/stores/calculation/values/types'; import { observer } from 'mobx-react-lite'; import type { ComponentType } from 'react'; -import { useStatus } from 'stores/calculation/statuses/hooks'; -import { useValue } from 'stores/calculation/values/hooks'; -import type { Values } from 'stores/calculation/values/types'; -import type { Elements } from '../config/map/values'; type BuilderProps = { elementName: Elements; @@ -18,6 +18,6 @@ export default function buildReadonly( const [value] = useValue(valueName); const status = useStatus(elementName); - return ; + return ; }); } diff --git a/apps/web/Components/Calculation/builders/build-value.tsx b/apps/web/Components/Calculation/builders/build-value.tsx index 89bac17..06da07b 100644 --- a/apps/web/Components/Calculation/builders/build-value.tsx +++ b/apps/web/Components/Calculation/builders/build-value.tsx @@ -1,10 +1,10 @@ -import { observer } from 'mobx-react-lite'; -import type { ComponentType } from 'react'; -import { useStatus } from 'stores/calculation/statuses/hooks'; -import { useValidation } from 'stores/calculation/validation/hooks'; -import type { Values } from 'stores/calculation/values/types'; import type { Elements } from '../config/map/values'; import { useStoreValue } from './hooks'; +import { useStatus } from '@/stores/calculation/statuses/hooks'; +import { useValidation } from '@/stores/calculation/validation/hooks'; +import type { Values } from '@/stores/calculation/values/types'; +import { observer } from 'mobx-react-lite'; +import type { ComponentType } from 'react'; export type BuilderProps = { elementName: Elements; @@ -22,11 +22,11 @@ export default function buildValue( return ( ); diff --git a/apps/web/Components/Calculation/builders/hooks.js b/apps/web/Components/Calculation/builders/hooks.js index 9d3390c..baaf214 100644 --- a/apps/web/Components/Calculation/builders/hooks.js +++ b/apps/web/Components/Calculation/builders/hooks.js @@ -1,24 +1,18 @@ -/* eslint-disable import/prefer-default-export */ +import { useValue } from '@/stores/calculation/values/hooks'; import { useEffect, useState } from 'react'; -import { useValue } from 'stores/calculation/values/hooks'; import { useDebouncedCallback } from 'use-debounce'; export function useStoreValue(valueName) { const [storeValue, setStoreValue] = useValue(valueName); const [value, setValue] = useState(storeValue); - // eslint-disable-next-line object-curly-newline - const debouncedSetStoreValue = useDebouncedCallback(setStoreValue, 350, { maxWait: 1000 }); + const debouncedSetStoreValue = useDebouncedCallback(setStoreValue, 350, { maxWait: 1_000 }); - useEffect( - () => { - if (storeValue !== value) { - debouncedSetStoreValue(value); - } - }, - // eslint-disable-next-line react-hooks/exhaustive-deps - [value] - ); + useEffect(() => { + if (storeValue !== value) { + debouncedSetStoreValue(value); + } + }, [value]); useEffect(() => { setValue(storeValue); diff --git a/apps/web/Components/Calculation/config/elements-components.ts b/apps/web/Components/Calculation/config/elements-components.ts index 1d44bad..6e9b5ed 100644 --- a/apps/web/Components/Calculation/config/elements-components.ts +++ b/apps/web/Components/Calculation/config/elements-components.ts @@ -1,9 +1,11 @@ -import type { ComponentProps } from 'react'; -import * as e from 'ui/elements'; +/* eslint-disable jsdoc/multiline-blocks */ +/* eslint-disable canonical/sort-keys */ import type { Elements as ActionElements } from './map/actions'; import type { Elements as ValuesElements } from './map/values'; +import type { ComponentProps } from 'react'; +import * as e from 'ui/elements'; -function wrapComponentsMap>(arg: T) { +function wrapComponentsMap>(arg: T) { return arg; } diff --git a/apps/web/Components/Calculation/config/elements-props.ts b/apps/web/Components/Calculation/config/elements-props.ts index cae54fa..332a35c 100644 --- a/apps/web/Components/Calculation/config/elements-props.ts +++ b/apps/web/Components/Calculation/config/elements-props.ts @@ -1,9 +1,11 @@ -import { MAX_FRANCHISE, MAX_LEASING_PERIOD } from 'constants/values'; +/* eslint-disable jsdoc/multiline-blocks */ +/* eslint-disable canonical/sort-keys */ +import CurrencyAddon from '../addons/currency-addon'; +import type { ElementsProps } from './elements-components'; +import { MAX_FRANCHISE, MAX_LEASING_PERIOD } from '@/constants/values'; import dayjs from 'dayjs'; import { formatter, formatterExtra, parser } from 'tools/number'; import { DownloadOutlined } from 'ui/elements/icons'; -import CurrencyAddon from '../addons/currency-addon'; -import type { ElementsProps } from './elements-components'; const props: Partial = { tbxLeaseObjectPrice: { @@ -197,7 +199,7 @@ const props: Partial = { }, tbxEngineVolume: { min: 0, - max: 99.9999, + max: 99.999_9, step: 0.5, precision: 4, parser, @@ -354,7 +356,7 @@ const props: Partial = { tbxIRR_Perc: { min: 0, max: 500, - step: 0.0001, + step: 0.000_1, precision: 6, parser, formatter: formatterExtra, diff --git a/apps/web/Components/Calculation/config/elements-render/index.ts b/apps/web/Components/Calculation/config/elements-render/index.ts index 07f3d61..893cd18 100644 --- a/apps/web/Components/Calculation/config/elements-render/index.ts +++ b/apps/web/Components/Calculation/config/elements-render/index.ts @@ -1,4 +1,3 @@ -/* eslint-disable object-curly-newline */ import type map from '../map'; import overrideRender from './override'; import render from './render'; diff --git a/apps/web/Components/Calculation/config/elements-render/override.tsx b/apps/web/Components/Calculation/config/elements-render/override.tsx index 2232025..d13e504 100644 --- a/apps/web/Components/Calculation/config/elements-render/override.tsx +++ b/apps/web/Components/Calculation/config/elements-render/override.tsx @@ -1,10 +1,3 @@ -/* eslint-disable object-curly-newline */ -import { Container, Head } from 'Components/Layout/Element'; -import { observer } from 'mobx-react-lite'; -import type { ComponentProps } from 'react'; -import { useStore } from 'stores/hooks'; -import Link from 'ui/elements/Link'; -import Tooltip from 'ui/elements/Tooltip'; import buildReadonly from '../../builders/build-readonly'; import components from '../elements-components'; import elementsProps from '../elements-props'; @@ -12,6 +5,12 @@ import titles from '../elements-titles'; import types from '../elements-types'; import map from '../map'; import type { RenderProps } from './types'; +import { Container, Head } from '@/Components/Layout/Element'; +import { useStore } from '@/stores/hooks'; +import { observer } from 'mobx-react-lite'; +import type { ComponentProps } from 'react'; +import Link from 'ui/elements/Link'; +import Tooltip from 'ui/elements/Tooltip'; const defaultLinkProps: ComponentProps = { text: 'Открыть в CRM', @@ -19,6 +18,31 @@ const defaultLinkProps: ComponentProps = { }; const overrideRender: Partial> = { + selectHighSeasonStart: { + render: () => { + const elementName = 'selectHighSeasonStart'; + const title = titles.selectHighSeasonStart; + const valueName = map.selectHighSeasonStart; + const Component = components.selectHighSeasonStart; + const props = elementsProps.selectHighSeasonStart; + const { builder } = types.selectHighSeasonStart(); + + const Element = builder(Component, { + elementName, + valueName, + }); + + return ( + + + + + + + ); + }, + }, + selectLead: { render: () => { const elementName = 'selectLead'; @@ -41,9 +65,9 @@ const overrideRender: Partial> = { return ( } htmlFor={elementName} title={title} - addon={} /> @@ -73,9 +97,9 @@ const overrideRender: Partial> = { return ( } htmlFor={elementName} title={title} - addon={} /> @@ -105,9 +129,9 @@ const overrideRender: Partial> = { return ( } htmlFor={elementName} title={title} - addon={} /> @@ -115,56 +139,6 @@ const overrideRender: Partial> = { }, }, - tbxVehicleTaxInYear: { - render: () => { - const elementName = 'tbxVehicleTaxInYear'; - const title = titles.tbxVehicleTaxInYear; - const valueName = map.tbxVehicleTaxInYear; - const Component = components.tbxVehicleTaxInYear; - const props = elementsProps.tbxVehicleTaxInYear; - const { builder } = types.tbxVehicleTaxInYear(); - - const Element = builder(Component, { - elementName, - valueName, - }); - - return ( - - - - - - - ); - }, - }, - - selectHighSeasonStart: { - render: () => { - const elementName = 'selectHighSeasonStart'; - const title = titles.selectHighSeasonStart; - const valueName = map.selectHighSeasonStart; - const Component = components.selectHighSeasonStart; - const props = elementsProps.selectHighSeasonStart; - const { builder } = types.selectHighSeasonStart(); - - const Element = builder(Component, { - elementName, - valueName, - }); - - return ( - - - - - - - ); - }, - }, - selectSeasonType: { render: () => { const elementName = 'selectSeasonType'; @@ -203,6 +177,31 @@ const overrideRender: Partial> = { ); }, }, + + tbxVehicleTaxInYear: { + render: () => { + const elementName = 'tbxVehicleTaxInYear'; + const title = titles.tbxVehicleTaxInYear; + const valueName = map.tbxVehicleTaxInYear; + const Component = components.tbxVehicleTaxInYear; + const props = elementsProps.tbxVehicleTaxInYear; + const { builder } = types.tbxVehicleTaxInYear(); + + const Element = builder(Component, { + elementName, + valueName, + }); + + return ( + + + + + + + ); + }, + }, }; export default overrideRender; diff --git a/apps/web/Components/Calculation/config/elements-render/render.jsx b/apps/web/Components/Calculation/config/elements-render/render.jsx index 5d28268..f29b036 100644 --- a/apps/web/Components/Calculation/config/elements-render/render.jsx +++ b/apps/web/Components/Calculation/config/elements-render/render.jsx @@ -1,10 +1,9 @@ -/* eslint-disable object-curly-newline */ -import { Container, Head } from 'Components/Layout/Element'; import components from '../elements-components'; import elementsProps from '../elements-props'; import titles from '../elements-titles'; import types from '../elements-types'; import map from '../map'; +import { Container, Head } from '@/Components/Layout/Element'; const render = Object.keys(map).reduce((acc, elementName) => { const title = titles[elementName]; diff --git a/apps/web/Components/Calculation/config/elements-titles.ts b/apps/web/Components/Calculation/config/elements-titles.ts index 7ddc54e..d6d9e15 100644 --- a/apps/web/Components/Calculation/config/elements-titles.ts +++ b/apps/web/Components/Calculation/config/elements-titles.ts @@ -1,7 +1,9 @@ +/* eslint-disable jsdoc/multiline-blocks */ +/* eslint-disable canonical/sort-keys */ import type { Elements as ActionElements } from './map/actions'; import type { Elements as ValuesElements } from './map/values'; -const titles: Record = { +const titles: Record = { selectLead: 'Интерес', selectOpportunity: 'Лизинговая сделка', selectQuote: 'Предложение', diff --git a/apps/web/Components/Calculation/config/elements-types.ts b/apps/web/Components/Calculation/config/elements-types.ts index 0c2a80c..c2ec977 100644 --- a/apps/web/Components/Calculation/config/elements-types.ts +++ b/apps/web/Components/Calculation/config/elements-types.ts @@ -1,13 +1,15 @@ +/* eslint-disable jsdoc/multiline-blocks */ +/* eslint-disable canonical/sort-keys */ import { buildAction, buildOptions, buildReadonly, buildValue } from '../builders'; import type { Elements as ActionElements } from './map/actions'; import type { Elements as ValuesElements } from './map/values'; -type ElementTypes = 'Value' | 'Readonly' | 'Options' | 'Action'; -type Builders = typeof buildValue | typeof buildReadonly | typeof buildOptions | typeof buildAction; +type ElementTypes = 'Action' | 'Options' | 'Readonly' | 'Value'; +type Builders = typeof buildAction | typeof buildOptions | typeof buildReadonly | typeof buildValue; type GetType = () => { - typeName: ElementTypes; builder: Builders; + typeName: ElementTypes; }; function wrapTypeGetters>(arg: E) { @@ -33,7 +35,7 @@ const t = wrapTypeGetters({ }), }); -function wrapElementsTypes>(arg: E) { +function wrapElementsTypes>(arg: E) { return arg; } diff --git a/apps/web/Components/Calculation/config/map/values.ts b/apps/web/Components/Calculation/config/map/values.ts index 5abb8d3..c2d541e 100644 --- a/apps/web/Components/Calculation/config/map/values.ts +++ b/apps/web/Components/Calculation/config/map/values.ts @@ -1,4 +1,6 @@ -import type { CalculationValues, Values } from 'stores/calculation/values/types'; +/* eslint-disable jsdoc/multiline-blocks */ +/* eslint-disable canonical/sort-keys */ +import type { CalculationValues, Values } from '@/stores/calculation/values/types'; function wrapElementsMap>(arg: T) { return arg; diff --git a/apps/web/Components/Calculation/lib/render-rows.tsx b/apps/web/Components/Calculation/lib/render-rows.tsx index d7ee1dd..35d0476 100644 --- a/apps/web/Components/Calculation/lib/render-rows.tsx +++ b/apps/web/Components/Calculation/lib/render-rows.tsx @@ -1,15 +1,19 @@ /* eslint-disable react/no-array-index-key */ -import Divider from 'ui/elements/layout/Divider'; -import type { BoxProps } from 'ui/grid'; -import { Box } from 'ui/grid'; + import elementsRender from '../config/elements-render'; import type { Elements as ActionElements } from '../config/map/actions'; import type { Elements as ValuesElements } from '../config/map/values'; +import Divider from 'ui/elements/layout/Divider'; +import type { BoxProps } from 'ui/grid'; +import { Box } from 'ui/grid'; -export type ElementsRow = [elements: (ValuesElements | ActionElements)[], style?: BoxProps['sx']]; +export type ElementsRow = [ + elements: Array, + style?: BoxProps['sx'] +]; type DividerRow = { title: string }; -export type FormTabRows = Array; +export type FormTabRows = Array; function renderFormRows(rowsConfig: FormTabRows) { const rows = rowsConfig.map((row, i) => { @@ -18,7 +22,6 @@ function renderFormRows(rowsConfig: FormTabRows) { const renderedElements = elements.map((elementName) => { const render = elementsRender[elementName]?.render; - // eslint-disable-next-line object-curly-newline return render({}); }); @@ -27,8 +30,8 @@ function renderFormRows(rowsConfig: FormTabRows) { key={i.toString()} sx={{ display: 'grid', - gridTemplateColumns: ['1fr', '1fr', 'repeat(3, 1fr)'], gap: '10px', + gridTemplateColumns: ['1fr', '1fr', 'repeat(3, 1fr)'], ...style, }} > diff --git a/apps/web/Components/Common/Error.jsx b/apps/web/Components/Common/Error.jsx index 0f716ed..fc7d6cf 100644 --- a/apps/web/Components/Common/Error.jsx +++ b/apps/web/Components/Common/Error.jsx @@ -1,4 +1,3 @@ -/* eslint-disable import/prefer-default-export */ import Button from 'ui/elements/Button'; import Result from 'ui/elements/Result'; diff --git a/apps/web/Components/Layout/Auth.jsx b/apps/web/Components/Layout/Auth.jsx index 01c361e..e1c00b8 100644 --- a/apps/web/Components/Layout/Auth.jsx +++ b/apps/web/Components/Layout/Auth.jsx @@ -1,7 +1,7 @@ +import { getUser } from '@/api/user/query'; +import { min } from '@/styles/mq'; import { useQuery } from '@tanstack/react-query'; -import { getUser } from 'api/user/query'; import styled from 'styled-components'; -import { min } from 'styles/mq'; import { Flex } from 'ui'; const UserText = styled.span` diff --git a/apps/web/Components/Layout/Background.jsx b/apps/web/Components/Layout/Background.jsx index 9bb4a8d..5d68406 100644 --- a/apps/web/Components/Layout/Background.jsx +++ b/apps/web/Components/Layout/Background.jsx @@ -1,5 +1,5 @@ +import { min } from '@/styles/mq'; import styled from 'styled-components'; -import { min } from 'styles/mq'; import { Box } from 'ui/grid'; const Background = styled(Box)` diff --git a/apps/web/Components/Layout/Element.tsx b/apps/web/Components/Layout/Element.tsx index 82d5ff1..d62ad16 100644 --- a/apps/web/Components/Layout/Element.tsx +++ b/apps/web/Components/Layout/Element.tsx @@ -1,6 +1,7 @@ +/* eslint-disable func-style */ +import { min } from '@/styles/mq'; import type { ReactNode } from 'react'; import styled from 'styled-components'; -import { min } from 'styles/mq'; import { Flex } from 'ui'; const ElementTitle = styled.label` @@ -23,12 +24,12 @@ export function Head({ addon, htmlFor, }: { - title: ReactNode; addon?: ReactNode; htmlFor: string; + title: ReactNode; }) { return ( - + {title} {addon} diff --git a/apps/web/Components/Layout/Header.jsx b/apps/web/Components/Layout/Header.jsx index 2c87bf5..bf920f0 100644 --- a/apps/web/Components/Layout/Header.jsx +++ b/apps/web/Components/Layout/Header.jsx @@ -1,9 +1,8 @@ -/* eslint-disable import/no-unresolved */ -import styled from 'styled-components'; -import { min } from 'styles/mq'; -import { Flex } from 'ui'; import Auth from './Auth'; import Logo from './Logo'; +import { min } from '@/styles/mq'; +import styled from 'styled-components'; +import { Flex } from 'ui'; const HeaderContent = styled(Flex)` flex-direction: row; @@ -16,7 +15,6 @@ const HeaderContent = styled(Flex)` var(--color-tertiarty) 100% ); - ${'' /* height: 70px; */} padding: 10px 12px; ${min('laptop')} { padding: 10px 12px; diff --git a/apps/web/Components/Layout/Logo.jsx b/apps/web/Components/Layout/Logo.jsx index 9d54468..509569f 100644 --- a/apps/web/Components/Layout/Logo.jsx +++ b/apps/web/Components/Layout/Logo.jsx @@ -1,9 +1,10 @@ +/* eslint-disable react/forbid-component-props */ +import styles from './Logo.module.css'; +import { min } from '@/styles/mq'; import Image from 'next/image'; import logo from 'public/assets/images/logo-primary.svg'; import styled from 'styled-components'; -import { min } from 'styles/mq'; import { Flex } from 'ui'; -import styles from './Logo.module.css'; const ImageWrapper = styled.div` width: 100px; diff --git a/apps/web/Components/Layout/index.jsx b/apps/web/Components/Layout/index.jsx index 8cfa2df..54abe53 100644 --- a/apps/web/Components/Layout/index.jsx +++ b/apps/web/Components/Layout/index.jsx @@ -1,7 +1,5 @@ -/* eslint-disable react/prop-types */ -/* eslint-disable import/no-unresolved */ -import { Flex } from 'ui'; import Header from './Header'; +import { Flex } from 'ui'; export default function Layout({ children }) { return ( diff --git a/apps/web/Components/Output/PaymentsTable/config.ts b/apps/web/Components/Output/PaymentsTable/config.ts index 8717f3d..f542472 100644 --- a/apps/web/Components/Output/PaymentsTable/config.ts +++ b/apps/web/Components/Output/PaymentsTable/config.ts @@ -1,7 +1,6 @@ -/* eslint-disable import/prefer-default-export */ - -import type { ColumnsType } from 'antd/lib/table'; +/* eslint-disable canonical/sort-keys */ import type { Payment } from './types'; +import type { ColumnsType } from 'antd/lib/table'; export const columns: ColumnsType = [ { diff --git a/apps/web/Components/Output/PaymentsTable/index.jsx b/apps/web/Components/Output/PaymentsTable/index.jsx index 6ae8f20..2728fd9 100644 --- a/apps/web/Components/Output/PaymentsTable/index.jsx +++ b/apps/web/Components/Output/PaymentsTable/index.jsx @@ -1,9 +1,9 @@ -import { MAX_LEASING_PERIOD } from 'constants/values'; +import { columns } from './config'; +import { MAX_LEASING_PERIOD } from '@/constants/values'; +import { useStore } from '@/stores/hooks'; import { toJS } from 'mobx'; import { observer } from 'mobx-react-lite'; -import { useStore } from 'stores/hooks'; import Table from 'ui/elements/Table'; -import { columns } from './config'; const PaymentsTable = observer(() => { const { $results } = useStore(); @@ -26,7 +26,7 @@ const PaymentsTable = observer(() => { }); export default { + Component: PaymentsTable, id: 'payments-table', title: 'Таблица платежей', - Component: PaymentsTable, }; diff --git a/apps/web/Components/Output/PaymentsTable/types.ts b/apps/web/Components/Output/PaymentsTable/types.ts index 3c3d011..020fb14 100644 --- a/apps/web/Components/Output/PaymentsTable/types.ts +++ b/apps/web/Components/Output/PaymentsTable/types.ts @@ -1,7 +1,7 @@ export type Payment = { key: string; + ndsCompensation: string; num: number; paymentSum: string; - ndsCompensation: string; redemptionAmount: string; }; diff --git a/apps/web/Components/Output/Results/config.ts b/apps/web/Components/Output/Results/config.ts index 36e170a..2210859 100644 --- a/apps/web/Components/Output/Results/config.ts +++ b/apps/web/Components/Output/Results/config.ts @@ -1,29 +1,27 @@ -/* eslint-disable object-curly-newline */ - -import type { Values } from 'stores/results/types'; +import type { Values } from '@/stores/results/types'; export const id = 'output'; export const title = 'Результаты'; export const titles: Record = { - resultTotalGraphwithNDS: 'Итого по графику, с НДС', - resultPlPrice: 'Стоимость ПЛ с НДС', - resultPriceUpPr: 'Удорожание, год', + resultAB_FL: 'АВ ФЛ, без НДФЛ.', + resultAB_UL: 'АВ ЮЛ, с НДС.', + resultBonusDopProd: 'Бонус МПЛ за доп.продукты, без НДФЛ', + resultBonusMPL: 'Бонус МПЛ за лизинг, без НДФЛ', + resultBonusSafeFinance: 'Бонус за Safe Finance без НДФЛ', + resultDopMPLLeasing: 'Доп.бонус МПЛ за лизинг, без НДФЛ', + resultDopProdSum: 'Общая сумма доп.продуктов', + resultFirstPayment: 'Первый платеж', + resultFirstPaymentRiskPolicy: 'Первый платеж по риск политике, %', resultIRRGraphPerc: 'IRR по графику клиента, %', resultIRRNominalPerc: 'IRR (номинал), %', resultInsKasko: 'КАСКО, НС, ДГО в графике', resultInsOsago: 'ОСАГО в графике', - resultDopProdSum: 'Общая сумма доп.продуктов', - resultFirstPayment: 'Первый платеж', resultLastPayment: 'Последний платеж', + resultPlPrice: 'Стоимость ПЛ с НДС', + resultPriceUpPr: 'Удорожание, год', resultTerm: 'Срок, мес.', - resultAB_FL: 'АВ ФЛ, без НДФЛ.', - resultAB_UL: 'АВ ЮЛ, с НДС.', - resultBonusMPL: 'Бонус МПЛ за лизинг, без НДФЛ', - resultDopMPLLeasing: 'Доп.бонус МПЛ за лизинг, без НДФЛ', - resultBonusDopProd: 'Бонус МПЛ за доп.продукты, без НДФЛ', - resultBonusSafeFinance: 'Бонус за Safe Finance без НДФЛ', - resultFirstPaymentRiskPolicy: 'Первый платеж по риск политике, %', + resultTotalGraphwithNDS: 'Итого по графику, с НДС', }; const moneyFormatters = Object.fromEntries( @@ -47,10 +45,9 @@ const moneyFormatters = Object.fromEntries( ] as Values[] ).map((a) => [ a, - // prettier-ignore Intl.NumberFormat('ru', { - style: 'currency', currency: 'RUB', + style: 'currency', }).format, ]) ); @@ -59,11 +56,10 @@ const percentFormatters = Object.fromEntries( (['resultIRRGraphPerc', 'resultIRRNominalPerc', 'resultFirstPaymentRiskPolicy'] as Values[]).map( (a) => [ a, - // prettier-ignore Intl.NumberFormat('ru', { - style: 'percent', - minimumFractionDigits: 2, maximumFractionDigits: 2, + minimumFractionDigits: 2, + style: 'percent', }).format, ] ) diff --git a/apps/web/Components/Output/Results/index.jsx b/apps/web/Components/Output/Results/index.jsx index fbeb2ca..a577f30 100644 --- a/apps/web/Components/Output/Results/index.jsx +++ b/apps/web/Components/Output/Results/index.jsx @@ -1,12 +1,12 @@ -import { Container, Head } from 'Components/Layout/Element'; +import { formatters, id, title, titles } from './config'; +import { Container, Head } from '@/Components/Layout/Element'; +import { useStore } from '@/stores/hooks'; +import { min } from '@/styles/mq'; import { toJS } from 'mobx'; import { observer } from 'mobx-react-lite'; -import { useStore } from 'stores/hooks'; import styled from 'styled-components'; -import { min } from 'styles/mq'; import Text from 'ui/elements/Text'; import { Box } from 'ui/grid'; -import { formatters, id, title, titles } from './config'; const Grid = styled(Box)` display: grid; @@ -40,7 +40,7 @@ const Results = observer(() => { }); export default { + Component: Results, id, title, - Component: Results, }; diff --git a/apps/web/Components/Output/Validation.jsx b/apps/web/Components/Output/Validation.jsx index 1746d51..6435e2b 100644 --- a/apps/web/Components/Output/Validation.jsx +++ b/apps/web/Components/Output/Validation.jsx @@ -1,5 +1,6 @@ +/* eslint-disable react/jsx-key */ +import { useStore } from '@/stores/hooks'; import { observer } from 'mobx-react-lite'; -import { useStore } from 'stores/hooks'; import styled from 'styled-components'; import Alert from 'ui/elements/Alert'; import { Box, Flex } from 'ui/grid'; @@ -23,18 +24,16 @@ const AlertWrapper = styled(Box)` `; function getElementsErrors($calculation) { - const errors = Object.values($calculation.$validation).map((validation) => { + return Object.values($calculation.$validation).map((validation) => { const elementErrors = validation.getMessages(); const elementTitle = validation.params.err_title; return elementErrors.map((error) => ( - + )); }); - - return errors; } function getPaymentsTableErrors($tables) { @@ -50,9 +49,7 @@ function getInsuranceTableErrors($tables) { const messages = insurance.validation.getMessages(); const title = insurance.validation.params.err_title; - return messages.map((message) => ( - - )); + return messages.map((text) => ); } const Errors = observer(() => { @@ -86,7 +83,7 @@ function Validation() { } export default { + Component: Validation, id: 'validation', title: 'Ошибки', - Component: Validation, }; diff --git a/apps/web/Components/Output/index.jsx b/apps/web/Components/Output/index.jsx index 59cff0e..c15e8fd 100644 --- a/apps/web/Components/Output/index.jsx +++ b/apps/web/Components/Output/index.jsx @@ -1,10 +1,10 @@ -import Background from 'Components/Layout/Background'; -import styled from 'styled-components'; -import { min } from 'styles/mq'; -import Tabs from 'ui/elements/layout/Tabs'; import PaymentsTable from './PaymentsTable'; import Results from './Results'; import Validation from './Validation'; +import Background from '@/Components/Layout/Background'; +import { min } from '@/styles/mq'; +import styled from 'styled-components'; +import Tabs from 'ui/elements/layout/Tabs'; const outputTabs = [PaymentsTable, Results, Validation]; diff --git a/apps/web/api/core/query.ts b/apps/web/api/core/query.ts index 5c39f17..b0c3d46 100644 --- a/apps/web/api/core/query.ts +++ b/apps/web/api/core/query.ts @@ -1,8 +1,7 @@ -/* eslint-disable import/prefer-default-export */ +import type { RequestFinGAP, ResponseFinGAP } from './types'; +import getUrls from '@/config/urls'; import type { QueryFunctionContext } from '@tanstack/react-query'; import axios from 'axios'; -import getUrls from 'config/urls'; -import type { RequestFinGAP, ResponseFinGAP } from './types'; const { URL_CORE_FINGAP } = getUrls(); diff --git a/apps/web/api/core/types.ts b/apps/web/api/core/types.ts index 2a66d8d..e08c875 100644 --- a/apps/web/api/core/types.ts +++ b/apps/web/api/core/types.ts @@ -5,17 +5,17 @@ export type PaymentRow = { export type RequestFinGAP = { calcType: number; - payments: Array; + payments: PaymentRow[]; values: { - plPrice: number; discount: number; firstPayment: number; leasingPeriod: number; + plPrice: number; premiumPerc: number; }; }; export type ResponseFinGAP = { - sum: number; premium: number; + sum: number; }; diff --git a/apps/web/api/user/query.ts b/apps/web/api/user/query.ts index 40d89af..e19a7e3 100644 --- a/apps/web/api/user/query.ts +++ b/apps/web/api/user/query.ts @@ -1,14 +1,11 @@ -/* eslint-disable import/prefer-default-export */ -import type { AxiosRequestConfig } from 'axios'; -import axios from 'axios'; -import getUrls from 'config/urls'; import { love } from './tools'; import type { User } from './types'; +import getUrls from '@/config/urls'; +import type { AxiosRequestConfig } from 'axios'; +import axios from 'axios'; const { URL_GET_USER } = getUrls(); export async function getUser(config: AxiosRequestConfig) { - const user = await axios.get(URL_GET_USER, config).then((res) => love(res.data)); - - return user; + return await axios.get(URL_GET_USER, config).then((res) => love(res.data)); } diff --git a/apps/web/api/user/tools.ts b/apps/web/api/user/tools.ts index 90c4f95..3539d54 100644 --- a/apps/web/api/user/tools.ts +++ b/apps/web/api/user/tools.ts @@ -1,14 +1,12 @@ -/* eslint-disable import/prefer-default-export */ -import { publicRuntimeConfigSchema } from 'config/schema/runtime-config'; -import getConfig from 'next/config'; import type { User } from './types'; +import { publicRuntimeConfigSchema } from '@/config/schema/runtime-config'; +import getConfig from 'next/config'; const { publicRuntimeConfig } = getConfig(); const { USERS_SUPER } = publicRuntimeConfigSchema.parse(publicRuntimeConfig); export function love(user: User) { const superUsers: string[] = JSON.parse(USERS_SUPER); - // eslint-disable-next-line no-param-reassign if (superUsers?.includes(user.username)) user.displayName += '🧡'; return user; diff --git a/apps/web/api/user/types.ts b/apps/web/api/user/types.ts index d6f1b84..8fb227d 100644 --- a/apps/web/api/user/types.ts +++ b/apps/web/api/user/types.ts @@ -1,9 +1,9 @@ export type User = { - displayName: string; - username: string; department: string; - position: string; - mail: string; + displayName: string; domain: string; domainName: string; + mail: string; + position: string; + username: string; }; diff --git a/apps/web/apollo.config.js b/apps/web/apollo.config.js index 7984bf1..61ee608 100644 --- a/apps/web/apollo.config.js +++ b/apps/web/apollo.config.js @@ -5,12 +5,12 @@ module.exports = { name: 'crmgraphql', localSchemaFile: `${__dirname}/graphql/crm.schema.graphql`, }, - excludes: ['**/graphql/**/*.schema.graphql', '**/graphql/**/*.types.graphql'], includes: [ '**/pages/**/*', '**/process/**/*', '**/Components/**/*', '**/graphql/**/*.query.graphql', ], + excludes: ['**/graphql/**/*.schema.graphql', '**/graphql/**/*.types.graphql'], }, }; diff --git a/apps/web/apollo/client.js b/apps/web/apollo/client.js index ef8319b..012742d 100644 --- a/apps/web/apollo/client.js +++ b/apps/web/apollo/client.js @@ -1,19 +1,17 @@ -/* eslint-disable no-underscore-dangle */ -/* eslint-disable @typescript-eslint/naming-convention */ +import getUrls from '@/config/urls'; import { ApolloClient, InMemoryCache } from '@apollo/client'; -import getUrls from 'config/urls'; import { isServer } from 'tools/common'; -/** @type {import('@apollo/client').ApolloClient} */ +/** @type {import('@apollo/client').ApolloClient} */ let apolloClient; const { URL_CRM_GRAPHQL } = getUrls(); function createApolloClient() { return new ApolloClient({ + cache: new InMemoryCache(), ssrMode: isServer(), uri: URL_CRM_GRAPHQL, - cache: new InMemoryCache(), }); } diff --git a/apps/web/config/default-options.ts b/apps/web/config/default-options.ts index f5da015..417a93b 100644 --- a/apps/web/config/default-options.ts +++ b/apps/web/config/default-options.ts @@ -1,5 +1,6 @@ +/* eslint-disable canonical/sort-keys */ +import type { CalculationOptions } from '@/stores/calculation/options/types'; import { alphabetical } from 'radash'; -import type { CalculationOptions } from 'stores/calculation/options/types'; export const selectSeasonType = [ { diff --git a/apps/web/config/default-statuses.ts b/apps/web/config/default-statuses.ts index 3cc300a..dfa5acd 100644 --- a/apps/web/config/default-statuses.ts +++ b/apps/web/config/default-statuses.ts @@ -1,141 +1,141 @@ -import type { CalculationStatuses } from 'stores/calculation/statuses/types'; +import type { CalculationStatuses } from '@/stores/calculation/statuses/types'; const defaultStatuses: CalculationStatuses = { - selectIndAgent: 'Default', - selectCalcBroker: 'Default', - selectCalcFinDepartment: 'Default', - selectCalcDoubleAgent: 'Default', - selectClientType: 'Disabled', - tbxImporterRewardRub: 'Disabled', - tbxImporterRewardPerc: 'Disabled', - tbxMaxPriceChange: 'Disabled', - tbxCreditRate: 'Disabled', - selectRate: 'Disabled', - selectTarif: 'Disabled', - tbxVehicleTaxInLeasingPeriod: 'Disabled', - selectObjectTypeTax: 'Disabled', - selectLeaseObjectCategory: 'Disabled', - tbxINNForCalc: 'Disabled', - radioInfuranceOPF: 'Disabled', - tbxRedemptionPaymentSum: 'Disabled', - tbxLeaseObjectPriceWthtVAT: 'Disabled', - selectLead: 'Default', - selectOpportunity: 'Default', - selectQuote: 'Default', - cbxRecalcWithRevision: 'Default', - selectProduct: 'Default', - selectClientRisk: 'Default', - tbxLeaseObjectPrice: 'Default', - tbxVATInLeaseObjectPrice: 'Default', - tbxEngineHours: 'Default', - selectSupplierCurrency: 'Default', - tbxSupplierDiscountRub: 'Default', - tbxSupplierDiscountPerc: 'Default', - tbxLeasingPeriod: 'Default', - tbxFirstPaymentPerc: 'Default', - tbxFirstPaymentRub: 'Default', - tbxLastPaymentPerc: 'Default', - tbxLastPaymentRub: 'Default', - radioLastPaymentRule: 'Default', - radioBalanceHolder: 'Default', - radioGraphType: 'Default', - tbxParmentsDecreasePercent: 'Default', - selectSeasonType: 'Default', - selectHighSeasonStart: 'Default', - tbxComissionPerc: 'Default', - tbxComissionRub: 'Default', - tbxSaleBonus: 'Default', - tbxIRR_Perc: 'Default', - selectLeaseObjectType: 'Default', - radioDeliveryTime: 'Default', - labelDepreciationGroup: 'Default', - tbxLeaseObjectCount: 'Default', - cbxWithTrailer: 'Default', - cbxLeaseObjectUsed: 'Default', - tbxMaxMass: 'Default', - tbxCountSeats: 'Default', - tbxMaxSpeed: 'Default', - selectBrand: 'Default', - selectModel: 'Default', - selectConfiguration: 'Default', - tbxLeaseObjectYear: 'Default', - selectEngineType: 'Default', - tbxLeaseObjectMotorPower: 'Default', - tbxEngineVolume: 'Default', - selectLeaseObjectUseFor: 'Default', - selectDealer: 'Default', - selectDealerPerson: 'Default', - selectDealerRewardCondition: 'Default', - tbxDealerRewardSumm: 'Disabled', - selectDealerBroker: 'Default', - selectDealerBrokerRewardCondition: 'Default', - tbxDealerBrokerRewardSumm: 'Disabled', - selectIndAgentRewardCondition: 'Default', - tbxIndAgentRewardSumm: 'Disabled', - selectCalcDoubleAgentRewardCondition: 'Default', - tbxCalcDoubleAgentRewardSumm: 'Disabled', - selectCalcBrokerRewardCondition: 'Default', - tbxCalcBrokerRewardSum: 'Disabled', - selectFinDepartmentRewardCondtion: 'Default', - tbxFinDepartmentRewardSumm: 'Disabled', - selectGPSBrand: 'Default', - selectGPSModel: 'Default', - selectRegionRegistration: 'Default', - selectTownRegistration: 'Default', - radioInsKaskoType: 'Default', - cbxInsDecentral: 'Default', - tbxInsFranchise: 'Default', - cbxInsUnlimitDrivers: 'Default', - tbxInsAgeDrivers: 'Default', - tbxInsExpDrivers: 'Default', - cbxLastPaymentRedemption: 'Default', - cbxPriceWithDiscount: 'Default', - cbxFullPriceWithDiscount: 'Default', + btnCalculate: 'Default', + btnCreateKP: 'Default', cbxCostIncrease: 'Default', - cbxInsurance: 'Default', - cbxRegistrationQuote: 'Default', - cbxTechnicalCardQuote: 'Default', - cbxNSIB: 'Default', - tbxQuoteName: 'Default', - radioQuoteContactGender: 'Default', - cbxQuoteRedemptionGraph: 'Default', - cbxShowFinGAP: 'Default', cbxDisableChecks: 'Default', - selectRegistration: 'Default', - selectInsNSIB: 'Default', - selectTechnicalCard: 'Default', - selectRequirementTelematic: 'Default', - selectTelematic: 'Default', - selectTracker: 'Default', - tbxMileage: 'Default', - radioCalcType: 'Default', - tbxTotalPayments: 'Default', - radioObjectRegistration: 'Default', - selectObjectRegionRegistration: 'Default', - tbxVehicleTaxInYear: 'Default', - selectObjectCategoryTax: 'Default', - radioTypePTS: 'Default', - selectLegalClientRegion: 'Default', - selectLegalClientTown: 'Default', - selectSubsidy: 'Default', - tbxSubsidySum: 'Default', - selectFuelCard: 'Default', - tbxMinPriceChange: 'Default', - linkDownloadKp: 'Default', - selectImportProgram: 'Default', - tbxImportProgramSum: 'Default', - tbxAddEquipmentPrice: 'Default', - labelLeaseObjectRisk: 'Default', - tbxInsKaskoPriceLeasePeriod: 'Default', + cbxFullPriceWithDiscount: 'Default', + cbxInsDecentral: 'Default', + cbxInsUnlimitDrivers: 'Default', + cbxInsurance: 'Default', + cbxLastPaymentRedemption: 'Default', + cbxLeaseObjectUsed: 'Default', + cbxNSIB: 'Default', + cbxPriceWithDiscount: 'Default', + cbxQuoteRedemptionGraph: 'Default', + cbxRecalcWithRevision: 'Default', + cbxRegistrationQuote: 'Default', + cbxShowFinGAP: 'Default', + cbxTechnicalCardQuote: 'Default', + cbxWithTrailer: 'Default', + labelDepreciationGroup: 'Default', labelIrrInfo: 'Default', + labelLeaseObjectRisk: 'Default', labelRegistrationDescription: 'Default', + linkDownloadKp: 'Default', linkLeadUrl: 'Default', linkOpportunityUrl: 'Default', linkQuoteUrl: 'Default', - tbxBonusCoefficient: 'Default', - btnCalculate: 'Default', - btnCreateKP: 'Default', + radioBalanceHolder: 'Default', + radioCalcType: 'Default', + radioDeliveryTime: 'Default', + radioGraphType: 'Default', + radioInfuranceOPF: 'Disabled', + radioInsKaskoType: 'Default', + radioLastPaymentRule: 'Default', + radioObjectRegistration: 'Default', + radioQuoteContactGender: 'Default', + radioTypePTS: 'Default', + selectBrand: 'Default', + selectCalcBroker: 'Default', + selectCalcBrokerRewardCondition: 'Default', + selectCalcDoubleAgent: 'Default', + selectCalcDoubleAgentRewardCondition: 'Default', + selectCalcFinDepartment: 'Default', + selectClientRisk: 'Default', + selectClientType: 'Disabled', + selectConfiguration: 'Default', + selectDealer: 'Default', + selectDealerBroker: 'Default', + selectDealerBrokerRewardCondition: 'Default', + selectDealerPerson: 'Default', + selectDealerRewardCondition: 'Default', + selectEngineType: 'Default', + selectFinDepartmentRewardCondtion: 'Default', + selectFuelCard: 'Default', + selectGPSBrand: 'Default', + selectGPSModel: 'Default', + selectHighSeasonStart: 'Default', + selectImportProgram: 'Default', + selectIndAgent: 'Default', + selectIndAgentRewardCondition: 'Default', + selectInsNSIB: 'Default', + selectLead: 'Default', + selectLeaseObjectCategory: 'Disabled', + selectLeaseObjectType: 'Default', + selectLeaseObjectUseFor: 'Default', selectLeasingWithoutKasko: 'Default', + selectLegalClientRegion: 'Default', + selectLegalClientTown: 'Default', + selectModel: 'Default', + selectObjectCategoryTax: 'Default', + selectObjectRegionRegistration: 'Default', + selectObjectTypeTax: 'Disabled', + selectOpportunity: 'Default', + selectProduct: 'Default', + selectQuote: 'Default', + selectRate: 'Disabled', + selectRegionRegistration: 'Default', + selectRegistration: 'Default', + selectRequirementTelematic: 'Default', + selectSeasonType: 'Default', + selectSubsidy: 'Default', + selectSupplierCurrency: 'Default', + selectTarif: 'Disabled', + selectTechnicalCard: 'Default', + selectTelematic: 'Default', + selectTownRegistration: 'Default', + selectTracker: 'Default', + tbxAddEquipmentPrice: 'Default', + tbxBonusCoefficient: 'Default', + tbxCalcBrokerRewardSum: 'Disabled', + tbxCalcDoubleAgentRewardSumm: 'Disabled', + tbxComissionPerc: 'Default', + tbxComissionRub: 'Default', + tbxCountSeats: 'Default', + tbxCreditRate: 'Disabled', + tbxDealerBrokerRewardSumm: 'Disabled', + tbxDealerRewardSumm: 'Disabled', + tbxEngineHours: 'Default', + tbxEngineVolume: 'Default', + tbxFinDepartmentRewardSumm: 'Disabled', + tbxFirstPaymentPerc: 'Default', + tbxFirstPaymentRub: 'Default', + tbxINNForCalc: 'Disabled', + tbxIRR_Perc: 'Default', + tbxImportProgramSum: 'Default', + tbxImporterRewardPerc: 'Disabled', + tbxImporterRewardRub: 'Disabled', + tbxIndAgentRewardSumm: 'Disabled', + tbxInsAgeDrivers: 'Default', + tbxInsExpDrivers: 'Default', + tbxInsFranchise: 'Default', + tbxInsKaskoPriceLeasePeriod: 'Default', + tbxLastPaymentPerc: 'Default', + tbxLastPaymentRub: 'Default', + tbxLeaseObjectCount: 'Default', + tbxLeaseObjectMotorPower: 'Default', + tbxLeaseObjectPrice: 'Default', + tbxLeaseObjectPriceWthtVAT: 'Disabled', + tbxLeaseObjectYear: 'Default', + tbxLeasingPeriod: 'Default', + tbxMaxMass: 'Default', + tbxMaxPriceChange: 'Disabled', + tbxMaxSpeed: 'Default', + tbxMileage: 'Default', + tbxMinPriceChange: 'Default', + tbxParmentsDecreasePercent: 'Default', + tbxQuoteName: 'Default', + tbxRedemptionPaymentSum: 'Disabled', + tbxSaleBonus: 'Default', + tbxSubsidySum: 'Default', + tbxSupplierDiscountPerc: 'Default', + tbxSupplierDiscountRub: 'Default', + tbxTotalPayments: 'Default', + tbxVATInLeaseObjectPrice: 'Default', + tbxVehicleTaxInLeasingPeriod: 'Disabled', + tbxVehicleTaxInYear: 'Default', }; export default defaultStatuses; diff --git a/apps/web/config/default-values.ts b/apps/web/config/default-values.ts index 587ffe5..d29e818 100644 --- a/apps/web/config/default-values.ts +++ b/apps/web/config/default-values.ts @@ -1,143 +1,144 @@ -import { RATE } from 'constants/values'; +/* eslint-disable canonical/sort-keys */ +import { RATE } from '@/constants/values'; +import type { CalculationValues } from '@/stores/calculation/values/types'; import dayjs from 'dayjs'; -import type { CalculationValues } from 'stores/calculation/values/types'; const defaultValues: CalculationValues = { - lead: null, - opportunity: null, - quote: null, - recalcWithRevision: false, - leaseObjectPrice: 1_000_000, - VATInLeaseObjectPrice: 0, - leaseObjectPriceWthtVAT: 0, - engineHours: 0, - supplierCurrency: null, - supplierDiscountRub: 0, - supplierDiscountPerc: 0, - leasingPeriod: 13, - firstPaymentPerc: 25, - firstPaymentRub: 0, - lastPaymentPerc: 1, - lastPaymentRule: 100_000_001, - redemptionPaymentSum: 1000, + addEquipmentPrice: 0, balanceHolder: 100_000_001, - graphType: 100_000_000, - parmentsDecreasePercent: 94, - seasonType: null, - highSeasonStart: null, - comissionPerc: 0, - comissionRub: 0, - saleBonus: 1.3, - IRR_Perc: 20, + bonusCoefficient: 1, brand: null, - model: null, - configuration: null, - deliveryTime: 100_000_000, - leaseObjectCount: 1, - withTrailer: false, - leaseObjectUsed: false, - maxMass: 0, - countSeats: 0, - maxSpeed: 0, - leaseObjectYear: dayjs().year(), - engineType: 100_000_000, - leaseObjectCategory: null, - leaseObjectMotorPower: 0, - engineVolume: 0, - dealerRewardSumm: 0, - dealerBrokerRewardSumm: 0, - indAgent: null, - calcDoubleAgent: null, calcBroker: null, - calcFinDepartment: null, - dealerPerson: null, - dealerBroker: null, - dealer: null, - indAgentRewardSumm: 0, - calcDoubleAgentRewardSumm: 0, + calcBrokerRewardCondition: null, calcBrokerRewardSum: 0, - finDepartmentRewardSumm: 0, - insKaskoType: 100_000_000, - insDecentral: false, - insUnlimitDrivers: true, - insAgeDrivers: 0, - insExpDrivers: 0, - lastPaymentRedemption: true, - priceWithDiscount: false, - fullPriceWithDiscount: false, - costIncrease: true, - insurance: true, - registrationQuote: true, - technicalCardQuote: true, - NSIB: true, - quoteContactGender: 100_000_000, - quoteRedemptionGraph: true, - showFinGAP: true, - creditRate: RATE, - requirementTelematic: 100_000_000, - maxPriceChange: 0, - importerRewardPerc: 0, - importerRewardRub: 0, - disableChecks: false, - insFranchise: 0, - rate: null, + calcDoubleAgent: null, + calcDoubleAgentRewardCondition: null, + calcDoubleAgentRewardSumm: 0, + calcFinDepartment: null, calcType: 100_000_000, - totalPayments: 0, - vehicleTaxInYear: 0, - vehicleTaxInLeasingPeriod: 0, - objectRegistration: 100_000_000, - typePTS: 100_000_001, - insNSIB: null, - regionRegistration: null, - legalClientRegion: null, - legalClientTown: null, - infuranceOPF: null, - product: null, clientRisk: null, clientType: null, - lastPaymentRub: 0, - leaseObjectType: null, - leaseObjectUseFor: null, - dealerRewardCondition: null, + comissionPerc: 0, + comissionRub: 0, + configuration: null, + costIncrease: true, + countSeats: 0, + creditRate: RATE, + dealer: null, + dealerBroker: null, dealerBrokerRewardCondition: null, - indAgentRewardCondition: null, - calcDoubleAgentRewardCondition: null, - calcBrokerRewardCondition: null, + dealerBrokerRewardSumm: 0, + dealerPerson: null, + dealerRewardCondition: null, + dealerRewardSumm: 0, + deliveryTime: 100_000_000, + depreciationGroup: '-', + disableChecks: false, + discountRub: 0, + engineHours: 0, + engineType: 100_000_000, + engineVolume: 0, finDepartmentRewardCondtion: null, + finDepartmentRewardSumm: 0, + firstPaymentPerc: 25, + firstPaymentRub: 0, + fuelCard: null, + fullPriceWithDiscount: false, GPSBrand: null, GPSModel: null, - townRegistration: null, - INNForCalc: 0, - quoteName: null, - tarif: null, - minPriceChange: 0, - registration: null, - technicalCard: null, - telematic: null, - tracker: null, - mileage: 0, - objectRegionRegistration: null, - objectCategoryTax: null, - objectTypeTax: null, - subsidy: null, - fuelCard: null, - kpUrl: null, - leadUrl: null, - opportunityUrl: null, - quoteUrl: null, - subsidySum: 0, - leaseObjectRiskName: '-', - insKaskoPriceLeasePeriod: 0, - irrInfo: '-', - registrationDescription: '-', - depreciationGroup: '-', + graphType: 100_000_000, + highSeasonStart: null, + importerRewardPerc: 0, + importerRewardRub: 0, importProgram: null, importProgramSum: 0, - addEquipmentPrice: 0, - bonusCoefficient: 1, - plPriceRub: 0, - discountRub: 0, + indAgent: null, + indAgentRewardCondition: null, + indAgentRewardSumm: 0, + infuranceOPF: null, + INNForCalc: 0, + insAgeDrivers: 0, + insDecentral: false, + insExpDrivers: 0, + insFranchise: 0, + insKaskoPriceLeasePeriod: 0, + insKaskoType: 100_000_000, + insNSIB: null, + insUnlimitDrivers: true, + insurance: true, + IRR_Perc: 20, + irrInfo: '-', + kpUrl: null, + lastPaymentPerc: 1, + lastPaymentRedemption: true, + lastPaymentRub: 0, + lastPaymentRule: 100_000_001, + lead: null, + leadUrl: null, + leaseObjectCategory: null, + leaseObjectCount: 1, + leaseObjectMotorPower: 0, + leaseObjectPrice: 1_000_000, + leaseObjectPriceWthtVAT: 0, + leaseObjectRiskName: '-', + leaseObjectType: null, + leaseObjectUsed: false, + leaseObjectUseFor: null, + leaseObjectYear: dayjs().year(), + leasingPeriod: 13, leasingWithoutKasko: null, + legalClientRegion: null, + legalClientTown: null, + maxMass: 0, + maxPriceChange: 0, + maxSpeed: 0, + mileage: 0, + minPriceChange: 0, + model: null, + NSIB: true, + objectCategoryTax: null, + objectRegionRegistration: null, + objectRegistration: 100_000_000, + objectTypeTax: null, + opportunity: null, + opportunityUrl: null, + parmentsDecreasePercent: 94, + plPriceRub: 0, + priceWithDiscount: false, + product: null, + quote: null, + quoteContactGender: 100_000_000, + quoteName: null, + quoteRedemptionGraph: true, + quoteUrl: null, + rate: null, + recalcWithRevision: false, + redemptionPaymentSum: 1_000, + regionRegistration: null, + registration: null, + registrationDescription: '-', + registrationQuote: true, + requirementTelematic: 100_000_000, + saleBonus: 1.3, + seasonType: null, + showFinGAP: true, + subsidy: null, + subsidySum: 0, + supplierCurrency: null, + supplierDiscountPerc: 0, + supplierDiscountRub: 0, + tarif: null, + technicalCard: null, + technicalCardQuote: true, + telematic: null, + totalPayments: 0, + townRegistration: null, + tracker: null, + typePTS: 100_000_001, + VATInLeaseObjectPrice: 0, + vehicleTaxInLeasingPeriod: 0, + vehicleTaxInYear: 0, + withTrailer: false, }; export default defaultValues; diff --git a/apps/web/config/meta.jsx b/apps/web/config/meta.jsx index bb5f64f..4c65d64 100644 --- a/apps/web/config/meta.jsx +++ b/apps/web/config/meta.jsx @@ -1,5 +1,4 @@ -/* eslint-disable import/prefer-default-export */ -import getUrls from 'config/urls'; +import getUrls from '@/config/urls'; const { BASE_PATH } = getUrls(); diff --git a/apps/web/config/schema/env.js b/apps/web/config/schema/env.js index 90a51ce..090d8f5 100644 --- a/apps/web/config/schema/env.js +++ b/apps/web/config/schema/env.js @@ -1,17 +1,13 @@ -/* eslint-disable @typescript-eslint/no-var-requires */ const { z } = require('zod'); const envSchema = z.object({ - USE_DEV_COLORS: z - .unknown() - .optional() - .transform((val) => !!val), - PORT: z.string().optional(), BASE_PATH: z.string().optional().default(''), - USERS_SUPER: z.string().optional().default(''), + PORT: z.string().optional(), + URL_CORE_FINGAP_DIRECT: z.string(), URL_CRM_GRAPHQL_DIRECT: z.string(), URL_GET_USER_DIRECT: z.string(), - URL_CORE_FINGAP_DIRECT: z.string(), + USE_DEV_COLORS: z.unknown().optional().transform(Boolean), + USERS_SUPER: z.string().optional().default(''), }); module.exports = envSchema; diff --git a/apps/web/config/schema/fingap.ts b/apps/web/config/schema/fingap.ts index 186a617..129130a 100644 --- a/apps/web/config/schema/fingap.ts +++ b/apps/web/config/schema/fingap.ts @@ -1,13 +1,14 @@ -/* eslint-disable import/prefer-default-export */ import { z } from 'zod'; -export const RiskSchema = z.object({ - key: z.string(), - riskId: z.string(), - riskName: z.string(), - calcType: z.number(), - premiumPerc: z.number(), - sum: z.number(), - premium: z.number(), - keys: z.array(z.string()).optional(), -}); +export const RiskSchema = z + .object({ + calcType: z.number(), + key: z.string(), + keys: z.array(z.string()).optional(), + premium: z.number(), + premiumPerc: z.number(), + riskId: z.string(), + riskName: z.string(), + sum: z.number(), + }) + .strict(); diff --git a/apps/web/config/schema/insurance.ts b/apps/web/config/schema/insurance.ts index 5d7a55b..6aeda66 100644 --- a/apps/web/config/schema/insurance.ts +++ b/apps/web/config/schema/insurance.ts @@ -1,12 +1,14 @@ import { z } from 'zod'; -export const KeysSchema = z.union([z.literal('osago'), z.literal('kasko'), z.literal('fingap')]); +export const KeysSchema = z.enum(['osago', 'kasko', 'fingap']); -export const RowSchema = z.object({ - key: KeysSchema, - policyType: z.string(), - insuranceCompany: z.string().nullable(), - insured: z.number().nullable(), - insCost: z.number(), - insTerm: z.number().nullable(), -}); +export const RowSchema = z + .object({ + insCost: z.number(), + insTerm: z.number().nullable(), + insuranceCompany: z.string().nullable(), + insured: z.number().nullable(), + key: KeysSchema, + policyType: z.string(), + }) + .strict(); diff --git a/apps/web/config/schema/payments.ts b/apps/web/config/schema/payments.ts index 9ef49b5..bf6d566 100644 --- a/apps/web/config/schema/payments.ts +++ b/apps/web/config/schema/payments.ts @@ -1,7 +1,9 @@ import { z } from 'zod'; -const PaymentsSchema = z.object({ - values: z.number().array(), -}); +const PaymentsSchema = z + .object({ + values: z.number().array(), + }) + .strict(); export default PaymentsSchema; diff --git a/apps/web/config/schema/runtime-config.js b/apps/web/config/schema/runtime-config.js index 224fc7c..0a66682 100644 --- a/apps/web/config/schema/runtime-config.js +++ b/apps/web/config/schema/runtime-config.js @@ -1,4 +1,3 @@ -/* eslint-disable @typescript-eslint/no-var-requires */ const envSchema = require('./env'); const publicRuntimeConfigSchema = envSchema.pick({ @@ -8,11 +7,11 @@ const publicRuntimeConfigSchema = envSchema.pick({ }); const serverRuntimeConfigSchema = envSchema.pick({ - PORT: true, BASE_PATH: true, + PORT: true, + URL_CORE_FINGAP_DIRECT: true, URL_CRM_GRAPHQL_DIRECT: true, URL_GET_USER_DIRECT: true, - URL_CORE_FINGAP_DIRECT: true, }); module.exports = { diff --git a/apps/web/config/schema/values.ts b/apps/web/config/schema/values.ts index d1b6b7a..7c1d583 100644 --- a/apps/web/config/schema/values.ts +++ b/apps/web/config/schema/values.ts @@ -1,145 +1,152 @@ +/* eslint-disable canonical/sort-keys */ import { z } from 'zod'; -const ValuesSchema = z.object({ - lead: z.string().nullable(), - opportunity: z.string().nullable(), - quote: z.string().nullable(), - recalcWithRevision: z.boolean(), - product: z.string().nullable(), - clientRisk: z.string().nullable(), - clientType: z.string().nullable(), - leaseObjectPrice: z.number(), - supplierCurrency: z.string().nullable(), - supplierDiscountRub: z.number(), - supplierDiscountPerc: z.number(), - leasingPeriod: z.number(), - firstPaymentPerc: z.number(), - firstPaymentRub: z.number(), - lastPaymentPerc: z.number(), - lastPaymentRub: z.number(), - lastPaymentRule: z.number().nullable(), - importProgram: z.string().nullable(), - importProgramSum: z.number(), - addEquipmentPrice: z.number(), - redemptionPaymentSum: z.number(), - balanceHolder: z.number().nullable(), - graphType: z.number().nullable(), - parmentsDecreasePercent: z.number(), - seasonType: z.number().nullable(), - highSeasonStart: z.number().nullable(), - comissionPerc: z.number(), - comissionRub: z.number(), - saleBonus: z.number(), - IRR_Perc: z.number(), - leaseObjectType: z.string().nullable(), - deliveryTime: z.number().nullable(), - leaseObjectCount: z.number(), - withTrailer: z.boolean(), - leaseObjectUsed: z.boolean(), - maxMass: z.number(), - countSeats: z.number(), - maxSpeed: z.number(), - brand: z.string().nullable(), - model: z.string().nullable(), - configuration: z.string().nullable(), - leaseObjectYear: z.number(), - engineType: z.number().nullable(), - leaseObjectCategory: z.number().nullable(), - leaseObjectMotorPower: z.number(), - engineVolume: z.number(), - leaseObjectUseFor: z.number().nullable(), - dealer: z.string().nullable(), - dealerPerson: z.string().nullable(), - dealerRewardCondition: z.string().nullable(), - dealerRewardSumm: z.number(), - dealerBroker: z.string().nullable(), - dealerBrokerRewardCondition: z.string().nullable(), - dealerBrokerRewardSumm: z.number(), - indAgent: z.string().nullable(), - indAgentRewardCondition: z.string().nullable(), - indAgentRewardSumm: z.number(), - calcDoubleAgent: z.string().nullable(), - calcDoubleAgentRewardCondition: z.string().nullable(), - calcDoubleAgentRewardSumm: z.number(), - calcBroker: z.string().nullable(), - calcBrokerRewardCondition: z.string().nullable(), - calcBrokerRewardSum: z.number(), - calcFinDepartment: z.string().nullable(), - finDepartmentRewardCondtion: z.string().nullable(), - finDepartmentRewardSumm: z.number(), - GPSBrand: z.string().nullable(), - GPSModel: z.string().nullable(), - regionRegistration: z.string().nullable(), - townRegistration: z.string().nullable(), - infuranceOPF: z.number().nullable(), - insKaskoType: z.number().nullable(), - insDecentral: z.boolean(), - insFranchise: z.number(), - insUnlimitDrivers: z.boolean(), - insAgeDrivers: z.number(), - insExpDrivers: z.number(), - INNForCalc: z.number(), - lastPaymentRedemption: z.boolean(), - priceWithDiscount: z.boolean(), - fullPriceWithDiscount: z.boolean(), - costIncrease: z.boolean(), - insurance: z.boolean(), - registrationQuote: z.boolean(), - technicalCardQuote: z.boolean(), - NSIB: z.boolean(), - quoteName: z.string().nullable(), - quoteContactGender: z.number().nullable(), - quoteRedemptionGraph: z.boolean(), - showFinGAP: z.boolean(), - tarif: z.string().nullable(), - creditRate: z.number(), - rate: z.string().nullable(), - requirementTelematic: z.number().nullable(), - minPriceChange: z.number(), - maxPriceChange: z.number(), - importerRewardPerc: z.number(), - importerRewardRub: z.number(), - disableChecks: z.boolean(), - registration: z.string().nullable(), - insNSIB: z.string().nullable(), - technicalCard: z.string().nullable(), - telematic: z.string().nullable(), - tracker: z.string().nullable(), - mileage: z.number(), - calcType: z.number().nullable(), - totalPayments: z.number(), - objectRegistration: z.number().nullable(), - objectRegionRegistration: z.string().nullable(), - vehicleTaxInYear: z.number(), - vehicleTaxInLeasingPeriod: z.number(), - objectCategoryTax: z.number().nullable(), - objectTypeTax: z.number().nullable(), - typePTS: z.number().nullable(), - legalClientRegion: z.string().nullable(), - legalClientTown: z.string().nullable(), - subsidy: z.string().nullable(), - fuelCard: z.string().nullable(), - leaseObjectPriceWthtVAT: z.number(), - VATInLeaseObjectPrice: z.number(), - engineHours: z.number(), - bonusCoefficient: z.number(), - leasingWithoutKasko: z.string().nullable(), +const ValuesSchema = z + .object({ + addEquipmentPrice: z.number(), + balanceHolder: z.number().nullable(), + bonusCoefficient: z.number(), + brand: z.string().nullable(), + calcBroker: z.string().nullable(), + calcBrokerRewardCondition: z.string().nullable(), + calcBrokerRewardSum: z.number(), + calcDoubleAgent: z.string().nullable(), + calcDoubleAgentRewardCondition: z.string().nullable(), + calcDoubleAgentRewardSumm: z.number(), + calcFinDepartment: z.string().nullable(), + calcType: z.number().nullable(), + clientRisk: z.string().nullable(), + clientType: z.string().nullable(), + comissionPerc: z.number(), + comissionRub: z.number(), + configuration: z.string().nullable(), + costIncrease: z.boolean(), + countSeats: z.number(), + creditRate: z.number(), + dealer: z.string().nullable(), + dealerBroker: z.string().nullable(), + dealerBrokerRewardCondition: z.string().nullable(), + dealerBrokerRewardSumm: z.number(), + dealerPerson: z.string().nullable(), + dealerRewardCondition: z.string().nullable(), + dealerRewardSumm: z.number(), + deliveryTime: z.number().nullable(), + disableChecks: z.boolean(), + engineHours: z.number(), + engineType: z.number().nullable(), + engineVolume: z.number(), + finDepartmentRewardCondtion: z.string().nullable(), + finDepartmentRewardSumm: z.number(), + firstPaymentPerc: z.number(), + firstPaymentRub: z.number(), + fuelCard: z.string().nullable(), + fullPriceWithDiscount: z.boolean(), + GPSBrand: z.string().nullable(), + GPSModel: z.string().nullable(), + graphType: z.number().nullable(), + highSeasonStart: z.number().nullable(), + importerRewardPerc: z.number(), + importerRewardRub: z.number(), + importProgram: z.string().nullable(), + importProgramSum: z.number(), + indAgent: z.string().nullable(), + indAgentRewardCondition: z.string().nullable(), + indAgentRewardSumm: z.number(), + infuranceOPF: z.number().nullable(), + INNForCalc: z.number(), + insAgeDrivers: z.number(), + insDecentral: z.boolean(), + insExpDrivers: z.number(), + insFranchise: z.number(), + insKaskoType: z.number().nullable(), + insNSIB: z.string().nullable(), + insUnlimitDrivers: z.boolean(), + insurance: z.boolean(), + IRR_Perc: z.number(), + lastPaymentPerc: z.number(), + lastPaymentRedemption: z.boolean(), + lastPaymentRub: z.number(), + lastPaymentRule: z.number().nullable(), + lead: z.string().nullable(), + leaseObjectCategory: z.number().nullable(), + leaseObjectCount: z.number(), + leaseObjectMotorPower: z.number(), + leaseObjectPrice: z.number(), + leaseObjectPriceWthtVAT: z.number(), + leaseObjectType: z.string().nullable(), + leaseObjectUsed: z.boolean(), + leaseObjectUseFor: z.number().nullable(), + leaseObjectYear: z.number(), + leasingPeriod: z.number(), + leasingWithoutKasko: z.string().nullable(), + legalClientRegion: z.string().nullable(), + legalClientTown: z.string().nullable(), + maxMass: z.number(), + maxPriceChange: z.number(), + maxSpeed: z.number(), + mileage: z.number(), + minPriceChange: z.number(), + model: z.string().nullable(), + NSIB: z.boolean(), + objectCategoryTax: z.number().nullable(), + objectRegionRegistration: z.string().nullable(), + objectRegistration: z.number().nullable(), + objectTypeTax: z.number().nullable(), + opportunity: z.string().nullable(), + parmentsDecreasePercent: z.number(), + priceWithDiscount: z.boolean(), + product: z.string().nullable(), + quote: z.string().nullable(), + quoteContactGender: z.number().nullable(), + quoteName: z.string().nullable(), + quoteRedemptionGraph: z.boolean(), + rate: z.string().nullable(), + recalcWithRevision: z.boolean(), + redemptionPaymentSum: z.number(), + regionRegistration: z.string().nullable(), + registration: z.string().nullable(), + registrationQuote: z.boolean(), + requirementTelematic: z.number().nullable(), + saleBonus: z.number(), + seasonType: z.number().nullable(), + showFinGAP: z.boolean(), + subsidy: z.string().nullable(), + supplierCurrency: z.string().nullable(), + supplierDiscountPerc: z.number(), + supplierDiscountRub: z.number(), + tarif: z.string().nullable(), + technicalCard: z.string().nullable(), + technicalCardQuote: z.boolean(), + telematic: z.string().nullable(), + totalPayments: z.number(), + townRegistration: z.string().nullable(), + tracker: z.string().nullable(), + typePTS: z.number().nullable(), + VATInLeaseObjectPrice: z.number(), + vehicleTaxInLeasingPeriod: z.number(), + vehicleTaxInYear: z.number(), + withTrailer: z.boolean(), - /** Link Values */ - kpUrl: z.string().nullable(), - leadUrl: z.string().nullable(), - opportunityUrl: z.string().nullable(), - quoteUrl: z.string().nullable(), + /** + * Link Values + */ + kpUrl: z.string().nullable(), + leadUrl: z.string().nullable(), + opportunityUrl: z.string().nullable(), + quoteUrl: z.string().nullable(), - /** Readonly Values */ - leaseObjectRiskName: z.string().nullable(), - insKaskoPriceLeasePeriod: z.number(), - irrInfo: z.string().nullable(), - registrationDescription: z.string().nullable(), - depreciationGroup: z.string().nullable(), - subsidySum: z.number(), - plPriceRub: z.number(), - discountRub: z.number(), -}); + /** + * Readonly Values + */ + depreciationGroup: z.string().nullable(), + discountRub: z.number(), + insKaskoPriceLeasePeriod: z.number(), + irrInfo: z.string().nullable(), + leaseObjectRiskName: z.string().nullable(), + plPriceRub: z.number(), + registrationDescription: z.string().nullable(), + subsidySum: z.number(), + }) + .strict(); export default ValuesSchema; diff --git a/apps/web/config/tables/insurance-table.ts b/apps/web/config/tables/insurance-table.ts index 11bdbbe..89418f5 100644 --- a/apps/web/config/tables/insurance-table.ts +++ b/apps/web/config/tables/insurance-table.ts @@ -1,82 +1,36 @@ -/* eslint-disable object-curly-newline */ -import type * as Insurance from 'Components/Calculation/Form/Insurance/InsuranceTable/types'; +/* eslint-disable canonical/sort-keys */ +import type * as Insurance from '@/Components/Calculation/Form/Insurance/InsuranceTable/types'; + +const defaultRowOptions: Insurance.RowOptions = { + insured: [ + { + label: 'ЛП', + value: 100_000_000, + }, + { + label: 'ЛД', + value: 100_000_001, + }, + ], + insTerm: [ + { + label: '12 месяцев', + value: 100_000_000, + }, + { + label: 'Срок ДЛ', + value: 100_000_001, + }, + ], + insCost: [], + insuranceCompany: [], + policyType: [], +}; export const defaultOptions: Record = { - osago: { - insured: [ - { - label: 'ЛП', - value: 100_000_000, - }, - { - label: 'ЛД', - value: 100_000_001, - }, - ], - insTerm: [ - { - label: '12 месяцев', - value: 100_000_000, - }, - { - label: 'Срок ДЛ', - value: 100_000_001, - }, - ], - insCost: [], - insuranceCompany: [], - policyType: [], - }, - kasko: { - insured: [ - { - label: 'ЛП', - value: 100_000_000, - }, - { - label: 'ЛД', - value: 100_000_001, - }, - ], - insTerm: [ - { - label: '12 месяцев', - value: 100_000_000, - }, - { - label: 'Срок ДЛ', - value: 100_000_001, - }, - ], - insCost: [], - insuranceCompany: [], - policyType: [], - }, - fingap: { - insured: [ - { - label: 'ЛП', - value: 100_000_000, - }, - { - label: 'ЛД', - value: 100_000_001, - }, - ], - insTerm: [ - { - label: '12 месяцев', - value: 100_000_000, - }, - { - label: 'Срок ДЛ', - value: 100_000_001, - }, - ], - insCost: [], - insuranceCompany: [], - policyType: [], - }, + osago: defaultRowOptions, + kasko: defaultRowOptions, + fingap: defaultRowOptions, }; export const defaultValues: Insurance.RowValues[] = [ @@ -108,24 +62,24 @@ export const defaultValues: Insurance.RowValues[] = [ export const defaultStatuses: Record = { osago: { - insTerm: 'Disabled', - insCost: 'Default', + policyType: 'Default', insuranceCompany: 'Default', insured: 'Default', - policyType: 'Default', + insCost: 'Default', + insTerm: 'Disabled', }, kasko: { - insTerm: 'Disabled', - insCost: 'Default', + policyType: 'Default', insuranceCompany: 'Default', insured: 'Default', - policyType: 'Default', + insCost: 'Default', + insTerm: 'Disabled', }, fingap: { - insCost: 'Disabled', + policyType: 'Default', insuranceCompany: 'Default', insured: 'Default', + insCost: 'Disabled', insTerm: 'Default', - policyType: 'Default', }, }; diff --git a/apps/web/config/ui.js b/apps/web/config/ui.js index 5a9f2c7..d7f907e 100644 --- a/apps/web/config/ui.js +++ b/apps/web/config/ui.js @@ -1,3 +1,4 @@ +/* eslint-disable canonical/sort-keys */ const threshold = 0; const screens = { diff --git a/apps/web/config/urls.ts b/apps/web/config/urls.ts index 2f4cf53..0e18a17 100644 --- a/apps/web/config/urls.ts +++ b/apps/web/config/urls.ts @@ -1,35 +1,35 @@ -import urls from 'constants/urls'; +import { publicRuntimeConfigSchema, serverRuntimeConfigSchema } from './schema/runtime-config'; +import urls from '@/constants/urls'; import getConfig from 'next/config'; import { isServer } from 'tools/common'; -import { publicRuntimeConfigSchema, serverRuntimeConfigSchema } from './schema/runtime-config'; const { serverRuntimeConfig, publicRuntimeConfig } = getConfig(); function getUrls() { + const { BASE_PATH } = publicRuntimeConfigSchema.parse(publicRuntimeConfig); + if (isServer()) { - const { URL_CRM_GRAPHQL_DIRECT, URL_GET_USER_DIRECT, URL_CORE_FINGAP_DIRECT, BASE_PATH, PORT } = + const { URL_CRM_GRAPHQL_DIRECT, URL_GET_USER_DIRECT, URL_CORE_FINGAP_DIRECT, PORT } = serverRuntimeConfigSchema.parse(serverRuntimeConfig); return { - PORT, BASE_PATH, + PORT, + URL_CORE_FINGAP: URL_CORE_FINGAP_DIRECT, URL_CRM_GRAPHQL: URL_CRM_GRAPHQL_DIRECT, URL_GET_USER: URL_GET_USER_DIRECT, - URL_CORE_FINGAP: URL_CORE_FINGAP_DIRECT, }; } - const { BASE_PATH } = publicRuntimeConfigSchema.parse(publicRuntimeConfig); - function withBasePath(url: string) { return BASE_PATH + url; } return { BASE_PATH, + URL_CORE_FINGAP: withBasePath(urls.URL_CORE_FINGAP_PROXY), URL_CRM_GRAPHQL: withBasePath(urls.URL_CRM_GRAPHQL_PROXY), URL_GET_USER: withBasePath(urls.URL_GET_USER_PROXY), - URL_CORE_FINGAP: withBasePath(urls.URL_CORE_FINGAP_PROXY), }; } diff --git a/apps/web/constants/colors.js b/apps/web/constants/colors.js index 7e377c2..1c88cbb 100644 --- a/apps/web/constants/colors.js +++ b/apps/web/constants/colors.js @@ -10,6 +10,6 @@ const COLORS_DEV = { }; module.exports = { - COLORS_PROD, COLORS_DEV, + COLORS_PROD, }; diff --git a/apps/web/constants/request.js b/apps/web/constants/request.js index a0c6479..4882586 100644 --- a/apps/web/constants/request.js +++ b/apps/web/constants/request.js @@ -1,2 +1 @@ -/* eslint-disable import/prefer-default-export */ export const STALE_TIME = Number.POSITIVE_INFINITY; diff --git a/apps/web/constants/urls.js b/apps/web/constants/urls.js index ff1491a..2a50a7b 100644 --- a/apps/web/constants/urls.js +++ b/apps/web/constants/urls.js @@ -1,5 +1,5 @@ module.exports = { - URL_GET_USER_PROXY: '/api/auth/user', - URL_CRM_GRAPHQL_PROXY: '/api/graphql/crm', URL_CORE_FINGAP_PROXY: '/api/core/fingap', + URL_CRM_GRAPHQL_PROXY: '/api/graphql/crm', + URL_GET_USER_PROXY: '/api/auth/user', }; diff --git a/apps/web/jest.config.js b/apps/web/jest.config.js index 67ec1da..127104b 100644 --- a/apps/web/jest.config.js +++ b/apps/web/jest.config.js @@ -16,6 +16,7 @@ const customJestConfig = { moduleDirectories: ['node_modules', '/'], moduleNameMapper: { // Handle module aliases (this will be automatically configured for you soon) + '^@/(.*)$': '/$1', }, testEnvironment: 'jest-environment-jsdom', preset: 'ts-jest', diff --git a/apps/web/mocks/handlers.js b/apps/web/mocks/handlers.js index 67d0e49..45fcd36 100644 --- a/apps/web/mocks/handlers.js +++ b/apps/web/mocks/handlers.js @@ -1,4 +1,4 @@ -import getUrls from 'config/urls'; +import getUrls from '@/config/urls'; import { rest } from 'msw'; const _ = require('radash'); diff --git a/apps/web/next.config.js b/apps/web/next.config.js index 308ebeb..20bb334 100644 --- a/apps/web/next.config.js +++ b/apps/web/next.config.js @@ -15,49 +15,49 @@ const favicons = fs.readdirSync('./public/favicon/prod'); const faviconSubPath = env.USE_DEV_COLORS ? '/favicon/dev' : '/favicon/prod'; function buildFaviconRewrite(source) { return { - source, destination: String.prototype.concat(env.BASE_PATH, faviconSubPath, source), + source, }; } /** @type {import('next').NextConfig} */ const nextConfig = { basePath: env.BASE_PATH, - transpilePackages: ['ui', 'tools'], - output: 'standalone', - swcMinify: true, - reactStrictMode: true, + compiler: { + styledComponents: true, + }, eslint: { ignoreDuringBuilds: true, }, - compiler: { - styledComponents: true, + experimental: { + outputFileTracingRoot: path.join(__dirname, '../../'), }, images: { deviceSizes: devices, }, + output: 'standalone', + publicRuntimeConfig: publicRuntimeConfigSchema.parse(env), + reactStrictMode: true, async rewrites() { return [ { - source: urls.URL_CRM_GRAPHQL_PROXY, destination: env.URL_CRM_GRAPHQL_DIRECT, + source: urls.URL_CRM_GRAPHQL_PROXY, }, { - source: urls.URL_GET_USER_PROXY, destination: env.URL_GET_USER_DIRECT, + source: urls.URL_GET_USER_PROXY, }, { - source: urls.URL_CORE_FINGAP_PROXY, destination: env.URL_CORE_FINGAP_DIRECT, + source: urls.URL_CORE_FINGAP_PROXY, }, ...favicons.map((fileName) => buildFaviconRewrite(`/${fileName}`)), ]; }, - publicRuntimeConfig: publicRuntimeConfigSchema.parse(env), serverRuntimeConfig: serverRuntimeConfigSchema.parse(env), - experimental: { - outputFileTracingRoot: path.join(__dirname, '../../'), - }, + swcMinify: true, + transpilePackages: ['ui', 'tools'], }; const plugins = [withLess]; diff --git a/apps/web/pages/_app.jsx b/apps/web/pages/_app.jsx index 0681fd3..be39298 100644 --- a/apps/web/pages/_app.jsx +++ b/apps/web/pages/_app.jsx @@ -1,22 +1,20 @@ -/* eslint-disable global-require */ -import { ApolloProvider } from '@apollo/client'; -import { QueryClientProvider } from '@tanstack/react-query'; -import Layout from 'Components/Layout'; -import { theme } from 'config/ui'; -import Head from 'next/head'; import 'normalize.css'; -import { useMemo } from 'react'; -import StoreProvider from 'stores/Provider'; -import { ThemeProvider } from 'styled-components'; -import { GlobalStyle } from 'styles/global-style'; -import { trpcClient } from 'trpc/client'; -import AntdConfig from 'ui/elements/Config'; import 'ui/elements/styles/antd.less'; import '../styles/fonts.css'; import '../styles/globals.css'; - -import initializeQueryClient from 'api/client'; -import initializeApollo from 'apollo/client'; +import initializeQueryClient from '@/api/client'; +import initializeApollo from '@/apollo/client'; +import Layout from '@/Components/Layout'; +import { theme } from '@/config/ui'; +import StoreProvider from '@/stores/Provider'; +import { GlobalStyle } from '@/styles/global-style'; +import { trpcClient } from '@/trpc/client'; +import { ApolloProvider } from '@apollo/client'; +import { QueryClientProvider } from '@tanstack/react-query'; +import Head from 'next/head'; +import { useMemo } from 'react'; +import { ThemeProvider } from 'styled-components'; +import AntdConfig from 'ui/elements/Config'; // eslint-disable-next-line turbo/no-undeclared-env-vars if (process.env.NODE_ENV === 'development') { diff --git a/apps/web/pages/_document.jsx b/apps/web/pages/_document.jsx index dd8f382..48f85de 100644 --- a/apps/web/pages/_document.jsx +++ b/apps/web/pages/_document.jsx @@ -1,4 +1,5 @@ -import { metaFavicon } from 'config/meta'; +/* eslint-disable @typescript-eslint/explicit-member-accessibility */ +import { metaFavicon } from '@/config/meta'; import Document, { Head, Html, Main, NextScript } from 'next/document'; import { ServerStyleSheet } from 'styled-components'; @@ -8,8 +9,8 @@ export default class MyDocument extends Document { const originalRenderPage = ctx.renderPage; try { - // prettier-ignore - ctx.renderPage = () => originalRenderPage({ + ctx.renderPage = () => + originalRenderPage({ enhanceApp: (App) => (props) => sheet.collectStyles(), }); diff --git a/apps/web/pages/api/trpc/[trpc].ts b/apps/web/pages/api/trpc/[trpc].ts index 47e091a..e0b9eaf 100644 --- a/apps/web/pages/api/trpc/[trpc].ts +++ b/apps/web/pages/api/trpc/[trpc].ts @@ -1,8 +1,8 @@ +/* eslint-disable canonical/filename-match-regex */ +import appRouter from '@/trpc/routers'; import * as trpcNext from '@trpc/server/adapters/next'; -import appRouter from 'trpc/routers'; export default trpcNext.createNextApiHandler({ - router: appRouter, - // eslint-disable-next-line object-curly-newline createContext: () => ({}), + router: appRouter, }); diff --git a/apps/web/pages/index.jsx b/apps/web/pages/index.jsx index e34c2c7..ab62819 100644 --- a/apps/web/pages/index.jsx +++ b/apps/web/pages/index.jsx @@ -1,14 +1,14 @@ +import { getUser } from '@/api/user/query'; +import initializeApollo from '@/apollo/client'; +import * as Calculation from '@/Components/Calculation'; +import { CRMError } from '@/Components/Common/Error'; +import Output from '@/Components/Output'; +import { getOwnerData, useInsuranceData, useMainData } from '@/process/init/get-data'; +import { useReactions } from '@/process/init/inject-reactions/hooks'; +import { min } from '@/styles/mq'; import { dehydrate, QueryClient } from '@tanstack/react-query'; -import { getUser } from 'api/user/query'; -import initializeApollo from 'apollo/client'; -import * as Calculation from 'Components/Calculation'; -import { CRMError } from 'Components/Common/Error'; -import Output from 'Components/Output'; import Head from 'next/head'; -import { getOwnerData, useInsuranceData, useMainData } from 'process/init/get-data'; -import { useReactions } from 'process/init/inject-reactions/hooks'; import styled from 'styled-components'; -import { min } from 'styles/mq'; import { Box } from 'ui/grid'; const Grid = styled(Box)` @@ -56,8 +56,8 @@ function Home({ error }) { /** @type {import('next').GetServerSideProps} */ export const getServerSideProps = async ({ req }) => { const { cookie = '' } = req.headers; - // prettier-ignore - const queryGetUser = () => getUser({ + const queryGetUser = () => + getUser({ headers: { cookie, }, diff --git a/apps/web/process/calculate/reactions/index.js b/apps/web/process/calculate/reactions/index.js index 204b641..5aaa2fd 100644 --- a/apps/web/process/calculate/reactions/index.js +++ b/apps/web/process/calculate/reactions/index.js @@ -1,2 +1 @@ -/* eslint-disable import/prefer-default-export */ export { default as validation } from './validation'; diff --git a/apps/web/process/calculate/reactions/validation.ts b/apps/web/process/calculate/reactions/validation.ts index 0c83488..1f7624a 100644 --- a/apps/web/process/calculate/reactions/validation.ts +++ b/apps/web/process/calculate/reactions/validation.ts @@ -1,11 +1,11 @@ -import types from 'Components/Calculation/config/elements-types'; -import type * as Values from 'Components/Calculation/config/map/values'; -import type * as Insurance from 'Components/Calculation/Form/Insurance/InsuranceTable/types'; +import types from '@/Components/Calculation/config/elements-types'; +import type * as Values from '@/Components/Calculation/config/map/values'; +import type * as Insurance from '@/Components/Calculation/Form/Insurance/InsuranceTable/types'; +import type { ReactionsContext } from '@/process/types'; import { reaction } from 'mobx'; -import type { ReactionsContext } from 'process/types'; import type { BaseOption } from 'ui/elements/types'; -function hasInvalidValueOrOptions(value: unknown, options: BaseOption[]) { +function hasInvalidValueOrOptions(value: unknown, options: Array>) { if (value === null) { return false; } @@ -58,8 +58,8 @@ export default function validationReactions({ store }: ReactionsContext) { const value = element.getValue(); return { - value, options, + value, }; }, ({ value, options }) => { @@ -101,8 +101,8 @@ export default function validationReactions({ store }: ReactionsContext) { const value = row.getValue('insuranceCompany'); return { - value, options, + value, }; }, ({ value, options }) => { diff --git a/apps/web/process/configurator/get-kp-data.ts b/apps/web/process/configurator/get-kp-data.ts index 2e2f8f4..8b31c57 100644 --- a/apps/web/process/configurator/get-kp-data.ts +++ b/apps/web/process/configurator/get-kp-data.ts @@ -1,8 +1,7 @@ -/* eslint-disable @typescript-eslint/naming-convention */ -import { gql } from '@apollo/client'; -import initializeApollo from 'apollo/client'; -import type * as CRMTypes from 'graphql/crm.types'; import type { GetQuoteDataInput, GetQuoteDataOutput } from '../load-kp/types'; +import initializeApollo from '@/apollo/client'; +import type * as CRMTypes from '@/graphql/crm.types'; +import { gql } from '@apollo/client'; const QUERY_GET_CONFIGURATOR_DATA_FROM_QUOTE = gql` query GetConfiguratorDataFromQuote($quoteId: Uuid!) { diff --git a/apps/web/process/configurator/reactions/filters.ts b/apps/web/process/configurator/reactions/filters.ts index 7504984..29acf7f 100644 --- a/apps/web/process/configurator/reactions/filters.ts +++ b/apps/web/process/configurator/reactions/filters.ts @@ -1,11 +1,11 @@ /* eslint-disable @typescript-eslint/naming-convention */ -import { radioGraphType, selectSeasonType } from 'config/default-options'; +import { radioGraphType, selectSeasonType } from '@/config/default-options'; +import * as CRMTypes from '@/graphql/crm.types'; +import { SEASON_TYPES } from '@/process/payments/lib/seasons-constants'; +import type { ReactionsContext } from '@/process/types'; import dayjs from 'dayjs'; import utc from 'dayjs/plugin/utc'; -import * as CRMTypes from 'graphql/crm.types'; import { reaction } from 'mobx'; -import { SEASON_TYPES } from 'process/payments/lib/seasons-constants'; -import type { ReactionsContext } from 'process/types'; import { diff } from 'radash'; import { normalizeOptions } from 'tools'; @@ -19,35 +19,36 @@ export default function commonReactions({ store, apolloClient }: ReactionsContex const { product, subsidy, importProgram, dealer } = $calculation.$values.values; return { + dealerId: dealer, + importProgramId: importProgram, productId: product, subsidyId: subsidy, - importProgramId: importProgram, - dealerId: dealer, }; }, + // eslint-disable-next-line sonarjs/cognitive-complexity async ({ productId, subsidyId, importProgramId, dealerId }) => { /** - #1 - * DYN-190 При выборе значения в поле selectSubsidy необходимо добавить - * фильтрацию в полях при условии что selectSubsidy не равно null: - - Тип предмета лизинга selectLeaseObjectType - если с записью Субсидия нет связанных Типов предмета лизинга, - то указываются все записи согласно текущей фильтрации, - иначе указываются те записи, которые связаны с Субсидией, указанной в поле selectSubsidy - - #2 - * На изменение поля Продукт selectProduct добавляем фильтрацию списков: - в поле Тип предмета лизинга selectLeaseObjectType - указываются те, которые связаны с продуктом. - Если с Продуктом нет связанных Типов предмета лизинга, - то указывается весь список. Это надо добавить в текущие условия фильтрации данного поля - - #3 - Тип предмета лизинга selectLeaseObjectType - если с записью Субсидия нет связанных Типов предмета лизинга, - то указываются все записи согласно текущей фильтрации, - иначе указываются те записи, которые связаны с Субсидией, указанной в поле selectImportProgram - */ + * #1 + * DYN-190 При выборе значения в поле selectSubsidy необходимо добавить + * фильтрацию в полях при условии что selectSubsidy не равно null: + * + * Тип предмета лизинга selectLeaseObjectType + * если с записью Субсидия нет связанных Типов предмета лизинга, + * то указываются все записи согласно текущей фильтрации, + * иначе указываются те записи, которые связаны с Субсидией, указанной в поле selectSubsidy + * + * #2 + * На изменение поля Продукт selectProduct добавляем фильтрацию списков: + * в поле Тип предмета лизинга selectLeaseObjectType - указываются те, которые связаны с продуктом. + * Если с Продуктом нет связанных Типов предмета лизинга, + * то указывается весь список. Это надо добавить в текущие условия фильтрации данного поля + * + * #3 + * Тип предмета лизинга selectLeaseObjectType + * если с записью Субсидия нет связанных Типов предмета лизинга, + * то указываются все записи согласно текущей фильтрации, + * иначе указываются те записи, которые связаны с Субсидией, указанной в поле selectImportProgram + */ let { data: { evo_leasingobject_types: leaseObjectTypes = [] }, @@ -192,9 +193,9 @@ export default function commonReactions({ store, apolloClient }: ReactionsContex /** * На изменение поля Тариф selectTarif добавляем фильрацию в полях: - в поле Вид графика radioGraphType должны закрываться значения для выбора, - которые указаны в массиве поля "Недопустимые виды графиков" evo_graphtype_exception. - Если в массиве пусто, значит допустимы все значения + * в поле Вид графика radioGraphType должны закрываться значения для выбора, + * которые указаны в массиве поля "Недопустимые виды графиков" evo_graphtype_exception. + * Если в массиве пусто, значит допустимы все значения */ reaction( () => $calculation.element('selectTarif').getValue(), @@ -231,8 +232,8 @@ export default function commonReactions({ store, apolloClient }: ReactionsContex */ reaction( () => ({ - tarif: $calculation.element('selectTarif').getValue(), graphType: $calculation.element('radioGraphType').getValue(), + tarif: $calculation.element('selectTarif').getValue(), }), async ({ tarif, graphType }) => { let evo_tarif: CRMTypes.GetTarifQuery['evo_tarif'] = null; @@ -249,7 +250,7 @@ export default function commonReactions({ store, apolloClient }: ReactionsContex } const seasonTypesExeption = evo_tarif?.evo_seasons_type_exception || []; - let seasonTypes: Array = []; + let seasonTypes: number[] = []; if (graphType === 100_000_001 || graphType === 100_000_003) { seasonTypes = SEASON_TYPES[graphType]; @@ -300,13 +301,12 @@ export default function commonReactions({ store, apolloClient }: ReactionsContex } ); - /* eslint-disable max-len */ /** * Добавить фильтр для поля selectProduct (работает на загрузку КП) * если recalcWithRevision=True, то в списке поля selectProduct должны отображаться * записи quote.evo_baseproductid из поля Предложение selectQuote + дать возможность выбирать продукт, * связанный с оquote.evo_baseproductid из поля Предложение selectQuote по связи evo_evo_baseproduct_evo_baseproduct - /* eslint-enable */ + */ reaction( () => $calculation.element('selectQuote').getValue(), async (quoteId) => { @@ -315,11 +315,11 @@ export default function commonReactions({ store, apolloClient }: ReactionsContex const { data: { evo_baseproducts }, } = await apolloClient.query({ + fetchPolicy: 'network-only', query: CRMTypes.GetProductsDocument, variables: { currentDate, }, - fetchPolicy: 'network-only', }); if (!$calculation.element('cbxRecalcWithRevision').getValue()) { diff --git a/apps/web/process/configurator/reactions/validation.ts b/apps/web/process/configurator/reactions/validation.ts index e724602..9b2618c 100644 --- a/apps/web/process/configurator/reactions/validation.ts +++ b/apps/web/process/configurator/reactions/validation.ts @@ -1,26 +1,24 @@ -import * as CRMTypes from 'graphql/crm.types'; +/* eslint-disable @typescript-eslint/naming-convention */ +import * as CRMTypes from '@/graphql/crm.types'; +import type { ReactionsContext } from '@/process/types'; import { reaction } from 'mobx'; -import type { ReactionsContext } from 'process/types'; export default function validationReactions({ store, apolloClient }: ReactionsContext) { const { $calculation } = store; - /* eslint-disable max-len */ /** - * На изменение поля Процет убывания платежей tbxParmentsDecreasePercent необходимо заложить проверку: - * Если значение поля меньше значения в поле "Минимальный % убывания платежей" evo_min_decreasing_perc из записи, - * указанной в поле ТарифselectTarif , то поле Процет убывания платежей tbxParmentsDecreasePercent должно обводиться красной рамкой - * и выводиться сообщение "Процент убывания не может быть меньше минимального значения по данному тарифу - - <указывается значение из поля "Минимальный % убывания платежей">, иначе красная рамка снимается. - * При красной рамке в данном поле нельзя осуществить расчет графика. - */ - /* eslint-enable */ + * На изменение поля Процет убывания платежей tbxParmentsDecreasePercent необходимо заложить проверку: + * Если значение поля меньше значения в поле "Минимальный % убывания платежей" evo_min_decreasing_perc из записи, + * указанной в поле ТарифselectTarif , то поле Процет убывания платежей tbxParmentsDecreasePercent должно обводиться красной рамкой + * и выводиться сообщение "Процент убывания не может быть меньше минимального значения по данному тарифу + * - <указывается значение из поля "Минимальный % убывания платежей">, иначе красная рамка снимается. + * При красной рамке в данном поле нельзя осуществить расчет графика. + */ reaction( () => ({ parmentsDecreasePercent: $calculation.element('tbxParmentsDecreasePercent').getValue(), tarifId: $calculation.element('selectTarif').getValue(), }), async ({ parmentsDecreasePercent, tarifId }) => { - // eslint-disable-next-line @typescript-eslint/naming-convention let evo_tarif: CRMTypes.GetTarifQuery['evo_tarif'] = null; if (tarifId) { @@ -35,9 +33,10 @@ export default function validationReactions({ store, apolloClient }: ReactionsCo } $calculation.element('tbxParmentsDecreasePercent').validate({ - invalid: - !!evo_tarif?.evo_min_decreasing_perc && - parmentsDecreasePercent < evo_tarif?.evo_min_decreasing_perc, + invalid: Boolean( + evo_tarif?.evo_min_decreasing_perc && + parmentsDecreasePercent < evo_tarif?.evo_min_decreasing_perc + ), message: `Процент убывания не может быть меньше минимального значения по данному тарифу - ${evo_tarif?.evo_min_decreasing_perc}`, }); } diff --git a/apps/web/process/configurator/reactions/values.ts b/apps/web/process/configurator/reactions/values.ts index 45c9a19..4072860 100644 --- a/apps/web/process/configurator/reactions/values.ts +++ b/apps/web/process/configurator/reactions/values.ts @@ -1,10 +1,9 @@ /* eslint-disable @typescript-eslint/naming-convention */ +import * as CRMTypes from '@/graphql/crm.types'; +import type { ReactionsContext } from '@/process/types'; import dayjs from 'dayjs'; import utc from 'dayjs/plugin/utc'; import { autorun, reaction } from 'mobx'; - -import * as CRMTypes from 'graphql/crm.types'; -import type { ReactionsContext } from 'process/types'; import { makeDisposable, normalizeOptions } from 'tools'; dayjs.extend(utc); @@ -28,11 +27,11 @@ export default function valuesReactions({ store, apolloClient }: ReactionsContex let { data: { evo_tarifs = [] }, } = await apolloClient.query({ + fetchPolicy: 'network-only', query: CRMTypes.GetTarifsDocument, variables: { currentDate, }, - fetchPolicy: 'network-only', }); if (product && leasingPeriod && deliveryTime && evo_tarifs) { diff --git a/apps/web/process/fingap/get-kp-data.ts b/apps/web/process/fingap/get-kp-data.ts index 79e4523..97f05ae 100644 --- a/apps/web/process/fingap/get-kp-data.ts +++ b/apps/web/process/fingap/get-kp-data.ts @@ -1,9 +1,10 @@ -import { gql } from '@apollo/client'; -import initializeApollo from 'apollo/client'; -import { defaultValues } from 'config/tables/insurance-table'; -import type * as CRMTypes from 'graphql/crm.types'; import type { GetQuoteDataInput, GetQuoteDataOutput } from '../load-kp/types'; +import initializeApollo from '@/apollo/client'; +import { defaultValues } from '@/config/tables/insurance-table'; +import type * as CRMTypes from '@/graphql/crm.types'; +import { gql } from '@apollo/client'; +// eslint-disable-next-line @typescript-eslint/no-non-null-assertion const DEFAULT_FINGAP_ROW = defaultValues.find((x) => x.key === 'fingap')!; const QUERY_GET_FINGAP_DATA_FROM_QUOTE = gql` @@ -20,10 +21,10 @@ const QUERY_GET_FINGAP_DATA_FROM_QUOTE = gql` `; type QuoteFingapProcessData = { + fingap: GetQuoteDataOutput['fingap']; insurance: { values: Pick; }; - fingap: GetQuoteDataOutput['fingap']; }; export default async function getFingapDataFromKP({ @@ -43,7 +44,7 @@ export default async function getFingapDataFromKP({ }, }); - const keys: Array = []; + const keys: string[] = []; quote?.evo_product_risks?.forEach((x) => { if (x?.evo_addproduct_typeid) { keys.push(x.evo_addproduct_typeid); @@ -58,9 +59,9 @@ export default async function getFingapDataFromKP({ values: { fingap: { ...DEFAULT_FINGAP_ROW, + insTerm: quote?.evo_fingap_period || null, insuranceCompany: quote?.evo_fingap_accountid || null, insured: quote?.evo_fingap_payer || null, - insTerm: quote?.evo_fingap_period || null, }, }, }, diff --git a/apps/web/process/fingap/reactions/common.ts b/apps/web/process/fingap/reactions/common.ts index 1519cc0..c6be69e 100644 --- a/apps/web/process/fingap/reactions/common.ts +++ b/apps/web/process/fingap/reactions/common.ts @@ -1,17 +1,15 @@ -/* eslint-disable implicit-arrow-linebreak */ -/* eslint-disable unicorn/consistent-function-scoping */ /* eslint-disable @typescript-eslint/naming-convention */ +import { calculateFinGAP } from '@/api/core/query'; +import type { RequestFinGAP } from '@/api/core/types'; +import type { Risk } from '@/Components/Calculation/Form/Insurance/FinGAPTable/types'; +import { STALE_TIME } from '@/constants/request'; +import type * as CRMTypes from '@/graphql/crm.types'; +import type { ReactionsContext } from '@/process/types'; import { gql } from '@apollo/client'; import type { QueryFunctionContext } from '@tanstack/react-query'; -import { calculateFinGAP } from 'api/core/query'; -import type { RequestFinGAP } from 'api/core/types'; -import type { Risk } from 'Components/Calculation/Form/Insurance/FinGAPTable/types'; -import { STALE_TIME } from 'constants/request'; import dayjs from 'dayjs'; import utc from 'dayjs/plugin/utc'; -import type * as CRMTypes from 'graphql/crm.types'; import { comparer, reaction, toJS } from 'mobx'; -import type { ReactionsContext } from 'process/types'; import { flatten } from 'tools/object'; dayjs.extend(utc); @@ -27,21 +25,21 @@ export default function commonReactions({ store, apolloClient, queryClient }: Re ); /** -Реакция на изменение Страховой компании у ФинГАП и Срока лизинга: - -Если Страхованя компания = Не выбрано, то - -Плательщик insuredFinGAP = ЛП (100 000 000) и закрыто для редактирования, -Стоимость за первый период inscostFinGAP = 0 -Срок страхования insTermFinGAP = 12 мес (100 000 000) и закрыто для редактирования - -иначе - -Плательщик insuredFinGAP = открыто для редактирования, -Стоимость за первый период inscostFinGAP = 0 -Срок страхования insTermFinGAP = Если срок лизинга tbxLeasingPeriod < 13, -то указываем Срок страхования insTermFinGAP = 12 мес -и закрываем для редактирования, иначе открыто для редактирования + * Реакция на изменение Страховой компании у ФинГАП и Срока лизинга: + * + * Если Страхованя компания = Не выбрано, то + * + * Плательщик insuredFinGAP = ЛП (100 000 000) и закрыто для редактирования, + * Стоимость за первый период inscostFinGAP = 0 + * Срок страхования insTermFinGAP = 12 мес (100 000 000) и закрыто для редактирования + * + * иначе + * + * Плательщик insuredFinGAP = открыто для редактирования, + * Стоимость за первый период inscostFinGAP = 0 + * Срок страхования insTermFinGAP = Если срок лизинга tbxLeasingPeriod < 13, + * то указываем Срок страхования insTermFinGAP = 12 мес + * и закрываем для редактирования, иначе открыто для редактирования */ reaction( () => { @@ -62,19 +60,21 @@ export default function commonReactions({ store, apolloClient, queryClient }: Re .setValue('insTerm', 100_000_000) .block('insured') .block('insTerm'); - } else { - $tables.insurance - .row('fingap') - .setValue('insured', 100_000_000) - .setValue('insCost', 0) - .setValue('insTerm', leasingPeriod < 13 ? 100_000_000 : null) - .unblock('insured'); - if (leasingPeriod < 13) { - $tables.insurance.row('fingap').block('insTerm'); - } else { - $tables.insurance.row('fingap').unblock('insTerm'); - } + return; + } + + $tables.insurance + .row('fingap') + .setValue('insured', 100_000_000) + .setValue('insCost', 0) + .setValue('insTerm', leasingPeriod < 13 ? 100_000_000 : null) + .unblock('insured'); + + if (leasingPeriod < 13) { + $tables.insurance.row('fingap').block('insTerm'); + } else { + $tables.insurance.row('fingap').unblock('insTerm'); } }, { @@ -123,12 +123,12 @@ export default function commonReactions({ store, apolloClient, queryClient }: Re const leasingPeriod = $calculation.element('tbxLeasingPeriod').getValue(); return { - finGAPInsuranceCompany, - paymentsValues, - plPriceRub, discountRub, + finGAPInsuranceCompany, firstPaymentRub, leasingPeriod, + paymentsValues, + plPriceRub, }; }, async ({ @@ -154,16 +154,18 @@ export default function commonReactions({ store, apolloClient, queryClient }: Re }); const risks = evo_addproduct_types?.map( - // prettier-ignore - (evo_addproduct_type) => ({ + (evo_addproduct_type) => + ({ + calcType: evo_addproduct_type?.evo_type_calc_cerebellum, key: evo_addproduct_type?.evo_addproduct_typeid, + keys: evo_addproduct_type?.evo_addproduct_types?.map( + (addproduct_type) => addproduct_type?.evo_addproduct_typeid + ), + premium: 0, + premiumPerc: evo_addproduct_type?.evo_cost_service_provider_withoutnds, riskId: evo_addproduct_type?.evo_addproduct_typeid, riskName: evo_addproduct_type?.evo_name, - calcType: evo_addproduct_type?.evo_type_calc_cerebellum, - premiumPerc: evo_addproduct_type?.evo_cost_service_provider_withoutnds, sum: 0, - premium: 0, - keys: evo_addproduct_type?.evo_addproduct_types?.map((k) => k?.evo_addproduct_typeid), } as Risk) ); @@ -178,15 +180,16 @@ export default function commonReactions({ store, apolloClient, queryClient }: Re percentPayment: payment, })), values: { - plPrice: plPriceRub, discount: discountRub, firstPayment: firstPaymentRub, leasingPeriod, + plPrice: plPriceRub, premiumPerc: risk.premiumPerc || 0, }, }; } + // eslint-disable-next-line unicorn/consistent-function-scoping function makeRequestGetFinGAP(request: RequestFinGAP) { const queryCalculateFinGAP = (context: QueryFunctionContext) => calculateFinGAP(request, context); @@ -207,8 +210,8 @@ export default function commonReactions({ store, apolloClient, queryClient }: Re ).then((results) => { const newRisks = risks.map((risk, i) => ({ ...risk, - sum: results.at(i)?.sum || 0, premium: results.at(i)?.premium || 0, + sum: results.at(i)?.sum || 0, })); $tables.fingap.setRisks(newRisks); @@ -216,8 +219,8 @@ export default function commonReactions({ store, apolloClient, queryClient }: Re }, { // Important: delay prohibits multiple reaction invocation - equals: comparer.structural, delay: 100, + equals: comparer.structural, } ); } diff --git a/apps/web/process/fingap/reactions/validation.ts b/apps/web/process/fingap/reactions/validation.ts index aa0675e..cd160d8 100644 --- a/apps/web/process/fingap/reactions/validation.ts +++ b/apps/web/process/fingap/reactions/validation.ts @@ -1,5 +1,5 @@ +import type { ReactionsContext } from '@/process/types'; import { reaction } from 'mobx'; -import type { ReactionsContext } from 'process/types'; export default function validationReactions({ store }: ReactionsContext) { const { $tables } = store; @@ -10,8 +10,8 @@ export default function validationReactions({ store }: ReactionsContext) { const finGAPInsuranceCompany = $tables.insurance.row('fingap').getValue('insuranceCompany'); return { - hasPaymentsErrors, finGAPInsuranceCompany, + hasPaymentsErrors, }; }, ({ hasPaymentsErrors, finGAPInsuranceCompany }) => { diff --git a/apps/web/process/init/get-data/get-insurance-data.js b/apps/web/process/init/get-data/get-insurance-data.js index b5a4a12..7320528 100644 --- a/apps/web/process/init/get-data/get-insurance-data.js +++ b/apps/web/process/init/get-data/get-insurance-data.js @@ -1,7 +1,7 @@ -/* eslint-disable import/prefer-default-export */ +/* eslint-disable canonical/sort-keys */ +import { useStore } from '@/stores/hooks'; import { gql, useApolloClient } from '@apollo/client'; import { useEffect } from 'react'; -import { useStore } from 'stores/hooks'; const QUERY_GET_INSURANCE_DATA = gql` query GetInsuranceData($evo_account_type: [Int!]) { @@ -33,8 +33,12 @@ const QUERY_GET_INSURANCE_DATA = gql` } } `; - -function getInsuranceData(query, handleOnCompleted) { +/** + * + * @param {import('@apollo/client').ApolloClient} apolloClient + * @param {*} onCompleted + */ +function getInsuranceData({ query }, onCompleted) { query({ query: QUERY_GET_INSURANCE_DATA, }).then(({ data }) => { @@ -50,13 +54,13 @@ function getInsuranceData(query, handleOnCompleted) { }, }; - handleOnCompleted(insurance); + onCompleted(insurance); }); } export function useInsuranceData() { const { $tables } = useStore(); - const { query } = useApolloClient(); + const apolloClient = useApolloClient(); function handleOnCompleted(options) { Object.keys(options).forEach((key) => { @@ -70,6 +74,6 @@ export function useInsuranceData() { } useEffect(() => { - getInsuranceData(query, handleOnCompleted); + getInsuranceData(apolloClient, handleOnCompleted); }, []); } diff --git a/apps/web/process/init/get-data/get-main-data.js b/apps/web/process/init/get-data/get-main-data.js index f6c346a..4241708 100644 --- a/apps/web/process/init/get-data/get-main-data.js +++ b/apps/web/process/init/get-data/get-main-data.js @@ -1,10 +1,10 @@ -/* eslint-disable import/prefer-default-export */ +/* eslint-disable canonical/sort-keys */ +import * as CRMTypes from '@/graphql/crm.types'; +import { useStore } from '@/stores/hooks'; import { gql, useApolloClient } from '@apollo/client'; import dayjs from 'dayjs'; import utc from 'dayjs/plugin/utc'; -import * as CRMTypes from 'graphql/crm.types'; import { useEffect } from 'react'; -import { useStore } from 'stores/hooks'; import { normalizeOptions } from 'tools'; dayjs.extend(utc); @@ -28,10 +28,10 @@ const currentDate = dayjs().utc(false).toISOString(); /** * - * @param {import('@apollo/client').ApolloClient['query']} query + * @param {import('@apollo/client').ApolloClient} apolloClient * @param {*} onCompleted */ -function getMainData(query, onCompleted) { +function getMainData({ query }, onCompleted) { query({ query: CRMTypes.GetTransactionCurrenciesDocument, variables: { @@ -189,7 +189,7 @@ function getMainData(query, onCompleted) { export function useMainData() { const { $calculation } = useStore(); - const { query } = useApolloClient(); + const apolloClient = useApolloClient(); function handleOnCompleted(options) { Object.keys(options).forEach((elementName) => { @@ -199,6 +199,6 @@ export function useMainData() { } useEffect(() => { - getMainData(query, handleOnCompleted); + getMainData(apolloClient, handleOnCompleted); }, []); } diff --git a/apps/web/process/init/get-data/get-owner-data.ts b/apps/web/process/init/get-data/get-owner-data.ts index 90ec863..fcb3ba4 100644 --- a/apps/web/process/init/get-data/get-owner-data.ts +++ b/apps/web/process/init/get-data/get-owner-data.ts @@ -1,10 +1,8 @@ -/* eslint-disable import/prefer-default-export */ +import type { User } from '@/api/user/types'; +import type { GetOwnerDataQuery, GetOwnerDataQueryVariables } from '@/graphql/crm.types'; import type { ApolloClient } from '@apollo/client'; import { gql } from '@apollo/client'; -import type { User } from 'api/user/types'; -import type { GetOwnerDataQuery, GetOwnerDataQueryVariables } from 'graphql/crm.types'; - const QUERY_GET_OWNER_DATA = gql` query GetOwnerData($domainname: String) { selectLead: leads(owner_domainname: $domainname) { diff --git a/apps/web/process/init/inject-reactions/default.js b/apps/web/process/init/inject-reactions/default.js index dcdf9b6..85bc5ba 100644 --- a/apps/web/process/init/inject-reactions/default.js +++ b/apps/web/process/init/inject-reactions/default.js @@ -1,4 +1,3 @@ -import loadKpReactions from 'process/load-kp/reactions'; import * as calculateReactions from '../../calculate/reactions'; import * as configurator from '../../configurator/reactions'; import * as fingapReactions from '../../fingap/reactions'; @@ -12,6 +11,7 @@ import * as agentsReactions from '../../supplier-agent/reactions/agents'; import leasebackReactions from '../../supplier-agent/reactions/leaseback'; import * as supplierReactions from '../../supplier-agent/reactions/supplier'; import setInitialValuesReactions from '../set-values/reactions'; +import loadKpReactions from '@/process/load-kp/reactions'; export default function injectDefaultReactions(context) { leadOpportunityReactions.common(context); diff --git a/apps/web/process/init/inject-reactions/hooks.js b/apps/web/process/init/inject-reactions/hooks.js index f0c538e..f9edc69 100644 --- a/apps/web/process/init/inject-reactions/hooks.js +++ b/apps/web/process/init/inject-reactions/hooks.js @@ -1,9 +1,8 @@ -/* eslint-disable import/prefer-default-export */ +import injectDefaultReactions from './default'; +import { useStore } from '@/stores/hooks'; +import { trpcPureClient } from '@/trpc/client'; import { useApolloClient } from '@apollo/client'; import { useQueryClient } from '@tanstack/react-query'; -import { useStore } from 'stores/hooks'; -import { trpcPureClient } from 'trpc/client'; -import injectDefaultReactions from './default'; export function useReactions() { const store = useStore(); @@ -11,9 +10,9 @@ export function useReactions() { const queryClient = useQueryClient(); injectDefaultReactions({ - store, apolloClient, queryClient, + store, trpcClient: trpcPureClient, }); } diff --git a/apps/web/process/init/set-values/reactions.ts b/apps/web/process/init/set-values/reactions.ts index e7a61cb..17d700f 100644 --- a/apps/web/process/init/set-values/reactions.ts +++ b/apps/web/process/init/set-values/reactions.ts @@ -1,7 +1,7 @@ /* eslint-disable @typescript-eslint/naming-convention */ -import { GetTransactionCurrenciesDocument } from 'graphql/crm.types'; +import { GetTransactionCurrenciesDocument } from '@/graphql/crm.types'; +import type { ReactionsContext } from '@/process/types'; import { when } from 'mobx'; -import type { ReactionsContext } from 'process/types'; export default function setInitialValuesReactions({ store, apolloClient }: ReactionsContext) { const { $calculation } = store; diff --git a/apps/web/process/lead-opportunity/reactions/common.ts b/apps/web/process/lead-opportunity/reactions/common.ts index 410a898..8308e76 100644 --- a/apps/web/process/lead-opportunity/reactions/common.ts +++ b/apps/web/process/lead-opportunity/reactions/common.ts @@ -1,7 +1,6 @@ -/* eslint-disable implicit-arrow-linebreak */ -import * as CRMTypes from 'graphql/crm.types'; +import * as CRMTypes from '@/graphql/crm.types'; +import type { ReactionsContext } from '@/process/types'; import { reaction } from 'mobx'; -import type { ReactionsContext } from 'process/types'; import { normalizeOptions } from 'tools/entity'; import { makeDisposable } from 'tools/mobx'; @@ -86,9 +85,9 @@ export default function commonReactions({ store, apolloClient }: ReactionsContex /** * Если lead содержит данные, - То в quote подгружается список Предложений CRM (сущность quote), - у которых в поле Интерес (quote.evo_leadid) записана ссылка на выбранный интерес. - Иначе очищать поле калькулятора quote. + * То в quote подгружается список Предложений CRM (сущность quote), + * у которых в поле Интерес (quote.evo_leadid) записана ссылка на выбранный интерес. + * Иначе очищать поле калькулятора quote. */ reaction( @@ -98,11 +97,11 @@ export default function commonReactions({ store, apolloClient }: ReactionsContex const { data: { quotes }, } = await apolloClient.query({ + fetchPolicy: 'network-only', query: CRMTypes.GetQuotesDocument, variables: { leadid, }, - fetchPolicy: 'network-only', }); $calculation.element('selectQuote').setOptions(normalizeOptions(quotes)); diff --git a/apps/web/process/lead-opportunity/reactions/index.js b/apps/web/process/lead-opportunity/reactions/index.js index 179f518..8595b30 100644 --- a/apps/web/process/lead-opportunity/reactions/index.js +++ b/apps/web/process/lead-opportunity/reactions/index.js @@ -1,3 +1,2 @@ -/* eslint-disable import/prefer-default-export */ export { default as common } from './common'; export { default as urls } from './urls'; diff --git a/apps/web/process/lead-opportunity/reactions/urls.ts b/apps/web/process/lead-opportunity/reactions/urls.ts index 694c974..228183c 100644 --- a/apps/web/process/lead-opportunity/reactions/urls.ts +++ b/apps/web/process/lead-opportunity/reactions/urls.ts @@ -1,8 +1,9 @@ +/* eslint-disable no-negated-condition */ +import type { Elements } from '@/Components/Calculation/config/map/values'; +import type { ReactionsContext } from '@/process/types'; import type { DocumentNode } from '@apollo/client'; import { gql } from '@apollo/client'; -import type { Elements } from 'Components/Calculation/config/map/values'; import { reaction } from 'mobx'; -import type { ReactionsContext } from 'process/types'; export default function urlsReactions({ store, apolloClient }: ReactionsContext) { const { $calculation } = store; diff --git a/apps/web/process/leasing-object/get-kp-data.ts b/apps/web/process/leasing-object/get-kp-data.ts index 6932c72..e16ca30 100644 --- a/apps/web/process/leasing-object/get-kp-data.ts +++ b/apps/web/process/leasing-object/get-kp-data.ts @@ -1,8 +1,8 @@ /* eslint-disable @typescript-eslint/naming-convention */ -import { gql } from '@apollo/client'; -import initializeApollo from 'apollo/client'; -import type * as CRMTypes from 'graphql/crm.types'; import type { GetQuoteDataInput, GetQuoteDataOutput } from '../load-kp/types'; +import initializeApollo from '@/apollo/client'; +import type * as CRMTypes from '@/graphql/crm.types'; +import { gql } from '@apollo/client'; const QUERY_GET_LEASING_OBJECT_DATA_FROM_QUOTE = gql` query GetLeasingObjectDataFromQuote($quoteId: Uuid!) { @@ -47,9 +47,9 @@ export default async function getLeasingObjectDataFromKP({ return { values: { brand: evo_brandid, - model: evo_modelid, configuration: evo_equipmentid, leaseObjectType: evo_leasingobject_typeid, + model: evo_modelid, }, }; } diff --git a/apps/web/process/leasing-object/reactions/common.ts b/apps/web/process/leasing-object/reactions/common.ts index 489ab26..0a20f97 100644 --- a/apps/web/process/leasing-object/reactions/common.ts +++ b/apps/web/process/leasing-object/reactions/common.ts @@ -1,7 +1,7 @@ /* eslint-disable @typescript-eslint/naming-convention */ -import * as CRMTypes from 'graphql/crm.types'; +import * as CRMTypes from '@/graphql/crm.types'; +import type { ReactionsContext } from '@/process/types'; import { reaction } from 'mobx'; -import type { ReactionsContext } from 'process/types'; import { intersects } from 'radash'; import { normalizeOptions } from 'tools'; @@ -14,11 +14,12 @@ export default function commonReactions({ store, apolloClient }: ReactionsContex return { brandId: brand, - subsidyId: subsidy, importProgramId: importProgram, leaseObjectTypeId: leaseObjectType, + subsidyId: subsidy, }; }, + // eslint-disable-next-line sonarjs/cognitive-complexity async ({ brandId, subsidyId, importProgramId, leaseObjectTypeId }) => { if (!brandId) { $calculation.element('selectModel').reset(); @@ -125,12 +126,13 @@ export default function commonReactions({ store, apolloClient }: ReactionsContex const { product, subsidy, importProgram, leaseObjectType } = $calculation.$values.values; return { - productId: product, - subsidyId: subsidy, importProgramId: importProgram, leaseObjectTypeId: leaseObjectType, + productId: product, + subsidyId: subsidy, }; }, + // eslint-disable-next-line sonarjs/cognitive-complexity async ({ productId, subsidyId, importProgramId, leaseObjectTypeId }) => { const { data: { evo_brands }, @@ -156,18 +158,13 @@ export default function commonReactions({ store, apolloClient }: ReactionsContex }, }); - brands = brands?.filter((brand) => { - if ( + brands = brands?.filter( + (brand) => !evo_baseproduct?.evo_brands?.length || evo_baseproduct.evo_brands.filter( (baseproduct_evo_brand) => baseproduct_evo_brand?.evo_brandid === brand?.evo_brandid )?.length - ) { - return true; - } - - return false; - }); + ); } if (leaseObjectTypeId) { @@ -180,20 +177,15 @@ export default function commonReactions({ store, apolloClient }: ReactionsContex }, }); - brands = brands?.filter((brand) => { - if ( + brands = brands?.filter( + (brand) => brand?.evo_vehicle_type?.length && leaseObjectType?.evo_vehicle_type && intersects( brand.evo_vehicle_type?.filter((x) => x > 0), leaseObjectType?.evo_vehicle_type ) - ) { - return true; - } - - return false; - }); + ); } if (subsidyId) { @@ -206,18 +198,13 @@ export default function commonReactions({ store, apolloClient }: ReactionsContex }, }); - brands = brands?.filter((brand) => { - if ( + brands = brands?.filter( + (brand) => !subsidy?.evo_brands?.length || subsidy?.evo_brands?.filter( (subsidy_evo_brand) => subsidy_evo_brand?.evo_brandid === brand?.evo_brandid )?.length - ) { - return true; - } - - return false; - }); + ); } if (importProgramId) { @@ -230,19 +217,14 @@ export default function commonReactions({ store, apolloClient }: ReactionsContex }, }); - brands = brands?.filter((brand) => { - if ( + brands = brands?.filter( + (brand) => !importProgram?.evo_brands?.length || importProgram?.evo_brands?.filter( (importProgram_evo_brand) => importProgram_evo_brand?.evo_brandid === brand?.evo_brandid )?.length - ) { - return true; - } - - return false; - }); + ); } $calculation.element('selectBrand').setOptions(normalizeOptions(brands)); diff --git a/apps/web/process/leasing-object/reactions/index.js b/apps/web/process/leasing-object/reactions/index.js index cdd6b5e..cc8d68a 100644 --- a/apps/web/process/leasing-object/reactions/index.js +++ b/apps/web/process/leasing-object/reactions/index.js @@ -1,3 +1,2 @@ -/* eslint-disable import/prefer-default-export */ export { default as common } from './common'; export { default as validation } from './validation'; diff --git a/apps/web/process/leasing-object/reactions/validation.ts b/apps/web/process/leasing-object/reactions/validation.ts index 6619122..1178640 100644 --- a/apps/web/process/leasing-object/reactions/validation.ts +++ b/apps/web/process/leasing-object/reactions/validation.ts @@ -1,15 +1,13 @@ +import type { ReactionsContext } from '@/process/types'; import { autorun } from 'mobx'; -import type { ReactionsContext } from 'process/types'; export default function validationReactions({ store }: ReactionsContext) { const { $calculation } = store; - /* eslint-disable max-len */ /** * Если model содержит данные и по связи Модель-Комплектация в CRM у данной модели есть связанные активные записи Комплектаций, * то configuration становится обязательным для заполнения, иначе configuration не обязателен для заполнения */ - /* eslint-enable */ autorun( () => { const selectConfiguration = $calculation.element('selectConfiguration'); diff --git a/apps/web/process/leasing-without-kasko/reactions/common.ts b/apps/web/process/leasing-without-kasko/reactions/common.ts index d69b624..c81842d 100644 --- a/apps/web/process/leasing-without-kasko/reactions/common.ts +++ b/apps/web/process/leasing-without-kasko/reactions/common.ts @@ -1,10 +1,11 @@ +/* eslint-disable canonical/sort-keys */ /* eslint-disable @typescript-eslint/naming-convention */ +import type * as CRMTypes from '@/graphql/crm.types'; +import type { ReactionsContext } from '@/process/types'; import { gql } from '@apollo/client'; import dayjs from 'dayjs'; import utc from 'dayjs/plugin/utc'; -import type * as CRMTypes from 'graphql/crm.types'; import { autorun, reaction } from 'mobx'; -import type { ReactionsContext } from 'process/types'; import { uid } from 'radash'; import { normalizeOptions } from 'tools'; import notification from 'ui/elements/notification'; @@ -41,7 +42,7 @@ const QUERY_GET_LEASING_WITHOUT_KASKO_OPTIONS = gql` } `; -export default function commonReactions({ store, apolloClient, queryClient }: ReactionsContext) { +export default function commonReactions({ store, apolloClient }: ReactionsContext) { const { $calculation, $tables } = store; reaction( @@ -57,12 +58,10 @@ export default function commonReactions({ store, apolloClient, queryClient }: Re } ); - /* eslint-disable max-len */ /** * если "Лизинг без КАСКО" (SelectLeasingWithoutKasko) содержит данные, * то в таблице страхования в строке ФинГАП: Страховая компания insCompany = null и закрыть для редактирования */ - /* eslint-enable */ reaction( () => $calculation.element('selectLeasingWithoutKasko').getValue(), (leasingWithoutKasko) => { diff --git a/apps/web/process/leasing-without-kasko/reactions/index.js b/apps/web/process/leasing-without-kasko/reactions/index.js index 1e2e8e6..c8077ba 100644 --- a/apps/web/process/leasing-without-kasko/reactions/index.js +++ b/apps/web/process/leasing-without-kasko/reactions/index.js @@ -1,2 +1 @@ -/* eslint-disable import/prefer-default-export */ export { default as common } from './common'; diff --git a/apps/web/process/load-kp/reactions.ts b/apps/web/process/load-kp/reactions.ts index 83904cc..0ba3630 100644 --- a/apps/web/process/load-kp/reactions.ts +++ b/apps/web/process/load-kp/reactions.ts @@ -1,7 +1,7 @@ +import type { ReactionsContext } from '@/process/types'; +import extend from '@/stores/tables/insurance/tools'; import { reaction } from 'mobx'; -import type { ReactionsContext } from 'process/types'; import { pick } from 'radash'; -import extend from 'stores/tables/insurance/tools'; import message from 'ui/elements/message'; const key = 'KP_LOADING_INFO'; @@ -19,8 +19,8 @@ export default function loadKpReactions({ store, trpcClient }: ReactionsContext) const quoteName = $calculation.element('selectQuote').getOption()?.label; message.loading({ - key, content: `Загружаем КП ${quoteName}...`, + key, }); const { recalcWithRevision } = $calculation.$values.values; @@ -64,14 +64,14 @@ export default function loadKpReactions({ store, trpcClient }: ReactionsContext) if (fingap) $tables.fingap.setSelectedKeys(fingap.keys); message.success({ - key, content: `КП ${quoteName} загружено`, + key, }); }) .catch(() => { message.error({ - key, content: `Ошибка во время загрузки КП ${quoteName}`, + key, }); }) .finally(() => { diff --git a/apps/web/process/load-kp/types.ts b/apps/web/process/load-kp/types.ts index 4f9778c..747d75f 100644 --- a/apps/web/process/load-kp/types.ts +++ b/apps/web/process/load-kp/types.ts @@ -1,32 +1,34 @@ -import { RiskSchema } from 'config/schema/fingap'; -import { KeysSchema, RowSchema } from 'config/schema/insurance'; -import PaymentsSchema from 'config/schema/payments'; -import ValuesSchema from 'config/schema/values'; +/* eslint-disable zod/require-strict */ +import { RiskSchema } from '@/config/schema/fingap'; +import { KeysSchema, RowSchema } from '@/config/schema/insurance'; +import PaymentsSchema from '@/config/schema/payments'; +import ValuesSchema from '@/config/schema/values'; import { z } from 'zod'; const { quote, recalcWithRevision } = ValuesSchema.shape; -export const GetQuoteDataInputSchema = z.object({ - values: z - .object({ - quote: quote.unwrap(), - recalcWithRevision, - }) - .required(), +const InputValuesSchema = z.object({ + quote: quote.unwrap(), + recalcWithRevision, }); +export const GetQuoteDataInputSchema = z + .object({ + values: InputValuesSchema.required(), + }) + .strict(); export type GetQuoteDataInput = z.infer; -export const GetQuoteDataOutputSchema = z.object({ - values: ValuesSchema, - payments: PaymentsSchema, - insurance: z - .object({ - values: z.record(KeysSchema, RowSchema), - }) - .required(), - fingap: z - .object({ - keys: z.array(RiskSchema.shape.key), - }) - .optional(), +const FinGAPSchema = z.object({ + keys: z.array(RiskSchema.shape.key), }); +const InsuranceSchema = z.object({ + values: z.record(KeysSchema, RowSchema), +}); +export const GetQuoteDataOutputSchema = z + .object({ + fingap: FinGAPSchema.optional(), + insurance: InsuranceSchema.required(), + payments: PaymentsSchema, + values: ValuesSchema, + }) + .strict(); export type GetQuoteDataOutput = z.infer; diff --git a/apps/web/process/payments/get-kp-data.ts b/apps/web/process/payments/get-kp-data.ts index d2b4330..fe630f2 100644 --- a/apps/web/process/payments/get-kp-data.ts +++ b/apps/web/process/payments/get-kp-data.ts @@ -1,9 +1,8 @@ -/* eslint-disable @typescript-eslint/naming-convention */ -import { gql } from '@apollo/client'; -import initializeApollo from 'apollo/client'; -import type * as CRMTypes from 'graphql/crm.types'; -import { sort } from 'radash'; import type { GetQuoteDataInput, GetQuoteDataOutput } from '../load-kp/types'; +import initializeApollo from '@/apollo/client'; +import type * as CRMTypes from '@/graphql/crm.types'; +import { gql } from '@apollo/client'; +import { sort } from 'radash'; const QUERY_GET_PAYMENTS_DATA_FROM_QUOTE = gql` query GetPaymentsDataFromQuote($quoteId: Uuid!) { @@ -28,8 +27,8 @@ const QUERY_GET_PAYMENTS_DATA_FROM_QUOTE = gql` `; type QuotePaymentsProcessData = { - values: Partial; payments: GetQuoteDataOutput['payments']; + values: Partial; }; export default async function getPaymentsDataFromKP({ @@ -53,7 +52,7 @@ export default async function getPaymentsDataFromKP({ ? Math.min(quote?.evo_period ?? 0, quote?.evo_accept_period ?? 0) : quote?.evo_period ?? 0; - let paymentsValues: Array = []; + let paymentsValues: number[] = []; if (quote?.evo_graphs) { paymentsValues = sort(quote?.evo_graphs, (evo_graph) => Date.parse(evo_graph?.createdon ?? '0')) @@ -64,15 +63,6 @@ export default async function getPaymentsDataFromKP({ } return { - values: { - leasingPeriod, - graphType: quote?.evo_graph_type ?? undefined, - parmentsDecreasePercent: quote?.evo_payments_decrease_perc || 0, - highSeasonStart: quote?.evo_high_season, - seasonType: quote?.evo_seasons_type, - firstPaymentPerc: quote?.evo_first_payment_perc || 0, - lastPaymentPerc: quote?.evo_last_payment_perc || 0, - }, payments: { values: [ quote?.evo_first_payment_perc || 0, @@ -80,5 +70,14 @@ export default async function getPaymentsDataFromKP({ quote?.evo_last_payment_perc || 0, ], }, + values: { + firstPaymentPerc: quote?.evo_first_payment_perc || 0, + graphType: quote?.evo_graph_type ?? undefined, + highSeasonStart: quote?.evo_high_season, + lastPaymentPerc: quote?.evo_last_payment_perc || 0, + leasingPeriod, + parmentsDecreasePercent: quote?.evo_payments_decrease_perc || 0, + seasonType: quote?.evo_seasons_type, + }, }; } diff --git a/apps/web/process/payments/lib/seasons-constants.ts b/apps/web/process/payments/lib/seasons-constants.ts index ea54f9c..31914bd 100644 --- a/apps/web/process/payments/lib/seasons-constants.ts +++ b/apps/web/process/payments/lib/seasons-constants.ts @@ -1,10 +1,10 @@ -export const SEASONS_PERIODS: Record> = { +export const SEASONS_PERIODS: Record = { 100_000_000: [0, 6], 100_000_001: [0, 8], 100_000_002: [0, 4, 8], }; -export const FORBIDDEN_HIGH_SEASON_START: Record> = { +export const FORBIDDEN_HIGH_SEASON_START: Record = { 100_000_000: ['9', '10'], 100_000_001: ['7', '8', '9'], 100_000_002: ['11'], diff --git a/apps/web/process/payments/lib/seasons-tools.ts b/apps/web/process/payments/lib/seasons-tools.ts index b6c51fc..80fc07d 100644 --- a/apps/web/process/payments/lib/seasons-tools.ts +++ b/apps/web/process/payments/lib/seasons-tools.ts @@ -1,7 +1,6 @@ -/* eslint-disable implicit-arrow-linebreak */ -import type { CalculationValues } from 'stores/calculation/values/types'; -import type { Row } from 'stores/tables/payments/types'; -import { SEASONS_PERIODS, SEASONS_PERIOD_NUMBER } from './seasons-constants'; +import { SEASONS_PERIOD_NUMBER, SEASONS_PERIODS } from './seasons-constants'; +import type { CalculationValues } from '@/stores/calculation/values/types'; +import type { Row } from '@/stores/tables/payments/types'; type SeasonType = NonNullable; type LeasingPeriod = CalculationValues['leasingPeriod']; @@ -18,14 +17,14 @@ export function getPositionIndex(seasonType: SeasonType, seasonsIndex: number) { return positionIndex; } -export function getSeasonsValues(seasonType: SeasonType, seasons: Array) { +export function getSeasonsValues(seasonType: SeasonType, seasons: number[]) { return SEASONS_PERIODS[seasonType].map((index) => seasons[index]); } -export function generateSeasons(seasonType: SeasonType, values: Array) { +export function generateSeasons(seasonType: SeasonType, values: number[]) { const positions = SEASONS_PERIODS[seasonType]; - const seasons: Array = []; + const seasons: number[] = []; [...positions, SEASONS_PERIOD_NUMBER].forEach((position, i, arr) => { if (position < SEASONS_PERIOD_NUMBER) { @@ -41,18 +40,15 @@ export function generateSeasons(seasonType: SeasonType, values: Array) { return seasons; } -export function generateSeasonsPayments(leasingPeriod: LeasingPeriod, seasons: Array) { - return ( - Array.from( - { - length: Math.floor((leasingPeriod - 2) / SEASONS_PERIOD_NUMBER), - }, - () => seasons - ) - .flat() - // eslint-disable-next-line unicorn/prefer-spread - .concat(seasons.slice(0, (leasingPeriod - 2) % SEASONS_PERIOD_NUMBER)) - ); +export function generateSeasonsPayments(leasingPeriod: LeasingPeriod, seasons: number[]) { + return Array.from( + { + length: Math.floor((leasingPeriod - 2) / SEASONS_PERIOD_NUMBER), + }, + () => seasons + ) + .flat() + .concat(seasons.slice(0, (leasingPeriod - 2) % SEASONS_PERIOD_NUMBER)); } export function generateSeasonPaymentsRows( @@ -64,8 +60,8 @@ export function generateSeasonPaymentsRows( SEASONS_PERIODS[seasonType].map((position) => (position + shiftNumber) % SEASONS_PERIOD_NUMBER) ); const rows: Row[] = payments.map((value, i) => ({ - value, status: shiftedPeriods.has(i) ? 'Default' : 'Disabled', + value, })); return rows; diff --git a/apps/web/process/payments/reactions.ts b/apps/web/process/payments/reactions.ts index 534b3bf..da009ca 100644 --- a/apps/web/process/payments/reactions.ts +++ b/apps/web/process/payments/reactions.ts @@ -1,16 +1,14 @@ -/* eslint-disable function-paren-newline */ -/* eslint-disable implicit-arrow-linebreak */ -import { selectHighSeasonStart } from 'config/default-options'; -import { comparer, reaction, toJS } from 'mobx'; -import type { ReactionsContext } from 'process/types'; -import { shift } from 'radash'; -import type { Row } from 'stores/tables/payments/types'; -import ValidationHelper from 'stores/validation/helper'; -import { difference } from 'tools/array'; -import { makeDisposable } from 'tools/mobx'; import * as seasonsConstants from './lib/seasons-constants'; import * as seasonsTools from './lib/seasons-tools'; import validatePaymentsTable from './validation'; +import { selectHighSeasonStart } from '@/config/default-options'; +import type { ReactionsContext } from '@/process/types'; +import type { Row } from '@/stores/tables/payments/types'; +import ValidationHelper from '@/stores/validation/helper'; +import { comparer, reaction, toJS } from 'mobx'; +import { shift } from 'radash'; +import { difference } from 'tools/array'; +import { makeDisposable } from 'tools/mobx'; const { generateSeasonPaymentsRows, @@ -20,13 +18,8 @@ const { getSeasonsValues, } = seasonsTools; -const { - DEFAULT_SEASONS_VALUES, - FORBIDDEN_HIGH_SEASON_START, - SEASONS_PERIODS, - SEASONS_PERIOD_NUMBER, - SEASON_TYPES, -} = seasonsConstants; +const { DEFAULT_SEASONS_VALUES, FORBIDDEN_HIGH_SEASON_START, SEASONS_PERIOD_NUMBER } = + seasonsConstants; export default function paymentsReactions({ store }: ReactionsContext) { const { $calculation, $tables, $process } = store; @@ -66,8 +59,8 @@ export default function paymentsReactions({ store }: ReactionsContext) { length: leasingPeriod - 2, }, () => ({ - value: 100, status: 'Disabled', + value: 100, }) ); @@ -76,13 +69,13 @@ export default function paymentsReactions({ store }: ReactionsContext) { const rows: Row[] = [ { - value: firstPaymentPerc, status: 'Disabled', + value: firstPaymentPerc, }, ...middlePayments, { - value: lastPaymentPerc, status: 'Disabled', + value: lastPaymentPerc, }, ]; @@ -124,8 +117,8 @@ export default function paymentsReactions({ store }: ReactionsContext) { const payment = 100 * (parmentsDecreasePercent / 100) ** k; return { - value: Number(payment.toFixed(2)), status: 'Disabled', + value: Number(payment.toFixed(2)), }; } ); @@ -135,13 +128,13 @@ export default function paymentsReactions({ store }: ReactionsContext) { const rows: Row[] = [ { - value: firstPaymentPerc, status: 'Disabled', + value: firstPaymentPerc, }, ...middlePayments, { - value: lastPaymentPerc, status: 'Disabled', + value: lastPaymentPerc, }, ]; @@ -172,16 +165,16 @@ export default function paymentsReactions({ store }: ReactionsContext) { if (graphType === 100_000_004) { const editablePayments: Row[] = [ { + status: 'Default', value: 25, - status: 'Default', }, { + status: 'Default', value: 50, - status: 'Default', }, { - value: 75, status: 'Default', + value: 75, }, ]; @@ -190,8 +183,8 @@ export default function paymentsReactions({ store }: ReactionsContext) { length: leasingPeriod - 5, }, () => ({ - value: 100, status: 'Disabled', + value: 100, }) ); @@ -200,14 +193,14 @@ export default function paymentsReactions({ store }: ReactionsContext) { const rows: Row[] = [ { - value: firstPaymentPerc, status: 'Disabled', + value: firstPaymentPerc, }, ...editablePayments, ...payments, { - value: lastPaymentPerc, status: 'Disabled', + value: lastPaymentPerc, }, ]; @@ -251,7 +244,7 @@ export default function paymentsReactions({ store }: ReactionsContext) { // } // ); - const degressionSteps: { [key: number]: Array } = { + const degressionSteps: { [key: number]: number[] } = { 100_000_003: [100, 50, 25], 100_000_004: [100, 30, 10], 100_000_005: [100, 70, 40], @@ -266,8 +259,8 @@ export default function paymentsReactions({ store }: ReactionsContext) { return { degressionType, - leasingPeriod, graphType, + leasingPeriod, }; }, ({ degressionType, leasingPeriod, graphType }) => { @@ -281,15 +274,15 @@ export default function paymentsReactions({ store }: ReactionsContext) { length: leasingPeriod - 3, }, () => ({ - value: 100, status: 'Default', + value: 100, }) ); middlePayments = [ { - value: 100, status: 'Disabled', + value: 100, }, ...editablePayments, ]; @@ -319,8 +312,8 @@ export default function paymentsReactions({ store }: ReactionsContext) { } return { - value, status: 'Disabled', + value, }; } ); @@ -336,13 +329,13 @@ export default function paymentsReactions({ store }: ReactionsContext) { const rows: Row[] = [ { - value: firstPaymentPerc, status: 'Disabled', + value: firstPaymentPerc, }, ...middlePayments, { - value: lastPaymentPerc, status: 'Disabled', + value: lastPaymentPerc, }, ]; @@ -364,9 +357,9 @@ export default function paymentsReactions({ store }: ReactionsContext) { const degressionType = $calculation.element('selectSeasonType').getValue(); return { + degressionType, graphType, payments, - degressionType, }; }, (nextParams, prevParams) => { @@ -422,11 +415,7 @@ export default function paymentsReactions({ store }: ReactionsContext) { ); reaction( - () => { - const seasonType = $calculation.element('selectSeasonType').getValue(); - - return seasonType; - }, + () => $calculation.element('selectSeasonType').getValue(), (seasonType) => { const graphType = $calculation.element('radioGraphType').getValue(); if (graphType !== 100_000_003) return; @@ -452,9 +441,9 @@ export default function paymentsReactions({ store }: ReactionsContext) { const leasingPeriod = $calculation.element('tbxLeasingPeriod').getValue(); return { - seasonType, highSeasonStartOption, leasingPeriod, + seasonType, }; }, ({ seasonType, highSeasonStartOption, leasingPeriod }) => { @@ -476,13 +465,13 @@ export default function paymentsReactions({ store }: ReactionsContext) { const rows: Row[] = [ { - value: firstPaymentPerc, status: 'Disabled', + value: firstPaymentPerc, }, ...middlePayments, { - value: lastPaymentPerc, status: 'Disabled', + value: lastPaymentPerc, }, ]; @@ -499,9 +488,8 @@ export default function paymentsReactions({ store }: ReactionsContext) { reaction( () => { const payments = toJS($tables.payments.values); - const seasons = payments.slice(1, SEASONS_PERIOD_NUMBER + 1); - return seasons; + return payments.slice(1, SEASONS_PERIOD_NUMBER + 1); }, (nextSeasons, prevSeasons) => { const graphType = $calculation.element('radioGraphType').getValue(); @@ -533,13 +521,13 @@ export default function paymentsReactions({ store }: ReactionsContext) { $tables.payments.setRows([ { - value: firstPaymentPerc, status: 'Disabled', + value: firstPaymentPerc, }, ...rows, { - value: lastPaymentPerc, status: 'Disabled', + value: lastPaymentPerc, }, ]); }, @@ -565,11 +553,11 @@ export default function paymentsReactions({ store }: ReactionsContext) { const leasingPeriod = $calculation.element('tbxLeasingPeriod').getValue(); return { - payments, graphType, - seasonType, highSeasonStart, leasingPeriod, + payments, + seasonType, }; }, () => { diff --git a/apps/web/process/payments/validation.ts b/apps/web/process/payments/validation.ts index 00b2d34..fd0cb9c 100644 --- a/apps/web/process/payments/validation.ts +++ b/apps/web/process/payments/validation.ts @@ -1,10 +1,9 @@ -/* eslint-disable no-case-declarations */ - +import { SEASONS_PERIOD_NUMBER, SEASONS_PERIODS } from './lib/seasons-constants'; +import type RootStore from '@/stores/root'; import { counting, max, min, shift, sort } from 'radash'; -import type RootStore from 'stores/root'; import { areEqual, isSorted } from 'tools/array'; -import { SEASONS_PERIODS, SEASONS_PERIOD_NUMBER } from './lib/seasons-constants'; +// eslint-disable-next-line sonarjs/cognitive-complexity export default function validatePaymentsTable({ $calculation, $tables }: RootStore) { switch ($calculation.element('radioGraphType').getValue()) { // Дегрессия @@ -52,7 +51,6 @@ export default function validatePaymentsTable({ $calculation, $tables }: RootSto } } } - /* eslint-disable max-len */ /** * Если вид графика = Дегрессия И значения в "Соотношении платежей" у 2, 3 и 4 платежа отличаются друг от друга не более чем на 10 * (т.е. берем значения в этих полях, определяем максимальное и минимальное значение и смотрим на их разницу) @@ -60,7 +58,6 @@ export default function validatePaymentsTable({ $calculation, $tables }: RootSto * На 2-4 платежах Соотношение платежа должен отличаться не более чем на 10%", * иначе осуществлять расчет */ - /* eslint-enable */ { const targetPayments = $tables.payments.values.slice(1, 4); @@ -69,14 +66,12 @@ export default function validatePaymentsTable({ $calculation, $tables }: RootSto } } - /* eslint-disable max-len */ /** * Если вид графика = Дегрессия И значения в "Соотношении платежей" для строк с 2 До "Срок лизинга-1" как минимум 2 раза по 2 платежа должны между собой быть равны * (т.е. берем значения "Соотношения платежей" для строк с 2 до "Срок лизинга-1" и делаем сводную таблицу - если кол-во одинаковых значение больше 2 встречаются 2 и более раза), * то осуществлять расчет, * иначе не осуществлять Расчет графика и выводить ошибку "Нельзя осуществить расчет - указана очень жетская дегрессия. Не менее чем у 4х платежей "Соотношение платежа" должно не отличаться между самой", */ - /* eslint-enable */ { const leasingPeriod = $calculation.element('tbxLeasingPeriod').getValue(); const targetPayments = $tables.payments.values.slice(1, leasingPeriod - 1); diff --git a/apps/web/process/price/get-kp-data.ts b/apps/web/process/price/get-kp-data.ts index a9d09f9..b2725dd 100644 --- a/apps/web/process/price/get-kp-data.ts +++ b/apps/web/process/price/get-kp-data.ts @@ -1,8 +1,7 @@ -/* eslint-disable @typescript-eslint/naming-convention */ -import { gql } from '@apollo/client'; -import initializeApollo from 'apollo/client'; -import type * as CRMTypes from 'graphql/crm.types'; import type { GetQuoteDataInput, GetQuoteDataOutput } from '../load-kp/types'; +import initializeApollo from '@/apollo/client'; +import type * as CRMTypes from '@/graphql/crm.types'; +import { gql } from '@apollo/client'; const QUERY_GET_PRICE_DATA_FROM_QUOTE = gql` query GetPriceDataFromQuote($quoteId: Uuid!) { @@ -45,17 +44,17 @@ export default async function getPriceDataFromKP({ return { values: { - leaseObjectPrice: quote?.evo_supplier_currency_price || 0, - leaseObjectPriceWthtVAT: quote?.evo_price_without_nds_supplier_currency || 0, VATInLeaseObjectPrice: quote?.evo_nds_in_price_supplier_currency || 0, - lastPaymentRub: quote?.evo_last_payment_rub || 0, - lastPaymentRule: quote?.evo_last_payment_calc, - supplierCurrency: quote?.evo_transactioncurrencyid, - supplierDiscountRub: quote?.evo_discount_supplier_currency || 0, - supplierDiscountPerc: quote?.evo_discount_perc || 0, comissionPerc: quote?.evo_comission_perc || 0, comissionRub: quote?.evo_comission_rub || 0, + lastPaymentRub: quote?.evo_last_payment_rub || 0, + lastPaymentRule: quote?.evo_last_payment_calc, + leaseObjectPrice: quote?.evo_supplier_currency_price || 0, + leaseObjectPriceWthtVAT: quote?.evo_price_without_nds_supplier_currency || 0, saleBonus: quote?.evo_sale_bonus || 0, + supplierCurrency: quote?.evo_transactioncurrencyid, + supplierDiscountPerc: quote?.evo_discount_perc || 0, + supplierDiscountRub: quote?.evo_discount_supplier_currency || 0, }, }; } diff --git a/apps/web/process/price/reactions/common.ts b/apps/web/process/price/reactions/common.ts index 4de89e7..8be398f 100644 --- a/apps/web/process/price/reactions/common.ts +++ b/apps/web/process/price/reactions/common.ts @@ -1,8 +1,8 @@ -import { MIN_LASTPAYMENT_NSIB } from 'constants/values'; +import { MIN_LASTPAYMENT_NSIB } from '@/constants/values'; +import type { ReactionsContext } from '@/process/types'; import { reaction } from 'mobx'; -import type { ReactionsContext } from 'process/types'; -export default function commonReactions({ store, apolloClient }: ReactionsContext) { +export default function commonReactions({ store }: ReactionsContext) { const { $calculation } = store; reaction( @@ -36,13 +36,13 @@ export default function commonReactions({ store, apolloClient }: ReactionsContex const insNSIB = $calculation.element('selectInsNSIB').getValue(); return { - lastPaymentRub, insNSIB, + lastPaymentRub, }; }, ({ lastPaymentRub, insNSIB }) => { $calculation.element('tbxLastPaymentRub').validate({ - invalid: !!insNSIB && lastPaymentRub < MIN_LASTPAYMENT_NSIB, + invalid: Boolean(insNSIB) && lastPaymentRub < MIN_LASTPAYMENT_NSIB, message: `Последний платеж меньше ${MIN_LASTPAYMENT_NSIB} руб. не может быть при наличии НСИБ, укажите большее значение`, }); } diff --git a/apps/web/process/price/reactions/computed.ts b/apps/web/process/price/reactions/computed.ts index 7452133..6c3cf10 100644 --- a/apps/web/process/price/reactions/computed.ts +++ b/apps/web/process/price/reactions/computed.ts @@ -1,9 +1,9 @@ /* eslint-disable @typescript-eslint/naming-convention */ +import * as CRMTypes from '@/graphql/crm.types'; +import type { ReactionsContext } from '@/process/types'; import dayjs from 'dayjs'; import utc from 'dayjs/plugin/utc'; -import * as CRMTypes from 'graphql/crm.types'; import { autorun } from 'mobx'; -import type { ReactionsContext } from 'process/types'; dayjs.extend(utc); diff --git a/apps/web/process/subsidy/reactions.ts b/apps/web/process/subsidy/reactions.ts index d4d47d7..dc46979 100644 --- a/apps/web/process/subsidy/reactions.ts +++ b/apps/web/process/subsidy/reactions.ts @@ -1,27 +1,25 @@ -/* eslint-disable @typescript-eslint/naming-convention */ -import * as CRMTypes from 'graphql/crm.types'; +import * as CRMTypes from '@/graphql/crm.types'; +import type { ReactionsContext } from '@/process/types'; import { autorun } from 'mobx'; -import type { ReactionsContext } from 'process/types'; -/* eslint-disable max-len */ /** * При изменении "Программа от производителя" selectImportProgram , Стоимости ПЛ tbxLeaseObjectPrice, Валюты selectSupplierCurrency, Скидка от поставщика, в валюте поставщика (tbxSupplierDiscountRub) * необходимо заполнять поле "Скидка от производителя, руб., с НДС" labelImportProgramSum: -если поле selectImportProgram содержит данные, -то -если -поле "Сумма субсидии с НДС" evo_subsidy.evo_subsidy_summ из selectImportProgram > 0, -то указывает данное значение в поле labelImportProgramSum, -иначе: -1)labelImportProgramSum = ( (Стоимость ПЛ tbxLeaseObjectPrice ), переведенные в рубли - Скидка от поставщика, в валюте поставщика (tbxSupplierDiscountRub))* "% субсидии от стоимости ПЛ" evo_subsidy.evo_percent_subsidy из selectImportProgram / 100. -2) Если полученное значение больше значения в поле "Максимальная сумма субсидии с НДС, руб." evo_subsidy.evo_max_subsidy_summ из записи Субсидия в поле selectImportProgram , -то в labelImportProgramSum указываем значение из поля "Максимальная сумма субсидии с НДС, руб." evo_subsidy.evo_max_subsidy_summ , -иначе результат расчета п.1 -иначе 0 -*/ + * если поле selectImportProgram содержит данные, + * то + * если + * поле "Сумма субсидии с НДС" evo_subsidy.evo_subsidy_summ из selectImportProgram > 0, + * то указывает данное значение в поле labelImportProgramSum, + * иначе: + * 1)labelImportProgramSum = ( (Стоимость ПЛ tbxLeaseObjectPrice ), переведенные в рубли - Скидка от поставщика, в валюте поставщика (tbxSupplierDiscountRub))* "% субсидии от стоимости ПЛ" evo_subsidy.evo_percent_subsidy из selectImportProgram / 100. + * 2) Если полученное значение больше значения в поле "Максимальная сумма субсидии с НДС, руб." evo_subsidy.evo_max_subsidy_summ из записи Субсидия в поле selectImportProgram , + * то в labelImportProgramSum указываем значение из поля "Максимальная сумма субсидии с НДС, руб." evo_subsidy.evo_max_subsidy_summ , + * иначе результат расчета п.1 + * иначе 0 + */ /* eslint-enable */ -export function computedReactions({ store, apolloClient, queryClient }: ReactionsContext) { +export function computedReactions({ store, apolloClient }: ReactionsContext) { const { $calculation } = store; autorun(async () => { @@ -55,6 +53,5 @@ export function computedReactions({ store, apolloClient, queryClient }: Reaction }); } -export function commonReactions({ store, apolloClient, queryClient }: ReactionsContext) { - const { $calculation, $tables } = store; -} +// eslint-disable-next-line @typescript-eslint/no-unused-vars +export function commonReactions({ store }: ReactionsContext) {} diff --git a/apps/web/process/supplier-agent/get-kp-values/get-sums.ts b/apps/web/process/supplier-agent/get-kp-values/get-sums.ts index bc8056c..59af825 100644 --- a/apps/web/process/supplier-agent/get-kp-values/get-sums.ts +++ b/apps/web/process/supplier-agent/get-kp-values/get-sums.ts @@ -1,8 +1,8 @@ /* eslint-disable @typescript-eslint/naming-convention */ -import { gql } from '@apollo/client'; -import initializeApollo from 'apollo/client'; -import type * as CRMTypes from 'graphql/crm.types'; import type { Quote } from './index'; +import initializeApollo from '@/apollo/client'; +import type * as CRMTypes from '@/graphql/crm.types'; +import { gql } from '@apollo/client'; const QUERY_GET_REWARD_RULES = gql` query GetRewardRules($conditionId: Uuid!) { @@ -15,17 +15,17 @@ const QUERY_GET_REWARD_RULES = gql` type QuoteSumFields = | 'evo_agent_reward_summ' | 'evo_broker_reward_summ' + | 'evo_dealer_broker_reward_summ' | 'evo_dealer_reward_summ' | 'evo_double_agent_reward_summ' - | 'evo_dealer_broker_reward_summ' | 'evo_fin_department_reward_summ'; type QuoteTotalFields = | 'evo_agent_reward_total' | 'evo_broker_reward_total' + | 'evo_dealer_broker_reward_total' | 'evo_dealer_reward_total' | 'evo_double_agent_reward_total' - | 'evo_dealer_broker_reward_total' | 'evo_fin_department_reward_total'; async function getRewardSum( @@ -103,11 +103,11 @@ export default async function getSums(quote: Quote) { ]); return { - dealerRewardSumm: dealerRewardSumm ?? 0, - dealerBrokerRewardSumm: dealerBrokerRewardSumm ?? 0, - indAgentRewardSumm: indAgentRewardSumm ?? 0, - calcDoubleAgentRewardSumm: calcDoubleAgentRewardSumm ?? 0, calcBrokerRewardSum: calcBrokerRewardSum ?? 0, + calcDoubleAgentRewardSumm: calcDoubleAgentRewardSumm ?? 0, + dealerBrokerRewardSumm: dealerBrokerRewardSumm ?? 0, + dealerRewardSumm: dealerRewardSumm ?? 0, finDepartmentRewardSumm: finDepartmentRewardSumm ?? 0, + indAgentRewardSumm: indAgentRewardSumm ?? 0, }; } diff --git a/apps/web/process/supplier-agent/get-kp-values/index.ts b/apps/web/process/supplier-agent/get-kp-values/index.ts index 9429a3a..8f6a80e 100644 --- a/apps/web/process/supplier-agent/get-kp-values/index.ts +++ b/apps/web/process/supplier-agent/get-kp-values/index.ts @@ -1,8 +1,9 @@ -import { gql } from '@apollo/client'; -import initializeApollo from 'apollo/client'; -import type * as CRMTypes from 'graphql/crm.types'; +/* eslint-disable canonical/sort-keys */ import type { GetQuoteDataInput, GetQuoteDataOutput } from '../../load-kp/types'; import getSums from './get-sums'; +import initializeApollo from '@/apollo/client'; +import type * as CRMTypes from '@/graphql/crm.types'; +import { gql } from '@apollo/client'; const QUERY_GET_AGENTS_DATA_FROM_QUOTE = gql` query GetAgentsDataFromQuote($quoteId: Uuid!) { @@ -75,25 +76,25 @@ export default async function getSupplierAgentsDataFromKP({ return { values: { dealer: quote?.evo_supplier_accountid, - dealerPerson: quote?.evo_dealer_person_accountid, - dealerRewardCondition: quote?.evo_dealer_reward_conditionid, - dealerRewardSumm, dealerBroker: quote?.evo_dealer_broker_accountid, dealerBrokerRewardCondition: quote?.evo_dealer_broker_reward_conditionid, dealerBrokerRewardSumm, + dealerPerson: quote?.evo_dealer_person_accountid, + dealerRewardCondition: quote?.evo_dealer_reward_conditionid, + dealerRewardSumm, - indAgent: quote?.evo_agent_accountid, - indAgentRewardCondition: quote?.evo_agent_reward_conditionid, - indAgentRewardSumm, - calcDoubleAgent: quote?.evo_double_agent_accountid, - calcDoubleAgentRewardCondition: quote?.evo_double_agent_reward_conditionid, - calcDoubleAgentRewardSumm, calcBroker: quote?.evo_broker_accountid, calcBrokerRewardCondition: quote?.evo_broker_reward_conditionid, calcBrokerRewardSum, + calcDoubleAgent: quote?.evo_double_agent_accountid, + calcDoubleAgentRewardCondition: quote?.evo_double_agent_reward_conditionid, + calcDoubleAgentRewardSumm, calcFinDepartment: quote?.evo_fin_department_accountid, finDepartmentRewardCondtion: quote?.evo_fin_department_reward_conditionid, finDepartmentRewardSumm, + indAgent: quote?.evo_agent_accountid, + indAgentRewardCondition: quote?.evo_agent_reward_conditionid, + indAgentRewardSumm, }, }; } diff --git a/apps/web/process/supplier-agent/lib/create-reactions.ts b/apps/web/process/supplier-agent/lib/create-reactions.ts index 0656711..b0a119b 100644 --- a/apps/web/process/supplier-agent/lib/create-reactions.ts +++ b/apps/web/process/supplier-agent/lib/create-reactions.ts @@ -1,14 +1,14 @@ /* eslint-disable @typescript-eslint/naming-convention */ +import type { AgentsFields, AgentsRewardConditionsFields, AgentsSumFields } from './types'; +import * as CRMTypes from '@/graphql/crm.types'; +import type RootStore from '@/stores/root'; +import ValidationHelper from '@/stores/validation/helper'; import type { ApolloClient } from '@apollo/client'; import dayjs from 'dayjs'; import utc from 'dayjs/plugin/utc'; -import * as CRMTypes from 'graphql/crm.types'; import { autorun, reaction } from 'mobx'; -import type RootStore from 'stores/root'; -import ValidationHelper from 'stores/validation/helper'; import { normalizeOptions } from 'tools/entity'; import { makeDisposable } from 'tools/mobx'; -import type { AgentsFields, AgentsRewardConditionsFields, AgentsSumFields } from './types'; dayjs.extend(utc); @@ -20,7 +20,7 @@ export function fillAgentRewardReaction( rewardConditionField: AgentsRewardConditionsFields; } ) { - const { $calculation, $process } = store; + const { $calculation } = store; const { agentField, rewardConditionField } = agentParams; reaction( diff --git a/apps/web/process/supplier-agent/lib/fill-agents-from-lead.ts b/apps/web/process/supplier-agent/lib/fill-agents-from-lead.ts index 4750734..5d85155 100644 --- a/apps/web/process/supplier-agent/lib/fill-agents-from-lead.ts +++ b/apps/web/process/supplier-agent/lib/fill-agents-from-lead.ts @@ -1,8 +1,7 @@ -/* eslint-disable import/prefer-default-export */ +import type { Elements } from '@/Components/Calculation/config/map/values'; +import * as CRMTypes from '@/graphql/crm.types'; +import type RootStore from '@/stores/root'; import type { ApolloClient } from '@apollo/client'; -import type { Elements } from 'Components/Calculation/config/map/values'; -import * as CRMTypes from 'graphql/crm.types'; -import type RootStore from 'stores/root'; import { normalizeOptions } from 'tools/entity'; type AgentsLeadProp = keyof Pick< @@ -14,7 +13,7 @@ type AgentsLeadProp = keyof Pick< >; function makeFillAgentFromLead(elementName: Elements, leadProp: AgentsLeadProp) { - return async function fillAgentFromLead( + return async function ( { $calculation }: RootStore, apolloClient: ApolloClient, leadid: string | null diff --git a/apps/web/process/supplier-agent/lib/types.ts b/apps/web/process/supplier-agent/lib/types.ts index e8e213f..196c175 100644 --- a/apps/web/process/supplier-agent/lib/types.ts +++ b/apps/web/process/supplier-agent/lib/types.ts @@ -1,29 +1,29 @@ -import type * as Values from 'Components/Calculation/config/map/values'; +import type * as Values from '@/Components/Calculation/config/map/values'; export type AgentsFields = Extract< Values.Elements, - | 'selectIndAgent' - | 'selectCalcDoubleAgent' | 'selectCalcBroker' + | 'selectCalcDoubleAgent' | 'selectCalcFinDepartment' - | 'selectDealerPerson' | 'selectDealerBroker' + | 'selectDealerPerson' + | 'selectIndAgent' >; export type AgentsRewardConditionsFields = Extract< Values.Elements, - | 'selectIndAgentRewardCondition' - | 'selectCalcDoubleAgentRewardCondition' | 'selectCalcBrokerRewardCondition' - | 'selectFinDepartmentRewardCondtion' - | 'selectDealerRewardCondition' + | 'selectCalcDoubleAgentRewardCondition' | 'selectDealerBrokerRewardCondition' + | 'selectDealerRewardCondition' + | 'selectFinDepartmentRewardCondtion' + | 'selectIndAgentRewardCondition' >; export type AgentsSumFields = Extract< Values.Elements, - | 'tbxIndAgentRewardSumm' - | 'tbxCalcDoubleAgentRewardSumm' | 'tbxCalcBrokerRewardSum' - | 'tbxFinDepartmentRewardSumm' - | 'tbxDealerRewardSumm' + | 'tbxCalcDoubleAgentRewardSumm' | 'tbxDealerBrokerRewardSumm' + | 'tbxDealerRewardSumm' + | 'tbxFinDepartmentRewardSumm' + | 'tbxIndAgentRewardSumm' >; diff --git a/apps/web/process/supplier-agent/reactions/agents.ts b/apps/web/process/supplier-agent/reactions/agents.ts index 13d5c5a..f50d5df 100644 --- a/apps/web/process/supplier-agent/reactions/agents.ts +++ b/apps/web/process/supplier-agent/reactions/agents.ts @@ -1,12 +1,13 @@ /* eslint-disable @typescript-eslint/naming-convention */ -import dayjs from 'dayjs'; -import utc from 'dayjs/plugin/utc'; -import * as CRMTypes from 'graphql/crm.types'; -import { autorun, reaction } from 'mobx'; -import type { ReactionsContext } from 'process/types'; -import { makeDisposable } from 'tools/mobx'; +/* eslint-disable sonarjs/no-identical-functions */ import * as createReactions from '../lib/create-reactions'; import * as fillAgentsFromLead from '../lib/fill-agents-from-lead'; +import * as CRMTypes from '@/graphql/crm.types'; +import type { ReactionsContext } from '@/process/types'; +import dayjs from 'dayjs'; +import utc from 'dayjs/plugin/utc'; +import { autorun, reaction } from 'mobx'; +import { makeDisposable } from 'tools/mobx'; const { fillIndAgent, fillCalcBroker, fillCalcDoubleAgent, fillFinDepartment } = fillAgentsFromLead; const { fillAgentRewardReaction, fillAgentRewardSummReaction, validateAgentRewardSumm } = @@ -96,7 +97,7 @@ export function fillReactions({ store, apolloClient }: ReactionsContext) { } class Helper { - enabled: boolean; + public enabled: boolean; /** * */ @@ -104,7 +105,7 @@ class Helper { this.enabled = false; } - set = (value: boolean) => { + public set = (value: boolean) => { this.enabled = value; }; } @@ -114,16 +115,16 @@ export function commonReactions({ store, apolloClient }: ReactionsContext) { /** * Добавить реакцию на изменение списка в поле selectDealerRewardCondition : - Если в списке selectDealerRewardCondition есть запись, - у которой evo_reward_condition.evo_agency_agreementid. - Выплата без других агентов (evo_reward_without_other_agent) = True, - то сбрасывают значение и закрываются для выбора поля: - - selectDealerBroker - selectIndAgent - selectCalcDoubleAgent - selectCalcBroker - selectFinDepartment + * Если в списке selectDealerRewardCondition есть запись, + * у которой evo_reward_condition.evo_agency_agreementid. + * Выплата без других агентов (evo_reward_without_other_agent) = True, + * то сбрасывают значение и закрываются для выбора поля: + * + * selectDealerBroker + * selectIndAgent + * selectCalcDoubleAgent + * selectCalcBroker + * selectFinDepartment */ { @@ -175,24 +176,24 @@ export function commonReactions({ store, apolloClient }: ReactionsContext) { } /** * Добавить реакцию на изменение списка в поле selectDealerBrokerRewardCondition : - - Если в списке selectDealerBrokerRewardCondition есть запись, - у которой evo_reward_condition.evo_agency_agreementid. - Выплата без других агентов (evo_reward_without_other_agent) = True, - то сбрасывают значение и закрываются для выбора поля: - - selectDealerPerson (не обнуляем) - selectIndAgent - selectCalcDoubleAgent - selectCalcBroker - selectFinDepartment - иначе - - selectDealerPerson открываем для редактирования - selectIndAgent заполняется значением из Интереса - selectCalcDoubleAgent заполняется значением из Интереса - selectCalcBrokerRewardCondition заполняется значением из Интереса - selectFinDepartmentRewardCondtion заполняется значением из Интереса + * + * Если в списке selectDealerBrokerRewardCondition есть запись, + * у которой evo_reward_condition.evo_agency_agreementid. + * Выплата без других агентов (evo_reward_without_other_agent) = True, + * то сбрасывают значение и закрываются для выбора поля: + * + * selectDealerPerson (не обнуляем) + * selectIndAgent + * selectCalcDoubleAgent + * selectCalcBroker + * selectFinDepartment + * иначе + * + * selectDealerPerson открываем для редактирования + * selectIndAgent заполняется значением из Интереса + * selectCalcDoubleAgent заполняется значением из Интереса + * selectCalcBrokerRewardCondition заполняется значением из Интереса + * selectFinDepartmentRewardCondtion заполняется значением из Интереса */ { @@ -245,24 +246,24 @@ export function commonReactions({ store, apolloClient }: ReactionsContext) { } /** * Добавить реакцию на изменение списка в поле selectIndAgentRewardCondition : - - Если в списке selectIndAgentRewardCondition есть запись, - у которой evo_reward_condition.evo_agency_agreementid. - Выплата без других агентов (evo_reward_without_other_agent) = True, - то сбрасывают значение и закрываются для выбора поля: - - selectDealerPerson (не обнуляем) - selectDealerBroker - selectCalcDoubleAgent - selectCalcBroker - selectFinDepartment - иначе - - selectDealerPerson открываем для редактирования - selectDealerBroker открываем для редактирования - selectCalcDoubleAgent заполняется значением из Интереса - selectCalcBroker заполняется значением из Интереса - selectCalcFinDepartment заполняется значением из Интереса + * + * Если в списке selectIndAgentRewardCondition есть запись, + * у которой evo_reward_condition.evo_agency_agreementid. + * Выплата без других агентов (evo_reward_without_other_agent) = True, + * то сбрасывают значение и закрываются для выбора поля: + * + * selectDealerPerson (не обнуляем) + * selectDealerBroker + * selectCalcDoubleAgent + * selectCalcBroker + * selectFinDepartment + * иначе + * + * selectDealerPerson открываем для редактирования + * selectDealerBroker открываем для редактирования + * selectCalcDoubleAgent заполняется значением из Интереса + * selectCalcBroker заполняется значением из Интереса + * selectCalcFinDepartment заполняется значением из Интереса */ { @@ -315,24 +316,24 @@ export function commonReactions({ store, apolloClient }: ReactionsContext) { /** * Добавить реакцию на изменение списка в поле selectCalcDoubleAgentRewardCondition : - - Если в списке selectCalcDoubleAgentRewardCondition есть запись, - у которой evo_reward_condition.evo_agency_agreementid. - Выплата без других агентов (evo_reward_without_other_agent) = True, - то сбрасывают значение и закрываются для выбора поля: - - selectDealerPerson (не обнуляем) - selectDealerBroker - selectIndAgent - selectCalcBroker - selectCalcFinDepartment - иначе - - selectDealerPerson открываем для редактирования - selectDealerBroker открываем для редактирования - selectIndAgent заполняется значением из Интереса - selectCalcBroker заполняется значением из Интереса - selectCalcFinDepartment заполняется значением из Интереса + * + * Если в списке selectCalcDoubleAgentRewardCondition есть запись, + * у которой evo_reward_condition.evo_agency_agreementid. + * Выплата без других агентов (evo_reward_without_other_agent) = True, + * то сбрасывают значение и закрываются для выбора поля: + * + * selectDealerPerson (не обнуляем) + * selectDealerBroker + * selectIndAgent + * selectCalcBroker + * selectCalcFinDepartment + * иначе + * + * selectDealerPerson открываем для редактирования + * selectDealerBroker открываем для редактирования + * selectIndAgent заполняется значением из Интереса + * selectCalcBroker заполняется значением из Интереса + * selectCalcFinDepartment заполняется значением из Интереса */ { @@ -386,24 +387,24 @@ export function commonReactions({ store, apolloClient }: ReactionsContext) { /** * @description * Добавить реакцию на изменение списка в поле selectCalcBrokerRewardCondition: - - Если в списке selectCalcBrokerRewardCondition есть запись, - у которой evo_reward_condition.evo_agency_agreementid. - Выплата без других агентов (evo_reward_without_other_agent) = True, - то сбрасывают значение и закрываются для выбора поля: - - selectDealerPerson (не обнуляем) - selectDealerBroker - selectIndAgent - selectCalcDoubleAgent - selectCalcFinDepartment - иначе - - selectDealerPerson открываем для редактирования - selectDealerBroker открываем для редактирования - selectIndAgent заполняется значением из Интереса - selectCalcDoubleAgent заполняется значением из Интереса - selectCalcFinDepartment заполняется значением из Интереса + * + * Если в списке selectCalcBrokerRewardCondition есть запись, + * у которой evo_reward_condition.evo_agency_agreementid. + * Выплата без других агентов (evo_reward_without_other_agent) = True, + * то сбрасывают значение и закрываются для выбора поля: + * + * selectDealerPerson (не обнуляем) + * selectDealerBroker + * selectIndAgent + * selectCalcDoubleAgent + * selectCalcFinDepartment + * иначе + * + * selectDealerPerson открываем для редактирования + * selectDealerBroker открываем для редактирования + * selectIndAgent заполняется значением из Интереса + * selectCalcDoubleAgent заполняется значением из Интереса + * selectCalcFinDepartment заполняется значением из Интереса */ { const helper = new Helper(); @@ -456,24 +457,24 @@ export function commonReactions({ store, apolloClient }: ReactionsContext) { /** * Добавить реакцию на изменение списка в поле selectFinDepartmentRewardCondtion: - - Если в списке selectFinDepartmentRewardCondtion есть запись, - у которой evo_reward_condition.evo_agency_agreementid. - Выплата без других агентов (evo_reward_without_other_agent) = True, - то сбрасывают значение и закрываются для выбора поля: - - selectDealerPerson (не обнуляем) - selectDealerBroker - selectIndAgent - selectCalcDoubleAgent - selectCalcBroker - иначе - - selectDealerPerson открываем для редактирования - selectDealerBroker открываем для редактирования - selectIndAgent заполняется значением из Интереса - selectCalcDoubleAgent заполняется значением из Интереса - selectCalcBroker заполняется значением из Интереса + * + * Если в списке selectFinDepartmentRewardCondtion есть запись, + * у которой evo_reward_condition.evo_agency_agreementid. + * Выплата без других агентов (evo_reward_without_other_agent) = True, + * то сбрасывают значение и закрываются для выбора поля: + * + * selectDealerPerson (не обнуляем) + * selectDealerBroker + * selectIndAgent + * selectCalcDoubleAgent + * selectCalcBroker + * иначе + * + * selectDealerPerson открываем для редактирования + * selectDealerBroker открываем для редактирования + * selectIndAgent заполняется значением из Интереса + * selectCalcDoubleAgent заполняется значением из Интереса + * selectCalcBroker заполняется значением из Интереса */ { @@ -548,53 +549,52 @@ export function validationReactions({ store, apolloClient }: ReactionsContext) { rewardSummField: 'tbxFinDepartmentRewardSumm', }); - /* eslint-disable max-len */ - /** * Добавить валидацию на кнопку Рассчитать: - если tbxDealerRewardSumm > 0 и - если selectDealerPerson = selectDealerBroker и tbxDealerBrokerRewardSumm > 0, то ругаться на selectDealerPerson - если selectDealerPerson = selectIndAgent и tbxIndAgentRewardSumm > 0, то ругаться на selectDealerPerson - // eslint-disable-next-line max-len - если selectDealerPerson = selectCalcDoubleAgent и tbxCalcDoubleAgentRewardSumm > 0, то ругаться на selectDealerPerson - если selectDealerPerson = selectCalcBroker tbxCalcBrokerRewardSum > 0, то ругаться на selectDealerPerson - если selectDealerPerson = selectFinDepartment и tbxFinDepartmentRewardSumm > 0, то ругаться на selectDealerPerson - 2.если tbxDealerBrokerRewardSumm > 0 и - - если selectDealerBroker = selectDealerPerson и tbxDealerRewardSumm > 0, то ругаться на selectDealerBroker - если selectDealerBroker = selectIndAgent и tbxIndAgentRewardSumm > 0, то ругаться на selectDealerBroker - если selectDealerBroker = selectCalcDoubleAgent и tbxCalcDoubleAgentRewardSumm > 0, то ругаться на selectDealerBroker - если selectDealerBroker = selectCalcBroker tbxCalcBrokerRewardSum > 0, то ругаться на selectDealerBroker - если selectDealerBroker = selectFinDepartment и tbxFinDepartmentRewardSumm > 0, то ругаться на selectDealerBroker - 3. если tbxIndAgentRewardSumm > 0 и - - если selectIndAgent = selectDealerPerson и tbxDealerRewardSumm > 0, то ругаться на selectIndAgent - если selectIndAgent = selectDealerBroker и tbxDealerBrokerRewardSumm > 0, то ругаться на selectIndAgent - если selectIndAgent = selectCalcDoubleAgent и tbxCalcDoubleAgentRewardSumm > 0, то ругаться на selectIndAgent - если selectIndAgent = selectCalcBroker tbxCalcBrokerRewardSum > 0, то ругаться на selectIndAgent - если selectIndAgent = selectFinDepartment и tbxFinDepartmentRewardSumm > 0, то ругаться на selectIndAgent - 4. если tbxCalcDoubleAgentRewardSumm > 0 и - - если selectCalcDoubleAgent = selectDealerPerson и tbxDealerRewardSumm > 0, то ругаться на selectCalcDoubleAgent - если selectCalcDoubleAgent = selectDealerBroker и tbxDealerBrokerRewardSumm > 0, то ругаться на selectCalcDoubleAgent - если selectCalcDoubleAgent = sselectIndAgent и tbxIndAgentRewardSumm > 0, то ругаться на selectCalcDoubleAgent - если selectCalcDoubleAgent = selectCalcBroker tbxCalcBrokerRewardSum > 0, то ругаться на selectCalcDoubleAgent - если selectCalcDoubleAgent = selectFinDepartment и tbxFinDepartmentRewardSumm > 0, то ругаться на selectCalcDoubleAgent - 5. если tbxCalcBrokerRewardSum > 0 и - - если selectCalcBroker = selectDealerPerson и tbxDealerRewardSumm > 0, то ругаться на selectCalcBroker - если selectCalcBroker = selectDealerBroker и tbxDealerBrokerRewardSumm > 0, то ругаться на selectCalcBroker - если selectCalcBroker = sselectIndAgent и tbxIndAgentRewardSumm > 0, то ругаться на selectCalcBroker - если selectCalcBroker = selectCalcDoubleAgent и tbxCalcDoubleAgentRewardSumm > 0, то ругаться на selectCalcBroker - если selectCalcBroker = selectFinDepartment и tbxFinDepartmentRewardSumm > 0, то ругаться на selectCalcBroker - 6. если tbxFinDepartmentRewardSumm > 0 и - - если selectFinDepartment = selectDealerPerson и tbxDealerRewardSumm > 0, то ругаться на selectFinDepartment - если selectFinDepartment = selectDealerBroker и tbxDealerBrokerRewardSumm > 0, то ругаться на selectFinDepartment - если selectFinDepartment = sselectIndAgent и tbxIndAgentRewardSumm > 0, то ругаться на selectFinDepartment - если selectFinDepartment = selectCalcDoubleAgent и tbxCalcDoubleAgentRewardSumm > 0, то ругаться на selectFinDepartment - если selectFinDepartment = selectCalcBroker tbxCalcBrokerRewardSum > 0, то ругаться на selectFinDepartment - */ - /* eslint-enable */ + /** + * Добавить валидацию на кнопку Рассчитать: + * если tbxDealerRewardSumm > 0 и + * если selectDealerPerson = selectDealerBroker и tbxDealerBrokerRewardSumm > 0, то ругаться на selectDealerPerson + * если selectDealerPerson = selectIndAgent и tbxIndAgentRewardSumm > 0, то ругаться на selectDealerPerson + * если selectDealerPerson = selectCalcDoubleAgent и tbxCalcDoubleAgentRewardSumm > 0, то ругаться на selectDealerPerson + * если selectDealerPerson = selectCalcBroker tbxCalcBrokerRewardSum > 0, то ругаться на selectDealerPerson + * если selectDealerPerson = selectFinDepartment и tbxFinDepartmentRewardSumm > 0, то ругаться на selectDealerPerson + * 2.если tbxDealerBrokerRewardSumm > 0 и + * + * если selectDealerBroker = selectDealerPerson и tbxDealerRewardSumm > 0, то ругаться на selectDealerBroker + * если selectDealerBroker = selectIndAgent и tbxIndAgentRewardSumm > 0, то ругаться на selectDealerBroker + * если selectDealerBroker = selectCalcDoubleAgent и tbxCalcDoubleAgentRewardSumm > 0, то ругаться на selectDealerBroker + * если selectDealerBroker = selectCalcBroker tbxCalcBrokerRewardSum > 0, то ругаться на selectDealerBroker + * если selectDealerBroker = selectFinDepartment и tbxFinDepartmentRewardSumm > 0, то ругаться на selectDealerBroker + * 3. если tbxIndAgentRewardSumm > 0 и + * + * если selectIndAgent = selectDealerPerson и tbxDealerRewardSumm > 0, то ругаться на selectIndAgent + * если selectIndAgent = selectDealerBroker и tbxDealerBrokerRewardSumm > 0, то ругаться на selectIndAgent + * если selectIndAgent = selectCalcDoubleAgent и tbxCalcDoubleAgentRewardSumm > 0, то ругаться на selectIndAgent + * если selectIndAgent = selectCalcBroker tbxCalcBrokerRewardSum > 0, то ругаться на selectIndAgent + * если selectIndAgent = selectFinDepartment и tbxFinDepartmentRewardSumm > 0, то ругаться на selectIndAgent + * 4. если tbxCalcDoubleAgentRewardSumm > 0 и + * + * если selectCalcDoubleAgent = selectDealerPerson и tbxDealerRewardSumm > 0, то ругаться на selectCalcDoubleAgent + * если selectCalcDoubleAgent = selectDealerBroker и tbxDealerBrokerRewardSumm > 0, то ругаться на selectCalcDoubleAgent + * если selectCalcDoubleAgent = sselectIndAgent и tbxIndAgentRewardSumm > 0, то ругаться на selectCalcDoubleAgent + * если selectCalcDoubleAgent = selectCalcBroker tbxCalcBrokerRewardSum > 0, то ругаться на selectCalcDoubleAgent + * если selectCalcDoubleAgent = selectFinDepartment и tbxFinDepartmentRewardSumm > 0, то ругаться на selectCalcDoubleAgent + * 5. если tbxCalcBrokerRewardSum > 0 и + * + * если selectCalcBroker = selectDealerPerson и tbxDealerRewardSumm > 0, то ругаться на selectCalcBroker + * если selectCalcBroker = selectDealerBroker и tbxDealerBrokerRewardSumm > 0, то ругаться на selectCalcBroker + * если selectCalcBroker = sselectIndAgent и tbxIndAgentRewardSumm > 0, то ругаться на selectCalcBroker + * если selectCalcBroker = selectCalcDoubleAgent и tbxCalcDoubleAgentRewardSumm > 0, то ругаться на selectCalcBroker + * если selectCalcBroker = selectFinDepartment и tbxFinDepartmentRewardSumm > 0, то ругаться на selectCalcBroker + * 6. если tbxFinDepartmentRewardSumm > 0 и + * + * если selectFinDepartment = selectDealerPerson и tbxDealerRewardSumm > 0, то ругаться на selectFinDepartment + * если selectFinDepartment = selectDealerBroker и tbxDealerBrokerRewardSumm > 0, то ругаться на selectFinDepartment + * если selectFinDepartment = sselectIndAgent и tbxIndAgentRewardSumm > 0, то ругаться на selectFinDepartment + * если selectFinDepartment = selectCalcDoubleAgent и tbxCalcDoubleAgentRewardSumm > 0, то ругаться на selectFinDepartment + * если selectFinDepartment = selectCalcBroker tbxCalcBrokerRewardSum > 0, то ругаться на selectFinDepartment + */ + // eslint-disable-next-line complexity, sonarjs/cognitive-complexity autorun(() => { const dealerRewardSumm = $calculation.element('tbxDealerRewardSumm').getValue(); const dealerBrokerRewardSumm = $calculation.element('tbxDealerBrokerRewardSumm').getValue(); @@ -617,7 +617,7 @@ export function validationReactions({ store, apolloClient }: ReactionsContext) { $calculation.element('selectDealerPerson').validate({ invalid: dealerRewardSumm > 0 && - !!dealerPerson && + Boolean(dealerPerson) && ((dealerPerson === dealerBroker && dealerBrokerRewardSumm > 0) || (dealerPerson === indAgent && indAgentRewardSumm > 0) || (dealerPerson === calcDoubleAgent && calcDoubleAgentRewardSumm > 0) || @@ -629,7 +629,7 @@ export function validationReactions({ store, apolloClient }: ReactionsContext) { $calculation.element('selectDealerBroker').validate({ invalid: dealerBrokerRewardSumm > 0 && - !!dealerBroker && + Boolean(dealerBroker) && ((dealerBroker === dealerPerson && dealerRewardSumm > 0) || (dealerBroker === indAgent && indAgentRewardSumm > 0) || (dealerBroker === calcDoubleAgent && calcDoubleAgentRewardSumm > 0) || @@ -641,7 +641,7 @@ export function validationReactions({ store, apolloClient }: ReactionsContext) { $calculation.element('selectIndAgent').validate({ invalid: indAgentRewardSumm > 0 && - !!indAgent && + Boolean(indAgent) && ((indAgent === dealerPerson && dealerRewardSumm > 0) || (indAgent === dealerBroker && dealerBrokerRewardSumm > 0) || (indAgent === calcDoubleAgent && calcDoubleAgentRewardSumm > 0) || @@ -653,7 +653,7 @@ export function validationReactions({ store, apolloClient }: ReactionsContext) { $calculation.element('selectCalcDoubleAgent').validate({ invalid: calcDoubleAgentRewardSumm > 0 && - !!calcDoubleAgent && + Boolean(calcDoubleAgent) && ((calcDoubleAgent === dealerPerson && dealerRewardSumm > 0) || (calcDoubleAgent === dealerBroker && dealerBrokerRewardSumm > 0) || (calcDoubleAgent === indAgent && indAgentRewardSumm > 0) || @@ -665,7 +665,7 @@ export function validationReactions({ store, apolloClient }: ReactionsContext) { $calculation.element('selectCalcBroker').validate({ invalid: calcBrokerRewardSum > 0 && - !!calcBroker && + Boolean(calcBroker) && ((calcBroker === dealerPerson && dealerRewardSumm > 0) || (calcBroker === dealerBroker && dealerBrokerRewardSumm > 0) || (calcBroker === indAgent && indAgentRewardSumm > 0) || @@ -677,7 +677,7 @@ export function validationReactions({ store, apolloClient }: ReactionsContext) { $calculation.element('selectCalcFinDepartment').validate({ invalid: finDepartmentRewardSumm > 0 && - !!calcFinDepartment && + Boolean(calcFinDepartment) && ((calcFinDepartment === dealerPerson && dealerRewardSumm > 0) || (calcFinDepartment === dealerBroker && dealerBrokerRewardSumm > 0) || (calcFinDepartment === indAgent && indAgentRewardSumm > 0) || diff --git a/apps/web/process/supplier-agent/reactions/leaseback.ts b/apps/web/process/supplier-agent/reactions/leaseback.ts index fbb1f80..a5a9bcc 100644 --- a/apps/web/process/supplier-agent/reactions/leaseback.ts +++ b/apps/web/process/supplier-agent/reactions/leaseback.ts @@ -1,23 +1,23 @@ -import * as CRMTypes from 'graphql/crm.types'; +import * as CRMTypes from '@/graphql/crm.types'; +import type { ReactionsContext } from '@/process/types'; import { autorun, reaction } from 'mobx'; -import type { ReactionsContext } from 'process/types'; export default function leasebackReactions({ store, apolloClient }: ReactionsContext) { const { $calculation, $tables } = store; /** - * Дополнить реакцию на изменение поля Салон приобретения selectDealer: - -если в поле selectDealer указан account, у которого evo_return_leasing_dealer = true, то - -1) поле selectDealerPerson обнулять и закрывать для редактирования, -иначе формировать список связанных значений - -2) в таблице страхования в столбце Плательщик -в строках ОСАГО и КАСКО указывать "Лизингополучатель" (100 000 000) и закрывать для редактирования , -иначе открывать данные поля для редактирования - -3) ПЛ БУ cbxLeaseObjectUsed = true - */ + * Дополнить реакцию на изменение поля Салон приобретения selectDealer: + * + * если в поле selectDealer указан account, у которого evo_return_leasing_dealer = true, то + * + * 1) поле selectDealerPerson обнулять и закрывать для редактирования, + * иначе формировать список связанных значений + * + * 2) в таблице страхования в столбце Плательщик + * в строках ОСАГО и КАСКО указывать "Лизингополучатель" (100 000 000) и закрывать для редактирования , + * иначе открывать данные поля для редактирования + * + * 3) ПЛ БУ cbxLeaseObjectUsed = true + */ reaction( () => $calculation.element('selectDealer').getValue(), @@ -74,16 +74,14 @@ export default function leasebackReactions({ store, apolloClient }: ReactionsCon } ); - /* eslint-disable max-len */ /** * В валидацию на кнопку Рассчитать внести изменение: - 1) поле selectDealerPerson убрать из списка обязательных для расчета полей - 2) добавить валидацию на поле selectDealerPerson : - Если в поле selectDealer указан account, у которого evo_return_leasing_dealer = False (или null) - и поле selectDealerPerson = null, то выводить ошибку и поле selectDealerPerson обводить красной рамкой, - иначе все ок + * 1) поле selectDealerPerson убрать из списка обязательных для расчета полей + * 2) добавить валидацию на поле selectDealerPerson : + * Если в поле selectDealer указан account, у которого evo_return_leasing_dealer = False (или null) + * и поле selectDealerPerson = null, то выводить ошибку и поле selectDealerPerson обводить красной рамкой, + * иначе все ок */ - /* eslint-enable */ autorun(async () => { const dealerId = $calculation.element('selectDealer').getValue(); @@ -104,7 +102,7 @@ export default function leasebackReactions({ store, apolloClient }: ReactionsCon } $calculation.element('selectDealerPerson').validate({ - invalid: !!dealerId && !dealerPersonId && !returnLeasing, + invalid: Boolean(dealerId) && !dealerPersonId && !returnLeasing, message: 'Не заполнено поле', }); }); diff --git a/apps/web/process/supplier-agent/reactions/supplier.ts b/apps/web/process/supplier-agent/reactions/supplier.ts index 85665d0..ac8cdf5 100644 --- a/apps/web/process/supplier-agent/reactions/supplier.ts +++ b/apps/web/process/supplier-agent/reactions/supplier.ts @@ -1,12 +1,11 @@ -/* eslint-disable @typescript-eslint/naming-convention */ +import * as createReactions from '../lib/create-reactions'; +import * as CRMTypes from '@/graphql/crm.types'; +import type { ReactionsContext } from '@/process/types'; import dayjs from 'dayjs'; import utc from 'dayjs/plugin/utc'; -import * as CRMTypes from 'graphql/crm.types'; import { reaction } from 'mobx'; -import type { ReactionsContext } from 'process/types'; import { sift } from 'radash'; import { normalizeOptions } from 'tools/entity'; -import * as createReactions from '../lib/create-reactions'; dayjs.extend(utc); diff --git a/apps/web/process/types.ts b/apps/web/process/types.ts index 26c22e9..bc301bf 100644 --- a/apps/web/process/types.ts +++ b/apps/web/process/types.ts @@ -1,11 +1,11 @@ +import type RootStore from '@/stores/root'; +import type { TRPCPureClient } from '@/trpc/types'; import type { ApolloClient } from '@apollo/client'; import type { QueryClient } from '@tanstack/react-query'; -import type RootStore from 'stores/root'; -import type { TRPCPureClient } from 'trpc/types'; export type ReactionsContext = { - store: RootStore; apolloClient: ApolloClient; queryClient: QueryClient; + store: RootStore; trpcClient: TRPCPureClient; }; diff --git a/apps/web/scripts/graphql-update.js b/apps/web/scripts/graphql-update.js index 92d9e03..3a3b438 100644 --- a/apps/web/scripts/graphql-update.js +++ b/apps/web/scripts/graphql-update.js @@ -1,4 +1,3 @@ -/* eslint-disable @typescript-eslint/no-var-requires */ const run = require('tools/scripts'); const { URL_CRM_GRAPHQL_DIRECT } = process.env; diff --git a/apps/web/stores/Provider.jsx b/apps/web/stores/Provider.jsx index aad7379..9c45d76 100644 --- a/apps/web/stores/Provider.jsx +++ b/apps/web/stores/Provider.jsx @@ -1,4 +1,3 @@ -/* eslint-disable react/prop-types */ import { initializeStore, StoreContext } from '.'; export default function StoreProvider({ children, ...initialData }) { diff --git a/apps/web/stores/calculation/index.ts b/apps/web/stores/calculation/index.ts index bf62329..f8048a2 100644 --- a/apps/web/stores/calculation/index.ts +++ b/apps/web/stores/calculation/index.ts @@ -1,21 +1,20 @@ -/* eslint-disable import/no-cycle */ -import titles from 'Components/Calculation/config/elements-titles'; -import type * as Values from 'Components/Calculation/config/map/values'; -import { getValueName } from 'Components/Calculation/config/map/values'; -import { observable } from 'mobx'; -import type RootStore from 'stores/root'; -import Validation from 'stores/validation'; -import type { BaseOption } from 'ui/elements/types'; import type { RemoveError, ValidationParams } from '../validation/types'; import OptionsStore from './options'; import StatusStore from './statuses'; import ValuesStore from './values'; +import titles from '@/Components/Calculation/config/elements-titles'; +import type * as Values from '@/Components/Calculation/config/map/values'; +import { getValueName } from '@/Components/Calculation/config/map/values'; +import type RootStore from '@/stores/root'; +import Validation from '@/stores/validation'; +import { observable } from 'mobx'; +import type { BaseOption } from 'ui/elements/types'; export default class CalculationStore { - $values: ValuesStore; - $status: StatusStore; - $options: OptionsStore; - $validation: Partial>; + public $values: ValuesStore; + public $status: StatusStore; + public $options: OptionsStore; + public $validation: Partial>; constructor(rootStore: RootStore) { this.$values = new ValuesStore(rootStore); @@ -31,48 +30,15 @@ export default class CalculationStore { }); }; - element = (elementName: E) => ({ - reset: () => { - const valueName = getValueName(elementName); - this.$values.resetValue(valueName); - - this.$options.resetOptions(elementName); - this.$status.resetStatus(elementName); - this.$validation[elementName]?.clearErrors(); - - return this.element(elementName); - }, - + public element = (elementName: E) => ({ block: () => { this.$status.setStatus(elementName, 'Disabled'); return this.element(elementName); }, - unblock: () => { - this.$status.setStatus(elementName, 'Default'); - - return this.element(elementName); - }, - - getValue: () => { - const valueName = getValueName(elementName); - - return this.$values.getValue(valueName) as Values.ElementsTypes[E]; - }, - - setValue: (value: Values.ElementsTypes[E]) => { - const valueName = getValueName(elementName); - this.$values.setValue(valueName, value); - - return this.element(elementName); - }, - - resetValue: () => { - const valueName = getValueName(elementName); - this.$values.resetValue(valueName); - - return this.element(elementName); + cleanErrors: () => { + this.$validation[elementName]?.clearErrors(); }, getOption: () => { @@ -84,8 +50,19 @@ export default class CalculationStore { getOptions: () => this.$options.getOptions(elementName), - setOptions: (options: BaseOption[]) => { - this.$options.setOptions(elementName, options); + getValue: () => { + const valueName = getValueName(elementName); + + return this.$values.getValue(valueName) as Values.ElementsTypes[E]; + }, + + reset: () => { + const valueName = getValueName(elementName); + this.$values.resetValue(valueName); + + this.$options.resetOptions(elementName); + this.$status.resetStatus(elementName); + this.$validation[elementName]?.clearErrors(); return this.element(elementName); }, @@ -96,6 +73,32 @@ export default class CalculationStore { return this.element(elementName); }, + resetValue: () => { + const valueName = getValueName(elementName); + this.$values.resetValue(valueName); + + return this.element(elementName); + }, + + setOptions: (options: Array>) => { + this.$options.setOptions(elementName, options); + + return this.element(elementName); + }, + + setValue: (value: Values.ElementsTypes[E]) => { + const valueName = getValueName(elementName); + this.$values.setValue(valueName, value); + + return this.element(elementName); + }, + + unblock: () => { + this.$status.setStatus(elementName, 'Default'); + + return this.element(elementName); + }, + validate: ({ invalid, message, silent }: ValidationParams) => { if (!this.$validation[elementName]) this.createElementValidation(elementName); @@ -112,9 +115,5 @@ export default class CalculationStore { }, }; }, - - cleanErrors: () => { - this.$validation[elementName]?.clearErrors(); - }, }); } diff --git a/apps/web/stores/calculation/options/hooks.js b/apps/web/stores/calculation/options/hooks.js index 9cb55bf..eabcd85 100644 --- a/apps/web/stores/calculation/options/hooks.js +++ b/apps/web/stores/calculation/options/hooks.js @@ -1,9 +1,7 @@ -/* eslint-disable import/prefer-default-export */ -import { useStore } from 'stores/hooks'; +import { useStore } from '@/stores/hooks'; export function useOptions(elementName) { const { $calculation } = useStore(); - const options = $calculation.$options.getOptions(elementName); - return options; + return $calculation.$options.getOptions(elementName); } diff --git a/apps/web/stores/calculation/options/index.ts b/apps/web/stores/calculation/options/index.ts index 2b14c7b..6b4a08f 100644 --- a/apps/web/stores/calculation/options/index.ts +++ b/apps/web/stores/calculation/options/index.ts @@ -1,41 +1,41 @@ -/* eslint-disable object-curly-newline */ -/* eslint-disable unicorn/prefer-set-has */ -import type { Elements, ElementsTypes } from 'Components/Calculation/config/map/values'; -import defaultOptions from 'config/default-options'; -import { makeAutoObservable } from 'mobx'; -import type RootStore from 'stores/root'; -import type { BaseOption } from 'ui/elements/types'; import type { CalculationOptions } from './types'; +import type { Elements, ElementsTypes } from '@/Components/Calculation/config/map/values'; +import defaultOptions from '@/config/default-options'; +import type RootStore from '@/stores/root'; +import { makeAutoObservable } from 'mobx'; +import type { BaseOption } from 'ui/elements/types'; export default class OptionsStore { - root: RootStore; - options: CalculationOptions = defaultOptions; + private root: RootStore; + private options: CalculationOptions = defaultOptions; constructor(rootStore: RootStore) { makeAutoObservable(this); this.root = rootStore; } - hydrate = (initialOptions: CalculationOptions) => { + public hydrate = (initialOptions: CalculationOptions) => { this.options = { ...defaultOptions, ...initialOptions }; }; - getOptions(elementName: T) { - const options = this.options[elementName]; - - return options; + public getOptions(elementName: T) { + return this.options[elementName]; } - setOptions = (elementName: T, options: BaseOption[]) => { + public setOptions = ( + elementName: T, + options: Array> + ) => { /** * TODO: use T instead of any in BaseOption type * at this moment T causes typescript error * but infer works just perfect */ - this.options[elementName] = options as BaseOption[]; + // eslint-disable-next-line @typescript-eslint/no-explicit-any + this.options[elementName] = options as Array>; }; - resetOptions = (elementName: T) => { + public resetOptions = (elementName: T) => { this.setOptions(elementName, defaultOptions[elementName]); }; } diff --git a/apps/web/stores/calculation/options/types.ts b/apps/web/stores/calculation/options/types.ts index 130f1a9..f51c9f8 100644 --- a/apps/web/stores/calculation/options/types.ts +++ b/apps/web/stores/calculation/options/types.ts @@ -1,6 +1,6 @@ -import type { Elements, ElementsTypes } from 'Components/Calculation/config/map/values'; +import type { Elements, ElementsTypes } from '@/Components/Calculation/config/map/values'; import type { BaseOption } from 'ui/elements/types'; export type CalculationOptions = { - [ElementName in Elements]: BaseOption>[]; + [ElementName in Elements]: Array>>; }; diff --git a/apps/web/stores/calculation/statuses/hooks.js b/apps/web/stores/calculation/statuses/hooks.js index 71ba1d9..bf9be87 100644 --- a/apps/web/stores/calculation/statuses/hooks.js +++ b/apps/web/stores/calculation/statuses/hooks.js @@ -1,9 +1,7 @@ -/* eslint-disable import/prefer-default-export */ -import { useStore } from 'stores/hooks'; +import { useStore } from '@/stores/hooks'; export function useStatus(elementName) { const { $calculation } = useStore(); - const status = $calculation.$status.getStatus(elementName); - return status; + return $calculation.$status.getStatus(elementName); } diff --git a/apps/web/stores/calculation/statuses/index.ts b/apps/web/stores/calculation/statuses/index.ts index 9655062..a4cd277 100644 --- a/apps/web/stores/calculation/statuses/index.ts +++ b/apps/web/stores/calculation/statuses/index.ts @@ -1,34 +1,33 @@ -/* eslint-disable object-curly-newline */ -import type { Elements as ElementsActions } from 'Components/Calculation/config/map/actions'; -import type { Elements as ElementsValues } from 'Components/Calculation/config/map/values'; -import defaultStatuses from 'config/default-statuses'; -import { makeAutoObservable } from 'mobx'; -import type RootStore from 'stores/root'; -import type { Status } from 'ui/elements/types'; import type { CalculationStatuses } from './types'; +import type { Elements as ElementsActions } from '@/Components/Calculation/config/map/actions'; +import type { Elements as ElementsValues } from '@/Components/Calculation/config/map/values'; +import defaultStatuses from '@/config/default-statuses'; +import type RootStore from '@/stores/root'; +import { makeAutoObservable } from 'mobx'; +import type { Status } from 'ui/elements/types'; export default class StatusStore { - root: RootStore; - statuses: CalculationStatuses = defaultStatuses; + private root: RootStore; + private statuses: CalculationStatuses = defaultStatuses; constructor(rootStore: RootStore) { makeAutoObservable(this); this.root = rootStore; } - hydrate = (initialStatuses: CalculationStatuses) => { + public hydrate = (initialStatuses: CalculationStatuses) => { this.statuses = initialStatuses; }; - getStatus(elementName: ElementsValues | ElementsActions) { + public getStatus(elementName: ElementsActions | ElementsValues) { return this.statuses[elementName]; } - setStatus = (elementName: ElementsValues | ElementsActions, status: Status) => { + public setStatus = (elementName: ElementsActions | ElementsValues, status: Status) => { this.statuses[elementName] = status; }; - resetStatus = (elementName: ElementsValues | ElementsActions) => { + public resetStatus = (elementName: ElementsActions | ElementsValues) => { this.statuses[elementName] = defaultStatuses[elementName]; }; } diff --git a/apps/web/stores/calculation/statuses/types.ts b/apps/web/stores/calculation/statuses/types.ts index ac17254..9c3ab5c 100644 --- a/apps/web/stores/calculation/statuses/types.ts +++ b/apps/web/stores/calculation/statuses/types.ts @@ -1,5 +1,5 @@ -import type { Elements as ElementsActions } from 'Components/Calculation/config/map/actions'; -import type { Elements as ElementsValues } from 'Components/Calculation/config/map/values'; +import type { Elements as ElementsActions } from '@/Components/Calculation/config/map/actions'; +import type { Elements as ElementsValues } from '@/Components/Calculation/config/map/values'; import type { Status } from 'ui/elements/types'; -export type CalculationStatuses = Record; +export type CalculationStatuses = Record; diff --git a/apps/web/stores/calculation/validation/hooks.js b/apps/web/stores/calculation/validation/hooks.js index fdf8120..9ae1faa 100644 --- a/apps/web/stores/calculation/validation/hooks.js +++ b/apps/web/stores/calculation/validation/hooks.js @@ -1,5 +1,4 @@ -/* eslint-disable import/prefer-default-export */ -import { useStore } from 'stores/hooks'; +import { useStore } from '@/stores/hooks'; export function useValidation(elementName) { const { $calculation } = useStore(); @@ -7,8 +6,8 @@ export function useValidation(elementName) { if (messages?.length) { return { - isValid: false, help: 'Некорректные данные', + isValid: false, }; } diff --git a/apps/web/stores/calculation/values/hooks.js b/apps/web/stores/calculation/values/hooks.js index 08a1729..d1c20e5 100644 --- a/apps/web/stores/calculation/values/hooks.js +++ b/apps/web/stores/calculation/values/hooks.js @@ -1,5 +1,4 @@ -/* eslint-disable import/prefer-default-export */ -import { useStore } from 'stores/hooks'; +import { useStore } from '@/stores/hooks'; export function useValue(valueName) { const { $calculation } = useStore(); diff --git a/apps/web/stores/calculation/values/index.ts b/apps/web/stores/calculation/values/index.ts index 125c809..42ac3d1 100644 --- a/apps/web/stores/calculation/values/index.ts +++ b/apps/web/stores/calculation/values/index.ts @@ -1,37 +1,36 @@ -/* eslint-disable object-curly-newline */ -import defaultValues from 'config/default-values'; -import { makeAutoObservable } from 'mobx'; import type RootStore from '../../root'; import type { CalculationValues, Values } from './types'; +import defaultValues from '@/config/default-values'; +import { makeAutoObservable } from 'mobx'; export default class ValuesStore { - root: RootStore; - values: CalculationValues = defaultValues; + private root: RootStore; + public values: CalculationValues = defaultValues; constructor(rootStore: RootStore) { makeAutoObservable(this); this.root = rootStore; } - hydrate = (initialValues: CalculationValues) => { + public hydrate = (initialValues: CalculationValues) => { this.values = initialValues; }; - setValues = (params: { values: CalculationValues }) => { + public setValues = (params: { values: CalculationValues }) => { const { values } = params; this.values = values; }; - getValue(valueName: V) { + public getValue(valueName: V) { return this.values[valueName]; } - setValue = (valueName: V, value: CalculationValues[V]) => { + public setValue = (valueName: V, value: CalculationValues[V]) => { this.values[valueName] = value; }; - resetValue = (valueName: Values) => { + public resetValue = (valueName: Values) => { this.setValue(valueName, defaultValues[valueName]); }; } diff --git a/apps/web/stores/calculation/values/types.ts b/apps/web/stores/calculation/values/types.ts index 74383c8..0e116fe 100644 --- a/apps/web/stores/calculation/values/types.ts +++ b/apps/web/stores/calculation/values/types.ts @@ -1,4 +1,4 @@ -import type ValuesSchema from 'config/schema/values'; +import type ValuesSchema from '@/config/schema/values'; import type { z } from 'zod'; export type CalculationValues = z.infer; diff --git a/apps/web/stores/hooks.js b/apps/web/stores/hooks.js index 9ef472e..e876c00 100644 --- a/apps/web/stores/hooks.js +++ b/apps/web/stores/hooks.js @@ -1,6 +1,5 @@ -/* eslint-disable import/prefer-default-export */ -import { useContext } from 'react'; import { StoreContext } from '.'; +import { useContext } from 'react'; export function useStore() { const context = useContext(StoreContext); diff --git a/apps/web/stores/index.js b/apps/web/stores/index.js index a795796..047bebe 100644 --- a/apps/web/stores/index.js +++ b/apps/web/stores/index.js @@ -1,11 +1,8 @@ -/* eslint-disable object-curly-newline */ -/* eslint-disable @typescript-eslint/naming-convention */ -/* eslint-disable no-underscore-dangle */ +import RootStore from './root'; import { createContext } from 'react'; import { isServer } from 'tools/common'; -import RootStore from './root'; -/** @type{RootStore} */ +/** @type {RootStore} */ let store; export const StoreContext = createContext(store); @@ -21,9 +18,9 @@ export function initializeStore(initialData) { if (tables?.insurance) { _store.$tables.insurance.hydrate({ - values: tables.insurance.values, options: tables.insurance.options, statuses: tables.insurance.statuses, + values: tables.insurance.values, }); } } diff --git a/apps/web/stores/process/index.ts b/apps/web/stores/process/index.ts index 89037e0..e18ef85 100644 --- a/apps/web/stores/process/index.ts +++ b/apps/web/stores/process/index.ts @@ -1,7 +1,7 @@ import type { ObservableSet } from 'mobx'; import { observable } from 'mobx'; -export type Process = 'LoadKP' | 'ELT'; +export type Process = 'ELT' | 'LoadKP'; export type ProcessStore = ObservableSet; export default function createProcessStore() { diff --git a/apps/web/stores/results/default-values.ts b/apps/web/stores/results/default-values.ts index 03a3377..9316534 100644 --- a/apps/web/stores/results/default-values.ts +++ b/apps/web/stores/results/default-values.ts @@ -1,23 +1,22 @@ -/* eslint-disable import/prefer-default-export */ import type { ResultsValues } from './types'; export const defaultResultsValues: ResultsValues = { - resultTotalGraphwithNDS: 0, - resultPlPrice: 0, - resultPriceUpPr: 0, + resultAB_FL: 0, + resultAB_UL: 0, + resultBonusDopProd: 0, + resultBonusMPL: 0, + resultBonusSafeFinance: 0, + resultDopMPLLeasing: 0, + resultDopProdSum: 0, + resultFirstPayment: 0, + resultFirstPaymentRiskPolicy: 0, resultIRRGraphPerc: 0, resultIRRNominalPerc: 0, resultInsKasko: 0, resultInsOsago: 0, - resultDopProdSum: 0, - resultFirstPayment: 0, resultLastPayment: 0, + resultPlPrice: 0, + resultPriceUpPr: 0, resultTerm: 0, - resultAB_FL: 0, - resultAB_UL: 0, - resultBonusMPL: 0, - resultDopMPLLeasing: 0, - resultBonusDopProd: 0, - resultBonusSafeFinance: 0, - resultFirstPaymentRiskPolicy: 0, + resultTotalGraphwithNDS: 0, }; diff --git a/apps/web/stores/results/index.ts b/apps/web/stores/results/index.ts index 205d352..96340ce 100644 --- a/apps/web/stores/results/index.ts +++ b/apps/web/stores/results/index.ts @@ -1,15 +1,14 @@ -import type { Payment } from 'Components/Output/PaymentsTable/types'; +import { defaultResultsValues } from './default-values'; +import type { ResultsValues } from './types'; +import type { Payment } from '@/Components/Output/PaymentsTable/types'; +import type RootStore from '@/stores/root'; import type { IObservableArray } from 'mobx'; import { makeAutoObservable, observable } from 'mobx'; -import type RootStore from 'stores/root'; -import { defaultResultsValues } from './default-values'; -import type { ResultsValues } from './types'; - export default class Results { - root: RootStore; - payments: IObservableArray; - values: ResultsValues; + private root: RootStore; + public payments: IObservableArray; + public values: ResultsValues; constructor(rootStore: RootStore) { this.payments = observable([]); @@ -19,15 +18,15 @@ export default class Results { this.root = rootStore; } - setPayments = (payments: Payment[]) => { + public setPayments = (payments: Payment[]) => { this.payments.replace(payments); }; - setValues = (values: ResultsValues) => { + public setValues = (values: ResultsValues) => { this.values = values; }; - clear = () => { + public clear = () => { this.payments.clear(); this.values = defaultResultsValues; }; diff --git a/apps/web/stores/results/types.ts b/apps/web/stores/results/types.ts index e4d418e..46bd7ad 100644 --- a/apps/web/stores/results/types.ts +++ b/apps/web/stores/results/types.ts @@ -1,22 +1,22 @@ export type ResultsValues = { - resultTotalGraphwithNDS: number; - resultPlPrice: number; - resultPriceUpPr: number; + resultAB_FL: number; + resultAB_UL: number; + resultBonusDopProd: number; + resultBonusMPL: number; + resultBonusSafeFinance: number; + resultDopMPLLeasing: number; + resultDopProdSum: number; + resultFirstPayment: number; + resultFirstPaymentRiskPolicy: number; resultIRRGraphPerc: number; resultIRRNominalPerc: number; resultInsKasko: number; resultInsOsago: number; - resultDopProdSum: number; - resultFirstPayment: number; resultLastPayment: number; + resultPlPrice: number; + resultPriceUpPr: number; resultTerm: number; - resultAB_FL: number; - resultAB_UL: number; - resultBonusMPL: number; - resultDopMPLLeasing: number; - resultBonusDopProd: number; - resultBonusSafeFinance: number; - resultFirstPaymentRiskPolicy: number; + resultTotalGraphwithNDS: number; }; export type Values = keyof ResultsValues; diff --git a/apps/web/stores/root.ts b/apps/web/stores/root.ts index 0c49ab8..a1c7fd9 100644 --- a/apps/web/stores/root.ts +++ b/apps/web/stores/root.ts @@ -1,19 +1,18 @@ -/* eslint-disable import/no-cycle */ -import { enableStaticRendering } from 'mobx-react-lite'; -import { isServer } from 'tools/common'; import CalculationStore from './calculation'; import type { ProcessStore } from './process'; import createProcessStore from './process'; import ResultsStore from './results'; import TablesStore from './tables'; +import { enableStaticRendering } from 'mobx-react-lite'; +import { isServer } from 'tools/common'; enableStaticRendering(isServer()); export default class RootStore { - $calculation: CalculationStore; - $results: ResultsStore; - $tables: TablesStore; - $process: ProcessStore; + public $calculation: CalculationStore; + public $results: ResultsStore; + public $tables: TablesStore; + public $process: ProcessStore; constructor() { this.$calculation = new CalculationStore(this); diff --git a/apps/web/stores/tables/fingap/index.ts b/apps/web/stores/tables/fingap/index.ts index bd10568..f2aefd5 100644 --- a/apps/web/stores/tables/fingap/index.ts +++ b/apps/web/stores/tables/fingap/index.ts @@ -1,15 +1,15 @@ -import type * as FinGAP from 'Components/Calculation/Form/Insurance/FinGAPTable/types'; -import type { IObservableArray } from 'mobx'; -import { makeAutoObservable, observable } from 'mobx'; -import type RootStore from 'stores/root'; import Validation from '../../validation'; import type { ValidationParams } from '../../validation/types'; +import type * as FinGAP from '@/Components/Calculation/Form/Insurance/FinGAPTable/types'; +import type RootStore from '@/stores/root'; +import type { IObservableArray } from 'mobx'; +import { makeAutoObservable, observable } from 'mobx'; export default class FinGAPTable { - root: RootStore; - validation: Validation; - risks: IObservableArray; - selectedKeys: Set; + private root: RootStore; + public validation: Validation; + public risks: IObservableArray; + public selectedKeys: Set; constructor(rootStore: RootStore) { this.selectedKeys = new Set(); @@ -24,21 +24,21 @@ export default class FinGAPTable { this.root = rootStore; } - setRisks = (risks: FinGAP.Risk[]) => { + public setRisks = (risks: FinGAP.Risk[]) => { this.risks.replace(risks); }; - setSelectedKeys = (keys: string[]) => { + public setSelectedKeys = (keys: string[]) => { this.selectedKeys = new Set(keys); }; - get totalSum() { + public get totalSum() { return this.risks .filter((risk) => this.selectedKeys.has(risk.key)) .reduce((sum, risk) => sum + risk.premium, 0); } - validate = ({ invalid, message }: ValidationParams) => { + public validate = ({ invalid, message }: ValidationParams) => { if (invalid) { this.validation?.addError(message); } else { @@ -46,7 +46,7 @@ export default class FinGAPTable { } }; - clear = () => { + public clear = () => { this.risks.clear(); this.selectedKeys.clear(); }; diff --git a/apps/web/stores/tables/index.ts b/apps/web/stores/tables/index.ts index 34792ec..94f4763 100644 --- a/apps/web/stores/tables/index.ts +++ b/apps/web/stores/tables/index.ts @@ -1,12 +1,12 @@ -import type RootStore from 'stores/root'; import FinGAPTable from './fingap'; import InsuranceTable from './insurance'; import PaymentsTable from './payments'; +import type RootStore from '@/stores/root'; export default class TablesStore { - payments: PaymentsTable; - insurance: InsuranceTable; - fingap: FinGAPTable; + public payments: PaymentsTable; + public insurance: InsuranceTable; + public fingap: FinGAPTable; constructor(rootStore: RootStore) { this.payments = new PaymentsTable(rootStore); diff --git a/apps/web/stores/tables/insurance/__tests__/index.test.js b/apps/web/stores/tables/insurance/__tests__/index.test.js index a809e0b..5599fae 100644 --- a/apps/web/stores/tables/insurance/__tests__/index.test.js +++ b/apps/web/stores/tables/insurance/__tests__/index.test.js @@ -1,6 +1,6 @@ -import { defaultOptions, defaultStatuses, defaultValues } from 'config/tables/insurance-table'; +import { defaultOptions, defaultStatuses, defaultValues } from '@/config/tables/insurance-table'; import { toJS } from 'mobx'; -import RootStore from 'stores/root'; +import RootStore from '@/stores/root'; const INSURANCE_COMPANIES_OPTIONS = [ { diff --git a/apps/web/stores/tables/insurance/hooks.js b/apps/web/stores/tables/insurance/hooks.js index 7fc707b..038ec38 100644 --- a/apps/web/stores/tables/insurance/hooks.js +++ b/apps/web/stores/tables/insurance/hooks.js @@ -1,5 +1,4 @@ -/* eslint-disable import/prefer-default-export */ -import { useStore } from 'stores/hooks'; +import { useStore } from '@/stores/hooks'; export function useRow(key) { const { $tables } = useStore(); diff --git a/apps/web/stores/tables/insurance/index.ts b/apps/web/stores/tables/insurance/index.ts index 683ce6c..15084c4 100644 --- a/apps/web/stores/tables/insurance/index.ts +++ b/apps/web/stores/tables/insurance/index.ts @@ -1,23 +1,24 @@ -/* eslint-disable object-curly-newline */ -import type * as Insurance from 'Components/Calculation/Form/Insurance/InsuranceTable/types'; -import * as insuranceTableConfig from 'config/tables/insurance-table'; -import { makeAutoObservable } from 'mobx'; -import type RootStore from 'stores/root'; import Validation from '../../validation'; import type { ValidationParams } from '../../validation/types'; +import type * as Insurance from '@/Components/Calculation/Form/Insurance/InsuranceTable/types'; +import * as insuranceTableConfig from '@/config/tables/insurance-table'; +import type RootStore from '@/stores/root'; +import { makeAutoObservable } from 'mobx'; -export interface InsuranceTableData { - values?: Insurance.RowValues[]; +export type InsuranceTableData = { options?: Record; statuses?: Record; -} + values?: Insurance.RowValues[]; +}; export default class InsuranceTable { - root: RootStore; - validation: Validation; - values: Insurance.RowValues[] = insuranceTableConfig.defaultValues; - options: Record = insuranceTableConfig.defaultOptions; - statuses: Record = insuranceTableConfig.defaultStatuses; + private root: RootStore; + public validation: Validation; + private values: Insurance.RowValues[] = insuranceTableConfig.defaultValues; + private options: Record = + insuranceTableConfig.defaultOptions; + private statuses: Record = + insuranceTableConfig.defaultStatuses; constructor(rootStore: RootStore) { this.validation = new Validation({ @@ -29,7 +30,7 @@ export default class InsuranceTable { this.root = rootStore; } - hydrate = ({ + public hydrate = ({ values: initialValues, options: initialOptions, statuses: initialStatuses, @@ -39,7 +40,7 @@ export default class InsuranceTable { if (initialStatuses) this.statuses = initialStatuses; }; - validate = ({ invalid, message }: ValidationParams) => { + public validate = ({ invalid, message }: ValidationParams) => { if (invalid) { this.validation?.addError(message); } else { @@ -47,46 +48,44 @@ export default class InsuranceTable { } }; - reset = () => { + public reset = () => { this.values = insuranceTableConfig.defaultValues; this.options = insuranceTableConfig.defaultOptions; this.statuses = insuranceTableConfig.defaultStatuses; this.validation.clearErrors(); }; - row = (key: K) => ({ - getValue: (valueName: V) => { - const rowIndex = this.values.findIndex((x) => x.key === key); - - return this.values[rowIndex][valueName]; - }, - - getStatus: (valueName: Insurance.Values) => this.statuses[key][valueName], - - getOptions: (valueName: V) => this.options[key][valueName], - - setValue: (valueName: V, value: Insurance.RowValues[V]) => { - const rowIndex = this.values.findIndex((x) => x.key === key); - - this.values[rowIndex] = { ...this.values[rowIndex], [valueName]: value }; - - return this.row(key); - }, - + public row = (key: K) => ({ block: (valueName: Insurance.Values) => { this.statuses[key][valueName] = 'Disabled'; return this.row(key); }, - unblock: (valueName: Insurance.Values) => { - this.statuses[key][valueName] = 'Default'; + getOptions: (valueName: V) => this.options[key][valueName], + + getStatus: (valueName: Insurance.Values) => this.statuses[key][valueName], + + getValue: (valueName: V) => { + const rowIndex = this.values.findIndex((x) => x.key === key); + + return this.values[rowIndex][valueName]; + }, + + reset: (valueName: Insurance.Values) => { + this.row(key).resetValue(valueName).resetStatus(valueName).resetOptions(valueName); return this.row(key); }, - setOptions: (valueName: V, options: Insurance.RowOptions[V]) => { - this.options[key][valueName] = options; + resetOptions: (valueName: V) => { + this.options[key][valueName] = insuranceTableConfig.defaultOptions[key][valueName]; + + return this.row(key); + }, + + resetStatus: (valueName: Insurance.Values) => { + this.statuses[key][valueName] = insuranceTableConfig.defaultStatuses[key][valueName]; return this.row(key); }, @@ -100,20 +99,22 @@ export default class InsuranceTable { return this.row(key); }, - resetStatus: (valueName: Insurance.Values) => { - this.statuses[key][valueName] = insuranceTableConfig.defaultStatuses[key][valueName]; + setOptions: (valueName: V, options: Insurance.RowOptions[V]) => { + this.options[key][valueName] = options; return this.row(key); }, - resetOptions: (valueName: V) => { - this.options[key][valueName] = insuranceTableConfig.defaultOptions[key][valueName]; + setValue: (valueName: V, value: Insurance.RowValues[V]) => { + const rowIndex = this.values.findIndex((x) => x.key === key); + + this.values[rowIndex] = { ...this.values[rowIndex], [valueName]: value }; return this.row(key); }, - reset: (valueName: Insurance.Values) => { - this.row(key).resetValue(valueName).resetStatus(valueName).resetOptions(valueName); + unblock: (valueName: Insurance.Values) => { + this.statuses[key][valueName] = 'Default'; return this.row(key); }, diff --git a/apps/web/stores/tables/insurance/tools.ts b/apps/web/stores/tables/insurance/tools.ts index fee4aa6..d873e37 100644 --- a/apps/web/stores/tables/insurance/tools.ts +++ b/apps/web/stores/tables/insurance/tools.ts @@ -1,5 +1,5 @@ -import type * as Insurance from 'Components/Calculation/Form/Insurance/InsuranceTable/types'; import type InsuranceTable from '.'; +import type * as Insurance from '@/Components/Calculation/Form/Insurance/InsuranceTable/types'; export default function extend(insuranceTable: InsuranceTable) { return { diff --git a/apps/web/stores/tables/payments/hooks.js b/apps/web/stores/tables/payments/hooks.js index b51fca3..0e9c8f7 100644 --- a/apps/web/stores/tables/payments/hooks.js +++ b/apps/web/stores/tables/payments/hooks.js @@ -1,5 +1,5 @@ +import { useStore } from '@/stores/hooks'; import { computed } from 'mobx'; -import { useStore } from 'stores/hooks'; export function useRowValue(index) { const { $tables } = useStore(); @@ -16,7 +16,5 @@ export function useRowValue(index) { export function useRowStatus(index) { const { $tables } = useStore(); - const status = computed(() => $tables.payments.getStatus(index)).get(); - - return status; + return computed(() => $tables.payments.getStatus(index)).get(); } diff --git a/apps/web/stores/tables/payments/index.ts b/apps/web/stores/tables/payments/index.ts index 2b4a9f6..5a8f4b6 100644 --- a/apps/web/stores/tables/payments/index.ts +++ b/apps/web/stores/tables/payments/index.ts @@ -1,17 +1,16 @@ +import Validation from '../../validation'; +import type { ValidationParams } from '../../validation/types'; +import type { Row } from './types'; +import type RootStore from '@/stores/root'; import type { IObservableArray } from 'mobx'; import { makeAutoObservable, observable, reaction } from 'mobx'; import type { Status } from 'ui/elements/types'; -import type RootStore from 'stores/root'; -import Validation from '../../validation'; -import type { ValidationParams } from '../../validation/types'; -import type { Row } from './types'; - export default class PaymentsTable { - root: RootStore; - validation: Validation; - values: IObservableArray; - statuses: IObservableArray; + private root: RootStore; + public validation: Validation; + public values: IObservableArray; + private statuses: IObservableArray; constructor(rootStore: RootStore) { this.validation = new Validation({ @@ -36,36 +35,36 @@ export default class PaymentsTable { ); } - getValue(index: number) { + public getValue(index: number) { return this.values[index]; } - setValue = (index: number, value: number) => { + public setValue = (index: number, value: number) => { this.values[index] = value; }; - setValues = (values: number[]) => { + public setValues = (values: number[]) => { this.values.replace(values); }; - getStatus(index: number) { + public getStatus(index: number) { return this.statuses[index]; } - setStatus = (index: number, status: Status) => { + public setStatus = (index: number, status: Status) => { this.statuses[index] = status; }; - setStatuses = (statuses: Status[]) => { + public setStatuses = (statuses: Status[]) => { this.statuses.replace(statuses); }; - setRow = (index: number, row: Row) => { + public setRow = (index: number, row: Row) => { this.setValue(index, row.value); this.setStatus(index, row.status); }; - setRows = (rows: Row[]) => { + public setRows = (rows: Row[]) => { const values = rows.map((row) => row.value); const statuses = rows.map((row) => row.status); @@ -73,7 +72,7 @@ export default class PaymentsTable { this.setStatuses(statuses); }; - validate = ({ invalid, message }: ValidationParams) => { + public validate = ({ invalid, message }: ValidationParams) => { if (invalid) { this.validation?.addError(message); } else { @@ -81,7 +80,7 @@ export default class PaymentsTable { } }; - reset = () => { + public reset = () => { this.values.clear(); this.statuses.clear(); this.validation.clearErrors(); diff --git a/apps/web/stores/tables/payments/types.ts b/apps/web/stores/tables/payments/types.ts index 078ff75..cf2053d 100644 --- a/apps/web/stores/tables/payments/types.ts +++ b/apps/web/stores/tables/payments/types.ts @@ -1,6 +1,6 @@ import type { Status } from 'ui/elements/types'; export type Row = { - value: number; status: Status; + value: number; }; diff --git a/apps/web/stores/validation/helper.ts b/apps/web/stores/validation/helper.ts index c31f5d5..713edcd 100644 --- a/apps/web/stores/validation/helper.ts +++ b/apps/web/stores/validation/helper.ts @@ -1,19 +1,19 @@ +import type { RemoveError } from './types'; import type { ObservableSet } from 'mobx'; import { observable } from 'mobx'; -import type { RemoveError } from './types'; export default class ValidationHelper { - errors: ObservableSet; + public errors: ObservableSet; constructor() { this.errors = observable.set(); } - add = (removeError: RemoveError) => { + public add = (removeError: RemoveError) => { this.errors.add(removeError); }; - removeErrors = () => { + public removeErrors = () => { this.errors.forEach((removeError) => removeError()); this.errors.clear(); }; diff --git a/apps/web/stores/validation/index.ts b/apps/web/stores/validation/index.ts index 50ad573..6c4559d 100644 --- a/apps/web/stores/validation/index.ts +++ b/apps/web/stores/validation/index.ts @@ -1,10 +1,10 @@ +import type { ValidationConfig } from './types'; import { makeAutoObservable } from 'mobx'; import notification from 'ui/elements/notification'; -import type { ValidationConfig } from './types'; export default class Validation { - params: ValidationConfig; - messages: Set; + private params: ValidationConfig; + private messages: Set; constructor(config: ValidationConfig) { this.params = config; @@ -12,34 +12,34 @@ export default class Validation { makeAutoObservable(this); } - get hasErrors() { + public get hasErrors() { return this.messages.size > 0; } - getMessages() { + public getMessages() { return [...this.messages]; } - removeError = (message: string) => { + public removeError = (message: string) => { this.messages.delete(message); if (this.messages.size === 0) notification.close(this.params.err_key); }; - addError = (message: string, silent?: boolean) => { + public addError = (message: string, silent?: boolean) => { this.messages.add(message); if (!silent) { notification.error({ + description: message, key: this.params.err_key, message: this.params.err_title, - description: message, }); } return () => this.removeError(message); }; - clearErrors = () => { + public clearErrors = () => { this.messages.clear(); notification.close(this.params.err_key); }; diff --git a/apps/web/styles/colors.js b/apps/web/styles/colors.js index 0cef3bb..2124f97 100644 --- a/apps/web/styles/colors.js +++ b/apps/web/styles/colors.js @@ -1,6 +1,6 @@ -import getConfig from 'next/config'; import { publicRuntimeConfigSchema } from '../config/schema/runtime-config'; import { COLORS_DEV, COLORS_PROD } from '../constants/colors'; +import getConfig from 'next/config'; const { publicRuntimeConfig } = getConfig(); const { USE_DEV_COLORS } = publicRuntimeConfigSchema.parse(publicRuntimeConfig); diff --git a/apps/web/styles/global-style.js b/apps/web/styles/global-style.js index 4c818fb..acee0f8 100644 --- a/apps/web/styles/global-style.js +++ b/apps/web/styles/global-style.js @@ -1,6 +1,5 @@ -/* eslint-disable import/prefer-default-export */ -import { createGlobalStyle } from 'styled-components'; import getColors from './colors'; +import { createGlobalStyle } from 'styled-components'; const { COLOR_PRIMARY, COLOR_SECONDARY, COLOR_TERTIARTY } = getColors(); diff --git a/apps/web/styles/mq.ts b/apps/web/styles/mq.ts index 6ba58a5..708af78 100644 --- a/apps/web/styles/mq.ts +++ b/apps/web/styles/mq.ts @@ -1,4 +1,4 @@ -import { screens, threshold } from 'config/ui'; +import { screens, threshold } from '@/config/ui'; export function min(breakpoint: keyof typeof screens) { return `@media (min-width: calc(${screens[breakpoint]}px + ${threshold}px))`; diff --git a/apps/web/trpc/client.ts b/apps/web/trpc/client.ts index 7c6eedb..2648b33 100644 --- a/apps/web/trpc/client.ts +++ b/apps/web/trpc/client.ts @@ -1,9 +1,9 @@ +import type { AppRouter } from './routers'; +import getUrls from '@/config/urls'; import { createTRPCProxyClient, httpBatchLink } from '@trpc/client'; import { createTRPCNext } from '@trpc/next'; -import getUrls from 'config/urls'; import SuperJSON from 'superjson'; import { isServer } from 'tools/common'; -import type { AppRouter } from './routers'; const { BASE_PATH, PORT } = getUrls(); diff --git a/apps/web/trpc/routers/quote.ts b/apps/web/trpc/routers/quote.ts index fc9786d..0c40560 100644 --- a/apps/web/trpc/routers/quote.ts +++ b/apps/web/trpc/routers/quote.ts @@ -1,13 +1,14 @@ -import defaultValues from 'config/default-values'; -import { defaultValues as defaultInsuranceValues } from 'config/tables/insurance-table'; -import getConfiguratorDataFromKP from 'process/configurator/get-kp-data'; -import getFingapDataFromKP from 'process/fingap/get-kp-data'; -import getLeasingObjectDataFromKP from 'process/leasing-object/get-kp-data'; -import { GetQuoteDataInputSchema, GetQuoteDataOutputSchema } from 'process/load-kp/types'; -import getPaymentsDataFromKP from 'process/payments/get-kp-data'; -import getPriceDataFromKP from 'process/price/get-kp-data'; -import getSupplierAgentsDataFromKP from 'process/supplier-agent/get-kp-values'; +/* eslint-disable canonical/sort-keys */ import { t } from '../server'; +import defaultValues from '@/config/default-values'; +import { defaultValues as defaultInsuranceValues } from '@/config/tables/insurance-table'; +import getConfiguratorDataFromKP from '@/process/configurator/get-kp-data'; +import getFingapDataFromKP from '@/process/fingap/get-kp-data'; +import getLeasingObjectDataFromKP from '@/process/leasing-object/get-kp-data'; +import { GetQuoteDataInputSchema, GetQuoteDataOutputSchema } from '@/process/load-kp/types'; +import getPaymentsDataFromKP from '@/process/payments/get-kp-data'; +import getPriceDataFromKP from '@/process/price/get-kp-data'; +import getSupplierAgentsDataFromKP from '@/process/supplier-agent/get-kp-values'; const DEFAULT_OSAGO_ROW = defaultInsuranceValues.find((x) => x.key === 'osago'); const DEFAULT_KASKO_ROW = defaultInsuranceValues.find((x) => x.key === 'kasko'); diff --git a/apps/web/trpc/server.ts b/apps/web/trpc/server.ts index 6adacac..cc152ab 100644 --- a/apps/web/trpc/server.ts +++ b/apps/web/trpc/server.ts @@ -1,4 +1,3 @@ -/* eslint-disable import/prefer-default-export */ import { initTRPC } from '@trpc/server'; import SuperJSON from 'superjson'; diff --git a/apps/web/tsconfig.json b/apps/web/tsconfig.json index 31628ad..2dc7e9d 100644 --- a/apps/web/tsconfig.json +++ b/apps/web/tsconfig.json @@ -4,6 +4,9 @@ "include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", "**/*.js", "**/*.jsx"], "exclude": ["node_modules"], "compilerOptions": { - "baseUrl": "." + "baseUrl": ".", + "paths": { + "@/*": ["*"] + } } } diff --git a/packages/.eslintignore b/packages/.eslintignore new file mode 100644 index 0000000..62e5581 --- /dev/null +++ b/packages/.eslintignore @@ -0,0 +1 @@ +scripts.js \ No newline at end of file diff --git a/packages/eslint-config-custom/index.js b/packages/eslint-config-custom/index.js index b35dabf..ae93b7d 100644 --- a/packages/eslint-config-custom/index.js +++ b/packages/eslint-config-custom/index.js @@ -9,87 +9,38 @@ module.exports = { }, parser: '@typescript-eslint/parser', extends: [ + 'canonical', + 'plugin:sonarjs/recommended', + 'eslint:recommended', 'next', - 'turbo', 'prettier', - 'airbnb', - 'airbnb-typescript', - 'plugin:@typescript-eslint/recommended', - 'plugin:unicorn/recommended', + 'turbo', ], - plugins: ['react', 'prettier', '@typescript-eslint', 'unicorn', 'testing-library'], - settings: { - react: { - version: 'detect', - }, - }, - rules: { - 'linebreak-style': ['error', 'windows'], - 'comma-dangle': 'off', - '@typescript-eslint/comma-dangle': ['off'], - 'react/react-in-jsx-scope': 'off', - 'react/jsx-props-no-spreading': 'off', - 'react/jsx-filename-extension': [2, { extensions: ['.js', '.jsx', '.ts', '.tsx'] }], - 'react/forbid-prop-types': 'off', - 'react/require-default-props': [ - 'error', - { - ignoreFunctionalComponents: true, - }, - ], - 'import/extensions': 'off', - 'object-curly-newline': [ - 'warn', - { - ObjectExpression: 'always', - ObjectPattern: { multiline: true }, - ImportDeclaration: 'never', - ExportDeclaration: { multiline: true, minProperties: 3 }, - }, - ], - 'lines-between-class-members': 'off', - '@typescript-eslint/lines-between-class-members': ['off'], - indent: 'off', - '@typescript-eslint/indent': ['off'], - 'react/jsx-no-bind': [ - 'error', - { - ignoreDOMComponents: false, - ignoreRefs: false, - allowArrowFunctions: false, - allowFunctions: true, - allowBind: false, - }, - ], - 'newline-before-return': 'warn', - '@typescript-eslint/consistent-type-imports': 'error', - 'react/prop-types': 'off', - // Airbnb prefers forEach - 'unicorn/no-array-for-each': 'off', - 'unicorn/prevent-abbreviations': 'off', - 'unicorn/no-null': 'off', - 'unicorn/prefer-node-protocol': 'off', - 'unicorn/no-array-reduce': 'off', - 'unicorn/prefer-module': 'off', - 'unicorn/text-encoding-identifier-case': 'off', - 'unicorn/filename-case': [ - 'error', - { - case: 'kebabCase', - ignore: ['^.*.(jsx|tsx)$'], - }, - ], - 'import/no-unresolved': 'warn', - 'implicit-arrow-linebreak': 'warn', - 'operator-linebreak': 'warn', - 'function-paren-newline': 'warn', - 'turbo/no-undeclared-env-vars': 'warn', - }, overrides: [ - // Only uses Testing Library lint rules in test files + { + extends: ['canonical/typescript', 'canonical/zod'], + files: '*.ts', + }, + { + extends: ['canonical/react', 'canonical/jsx-a11y', 'canonical/typescript'], + files: '*.tsx', + }, + { + extends: ['canonical/react', 'canonical/jsx-a11y'], + files: '*.jsx', + }, + { + extends: ['canonical/json'], + files: '*.json', + }, + { + extends: ['canonical/graphql'], + files: ['*.graphql'], + }, { files: ['**/__tests__/**/*.[jt]s?(x)', '**/?(*.)+(spec|test).[jt]s?(x)'], - extends: ['plugin:testing-library/react'], + extends: ['plugin:testing-library/react', 'canonical/jest'], }, ], + plugins: ['canonical', 'sonarjs', '@typescript-eslint', 'prettier', 'testing-library'], }; diff --git a/packages/eslint-config-custom/package.json b/packages/eslint-config-custom/package.json index faf2fc8..278be67 100644 --- a/packages/eslint-config-custom/package.json +++ b/packages/eslint-config-custom/package.json @@ -3,19 +3,17 @@ "version": "0.0.0", "license": "MIT", "main": "index.js", - "dependencies": { - "@typescript-eslint/eslint-plugin": "^5.48.0", - "@typescript-eslint/parser": "^5.48.0", - "eslint": "^8.31.0", - "eslint-config-airbnb": "^19.0.4", - "eslint-config-airbnb-typescript": "^17.0.0", - "eslint-config-next": "^13.1.1", + "devDependencies": { + "@typescript-eslint/parser": "^5.50.0", + "eslint": "^8.33.0", + "eslint-config-canonical": "^40.0.4", + "eslint-config-next": "^13.1.6", "eslint-config-prettier": "^8.6.0", - "eslint-config-turbo": "latest", + "eslint-config-turbo": "^0.0.7", + "eslint-plugin-canonical": "^3.3.0", "eslint-plugin-prettier": "^4.2.1", - "eslint-plugin-react": "7.28.0", - "eslint-plugin-testing-library": "^5.9.1", - "eslint-plugin-unicorn": "^45.0.2" + "eslint-plugin-sonarjs": "^0.18.0", + "eslint-plugin-testing-library": "^5.10.0" }, "publishConfig": { "access": "public" diff --git a/packages/eslint-config-custom/rules.js b/packages/eslint-config-custom/rules.js new file mode 100644 index 0000000..4d1e2d8 --- /dev/null +++ b/packages/eslint-config-custom/rules.js @@ -0,0 +1,136 @@ +module.exports = { + rules: { + // Disabled + 'brace-style': 'off', + '@typescript-eslint/brace-style': 'off', + 'comma-dangle': 'off', + '@typescript-eslint/comma-dangle': 'off', + 'comma-spacing': 'off', + '@typescript-eslint/comma-spacing': 'off', + 'func-call-spacing': 'off', + '@typescript-eslint/func-call-spacing': 'off', + indent: 'off', + '@typescript-eslint/indent': 'off', + 'keyword-spacing': 'off', + '@typescript-eslint/keyword-spacing': 'off', + 'lines-between-class-members': 'off', + '@typescript-eslint/lines-between-class-members': 'off', + '@typescript-eslint/member-delimiter-style': 'off', + 'no-extra-parens': 'off', + '@typescript-eslint/no-extra-parens': 'off', + 'object-curly-spacing': 'off', + '@typescript-eslint/object-curly-spacing': 'off', + 'padding-line-between-statements': 'off', + '@typescript-eslint/padding-line-between-statements': 'off', + quotes: 'off', + '@typescript-eslint/quotes': 'off', + semi: 'off', + '@typescript-eslint/semi': 'off', + 'space-before-blocks': 'off', + '@typescript-eslint/space-before-blocks': 'off', + 'space-before-function-paren': 'off', + '@typescript-eslint/space-before-function-paren': 'off', + 'space-infix-ops': 'off', + '@typescript-eslint/space-infix-ops': 'off', + '@typescript-eslint/type-annotation-spacing': 'off', + + // Config + 'linebreak-style': ['error', 'windows'], + 'import/extensions': 'off', + 'react/prop-types': 'off', + 'newline-before-return': 'warn', + '@typescript-eslint/consistent-type-imports': 'error', + 'function-paren-newline': 'off', + 'promise/prefer-await-to-then': 'off', + '@typescript-eslint/explicit-member-accessibility': [ + 'warn', + { + accessibility: 'explicit', + overrides: { + constructors: 'off', + }, + }, + ], + 'id-length': 'warn', + 'import/no-unassigned-import': 'off', + 'import/no-named-as-default-member': 'warn', + 'react/jsx-sort-props': 'off', + + // Unicorn + 'unicorn/no-array-for-each': 'off', + 'unicorn/prevent-abbreviations': 'off', + 'unicorn/prefer-node-protocol': 'off', + 'unicorn/no-array-reduce': 'off', + 'unicorn/prefer-module': 'off', + 'unicorn/text-encoding-identifier-case': 'off', + 'unicorn/filename-case': [ + 'error', + { + case: 'kebabCase', + ignore: ['^.*.(jsx|tsx)$'], + }, + ], + 'unicorn/numeric-separators-style': [ + 'off', + { + onlyIfContainsSeparator: false, + hexadecimal: { + minimumDigits: 0, + groupLength: 2, + }, + binary: { + minimumDigits: 0, + groupLength: 4, + }, + octal: { + minimumDigits: 0, + groupLength: 4, + }, + number: { + minimumDigits: 5, + groupLength: 3, + }, + }, + ], + + // Canonical + 'canonical/prefer-inline-type-import': 'off', + '@babel/object-curly-spacing': ['off'], + 'canonical/filename-match-exported': ['off'], + 'canonical/import-specifier-newline': ['off'], + 'canonical/destructuring-property-newline': ['off'], + 'canonical/export-specifier-newline': 'off', + 'canonical/sort-keys': [ + 'warn', + 'asc', + { + natural: true, + }, + ], + 'canonical/id-match': ['off'], + 'import/order': [ + 'error', + { + groups: [], + 'newlines-between': 'always', + }, + ], + 'func-style': ['warn', 'declaration', { allowArrowFunctions: true }], + 'react/function-component-definition': [ + 'error', + { + namedComponents: 'function-declaration', + unnamedComponents: 'arrow-function', + }, + ], + 'arrow-body-style': [ + 'error', + 'as-needed', + { + requireReturnForObjectLiteral: false, + }, + ], + // Turbo + 'turbo/no-undeclared-env-vars': 'warn', + }, +}; diff --git a/packages/tools/.eslintrc.js b/packages/tools/.eslintrc.js index 805a14e..5cb729c 100644 --- a/packages/tools/.eslintrc.js +++ b/packages/tools/.eslintrc.js @@ -1,6 +1,6 @@ module.exports = { root: true, - extends: ['custom'], + extends: ['custom', 'custom/rules'], parserOptions: { project: './tsconfig.json', tsconfigRootDir: __dirname, diff --git a/packages/tools/array.ts b/packages/tools/array.ts index 5c3b734..65f7049 100644 --- a/packages/tools/array.ts +++ b/packages/tools/array.ts @@ -1,8 +1,8 @@ -export function areEqual(arr1: ReadonlyArray, arr2: ReadonlyArray) { +export function areEqual(arr1: readonly T[], arr2: readonly T[]) { return arr1.length === arr2.length && arr1.every((value, index) => value === arr2[index]); } -export function difference(arr1: ReadonlyArray, arr2: ReadonlyArray) { +export function difference(arr1: readonly T[], arr2: readonly T[]) { if (arr1.length !== arr2.length) return null; const changes = []; @@ -16,6 +16,6 @@ export function difference(arr1: ReadonlyArray, arr2: ReadonlyArray) { return changes; } -export function isSorted(arr: Array) { +export function isSorted(arr: number[]) { return arr.every((value, index, array) => !index || array[index - 1] <= value); } diff --git a/packages/tools/common.ts b/packages/tools/common.ts index 421f808..c597692 100644 --- a/packages/tools/common.ts +++ b/packages/tools/common.ts @@ -1,4 +1,3 @@ -/* eslint-disable import/prefer-default-export */ export function isServer() { return typeof window === 'undefined'; } diff --git a/packages/tools/entity.ts b/packages/tools/entity.ts index 91ab708..78b0e7c 100644 --- a/packages/tools/entity.ts +++ b/packages/tools/entity.ts @@ -1,7 +1,7 @@ -/* eslint-disable import/prefer-default-export */ import { isEmpty } from 'radash'; import type { BaseOption } from 'ui/elements/types'; +// eslint-disable-next-line @typescript-eslint/no-explicit-any export function normalizeOptions(options: any[] | null | undefined) { if (isEmpty(options)) { return []; diff --git a/packages/tools/mobx.ts b/packages/tools/mobx.ts index a36643f..2bac7e7 100644 --- a/packages/tools/mobx.ts +++ b/packages/tools/mobx.ts @@ -1,4 +1,3 @@ -/* eslint-disable import/prefer-default-export */ import type { IReactionDisposer } from 'mobx'; import { autorun } from 'mobx'; diff --git a/packages/tools/number.ts b/packages/tools/number.ts index 689b3e5..7779961 100644 --- a/packages/tools/number.ts +++ b/packages/tools/number.ts @@ -1,7 +1,9 @@ -/* eslint-disable implicit-arrow-linebreak */ +/* eslint-disable func-style */ + export function parser(value?: string) { if (!value) return 0; + // eslint-disable-next-line unicorn/prefer-string-replace-all, require-unicode-regexp const normalized = value.replace(/\s/g, '').replaceAll(',', '.'); return Number.parseFloat(normalized); @@ -13,6 +15,6 @@ export const formatter = (value?: number) => export const formatterExtra = (value?: number) => Intl.NumberFormat('ru', { - minimumFractionDigits: 2, maximumFractionDigits: 6, + minimumFractionDigits: 2, }).format(value || 0); diff --git a/packages/tools/object.ts b/packages/tools/object.ts index 01713f2..7d79028 100644 --- a/packages/tools/object.ts +++ b/packages/tools/object.ts @@ -1,4 +1,3 @@ -/* eslint-disable import/prefer-default-export */ export function flatten(obj: object) { return Object.values(obj).flat(); } diff --git a/packages/tools/scripts.js b/packages/tools/scripts.js index a30dff3..8994286 100644 --- a/packages/tools/scripts.js +++ b/packages/tools/scripts.js @@ -1,4 +1,3 @@ -/* eslint-disable @typescript-eslint/no-var-requires */ const { exec } = require('child_process'); module.exports = function run(command, message) { diff --git a/packages/ui/.eslintrc.js b/packages/ui/.eslintrc.js index 805a14e..a4a64b5 100644 --- a/packages/ui/.eslintrc.js +++ b/packages/ui/.eslintrc.js @@ -1,8 +1,12 @@ module.exports = { root: true, - extends: ['custom'], + extends: ['custom', 'custom/rules'], parserOptions: { project: './tsconfig.json', tsconfigRootDir: __dirname, }, + rules: { + 'unicorn/filename-case': 'off', + 'react/jsx-no-bind': 'off', + }, }; diff --git a/packages/ui/elements/Alert.js b/packages/ui/elements/Alert.js index f012da8..4ad8e33 100644 --- a/packages/ui/elements/Alert.js +++ b/packages/ui/elements/Alert.js @@ -1,3 +1 @@ -/* eslint-disable unicorn/filename-case */ -/* eslint-disable no-restricted-exports */ export { Alert as default } from 'antd'; diff --git a/packages/ui/elements/Button.tsx b/packages/ui/elements/Button.tsx index de63e31..a992f96 100644 --- a/packages/ui/elements/Button.tsx +++ b/packages/ui/elements/Button.tsx @@ -1,8 +1,8 @@ +import type { BaseElementProps } from './types'; import { Button as AntButton } from 'antd'; import type { BaseButtonProps } from 'antd/lib/button/button'; import type { FC } from 'react'; import { useThrottledCallback } from 'use-debounce'; -import type { BaseElementProps } from './types'; type ElementProps = { action: () => void; @@ -11,13 +11,8 @@ type ElementProps = { type ButtonProps = BaseButtonProps & Pick; -export default (function Button({ - status, - action, - text, - ...props -}: BaseElementProps & ElementProps) { - const throttledAction = useThrottledCallback(action, 1200, { +function Button({ status, action, text, ...props }: BaseElementProps & ElementProps) { + const throttledAction = useThrottledCallback(action, 1_200, { trailing: false, }); @@ -31,4 +26,6 @@ export default (function Button({ {text} ); -} as FC); +} + +export default Button as FC; diff --git a/packages/ui/elements/Checkbox.tsx b/packages/ui/elements/Checkbox.tsx index 56d6aaa..97a9622 100644 --- a/packages/ui/elements/Checkbox.tsx +++ b/packages/ui/elements/Checkbox.tsx @@ -1,8 +1,8 @@ +import type { BaseElementProps } from './types'; import type { CheckboxProps as AntCheckboxProps } from 'antd'; import { Checkbox as AntCheckbox, Form } from 'antd'; import type { CheckboxChangeEvent } from 'antd/lib/checkbox'; import type { FC } from 'react'; -import type { BaseElementProps } from './types'; const { Item: FormItem } = Form; @@ -12,7 +12,7 @@ type ElementProps = { type CheckboxProps = AntCheckboxProps & ElementProps; -export default (function Checkbox({ +function Checkbox({ value, setValue, status, @@ -21,20 +21,22 @@ export default (function Checkbox({ text, ...props }: BaseElementProps & ElementProps) { - function handleChange(e: CheckboxChangeEvent) { - setValue(e.target.checked); + function handleChange(event: CheckboxChangeEvent) { + setValue(event.target.checked); } return ( - + {text} ); -} as FC); +} + +export default Checkbox as FC; diff --git a/packages/ui/elements/Config.jsx b/packages/ui/elements/Config.jsx index 68358a4..b6083da 100644 --- a/packages/ui/elements/Config.jsx +++ b/packages/ui/elements/Config.jsx @@ -1,5 +1,3 @@ -/* eslint-disable unicorn/filename-case */ - import { ConfigProvider } from 'antd'; import ru_RU from 'antd/lib/locale/ru_RU'; diff --git a/packages/ui/elements/Input.tsx b/packages/ui/elements/Input.tsx index 2fed01d..446ebb1 100644 --- a/packages/ui/elements/Input.tsx +++ b/packages/ui/elements/Input.tsx @@ -1,25 +1,20 @@ +import type { BaseElementProps } from './types'; import type { InputProps } from 'antd'; import { Form, Input as AntInput } from 'antd'; import type { ChangeEvent, FC } from 'react'; -import type { BaseElementProps } from './types'; const { Item: FormItem } = Form; -export default (function Input({ - value, - setValue, - status, - isValid, - help, - ...props -}: BaseElementProps) { - function handleChange(e: ChangeEvent) { - setValue(e.target.value); +function Input({ value, setValue, status, isValid, help, ...props }: BaseElementProps) { + function handleChange(event: ChangeEvent) { + setValue(event.target.value); } return ( - - + + ); -} as FC); +} + +export default Input as FC; diff --git a/packages/ui/elements/InputNumber.tsx b/packages/ui/elements/InputNumber.tsx index dc37f00..8164678 100644 --- a/packages/ui/elements/InputNumber.tsx +++ b/packages/ui/elements/InputNumber.tsx @@ -1,19 +1,13 @@ +import type { BaseElementProps } from './types'; import type { InputNumberProps as AntInputNumberProps } from 'antd'; import { Form, InputNumber as AntInputNumber } from 'antd'; import type { FC } from 'react'; -import type { BaseElementProps } from './types'; const { Item: FormItem } = Form; type InputNumberProps = AntInputNumberProps; -export default (function InputNumber({ - setValue, - status, - isValid, - help, - ...props -}: BaseElementProps) { +function InputNumber({ setValue, status, isValid, help, ...props }: BaseElementProps) { function handleChange(value: number | null) { if (value) { setValue(value); @@ -23,10 +17,11 @@ export default (function InputNumber({ } return ( - + ); -} as FC); +} + +export default InputNumber as FC; diff --git a/packages/ui/elements/Link.tsx b/packages/ui/elements/Link.tsx index 1b7aeee..f04ec33 100644 --- a/packages/ui/elements/Link.tsx +++ b/packages/ui/elements/Link.tsx @@ -1,7 +1,7 @@ +import type { BaseElementProps } from './types'; import { Button as AntButton } from 'antd'; import type { BaseButtonProps } from 'antd/lib/button/button'; import type { FC } from 'react'; -import type { BaseElementProps } from './types'; type ElementProps = { text: string; @@ -9,22 +9,19 @@ type ElementProps = { type LinkProps = BaseButtonProps & ElementProps; -export default (function Link({ - value, - status, - text, - ...props -}: BaseElementProps & ElementProps) { +function Link({ value, status, text, ...props }: BaseElementProps & ElementProps) { return ( {text} ); -} as FC); +} + +export default Link as FC; diff --git a/packages/ui/elements/Radio.tsx b/packages/ui/elements/Radio.tsx index 7b1b9fe..2ceeebe 100644 --- a/packages/ui/elements/Radio.tsx +++ b/packages/ui/elements/Radio.tsx @@ -1,7 +1,7 @@ +import type { BaseElementProps, BaseOption } from './types'; import type { RadioChangeEvent, RadioGroupProps, SpaceProps } from 'antd'; import { Form, Radio as AntRadio, Space } from 'antd'; import type { FC } from 'react'; -import type { BaseElementProps, BaseOption } from './types'; const { Item: FormItem } = Form; @@ -14,7 +14,7 @@ type RadioProps = RadioGroupProps & { spaceProps?: SpaceProps; }; -export default (function Radio({ +function Radio({ value = null, setValue, options, @@ -24,16 +24,16 @@ export default (function Radio({ spaceProps, ...props }: ElementProps) { - function handleChange(e: RadioChangeEvent) { - setValue(e.target.value); + function handleChange(event: RadioChangeEvent) { + setValue(event.target.value); } return ( - + @@ -46,4 +46,6 @@ export default (function Radio({ ); -} as FC); +} + +export default Radio as FC; diff --git a/packages/ui/elements/Result.js b/packages/ui/elements/Result.js index 6e22250..031b1ee 100644 --- a/packages/ui/elements/Result.js +++ b/packages/ui/elements/Result.js @@ -1,3 +1 @@ -/* eslint-disable unicorn/filename-case */ -/* eslint-disable no-restricted-exports */ export { Result as default } from 'antd'; diff --git a/packages/ui/elements/Segmented.tsx b/packages/ui/elements/Segmented.tsx index cf3a8a7..14eecea 100644 --- a/packages/ui/elements/Segmented.tsx +++ b/packages/ui/elements/Segmented.tsx @@ -1,34 +1,28 @@ +import type { BaseElementProps, BaseOption } from './types'; import type { SegmentedProps } from 'antd'; import { Form, Segmented as AntSegmented } from 'antd'; import type { FC } from 'react'; -import type { BaseElementProps, BaseOption } from './types'; const { Item: FormItem } = Form; -type ElementProps = BaseElementProps & { +type ElementProps = BaseElementProps & { options: BaseOption[]; }; -export default (function Segmented({ - value, - setValue, - options, - status, - isValid, - help, - ...props -}: ElementProps) { +function Segmented({ value, setValue, options, status, isValid, help, ...props }: ElementProps) { return ( - + ); -} as FC>); +} + +export default Segmented as FC>; diff --git a/packages/ui/elements/Select.tsx b/packages/ui/elements/Select.tsx index d1539a7..c533531 100644 --- a/packages/ui/elements/Select.tsx +++ b/packages/ui/elements/Select.tsx @@ -1,8 +1,8 @@ +import type { BaseElementProps, BaseOption } from './types'; import type { SelectProps } from 'antd'; import { Form, Select as AntSelect } from 'antd'; import type { FC } from 'react'; import { useMemo } from 'react'; -import type { BaseElementProps, BaseOption } from './types'; const { Item: FormItem } = Form; @@ -10,7 +10,7 @@ type ElementProps = { options: BaseOption[]; }; -export default (function Select({ +function Select({ value = null, setValue, options = [], @@ -31,16 +31,18 @@ export default (function Select({ ); return ( - + ); -} as FC); +} + +export default Select as FC; diff --git a/packages/ui/elements/Switch.tsx b/packages/ui/elements/Switch.tsx index 928bdcd..a55090c 100644 --- a/packages/ui/elements/Switch.tsx +++ b/packages/ui/elements/Switch.tsx @@ -1,21 +1,16 @@ +import type { BaseElementProps } from './types'; import type { SwitchProps } from 'antd'; import { Form, Switch as AntSwitch } from 'antd'; import type { FC } from 'react'; -import type { BaseElementProps } from './types'; const { Item: FormItem } = Form; -export default (function Switch({ - value, - setValue, - status, - isValid, - help, - ...props -}: BaseElementProps) { +function Switch({ value, setValue, status, isValid, help, ...props }: BaseElementProps) { return ( - - + + ); -} as FC); +} + +export default Switch as FC; diff --git a/packages/ui/elements/Table.js b/packages/ui/elements/Table.js index 2d7a5c8..0d0f490 100644 --- a/packages/ui/elements/Table.js +++ b/packages/ui/elements/Table.js @@ -1,4 +1 @@ -/* eslint-disable unicorn/filename-case */ -/* eslint-disable no-restricted-exports */ - export { Table as default } from 'antd'; diff --git a/packages/ui/elements/Text.tsx b/packages/ui/elements/Text.tsx index 8ac66dd..a36895a 100644 --- a/packages/ui/elements/Text.tsx +++ b/packages/ui/elements/Text.tsx @@ -7,10 +7,13 @@ const Span = styled.span` `; type TextProps = { - value: any; children: ReactNode; + // eslint-disable-next-line @typescript-eslint/no-explicit-any + value: any; }; -export default (function Text({ value, ...props }: TextProps) { +function Text({ value, ...props }: TextProps) { return {value || props.children}; -} as FC); +} + +export default Text as FC; diff --git a/packages/ui/elements/Tooltip.js b/packages/ui/elements/Tooltip.js index 36a825e..2f579c2 100644 --- a/packages/ui/elements/Tooltip.js +++ b/packages/ui/elements/Tooltip.js @@ -1,3 +1 @@ -/* eslint-disable unicorn/filename-case */ -/* eslint-disable no-restricted-exports */ export { Tooltip as default } from 'antd'; diff --git a/packages/ui/elements/icons/index.ts b/packages/ui/elements/icons/index.ts index 9eef34f..929b7c8 100644 --- a/packages/ui/elements/icons/index.ts +++ b/packages/ui/elements/icons/index.ts @@ -1,2 +1 @@ -/* eslint-disable import/prefer-default-export */ export { default as DownloadOutlined } from './DownloadOutlined'; diff --git a/packages/ui/elements/layout/Divider.js b/packages/ui/elements/layout/Divider.js index 2420faa..343bf7f 100644 --- a/packages/ui/elements/layout/Divider.js +++ b/packages/ui/elements/layout/Divider.js @@ -1,4 +1 @@ -/* eslint-disable unicorn/filename-case */ -/* eslint-disable no-restricted-exports */ - export { Divider as default } from 'antd'; diff --git a/packages/ui/elements/layout/Tabs.js b/packages/ui/elements/layout/Tabs.js index a9ab6a6..d011b65 100644 --- a/packages/ui/elements/layout/Tabs.js +++ b/packages/ui/elements/layout/Tabs.js @@ -1,4 +1 @@ -/* eslint-disable unicorn/filename-case */ -/* eslint-disable no-restricted-exports */ - export { Tabs as default } from 'antd'; diff --git a/packages/ui/elements/message.js b/packages/ui/elements/message.js index f6c7df5..2e6876d 100644 --- a/packages/ui/elements/message.js +++ b/packages/ui/elements/message.js @@ -2,8 +2,8 @@ import { message } from 'antd'; message.config({ - top: 70, maxCount: 3, + top: 70, }); export default message; diff --git a/packages/ui/elements/types.ts b/packages/ui/elements/types.ts index 81d9d59..dc065d8 100644 --- a/packages/ui/elements/types.ts +++ b/packages/ui/elements/types.ts @@ -1,13 +1,14 @@ -export type Status = 'Default' | 'Disabled' | 'Loading' | 'Hidden'; +export type Status = 'Default' | 'Disabled' | 'Hidden' | 'Loading'; export type BaseElementProps = { - value: Value; + help?: string; + isValid?: boolean; setValue: (value: Value) => void; status?: Status; - isValid?: boolean; - help?: string; + value: Value; }; +// eslint-disable-next-line @typescript-eslint/no-explicit-any export type BaseOption = { label: string; value: Value; diff --git a/packages/ui/grid.ts b/packages/ui/grid.ts index 3974437..dfebe96 100644 --- a/packages/ui/grid.ts +++ b/packages/ui/grid.ts @@ -1,2 +1,2 @@ -export { Box, Flex } from 'rebass/styled-components'; export type { BoxProps, FlexProps } from 'rebass/styled-components'; +export { Box, Flex } from 'rebass/styled-components'; diff --git a/turbo.json b/turbo.json index 5c8c167..b863a02 100644 --- a/turbo.json +++ b/turbo.json @@ -1,28 +1,29 @@ { "$schema": "https://turbo.build/schema.json", + "globalDependencies": [".env.*"], "pipeline": { "build": { "outputs": ["dist/**", ".next/**", "public/dist/**"], "dependsOn": ["^build"] }, - "test": { - "cache": false + "dev": { + "cache": false, + "persistent": true }, "lint": { "dependsOn": ["^build"], + "cache": false, "outputs": [] }, "lint:fix": { "dependsOn": ["^build"], "outputs": [] }, - "dev": { - "cache": false, - "persistent": true + "test": { + "cache": false }, "clean": { "cache": false } - }, - "globalDependencies": [".env.*"] + } } diff --git a/yarn.lock b/yarn.lock index 4edecd3..d4e42b9 100644 --- a/yarn.lock +++ b/yarn.lock @@ -110,7 +110,7 @@ resolved "https://registry.yarnpkg.com/@babel/compat-data/-/compat-data-7.20.10.tgz#9d92fa81b87542fff50e848ed585b4212c1d34ec" integrity sha512-sEnuDPpOJR/fcafHMjpcpGN5M2jbUGUHwmuWKM/YdPzeEDJg8bgmbcWQFUfE32MQjti1koACvoPVsDe8Uq+idg== -"@babel/core@^7.11.6", "@babel/core@^7.12.3", "@babel/core@^7.14.0": +"@babel/core@^7.11.6", "@babel/core@^7.12.3", "@babel/core@^7.14.0", "@babel/core@^7.20.12": version "7.20.12" resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.20.12.tgz#7930db57443c6714ad216953d1356dac0eb8496d" integrity sha512-XsMfHovsUYHFMdrIHkZphTN/2Hzzi78R08NuHfDBehym2VsPDL6Zn/JAD/JQdnRvbSsbQc4mVaU1m6JgtTEElg== @@ -131,6 +131,22 @@ json5 "^2.2.2" semver "^6.3.0" +"@babel/eslint-parser@^7.19.1": + version "7.19.1" + resolved "https://registry.yarnpkg.com/@babel/eslint-parser/-/eslint-parser-7.19.1.tgz#4f68f6b0825489e00a24b41b6a1ae35414ecd2f4" + integrity sha512-AqNf2QWt1rtu2/1rLswy6CDP7H9Oh3mMhk177Y67Rg8d7RD9WfOLLv8CGn6tisFvS2htm86yIe1yLF6I1UDaGQ== + dependencies: + "@nicolo-ribaudo/eslint-scope-5-internals" "5.1.1-v1" + eslint-visitor-keys "^2.1.0" + semver "^6.3.0" + +"@babel/eslint-plugin@^7.19.1": + version "7.19.1" + resolved "https://registry.yarnpkg.com/@babel/eslint-plugin/-/eslint-plugin-7.19.1.tgz#8bfde4b6e4380ea038e7947a765fe536c3057a4c" + integrity sha512-ElGPkQPapKMa3zVqXHkZYzuL7I5LbRw9UWBUArgWsdWDDb9XcACqOpBib5tRPA9XvbVZYrFUkoQPbiJ4BFvu4w== + dependencies: + eslint-rule-composer "^0.3.0" + "@babel/generator@^7.14.0", "@babel/generator@^7.18.13", "@babel/generator@^7.20.7", "@babel/generator@^7.7.2": version "7.20.7" resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.20.7.tgz#f8ef57c8242665c5929fe2e8d82ba75460187b4a" @@ -594,13 +610,13 @@ dependencies: "@babel/helper-plugin-utils" "^7.18.9" -"@babel/runtime-corejs3@^7.10.2": - version "7.20.1" - resolved "https://registry.yarnpkg.com/@babel/runtime-corejs3/-/runtime-corejs3-7.20.1.tgz#d0775a49bb5fba77e42cbb7276c9955c7b05af8d" - integrity sha512-CGulbEDcg/ND1Im7fUNRZdGXmX2MTWVVZacQi/6DiKE5HNwZ3aVTm5PV4lO8HHz0B2h8WQyvKKjbX5XgTtydsg== +"@babel/runtime-corejs3@^7.16.5": + version "7.20.13" + resolved "https://registry.yarnpkg.com/@babel/runtime-corejs3/-/runtime-corejs3-7.20.13.tgz#ad012857db412ab0b5ccf184b67be2cfcc2a1dcf" + integrity sha512-p39/6rmY9uvlzRiLZBIB3G9/EBr66LBMcYm7fIDeSBNdRjF2AGD3rFZucUyAgGHC2N+7DdLvVi33uTjSE44FIw== dependencies: core-js-pure "^3.25.1" - regenerator-runtime "^0.13.10" + regenerator-runtime "^0.13.11" "@babel/runtime@^7.0.0", "@babel/runtime@^7.10.1", "@babel/runtime@^7.10.4", "@babel/runtime@^7.11.1", "@babel/runtime@^7.11.2", "@babel/runtime@^7.12.5", "@babel/runtime@^7.16.7", "@babel/runtime@^7.18.0", "@babel/runtime@^7.18.3", "@babel/runtime@^7.20.0", "@babel/runtime@^7.20.7", "@babel/runtime@^7.5.5", "@babel/runtime@^7.7.2", "@babel/runtime@^7.9.2": version "7.20.7" @@ -609,13 +625,6 @@ dependencies: regenerator-runtime "^0.13.11" -"@babel/runtime@^7.10.2", "@babel/runtime@^7.18.9": - version "7.20.1" - resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.20.1.tgz#1148bb33ab252b165a06698fde7576092a78b4a9" - integrity sha512-mrzLkl6U9YLF8qpqI7TB82PESyEGjm/0Ly91jG575eVxMMlb8fYfOXFZIJ8XfLrJZQbm7dlKry2bJmXBUEkdFg== - dependencies: - regenerator-runtime "^0.13.10" - "@babel/template@^7.18.10", "@babel/template@^7.20.7", "@babel/template@^7.3.3": version "7.20.7" resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.20.7.tgz#a15090c2839a83b02aa996c0b4994005841fd5a8" @@ -786,6 +795,15 @@ resolved "https://registry.yarnpkg.com/@emotion/weak-memoize/-/weak-memoize-0.2.5.tgz#8eed982e2ee6f7f4e44c253e12962980791efd46" integrity sha512-6U71C2Wp7r5XtFtQzYrW5iKFT67OixrSxjI4MptCHzdSVlgabczzqLe0ZSgnub/5Kp4hSbpDB1tMytZY9pwxxA== +"@es-joy/jsdoccomment@~0.36.1": + version "0.36.1" + resolved "https://registry.yarnpkg.com/@es-joy/jsdoccomment/-/jsdoccomment-0.36.1.tgz#c37db40da36e4b848da5fd427a74bae3b004a30f" + integrity sha512-922xqFsTpHs6D0BUiG4toiyPOMc8/jafnWKxz1KWgS4XzKPy2qXf1Pe6UFuNSCQqt6tOuhAWXBNuuyUhJmw9Vg== + dependencies: + comment-parser "1.3.1" + esquery "^1.4.0" + jsdoc-type-pratt-parser "~3.1.0" + "@eslint-community/eslint-utils@^4.1.2": version "4.1.2" resolved "https://registry.yarnpkg.com/@eslint-community/eslint-utils/-/eslint-utils-4.1.2.tgz#14ca568ddaa291dd19a4a54498badc18c6cfab78" @@ -949,6 +967,23 @@ parse-filepath "^1.0.2" tslib "~2.4.0" +"@graphql-eslint/eslint-plugin@^3.14.3": + version "3.15.0" + resolved "https://registry.yarnpkg.com/@graphql-eslint/eslint-plugin/-/eslint-plugin-3.15.0.tgz#9d2db9a69836a24e608165ae9c8dafb34e73d431" + integrity sha512-0sCHsbD07sCAHLKr/89i0ZcKasAbPps9OcWcvBtBoyuyvINWQlTrG0eqIwo4n5pOdNLw1yCfk+R7AwRYJ8m+MQ== + dependencies: + "@babel/code-frame" "^7.18.6" + "@graphql-tools/code-file-loader" "^7.3.6" + "@graphql-tools/graphql-tag-pluck" "^7.3.6" + "@graphql-tools/utils" "^9.0.0" + chalk "^4.1.2" + debug "^4.3.4" + fast-glob "^3.2.12" + graphql-config "^4.4.0" + graphql-depth-limit "^1.1.0" + lodash.lowercase "^4.3.0" + tslib "^2.4.1" + "@graphql-tools/apollo-engine-loader@^7.3.6": version "7.3.21" resolved "https://registry.yarnpkg.com/@graphql-tools/apollo-engine-loader/-/apollo-engine-loader-7.3.21.tgz#416e548f6343342c1e8ef6c83139264589802172" @@ -980,6 +1015,17 @@ tslib "^2.4.0" unixify "^1.0.0" +"@graphql-tools/code-file-loader@^7.3.6": + version "7.3.16" + resolved "https://registry.yarnpkg.com/@graphql-tools/code-file-loader/-/code-file-loader-7.3.16.tgz#58aa85c250175cebe0ea4309214357768d550f93" + integrity sha512-109UFvQjZEntHwjPaHpWvgUudHenGngbXvSImabPc2fdrtgja5KC0h7thCg379Yw6IORHGrF2XbJwS1hAGPPWw== + dependencies: + "@graphql-tools/graphql-tag-pluck" "7.4.3" + "@graphql-tools/utils" "9.1.4" + globby "^11.0.3" + tslib "^2.4.0" + unixify "^1.0.0" + "@graphql-tools/delegate@9.0.21": version "9.0.21" resolved "https://registry.yarnpkg.com/@graphql-tools/delegate/-/delegate-9.0.21.tgz#914d59e6a10457fe1ddcac9270336648cfa8ca58" @@ -1088,6 +1134,18 @@ "@graphql-tools/utils" "9.1.3" tslib "^2.4.0" +"@graphql-tools/graphql-tag-pluck@7.4.3", "@graphql-tools/graphql-tag-pluck@^7.3.6": + version "7.4.3" + resolved "https://registry.yarnpkg.com/@graphql-tools/graphql-tag-pluck/-/graphql-tag-pluck-7.4.3.tgz#b07f2263c383d9605d941c836dc01a7bbc6e56a7" + integrity sha512-w+nrJVQw+NTuaZNQG5AwSh4Qe+urP/s4rUz5s1T007rDnv1kvkiX+XHOCnIfJzXOTuvFmG4GGYw/x0CuSRaGZQ== + dependencies: + "@babel/parser" "^7.16.8" + "@babel/plugin-syntax-import-assertions" "7.20.0" + "@babel/traverse" "^7.16.8" + "@babel/types" "^7.16.8" + "@graphql-tools/utils" "9.1.4" + tslib "^2.4.0" + "@graphql-tools/import@6.7.14": version "6.7.14" resolved "https://registry.yarnpkg.com/@graphql-tools/import/-/import-6.7.14.tgz#4f3278841217686eed8950db0aa5040bc35f6970" @@ -1237,6 +1295,13 @@ dependencies: tslib "^2.4.0" +"@graphql-tools/utils@9.1.4": + version "9.1.4" + resolved "https://registry.yarnpkg.com/@graphql-tools/utils/-/utils-9.1.4.tgz#2c9e0aefc9655dd73247667befe3c850ec014f3f" + integrity sha512-hgIeLt95h9nQgQuzbbdhuZmh+8WV7RZ/6GbTj6t3IU4Zd2zs9yYJ2jgW/krO587GMOY8zCwrjNOMzD40u3l7Vg== + dependencies: + tslib "^2.4.0" + "@graphql-tools/utils@^8.6.5": version "8.13.1" resolved "https://registry.yarnpkg.com/@graphql-tools/utils/-/utils-8.13.1.tgz#b247607e400365c2cd87ff54654d4ad25a7ac491" @@ -1575,10 +1640,17 @@ resolved "https://registry.yarnpkg.com/@next/env/-/env-13.1.1.tgz#6ff26488dc7674ef2bfdd1ca28fe43eed1113bea" integrity sha512-vFMyXtPjSAiOXOywMojxfKIqE3VWN5RCAx+tT3AS3pcKjMLFTCJFUWsKv8hC+87Z1F4W3r68qTwDFZIFmd5Xkw== -"@next/eslint-plugin-next@13.1.1": - version "13.1.1" - resolved "https://registry.yarnpkg.com/@next/eslint-plugin-next/-/eslint-plugin-next-13.1.1.tgz#cc5e419cc85587f73f2ac0046a91df01dc6fef8b" - integrity sha512-SBrOFS8PC3nQ5aeZmawJkjKkWjwK9RoxvBSv/86nZp0ubdoVQoko8r8htALd9ufp16NhacCdqhu9bzZLDWtALQ== +"@next/eslint-plugin-next@13.1.6": + version "13.1.6" + resolved "https://registry.yarnpkg.com/@next/eslint-plugin-next/-/eslint-plugin-next-13.1.6.tgz#ad8be22dd3d8aee9a9bd9a2507e2c55a2f7ebdd9" + integrity sha512-o7cauUYsXjzSJkay8wKjpKJf2uLzlggCsGUkPu3lP09Pv97jYlekTC20KJrjQKmSv5DXV0R/uks2ZXhqjNkqAw== + dependencies: + glob "7.1.7" + +"@next/eslint-plugin-next@^13.1.1": + version "13.1.5" + resolved "https://registry.yarnpkg.com/@next/eslint-plugin-next/-/eslint-plugin-next-13.1.5.tgz#3eebea0835d2ec549a7b4b8976bf1d7796cca632" + integrity sha512-3kvLTX35bOWOCKU8KY74Ygczc55Qk/kB2TQy0tH7Rti6hzZ6Aij7WQ8zHdIVjmnlD0n/zXWXrIf5y56RKcLQkQ== dependencies: glob "7.1.7" @@ -1647,6 +1719,13 @@ resolved "https://registry.yarnpkg.com/@next/swc-win32-x64-msvc/-/swc-win32-x64-msvc-13.1.1.tgz#c209a37da13be27b722f9c40c40ab4b094866244" integrity sha512-mVF0/3/5QAc5EGVnb8ll31nNvf3BWpPY4pBb84tk+BfQglWLqc5AC9q1Ht/YMWiEgs8ALNKEQ3GQnbY0bJF2Gg== +"@nicolo-ribaudo/eslint-scope-5-internals@5.1.1-v1": + version "5.1.1-v1" + resolved "https://registry.yarnpkg.com/@nicolo-ribaudo/eslint-scope-5-internals/-/eslint-scope-5-internals-5.1.1-v1.tgz#dbf733a965ca47b1973177dc0bb6c889edcfb129" + integrity sha512-54/JRvkLIzzDWshCWfuhadfrfZVPiElY8Fcgmg1HroEly/EDSszzhBAsarCux+D/kOslTRquNzuyGSmUSTTHGg== + dependencies: + eslint-scope "5.1.1" + "@nodelib/fs.scandir@2.1.5": version "2.1.5" resolved "https://registry.yarnpkg.com/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz#7619c2eb21b25483f6d167548b4cfd5a7488c3d5" @@ -1726,7 +1805,7 @@ resolved "https://registry.yarnpkg.com/@repeaterjs/repeater/-/repeater-3.0.4.tgz#a04d63f4d1bf5540a41b01a921c9a7fddc3bd1ca" integrity sha512-AW8PKd6iX3vAZ0vA43nOUOnbq/X5ihgU+mSXXqunMkeQADGiqw/PY0JNeYtD5sr0PAy51YPgAPbDoeapv9r8WA== -"@rushstack/eslint-patch@^1.1.3": +"@rushstack/eslint-patch@^1.1.3", "@rushstack/eslint-patch@^1.2.0": version "1.2.0" resolved "https://registry.yarnpkg.com/@rushstack/eslint-patch/-/eslint-patch-1.2.0.tgz#8be36a1f66f3265389e90b5f9c9962146758f728" integrity sha512-sXo/qW2/pAcmT43VoRKOJbDOfV3cYpq3szSVfIThQXNt+E4DfKj361vaAt3c88U5tPUxzEswam7GW48PJqtKAg== @@ -2267,13 +2346,13 @@ "@types/yargs-parser" "*" "@typescript-eslint/eslint-plugin@^5.48.0": - version "5.48.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.48.0.tgz#54f8368d080eb384a455f60c2ee044e948a8ce67" - integrity sha512-SVLafp0NXpoJY7ut6VFVUU9I+YeFsDzeQwtK0WZ+xbRN3mtxJ08je+6Oi2N89qDn087COdO0u3blKZNv9VetRQ== + version "5.49.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.49.0.tgz#d0b4556f0792194bf0c2fb297897efa321492389" + integrity sha512-IhxabIpcf++TBaBa1h7jtOWyon80SXPRLDq0dVz5SLFC/eW6tofkw/O7Ar3lkx5z5U6wzbKDrl2larprp5kk5Q== dependencies: - "@typescript-eslint/scope-manager" "5.48.0" - "@typescript-eslint/type-utils" "5.48.0" - "@typescript-eslint/utils" "5.48.0" + "@typescript-eslint/scope-manager" "5.49.0" + "@typescript-eslint/type-utils" "5.49.0" + "@typescript-eslint/utils" "5.49.0" debug "^4.3.4" ignore "^5.2.0" natural-compare-lite "^1.4.0" @@ -2281,72 +2360,123 @@ semver "^7.3.7" tsutils "^3.21.0" -"@typescript-eslint/parser@^5.42.0", "@typescript-eslint/parser@^5.48.0": - version "5.48.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-5.48.0.tgz#02803355b23884a83e543755349809a50b7ed9ba" - integrity sha512-1mxNA8qfgxX8kBvRDIHEzrRGrKHQfQlbW6iHyfHYS0Q4X1af+S6mkLNtgCOsGVl8+/LUPrqdHMssAemkrQ01qg== +"@typescript-eslint/experimental-utils@^5.0.0": + version "5.49.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/experimental-utils/-/experimental-utils-5.49.0.tgz#7962b4611eb0c8be0e330d6caf4da7f8261c8203" + integrity sha512-veLpCJLYn44Fru7mSvi2doxQMzMCOFSDYdMUQhAzaH1vFYq2RVNpecZ8d18Wh6UMv07yahXkiv/aShWE48iE9Q== dependencies: - "@typescript-eslint/scope-manager" "5.48.0" - "@typescript-eslint/types" "5.48.0" - "@typescript-eslint/typescript-estree" "5.48.0" + "@typescript-eslint/utils" "5.49.0" + +"@typescript-eslint/parser@^5.42.0", "@typescript-eslint/parser@^5.48.0": + version "5.49.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-5.49.0.tgz#d699734b2f20e16351e117417d34a2bc9d7c4b90" + integrity sha512-veDlZN9mUhGqU31Qiv2qEp+XrJj5fgZpJ8PW30sHU+j/8/e5ruAhLaVDAeznS7A7i4ucb/s8IozpDtt9NqCkZg== + dependencies: + "@typescript-eslint/scope-manager" "5.49.0" + "@typescript-eslint/types" "5.49.0" + "@typescript-eslint/typescript-estree" "5.49.0" debug "^4.3.4" -"@typescript-eslint/scope-manager@5.48.0": - version "5.48.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-5.48.0.tgz#607731cb0957fbc52fd754fd79507d1b6659cecf" - integrity sha512-0AA4LviDtVtZqlyUQnZMVHydDATpD9SAX/RC5qh6cBd3xmyWvmXYF+WT1oOmxkeMnWDlUVTwdODeucUnjz3gow== +"@typescript-eslint/parser@^5.50.0": + version "5.50.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-5.50.0.tgz#a33f44b2cc83d1b7176ec854fbecd55605b0b032" + integrity sha512-KCcSyNaogUDftK2G9RXfQyOCt51uB5yqC6pkUYqhYh8Kgt+DwR5M0EwEAxGPy/+DH6hnmKeGsNhiZRQxjH71uQ== dependencies: - "@typescript-eslint/types" "5.48.0" - "@typescript-eslint/visitor-keys" "5.48.0" + "@typescript-eslint/scope-manager" "5.50.0" + "@typescript-eslint/types" "5.50.0" + "@typescript-eslint/typescript-estree" "5.50.0" + debug "^4.3.4" -"@typescript-eslint/type-utils@5.48.0": - version "5.48.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/type-utils/-/type-utils-5.48.0.tgz#40496dccfdc2daa14a565f8be80ad1ae3882d6d6" - integrity sha512-vbtPO5sJyFjtHkGlGK4Sthmta0Bbls4Onv0bEqOGm7hP9h8UpRsHJwsrCiWtCUndTRNQO/qe6Ijz9rnT/DB+7g== +"@typescript-eslint/scope-manager@5.49.0": + version "5.49.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-5.49.0.tgz#81b5d899cdae446c26ddf18bd47a2f5484a8af3e" + integrity sha512-clpROBOiMIzpbWNxCe1xDK14uPZh35u4QaZO1GddilEzoCLAEz4szb51rBpdgurs5k2YzPtJeTEN3qVbG+LRUQ== dependencies: - "@typescript-eslint/typescript-estree" "5.48.0" - "@typescript-eslint/utils" "5.48.0" + "@typescript-eslint/types" "5.49.0" + "@typescript-eslint/visitor-keys" "5.49.0" + +"@typescript-eslint/scope-manager@5.50.0": + version "5.50.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-5.50.0.tgz#90b8a3b337ad2c52bbfe4eac38f9164614e40584" + integrity sha512-rt03kaX+iZrhssaT974BCmoUikYtZI24Vp/kwTSy841XhiYShlqoshRFDvN1FKKvU2S3gK+kcBW1EA7kNUrogg== + dependencies: + "@typescript-eslint/types" "5.50.0" + "@typescript-eslint/visitor-keys" "5.50.0" + +"@typescript-eslint/type-utils@5.49.0": + version "5.49.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/type-utils/-/type-utils-5.49.0.tgz#8d5dcc8d422881e2ccf4ebdc6b1d4cc61aa64125" + integrity sha512-eUgLTYq0tR0FGU5g1YHm4rt5H/+V2IPVkP0cBmbhRyEmyGe4XvJ2YJ6sYTmONfjmdMqyMLad7SB8GvblbeESZA== + dependencies: + "@typescript-eslint/typescript-estree" "5.49.0" + "@typescript-eslint/utils" "5.49.0" debug "^4.3.4" tsutils "^3.21.0" -"@typescript-eslint/types@5.48.0": - version "5.48.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.48.0.tgz#d725da8dfcff320aab2ac6f65c97b0df30058449" - integrity sha512-UTe67B0Ypius0fnEE518NB2N8gGutIlTojeTg4nt0GQvikReVkurqxd2LvYa9q9M5MQ6rtpNyWTBxdscw40Xhw== +"@typescript-eslint/types@5.49.0": + version "5.49.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.49.0.tgz#ad66766cb36ca1c89fcb6ac8b87ec2e6dac435c3" + integrity sha512-7If46kusG+sSnEpu0yOz2xFv5nRz158nzEXnJFCGVEHWnuzolXKwrH5Bsf9zsNlOQkyZuk0BZKKoJQI+1JPBBg== -"@typescript-eslint/typescript-estree@5.48.0": - version "5.48.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-5.48.0.tgz#a7f04bccb001003405bb5452d43953a382c2fac2" - integrity sha512-7pjd94vvIjI1zTz6aq/5wwE/YrfIyEPLtGJmRfyNR9NYIW+rOvzzUv3Cmq2hRKpvt6e9vpvPUQ7puzX7VSmsEw== +"@typescript-eslint/types@5.50.0": + version "5.50.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.50.0.tgz#c461d3671a6bec6c2f41f38ed60bd87aa8a30093" + integrity sha512-atruOuJpir4OtyNdKahiHZobPKFvZnBnfDiyEaBf6d9vy9visE7gDjlmhl+y29uxZ2ZDgvXijcungGFjGGex7w== + +"@typescript-eslint/typescript-estree@5.49.0": + version "5.49.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-5.49.0.tgz#ebd6294c0ea97891fce6af536048181e23d729c8" + integrity sha512-PBdx+V7deZT/3GjNYPVQv1Nc0U46dAHbIuOG8AZ3on3vuEKiPDwFE/lG1snN2eUB9IhF7EyF7K1hmTcLztNIsA== dependencies: - "@typescript-eslint/types" "5.48.0" - "@typescript-eslint/visitor-keys" "5.48.0" + "@typescript-eslint/types" "5.49.0" + "@typescript-eslint/visitor-keys" "5.49.0" debug "^4.3.4" globby "^11.1.0" is-glob "^4.0.3" semver "^7.3.7" tsutils "^3.21.0" -"@typescript-eslint/utils@5.48.0", "@typescript-eslint/utils@^5.13.0": - version "5.48.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/utils/-/utils-5.48.0.tgz#eee926af2733f7156ad8d15e51791e42ce300273" - integrity sha512-x2jrMcPaMfsHRRIkL+x96++xdzvrdBCnYRd5QiW5Wgo1OB4kDYPbC1XjWP/TNqlfK93K/lUL92erq5zPLgFScQ== +"@typescript-eslint/typescript-estree@5.50.0": + version "5.50.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-5.50.0.tgz#0b9b82975bdfa40db9a81fdabc7f93396867ea97" + integrity sha512-Gq4zapso+OtIZlv8YNAStFtT6d05zyVCK7Fx3h5inlLBx2hWuc/0465C2mg/EQDDU2LKe52+/jN4f0g9bd+kow== + dependencies: + "@typescript-eslint/types" "5.50.0" + "@typescript-eslint/visitor-keys" "5.50.0" + debug "^4.3.4" + globby "^11.1.0" + is-glob "^4.0.3" + semver "^7.3.7" + tsutils "^3.21.0" + +"@typescript-eslint/utils@5.49.0", "@typescript-eslint/utils@^5.10.0", "@typescript-eslint/utils@^5.42.1", "@typescript-eslint/utils@^5.43.0": + version "5.49.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/utils/-/utils-5.49.0.tgz#1c07923bc55ff7834dfcde487fff8d8624a87b32" + integrity sha512-cPJue/4Si25FViIb74sHCLtM4nTSBXtLx1d3/QT6mirQ/c65bV8arBEebBJJizfq8W2YyMoPI/WWPFWitmNqnQ== dependencies: "@types/json-schema" "^7.0.9" "@types/semver" "^7.3.12" - "@typescript-eslint/scope-manager" "5.48.0" - "@typescript-eslint/types" "5.48.0" - "@typescript-eslint/typescript-estree" "5.48.0" + "@typescript-eslint/scope-manager" "5.49.0" + "@typescript-eslint/types" "5.49.0" + "@typescript-eslint/typescript-estree" "5.49.0" eslint-scope "^5.1.1" eslint-utils "^3.0.0" semver "^7.3.7" -"@typescript-eslint/visitor-keys@5.48.0": - version "5.48.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-5.48.0.tgz#4446d5e7f6cadde7140390c0e284c8702d944904" - integrity sha512-5motVPz5EgxQ0bHjut3chzBkJ3Z3sheYVcSwS5BpHZpLqSptSmELNtGixmgj65+rIfhvtQTz5i9OP2vtzdDH7Q== +"@typescript-eslint/visitor-keys@5.49.0": + version "5.49.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-5.49.0.tgz#2561c4da3f235f5c852759bf6c5faec7524f90fe" + integrity sha512-v9jBMjpNWyn8B6k/Mjt6VbUS4J1GvUlR4x3Y+ibnP1z7y7V4n0WRz+50DY6+Myj0UaXVSuUlHohO+eZ8IJEnkg== dependencies: - "@typescript-eslint/types" "5.48.0" + "@typescript-eslint/types" "5.49.0" + eslint-visitor-keys "^3.3.0" + +"@typescript-eslint/visitor-keys@5.50.0": + version "5.50.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-5.50.0.tgz#b752ffc143841f3d7bc57d6dd01ac5c40f8c4903" + integrity sha512-cdMeD9HGu6EXIeGOh2yVW6oGf9wq8asBgZx7nsR/D36gTfQ0odE5kcRYe5M81vjEFAcPeugXrHg78Imu55F6gg== + dependencies: + "@typescript-eslint/types" "5.50.0" eslint-visitor-keys "^3.3.0" "@whatwg-node/fetch@0.5.4", "@whatwg-node/fetch@^0.5.0": @@ -2434,6 +2564,11 @@ acorn@^8.1.0, acorn@^8.4.1, acorn@^8.8.0, acorn@^8.8.1: resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.8.1.tgz#0a3f9cbecc4ec3bea6f0a80b66ae8dd2da250b73" integrity sha512-7zFpHzhnqYKrkYdUjF1HI1bzd0VygEGX8lFk4k5zVMqHEoES+P+7TKI+EvLO9WVMJ8eekdO0aDEK044xTXwPPA== +acorn@^8.5.0: + version "8.8.2" + resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.8.2.tgz#1b2f25db02af965399b9776b0c2c391276d37c4a" + integrity sha512-xjIYgE8HBrkpd/sJqOGNspf8uHG+NOHGOw6a/Urj8taM2EXfdNAH2oFcPeIFfsv3+kz/mJrS5VuMqbNLjCa2vw== + agent-base@6: version "6.0.2" resolved "https://registry.yarnpkg.com/agent-base/-/agent-base-6.0.2.tgz#49fff58577cfee3f37176feab4c22e00f86d7f77" @@ -2564,15 +2699,7 @@ argparse@^2.0.1: resolved "https://registry.yarnpkg.com/argparse/-/argparse-2.0.1.tgz#246f50f3ca78a3240f6c997e8a9bd1eac49e4b38" integrity sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q== -aria-query@^4.2.2: - version "4.2.2" - resolved "https://registry.yarnpkg.com/aria-query/-/aria-query-4.2.2.tgz#0d2ca6c9aceb56b8977e9fed6aed7e15bbd2f83b" - integrity sha512-o/HelwhuKpTj/frsOsbNLNgnNGVIFsVP/SW2BSF14gVl7kAfMOJ6/8wUAUvG1R1NHKrfG+2sHZTu0yauT1qBrA== - dependencies: - "@babel/runtime" "^7.10.2" - "@babel/runtime-corejs3" "^7.10.2" - -aria-query@^5.0.0: +aria-query@^5.0.0, aria-query@^5.1.3: version "5.1.3" resolved "https://registry.yarnpkg.com/aria-query/-/aria-query-5.1.3.tgz#19db27cd101152773631396f7a95a3b58c22c35e" integrity sha512-R5iJ5lkuHybztUfuOAznmboyjWq8O6sqNqtK7CLOqdydi54VNbORp49mb14KbWgG1QD3JFO9hJdZ+y4KutfdOQ== @@ -2630,7 +2757,7 @@ array.prototype.flat@^1.2.5: es-abstract "^1.20.4" es-shim-unscopables "^1.0.0" -array.prototype.flatmap@^1.2.5, array.prototype.flatmap@^1.3.1: +array.prototype.flatmap@^1.3.1: version "1.3.1" resolved "https://registry.yarnpkg.com/array.prototype.flatmap/-/array.prototype.flatmap-1.3.1.tgz#1aae7903c2100433cb8261cd4ed310aab5c4a183" integrity sha512-8UGn9O1FDVvMNB0UlLv4voxRMze7+FpHyF5mSMRjWHUMlpoDViniy05870VlxhfgTnLbpuwTzvD76MTtWxB/mQ== @@ -2651,6 +2778,11 @@ array.prototype.tosorted@^1.1.1: es-shim-unscopables "^1.0.0" get-intrinsic "^1.1.3" +arrify@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/arrify/-/arrify-1.0.1.tgz#898508da2226f380df904728456849c1501a4b0d" + integrity sha512-3CYzex9M9FGQjCGMGyi6/31c8GJbgb0qGyrx5HWxPd0aCwh4cB2YjMb2Xf9UuoogrMrlO9cTqnB5rI5GHZTcUA== + asap@~2.0.3: version "2.0.6" resolved "https://registry.yarnpkg.com/asap/-/asap-2.0.6.tgz#e50347611d7e690943208bbdafebcbc2fb866d46" @@ -2705,10 +2837,10 @@ available-typed-arrays@^1.0.5: resolved "https://registry.yarnpkg.com/available-typed-arrays/-/available-typed-arrays-1.0.5.tgz#92f95616501069d07d10edb2fc37d3e1c65123b7" integrity sha512-DMD0KiN46eipeziST1LPP/STfDU0sufISXmjSgvVsoU2tqxctQeASejWcfNtxYKqETM1UxQ8sp2OrSBWpHY6sw== -axe-core@^4.4.3: - version "4.5.2" - resolved "https://registry.yarnpkg.com/axe-core/-/axe-core-4.5.2.tgz#823fdf491ff717ac3c58a52631d4206930c1d9f7" - integrity sha512-u2MVsXfew5HBvjsczCv+xlwdNnB1oQR9HlAcsejZttNjKKSkeDNVwB1vMThIUIFI9GoT57Vtk8iQLwqOfAkboA== +axe-core@^4.6.2: + version "4.6.3" + resolved "https://registry.yarnpkg.com/axe-core/-/axe-core-4.6.3.tgz#fc0db6fdb65cc7a80ccf85286d91d64ababa3ece" + integrity sha512-/BQzOX780JhsxDnPpH4ZiyrJAzcd8AfzFPkv+89veFSr1rcMjuq2JDCwypKaPeB6ljHp9KjXhPpjgCvQlWYuqg== axios@^1.2.2: version "1.2.2" @@ -2719,10 +2851,12 @@ axios@^1.2.2: form-data "^4.0.0" proxy-from-env "^1.1.0" -axobject-query@^2.2.0: - version "2.2.0" - resolved "https://registry.yarnpkg.com/axobject-query/-/axobject-query-2.2.0.tgz#943d47e10c0b704aa42275e20edf3722648989be" - integrity sha512-Td525n+iPOOyUQIeBfcASuG6uJsDOITl7Mds5gFyerkWiX7qhUTdYUBlSgNMyVqtSJqwpt1kXGLdUt6SykLMRA== +axobject-query@^3.1.1: + version "3.1.1" + resolved "https://registry.yarnpkg.com/axobject-query/-/axobject-query-3.1.1.tgz#3b6e5c6d4e43ca7ba51c5babf99d22a9c68485e1" + integrity sha512-goKlv8DZrK9hUh975fnHzhNIO4jUnFCfv/dszV5VwUGDFjI6vQ2VwoyjYjYNEbBE8AH87TduWP5uyDR1D+Iteg== + dependencies: + deep-equal "^2.0.5" babel-jest@^29.3.1: version "29.3.1" @@ -3098,7 +3232,7 @@ chalk@^3.0.0: ansi-styles "^4.1.0" supports-color "^7.1.0" -chalk@^4.0.0, chalk@^4.1.0, chalk@^4.1.1: +chalk@^4.0.0, chalk@^4.1.0, chalk@^4.1.1, chalk@^4.1.2: version "4.1.2" resolved "https://registry.yarnpkg.com/chalk/-/chalk-4.1.2.tgz#aac4e2b7734a740867aeb16bf02aad556a1e7a01" integrity sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA== @@ -3344,6 +3478,11 @@ combined-stream@^1.0.8: dependencies: delayed-stream "~1.0.0" +comment-parser@1.3.1, comment-parser@^1.1.2: + version "1.3.1" + resolved "https://registry.yarnpkg.com/comment-parser/-/comment-parser-1.3.1.tgz#3d7ea3adaf9345594aedee6563f422348f165c1b" + integrity sha512-B52sN2VNghyq5ofvUsqZjmk6YkihBX5vMSChmSK9v4ShjKf3Vk5Xcmgpw4o+iIgtrnM/u5FiMpz9VKb8lpBveA== + common-tags@1.8.2: version "1.8.2" resolved "https://registry.yarnpkg.com/common-tags/-/common-tags-1.8.2.tgz#94ebb3c076d26032745fd54face7f688ef5ac9c6" @@ -3364,11 +3503,6 @@ concat-map@0.0.1: resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" integrity sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg== -confusing-browser-globals@^1.0.10: - version "1.0.11" - resolved "https://registry.yarnpkg.com/confusing-browser-globals/-/confusing-browser-globals-1.0.11.tgz#ae40e9b57cdd3915408a2805ebd3a5585608dc81" - integrity sha512-JsPKdmh8ZkmnHxDk55FZ1TqVLvEQTvoByJZRN9jzI0UjxK/QgAmsphz7PGtqgPieQZ/CQcHWXCR7ATDNhGe+YA== - constant-case@^3.0.4: version "3.0.4" resolved "https://registry.yarnpkg.com/constant-case/-/constant-case-3.0.4.tgz#3b84a9aeaf4cf31ec45e6bf5de91bdfb0589faf1" @@ -3447,6 +3581,16 @@ cosmiconfig@7.0.1: path-type "^4.0.0" yaml "^1.10.0" +cosmiconfig@8.0.0: + version "8.0.0" + resolved "https://registry.yarnpkg.com/cosmiconfig/-/cosmiconfig-8.0.0.tgz#e9feae014eab580f858f8a0288f38997a7bebe97" + integrity sha512-da1EafcpH6b/TD8vDRaWV7xFINlHlF6zKsGwS1TsuVJTZRkquaS5HTMq7uq6h31619QjbsYl21gVDOm32KM1vQ== + dependencies: + import-fresh "^3.2.1" + js-yaml "^4.1.0" + parse-json "^5.0.0" + path-type "^4.0.0" + cosmiconfig@^6.0.0: version "6.0.0" resolved "https://registry.yarnpkg.com/cosmiconfig/-/cosmiconfig-6.0.0.tgz#da4fee853c52f6b1e6935f41c1a2fc50bd4a9982" @@ -3469,6 +3613,13 @@ cosmiconfig@^7.0.0: path-type "^4.0.0" yaml "^1.10.0" +create-eslint-index@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/create-eslint-index/-/create-eslint-index-1.0.0.tgz#d954372d86d5792fcd67e9f2b791b1ab162411bb" + integrity sha512-nXvJjnfDytOOaPOonX0h0a1ggMoqrhdekGeZkD6hkcWYvlCWhU719tKFVh8eU04CnMwu3uwe1JjwuUF2C3k2qg== + dependencies: + lodash.get "^4.3.0" + create-require@^1.1.0: version "1.1.1" resolved "https://registry.yarnpkg.com/create-require/-/create-require-1.1.1.tgz#c1d7e8f1e5f6cfc9ff65f9cd352d37348756c333" @@ -3854,6 +4005,13 @@ end-of-stream@^1.1.0, end-of-stream@^1.4.1: dependencies: once "^1.4.0" +enhance-visitors@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/enhance-visitors/-/enhance-visitors-1.0.0.tgz#aa945d05da465672a1ebd38fee2ed3da8518e95a" + integrity sha512-+29eJLiUixTEDRaZ35Vu8jP3gPLNcQQkQkOQjLp2X+6cZGGPDD/uasbFzvLsJKnGZnvmyZ0srxudwOtskHeIDA== + dependencies: + lodash "^4.13.1" + enhanced-resolve@^5.10.0: version "5.12.0" resolved "https://registry.yarnpkg.com/enhanced-resolve/-/enhanced-resolve-5.12.0.tgz#300e1c90228f5b570c4d35babf263f6da7155634" @@ -3973,38 +4131,65 @@ escodegen@^2.0.0: optionalDependencies: source-map "~0.6.1" -eslint-config-airbnb-base@^15.0.0: - version "15.0.0" - resolved "https://registry.yarnpkg.com/eslint-config-airbnb-base/-/eslint-config-airbnb-base-15.0.0.tgz#6b09add90ac79c2f8d723a2580e07f3925afd236" - integrity sha512-xaX3z4ZZIcFLvh2oUNvcX5oEofXda7giYmuplVxoOg5A7EXJMrUyqRgR+mhDhPK8LZ4PttFOBvCYDbX3sUoUig== +eslint-ast-utils@^1.0.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/eslint-ast-utils/-/eslint-ast-utils-1.1.0.tgz#3d58ba557801cfb1c941d68131ee9f8c34bd1586" + integrity sha512-otzzTim2/1+lVrlH19EfQQJEhVJSu0zOb9ygb3iapN6UlyaDtyRq4b5U1FuW0v1lRa9Fp/GJyHkSwm6NqABgCA== dependencies: - confusing-browser-globals "^1.0.10" - object.assign "^4.1.2" - object.entries "^1.1.5" - semver "^6.3.0" + lodash.get "^4.4.2" + lodash.zip "^4.2.0" -eslint-config-airbnb-typescript@^17.0.0: - version "17.0.0" - resolved "https://registry.yarnpkg.com/eslint-config-airbnb-typescript/-/eslint-config-airbnb-typescript-17.0.0.tgz#360dbcf810b26bbcf2ff716198465775f1c49a07" - integrity sha512-elNiuzD0kPAPTXjFWg+lE24nMdHMtuxgYoD30OyMD6yrW1AhFZPAg27VX7d3tzOErw+dgJTNWfRSDqEcXb4V0g== +eslint-config-canonical@^40.0.4: + version "40.0.4" + resolved "https://registry.yarnpkg.com/eslint-config-canonical/-/eslint-config-canonical-40.0.4.tgz#85a06cda156f5605a6210079e1cb6b71813c0a96" + integrity sha512-hHoDBvEnRMaWICaU5KgAruZMNOjAYl1gCmLANUDABaWQarNVAUUKQNYkvJ71nvAM4AlKgHh5co0gYrpLtVfDjA== dependencies: - eslint-config-airbnb-base "^15.0.0" + "@babel/core" "^7.20.12" + "@babel/eslint-parser" "^7.19.1" + "@babel/eslint-plugin" "^7.19.1" + "@graphql-eslint/eslint-plugin" "^3.14.3" + "@next/eslint-plugin-next" "^13.1.1" + "@rushstack/eslint-patch" "^1.2.0" + "@typescript-eslint/eslint-plugin" "^5.48.0" + "@typescript-eslint/parser" "^5.48.0" + eslint-config-prettier "^8.6.0" + eslint-import-resolver-typescript "^3.5.3" + eslint-plugin-ava "^13.2.0" + eslint-plugin-canonical "^3.2.4" + eslint-plugin-cypress "^2.12.1" + eslint-plugin-eslint-comments "^3.2.0" + eslint-plugin-flowtype "^8.0.3" + eslint-plugin-fp "^2.3.0" + eslint-plugin-import "^2.26.0" + eslint-plugin-jest "^27.2.0" + eslint-plugin-jsdoc "^39.6.4" + eslint-plugin-jsonc "^2.6.0" + eslint-plugin-jsx-a11y "^6.6.1" + eslint-plugin-lodash "^7.4.0" + eslint-plugin-mocha "^10.1.0" + eslint-plugin-modules-newline "0.0.6" + eslint-plugin-node "^11.1.0" + eslint-plugin-prettier "^4.2.1" + eslint-plugin-promise "^6.1.1" + eslint-plugin-react "^7.31.11" + eslint-plugin-react-hooks "^4.6.0" + eslint-plugin-regexp "^1.12.0" + eslint-plugin-simple-import-sort "^10.0.0" + eslint-plugin-typescript-sort-keys "^2.1.0" + eslint-plugin-unicorn "^45.0.2" + eslint-plugin-vitest "^0.0.25" + eslint-plugin-yml "^1.4.0" + eslint-plugin-zod "^1.4.0" + prettier "^2.8.1" + ramda "^0.28.0" + yaml-eslint-parser "^1.1.0" -eslint-config-airbnb@^19.0.4: - version "19.0.4" - resolved "https://registry.yarnpkg.com/eslint-config-airbnb/-/eslint-config-airbnb-19.0.4.tgz#84d4c3490ad70a0ffa571138ebcdea6ab085fdc3" - integrity sha512-T75QYQVQX57jiNgpF9r1KegMICE94VYwoFQyMGhrvc+lB8YF2E/M/PYDaQe1AJcWaEgqLE+ErXV1Og/+6Vyzew== +eslint-config-next@^13.1.6: + version "13.1.6" + resolved "https://registry.yarnpkg.com/eslint-config-next/-/eslint-config-next-13.1.6.tgz#ab6894fe5b80080f1e9b9306d1c4b0003230620e" + integrity sha512-0cg7h5wztg/SoLAlxljZ0ZPUQ7i6QKqRiP4M2+MgTZtxWwNKb2JSwNc18nJ6/kXBI6xYvPraTbQSIhAuVw6czw== dependencies: - eslint-config-airbnb-base "^15.0.0" - object.assign "^4.1.2" - object.entries "^1.1.5" - -eslint-config-next@^13.1.1: - version "13.1.1" - resolved "https://registry.yarnpkg.com/eslint-config-next/-/eslint-config-next-13.1.1.tgz#b1a6602b0a339820585d4b2f8d2e08866b6699a7" - integrity sha512-/5S2XGWlGaiqrRhzpn51ux5JUSLwx8PVK2keLi5xk7QmhfYB8PqE6R6SlVw6hgnf/VexvUXSrlNJ/su00NhtHQ== - dependencies: - "@next/eslint-plugin-next" "13.1.1" + "@next/eslint-plugin-next" "13.1.6" "@rushstack/eslint-patch" "^1.1.3" "@typescript-eslint/parser" "^5.42.0" eslint-import-resolver-node "^0.3.6" @@ -4019,12 +4204,12 @@ eslint-config-prettier@^8.6.0: resolved "https://registry.yarnpkg.com/eslint-config-prettier/-/eslint-config-prettier-8.6.0.tgz#dec1d29ab728f4fa63061774e1672ac4e363d207" integrity sha512-bAF0eLpLVqP5oEVUFKpMA+NnRFICwn9X8B5jrR9FcqnYBuPbqWEjTEspPWMj5ye6czoSLDweCzSo3Ko7gGrZaA== -eslint-config-turbo@latest: - version "0.0.4" - resolved "https://registry.yarnpkg.com/eslint-config-turbo/-/eslint-config-turbo-0.0.4.tgz#4850255f8c858131843aa38854d4aed0ff09bb6e" - integrity sha512-HErPS/wfWkSdV9Yd2dDkhZt3W2B78Ih/aWPFfaHmCMjzPalh+5KxRRGTf8MOBQLCebcWJX0lP1Zvc1rZIHlXGg== +eslint-config-turbo@^0.0.7: + version "0.0.7" + resolved "https://registry.yarnpkg.com/eslint-config-turbo/-/eslint-config-turbo-0.0.7.tgz#1a4ef7b28df40fb168a695e34d58d1d25477aab3" + integrity sha512-WbrGlyfs94rOXrhombi1wjIAYGdV2iosgJRndOZtmDQeq5GLTzYmBUCJQZWtLBEBUPCj96RxZ2OL7Cn+xv/Azg== dependencies: - eslint-plugin-turbo "0.0.4" + eslint-plugin-turbo "0.0.7" eslint-import-resolver-node@^0.3.6: version "0.3.6" @@ -4034,10 +4219,10 @@ eslint-import-resolver-node@^0.3.6: debug "^3.2.7" resolve "^1.20.0" -eslint-import-resolver-typescript@^3.5.2: - version "3.5.2" - resolved "https://registry.yarnpkg.com/eslint-import-resolver-typescript/-/eslint-import-resolver-typescript-3.5.2.tgz#9431acded7d898fd94591a08ea9eec3514c7de91" - integrity sha512-zX4ebnnyXiykjhcBvKIf5TNvt8K7yX6bllTRZ14MiurKPjDpCAZujlszTdB8pcNXhZcOf+god4s9SjQa5GnytQ== +eslint-import-resolver-typescript@^3.5.2, eslint-import-resolver-typescript@^3.5.3: + version "3.5.3" + resolved "https://registry.yarnpkg.com/eslint-import-resolver-typescript/-/eslint-import-resolver-typescript-3.5.3.tgz#db5ed9e906651b7a59dd84870aaef0e78c663a05" + integrity sha512-njRcKYBc3isE42LaTcJNVANR3R99H9bAxBDMNDr2W7yq5gYPxbU3MkdhsQukxZ/Xg9C2vcyLlDsbKfRDg0QvCQ== dependencies: debug "^4.3.4" enhanced-resolve "^5.10.0" @@ -4054,6 +4239,74 @@ eslint-module-utils@^2.7.3: dependencies: debug "^3.2.7" +eslint-plugin-ava@^13.2.0: + version "13.2.0" + resolved "https://registry.yarnpkg.com/eslint-plugin-ava/-/eslint-plugin-ava-13.2.0.tgz#a8e88fe62a259e11e0744d74aaff83f8ec4dbbe0" + integrity sha512-i5B5izsEdERKQLruk1nIWzTTE7C26/ju8qQf7JeyRv32XT2lRMW0zMFZNhIrEf5/5VvpSz2rqrV7UcjClGbKsw== + dependencies: + enhance-visitors "^1.0.0" + eslint-utils "^3.0.0" + espree "^9.0.0" + espurify "^2.1.1" + import-modules "^2.1.0" + micro-spelling-correcter "^1.1.1" + pkg-dir "^5.0.0" + resolve-from "^5.0.0" + +eslint-plugin-canonical@^3.2.4, eslint-plugin-canonical@^3.3.0: + version "3.3.0" + resolved "https://registry.yarnpkg.com/eslint-plugin-canonical/-/eslint-plugin-canonical-3.3.0.tgz#75bc2162b866bcec15549649e13b8a76d801bd44" + integrity sha512-aAVuNSaOTVP+dMTcQB2oxH4yINj2AQ2ss62+/xQmjHyGoGA/RRpb1op+39vxHsBEAw/xvRTGT+Sj625x06f/5g== + dependencies: + is-get-set-prop "^1.0.0" + is-js-type "^2.0.0" + is-obj-prop "^1.0.0" + is-proto-prop "^2.0.0" + lodash "^4.17.21" + natural-compare "^1.4.0" + xregexp "^5.1.1" + +eslint-plugin-cypress@^2.12.1: + version "2.12.1" + resolved "https://registry.yarnpkg.com/eslint-plugin-cypress/-/eslint-plugin-cypress-2.12.1.tgz#9aeee700708ca8c058e00cdafe215199918c2632" + integrity sha512-c2W/uPADl5kospNDihgiLc7n87t5XhUbFDoTl6CfVkmG+kDAb5Ux10V9PoLPu9N+r7znpc+iQlcmAqT1A/89HA== + dependencies: + globals "^11.12.0" + +eslint-plugin-es@^3.0.0: + version "3.0.1" + resolved "https://registry.yarnpkg.com/eslint-plugin-es/-/eslint-plugin-es-3.0.1.tgz#75a7cdfdccddc0589934aeeb384175f221c57893" + integrity sha512-GUmAsJaN4Fc7Gbtl8uOBlayo2DqhwWvEzykMHSCZHU3XdJ+NSzzZcVhXh3VxX5icqQ+oQdIEawXX8xkR3mIFmQ== + dependencies: + eslint-utils "^2.0.0" + regexpp "^3.0.0" + +eslint-plugin-eslint-comments@^3.2.0: + version "3.2.0" + resolved "https://registry.yarnpkg.com/eslint-plugin-eslint-comments/-/eslint-plugin-eslint-comments-3.2.0.tgz#9e1cd7b4413526abb313933071d7aba05ca12ffa" + integrity sha512-0jkOl0hfojIHHmEHgmNdqv4fmh7300NdpA9FFpF7zaoLvB/QeXOGNLIo86oAveJFrfB1p05kC8hpEMHM8DwWVQ== + dependencies: + escape-string-regexp "^1.0.5" + ignore "^5.0.5" + +eslint-plugin-flowtype@^8.0.3: + version "8.0.3" + resolved "https://registry.yarnpkg.com/eslint-plugin-flowtype/-/eslint-plugin-flowtype-8.0.3.tgz#e1557e37118f24734aa3122e7536a038d34a4912" + integrity sha512-dX8l6qUL6O+fYPtpNRideCFSpmWOUVx5QcaGLVqe/vlDiBSe4vYljDWDETwnyFzpl7By/WVIu6rcrniCgH9BqQ== + dependencies: + lodash "^4.17.21" + string-natural-compare "^3.0.1" + +eslint-plugin-fp@^2.3.0: + version "2.3.0" + resolved "https://registry.yarnpkg.com/eslint-plugin-fp/-/eslint-plugin-fp-2.3.0.tgz#376d2a108710e981980bdc3875e3b9920da0489c" + integrity sha512-3n2oHibwoIxAht9/+ZaTldhI6brXORgl8oNXqZd+d9xuAQt2SBJ2/aml0oQRMWvXrgsz2WG6wfC++NjzSG3prA== + dependencies: + create-eslint-index "^1.0.0" + eslint-ast-utils "^1.0.0" + lodash "^4.13.1" + req-all "^0.1.0" + eslint-plugin-import@^2.26.0: version "2.26.0" resolved "https://registry.yarnpkg.com/eslint-plugin-import/-/eslint-plugin-import-2.26.0.tgz#f812dc47be4f2b72b478a021605a59fc6fe8b88b" @@ -4073,25 +4326,91 @@ eslint-plugin-import@^2.26.0: resolve "^1.22.0" tsconfig-paths "^3.14.1" -eslint-plugin-jsx-a11y@^6.5.1: - version "6.6.1" - resolved "https://registry.yarnpkg.com/eslint-plugin-jsx-a11y/-/eslint-plugin-jsx-a11y-6.6.1.tgz#93736fc91b83fdc38cc8d115deedfc3091aef1ff" - integrity sha512-sXgFVNHiWffBq23uiS/JaP6eVR622DqwB4yTzKvGZGcPq6/yZ3WmOZfuBks/vHWo9GaFOqC2ZK4i6+C35knx7Q== +eslint-plugin-jest@^27.2.0: + version "27.2.1" + resolved "https://registry.yarnpkg.com/eslint-plugin-jest/-/eslint-plugin-jest-27.2.1.tgz#b85b4adf41c682ea29f1f01c8b11ccc39b5c672c" + integrity sha512-l067Uxx7ZT8cO9NJuf+eJHvt6bqJyz2Z29wykyEdz/OtmcELQl2MQGQLX8J94O1cSJWAwUSEvCjwjA7KEK3Hmg== dependencies: - "@babel/runtime" "^7.18.9" - aria-query "^4.2.2" - array-includes "^3.1.5" + "@typescript-eslint/utils" "^5.10.0" + +eslint-plugin-jsdoc@^39.6.4: + version "39.6.8" + resolved "https://registry.yarnpkg.com/eslint-plugin-jsdoc/-/eslint-plugin-jsdoc-39.6.8.tgz#a311dbaad00e51fe835c28e14e883c19e0d528a7" + integrity sha512-8W2B2vCfqXmV6AxhEO9u25zPqk7V/LxCsZBl0xDF1CSLDqabiQQtZXpWp19K53HMfFZMLeNRJRUFFhauWgMZrA== + dependencies: + "@es-joy/jsdoccomment" "~0.36.1" + comment-parser "1.3.1" + debug "^4.3.4" + escape-string-regexp "^4.0.0" + esquery "^1.4.0" + semver "^7.3.8" + spdx-expression-parse "^3.0.1" + +eslint-plugin-jsonc@^2.6.0: + version "2.6.0" + resolved "https://registry.yarnpkg.com/eslint-plugin-jsonc/-/eslint-plugin-jsonc-2.6.0.tgz#5a439ec15b4930c022bf157264a3d4f4712b982c" + integrity sha512-4bA9YTx58QaWalua1Q1b82zt7eZMB7i+ed8q8cKkbKP75ofOA2SXbtFyCSok7RY6jIXeCqQnKjN9If8zCgv6PA== + dependencies: + eslint-utils "^3.0.0" + jsonc-eslint-parser "^2.0.4" + natural-compare "^1.4.0" + +eslint-plugin-jsx-a11y@^6.5.1, eslint-plugin-jsx-a11y@^6.6.1: + version "6.7.1" + resolved "https://registry.yarnpkg.com/eslint-plugin-jsx-a11y/-/eslint-plugin-jsx-a11y-6.7.1.tgz#fca5e02d115f48c9a597a6894d5bcec2f7a76976" + integrity sha512-63Bog4iIethyo8smBklORknVjB0T2dwB8Mr/hIC+fBS0uyHdYYpzM/Ed+YC8VxTjlXHEWFOdmgwcDn1U2L9VCA== + dependencies: + "@babel/runtime" "^7.20.7" + aria-query "^5.1.3" + array-includes "^3.1.6" + array.prototype.flatmap "^1.3.1" ast-types-flow "^0.0.7" - axe-core "^4.4.3" - axobject-query "^2.2.0" + axe-core "^4.6.2" + axobject-query "^3.1.1" damerau-levenshtein "^1.0.8" emoji-regex "^9.2.2" has "^1.0.3" - jsx-ast-utils "^3.3.2" - language-tags "^1.0.5" + jsx-ast-utils "^3.3.3" + language-tags "=1.0.5" minimatch "^3.1.2" + object.entries "^1.1.6" + object.fromentries "^2.0.6" semver "^6.3.0" +eslint-plugin-lodash@^7.4.0: + version "7.4.0" + resolved "https://registry.yarnpkg.com/eslint-plugin-lodash/-/eslint-plugin-lodash-7.4.0.tgz#14a761547f126c92ff56789662a20a44f8bb6290" + integrity sha512-Tl83UwVXqe1OVeBRKUeWcfg6/pCW1GTRObbdnbEJgYwjxp5Q92MEWQaH9+dmzbRt6kvYU1Mp893E79nJiCSM8A== + dependencies: + lodash "^4.17.21" + +eslint-plugin-mocha@^10.1.0: + version "10.1.0" + resolved "https://registry.yarnpkg.com/eslint-plugin-mocha/-/eslint-plugin-mocha-10.1.0.tgz#69325414f875be87fb2cb00b2ef33168d4eb7c8d" + integrity sha512-xLqqWUF17llsogVOC+8C6/jvQ+4IoOREbN7ZCHuOHuD6cT5cDD4h7f2LgsZuzMAiwswWE21tO7ExaknHVDrSkw== + dependencies: + eslint-utils "^3.0.0" + rambda "^7.1.0" + +eslint-plugin-modules-newline@0.0.6: + version "0.0.6" + resolved "https://registry.yarnpkg.com/eslint-plugin-modules-newline/-/eslint-plugin-modules-newline-0.0.6.tgz#310093ee8656efe92a8c6f9cb3aa5df9fea6331c" + integrity sha512-69NpBr68U6pmXL+y+KHl/64PwRarceC3/sCNUVxRbe0gPI32SIw8AtdpkqNiJYCa2yMd4lRrkrnU09Yio7KVzA== + dependencies: + requireindex "~1.1.0" + +eslint-plugin-node@^11.1.0: + version "11.1.0" + resolved "https://registry.yarnpkg.com/eslint-plugin-node/-/eslint-plugin-node-11.1.0.tgz#c95544416ee4ada26740a30474eefc5402dc671d" + integrity sha512-oUwtPJ1W0SKD0Tr+wqu92c5xuCeQqB3hSCHasn/ZgjFdA9iDGNkNf2Zi9ztY7X+hNuMib23LNGRm6+uN+KLE3g== + dependencies: + eslint-plugin-es "^3.0.0" + eslint-utils "^2.0.0" + ignore "^5.1.1" + minimatch "^3.0.4" + resolve "^1.10.1" + semver "^6.1.0" + eslint-plugin-prettier@^4.2.1: version "4.2.1" resolved "https://registry.yarnpkg.com/eslint-plugin-prettier/-/eslint-plugin-prettier-4.2.1.tgz#651cbb88b1dab98bfd42f017a12fa6b2d993f94b" @@ -4099,35 +4418,20 @@ eslint-plugin-prettier@^4.2.1: dependencies: prettier-linter-helpers "^1.0.0" -eslint-plugin-react-hooks@^4.5.0: +eslint-plugin-promise@^6.1.1: + version "6.1.1" + resolved "https://registry.yarnpkg.com/eslint-plugin-promise/-/eslint-plugin-promise-6.1.1.tgz#269a3e2772f62875661220631bd4dafcb4083816" + integrity sha512-tjqWDwVZQo7UIPMeDReOpUgHCmCiH+ePnVT+5zVapL0uuHnegBUs2smM13CzOs2Xb5+MHMRFTs9v24yjba4Oig== + +eslint-plugin-react-hooks@^4.5.0, eslint-plugin-react-hooks@^4.6.0: version "4.6.0" resolved "https://registry.yarnpkg.com/eslint-plugin-react-hooks/-/eslint-plugin-react-hooks-4.6.0.tgz#4c3e697ad95b77e93f8646aaa1630c1ba607edd3" integrity sha512-oFc7Itz9Qxh2x4gNHStv3BqJq54ExXmfC+a1NjAta66IAN87Wu0R/QArgIS9qKzX3dXKPI9H5crl9QchNMY9+g== -eslint-plugin-react@7.28.0: - version "7.28.0" - resolved "https://registry.yarnpkg.com/eslint-plugin-react/-/eslint-plugin-react-7.28.0.tgz#8f3ff450677571a659ce76efc6d80b6a525adbdf" - integrity sha512-IOlFIRHzWfEQQKcAD4iyYDndHwTQiCMcJVJjxempf203jnNLUnW34AXLrV33+nEXoifJE2ZEGmcjKPL8957eSw== - dependencies: - array-includes "^3.1.4" - array.prototype.flatmap "^1.2.5" - doctrine "^2.1.0" - estraverse "^5.3.0" - jsx-ast-utils "^2.4.1 || ^3.0.0" - minimatch "^3.0.4" - object.entries "^1.1.5" - object.fromentries "^2.0.5" - object.hasown "^1.1.0" - object.values "^1.1.5" - prop-types "^15.7.2" - resolve "^2.0.0-next.3" - semver "^6.3.0" - string.prototype.matchall "^4.0.6" - -eslint-plugin-react@^7.31.7: - version "7.31.11" - resolved "https://registry.yarnpkg.com/eslint-plugin-react/-/eslint-plugin-react-7.31.11.tgz#011521d2b16dcf95795df688a4770b4eaab364c8" - integrity sha512-TTvq5JsT5v56wPa9OYHzsrOlHzKZKjV+aLgS+55NJP/cuzdiQPC7PfYoUjMoxlffKtvijpk7vA/jmuqRb9nohw== +eslint-plugin-react@^7.31.11, eslint-plugin-react@^7.31.7: + version "7.32.1" + resolved "https://registry.yarnpkg.com/eslint-plugin-react/-/eslint-plugin-react-7.32.1.tgz#88cdeb4065da8ca0b64e1274404f53a0f9890200" + integrity sha512-vOjdgyd0ZHBXNsmvU+785xY8Bfe57EFbTYYk8XrROzWpr9QBvpjITvAXt9xqcE6+8cjR/g1+mfumPToxsl1www== dependencies: array-includes "^3.1.6" array.prototype.flatmap "^1.3.1" @@ -4141,21 +4445,54 @@ eslint-plugin-react@^7.31.7: object.hasown "^1.1.2" object.values "^1.1.6" prop-types "^15.8.1" - resolve "^2.0.0-next.3" + resolve "^2.0.0-next.4" semver "^6.3.0" string.prototype.matchall "^4.0.8" -eslint-plugin-testing-library@^5.9.1: - version "5.9.1" - resolved "https://registry.yarnpkg.com/eslint-plugin-testing-library/-/eslint-plugin-testing-library-5.9.1.tgz#12e4bd34c48683ee98af4df2e3318ec9f51dcf8a" - integrity sha512-6BQp3tmb79jLLasPHJmy8DnxREe+2Pgf7L+7o09TSWPfdqqtQfRZmZNetr5mOs3yqZk/MRNxpN3RUpJe0wB4LQ== +eslint-plugin-regexp@^1.12.0: + version "1.12.0" + resolved "https://registry.yarnpkg.com/eslint-plugin-regexp/-/eslint-plugin-regexp-1.12.0.tgz#b71c488d40ea011a56ab311cd906b2d844eb6b95" + integrity sha512-A1lnzOqHC22Ve8PZJgcw5pDHk5Sxp7J/pY86u027lVEGpUwe7dhZVVsy3SCm/cN438Zts8e9c09KGIVK4IixuA== dependencies: - "@typescript-eslint/utils" "^5.13.0" + comment-parser "^1.1.2" + eslint-utils "^3.0.0" + grapheme-splitter "^1.0.4" + jsdoctypeparser "^9.0.0" + refa "^0.9.0" + regexp-ast-analysis "^0.5.1" + regexpp "^3.2.0" + scslre "^0.1.6" -eslint-plugin-turbo@0.0.4: - version "0.0.4" - resolved "https://registry.yarnpkg.com/eslint-plugin-turbo/-/eslint-plugin-turbo-0.0.4.tgz#966f3dd6202143d0c28dc9cdbb48b0f779d06172" - integrity sha512-dfmYE/iPvoJInQq+5E/0mj140y/rYwKtzZkn3uVK8+nvwC5zmWKQ6ehMWrL4bYBkGzSgpOndZM+jOXhPQ2m8Cg== +eslint-plugin-simple-import-sort@^10.0.0: + version "10.0.0" + resolved "https://registry.yarnpkg.com/eslint-plugin-simple-import-sort/-/eslint-plugin-simple-import-sort-10.0.0.tgz#cc4ceaa81ba73252427062705b64321946f61351" + integrity sha512-AeTvO9UCMSNzIHRkg8S6c3RPy5YEwKWSQPx3DYghLedo2ZQxowPFLGDN1AZ2evfg6r6mjBSZSLxLFsWSu3acsw== + +eslint-plugin-sonarjs@^0.18.0: + version "0.18.0" + resolved "https://registry.yarnpkg.com/eslint-plugin-sonarjs/-/eslint-plugin-sonarjs-0.18.0.tgz#7c009452f633cf6a4c28387dd50502a3e828b05e" + integrity sha512-DJ3osLnt6KFdT5e9ZuIDOjT5A6wUGSLeiJJT03lPgpdD+7CVWlYAw9Goe3bt7SmbFO3Xh89NOCZAuB9XA7bAUQ== + +eslint-plugin-testing-library@^5.10.0: + version "5.10.0" + resolved "https://registry.yarnpkg.com/eslint-plugin-testing-library/-/eslint-plugin-testing-library-5.10.0.tgz#7fc5fec639ae7f84f434562560cf26cfc0ab329d" + integrity sha512-aTOsCAEI9trrX3TLOnsskfhe57DmsjP/yMKLPqg4ftdRvfR4qut2PGWUa8TwP7whZbwMzJjh98tgAPcE8vdHow== + dependencies: + "@typescript-eslint/utils" "^5.43.0" + +eslint-plugin-turbo@0.0.7: + version "0.0.7" + resolved "https://registry.yarnpkg.com/eslint-plugin-turbo/-/eslint-plugin-turbo-0.0.7.tgz#b70155dfeddc530f2f3ca383d850145f22e92fa6" + integrity sha512-iajOH8eD4jha3duztGVBD1BEmvNrQBaA/y3HFHf91vMDRYRwH7BpHSDFtxydDpk5ghlhRxG299SFxz7D6z4MBQ== + +eslint-plugin-typescript-sort-keys@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/eslint-plugin-typescript-sort-keys/-/eslint-plugin-typescript-sort-keys-2.1.0.tgz#f51764518aa512d83df9ba68ab2520b7b85ece2d" + integrity sha512-ET7ABypdz19m47QnKynzNfWPi4CTNQ5jQQC1X5d0gojIwblkbGiCa5IilsqzBTmqxZ0yXDqKBO/GBkBFQCOFsg== + dependencies: + "@typescript-eslint/experimental-utils" "^5.0.0" + json-schema "^0.4.0" + natural-compare-lite "^1.4.0" eslint-plugin-unicorn@^45.0.2: version "45.0.2" @@ -4179,7 +4516,34 @@ eslint-plugin-unicorn@^45.0.2: semver "^7.3.8" strip-indent "^3.0.0" -eslint-scope@^5.1.1: +eslint-plugin-vitest@^0.0.25: + version "0.0.25" + resolved "https://registry.yarnpkg.com/eslint-plugin-vitest/-/eslint-plugin-vitest-0.0.25.tgz#cc9650ee67b47e2a516b8848d18778147956674b" + integrity sha512-6nGXEekRPP2tg0SHijd+LYBKuDI1J00OdHUpJCCxiQjyy5F2J4+GrxVrbaNSIZ1jbvgghIBkAhOtFkImvRGNgg== + dependencies: + "@typescript-eslint/utils" "^5.42.1" + +eslint-plugin-yml@^1.4.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/eslint-plugin-yml/-/eslint-plugin-yml-1.4.0.tgz#703eda879b10be0555ff25c5b8f1cf73506e30de" + integrity sha512-vzggXNfPKa+arIaNUGoC3DPRZCxNty+xD/v9xOcE5D3Bj9SbgIrEobqVB35I8QxHd2YjL/dOS0xIIFmjAalwbw== + dependencies: + debug "^4.3.2" + lodash "^4.17.21" + natural-compare "^1.4.0" + yaml-eslint-parser "^1.1.0" + +eslint-plugin-zod@^1.4.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/eslint-plugin-zod/-/eslint-plugin-zod-1.4.0.tgz#02032d4947581ce35e068cf5f089010d9669492a" + integrity sha512-i9WzQGw2X5fQcuQh33mA8DQjZJM/yuyZvs1Fc5EyTidX7Ed/g832+1FEQ4u5gtXy+jZ+DVsB5+oMHj4tIOfeZg== + +eslint-rule-composer@^0.3.0: + version "0.3.0" + resolved "https://registry.yarnpkg.com/eslint-rule-composer/-/eslint-rule-composer-0.3.0.tgz#79320c927b0c5c0d3d3d2b76c8b4a488f25bbaf9" + integrity sha512-bt+Sh8CtDmn2OajxvNO+BX7Wn4CIWMpTRm3MaiKPCQcnnlm0CS2mhui6QaoeQugs+3Kj2ESKEEGJUdVafwhiCg== + +eslint-scope@5.1.1, eslint-scope@^5.1.1: version "5.1.1" resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-5.1.1.tgz#e786e59a66cb92b3f6c1fb0d508aab174848f48c" integrity sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw== @@ -4195,6 +4559,13 @@ eslint-scope@^7.1.1: esrecurse "^4.3.0" estraverse "^5.2.0" +eslint-utils@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/eslint-utils/-/eslint-utils-2.1.0.tgz#d2de5e03424e707dc10c74068ddedae708741b27" + integrity sha512-w94dQYoauyvlDc43XnGB8lU3Zt713vNChgt4EWwhXAP2XkBvndfxF0AgIqKOOasjPIPzj9JqgwkwbCYD0/V3Zg== + dependencies: + eslint-visitor-keys "^1.1.0" + eslint-utils@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/eslint-utils/-/eslint-utils-3.0.0.tgz#8aebaface7345bb33559db0a1f13a1d2d48c3672" @@ -4202,12 +4573,17 @@ eslint-utils@^3.0.0: dependencies: eslint-visitor-keys "^2.0.0" -eslint-visitor-keys@^2.0.0: +eslint-visitor-keys@^1.1.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz#30ebd1ef7c2fdff01c3a4f151044af25fab0523e" + integrity sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ== + +eslint-visitor-keys@^2.0.0, eslint-visitor-keys@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-2.1.0.tgz#f65328259305927392c938ed44eb0a5c9b2bd303" integrity sha512-0rSmRBzXgDzIsD6mGdJgevzgezI534Cer5L/vyMX0kHzT/jiB43jRhd9YUlMGYLQy2zprNmoT8qasCGtY+QaKw== -eslint-visitor-keys@^3.3.0: +eslint-visitor-keys@^3.0.0, eslint-visitor-keys@^3.3.0: version "3.3.0" resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-3.3.0.tgz#f6480fa6b1f30efe2d1968aa8ac745b862469826" integrity sha512-mQ+suqKJVyeuwGYHAdjMFqjCyfl8+Ldnxuyp3ldiMBFKkvytrXUZWaiPCEav8qDHKty44bD+qV1IP4T+w+xXRA== @@ -4257,7 +4633,52 @@ eslint@^8.31.0: strip-json-comments "^3.1.0" text-table "^0.2.0" -espree@^9.4.0: +eslint@^8.33.0: + version "8.33.0" + resolved "https://registry.yarnpkg.com/eslint/-/eslint-8.33.0.tgz#02f110f32998cb598c6461f24f4d306e41ca33d7" + integrity sha512-WjOpFQgKK8VrCnAtl8We0SUOy/oVZ5NHykyMiagV1M9r8IFpIJX7DduK6n1mpfhlG7T1NLWm2SuD8QB7KFySaA== + dependencies: + "@eslint/eslintrc" "^1.4.1" + "@humanwhocodes/config-array" "^0.11.8" + "@humanwhocodes/module-importer" "^1.0.1" + "@nodelib/fs.walk" "^1.2.8" + ajv "^6.10.0" + chalk "^4.0.0" + cross-spawn "^7.0.2" + debug "^4.3.2" + doctrine "^3.0.0" + escape-string-regexp "^4.0.0" + eslint-scope "^7.1.1" + eslint-utils "^3.0.0" + eslint-visitor-keys "^3.3.0" + espree "^9.4.0" + esquery "^1.4.0" + esutils "^2.0.2" + fast-deep-equal "^3.1.3" + file-entry-cache "^6.0.1" + find-up "^5.0.0" + glob-parent "^6.0.2" + globals "^13.19.0" + grapheme-splitter "^1.0.4" + ignore "^5.2.0" + import-fresh "^3.0.0" + imurmurhash "^0.1.4" + is-glob "^4.0.0" + is-path-inside "^3.0.3" + js-sdsl "^4.1.4" + js-yaml "^4.1.0" + json-stable-stringify-without-jsonify "^1.0.1" + levn "^0.4.1" + lodash.merge "^4.6.2" + minimatch "^3.1.2" + natural-compare "^1.4.0" + optionator "^0.9.1" + regexpp "^3.2.0" + strip-ansi "^6.0.1" + strip-json-comments "^3.1.0" + text-table "^0.2.0" + +espree@^9.0.0, espree@^9.4.0: version "9.4.1" resolved "https://registry.yarnpkg.com/espree/-/espree-9.4.1.tgz#51d6092615567a2c2cff7833445e37c28c0065bd" integrity sha512-XwctdmTO6SIvCzd9810yyNzIrOrqNYV9Koizx4C/mRhf9uq0o4yHoCEU/670pOxOL/MSraektvSAji79kX90Vg== @@ -4271,6 +4692,11 @@ esprima@^4.0.0, esprima@^4.0.1: resolved "https://registry.yarnpkg.com/esprima/-/esprima-4.0.1.tgz#13b04cdb3e6c5d19df91ab6987a8695619b0aa71" integrity sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A== +espurify@^2.1.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/espurify/-/espurify-2.1.1.tgz#afb043f22fac908d991dd25f7bf40bcf03935b9c" + integrity sha512-zttWvnkhcDyGOhSH4vO2qCBILpdCMv/MX8lp4cqgRkQoDRGK2oZxi2GfWhlP2dIXmk7BaKeOTuzbHhyC68o8XQ== + esquery@^1.4.0: version "1.4.0" resolved "https://registry.yarnpkg.com/esquery/-/esquery-1.4.0.tgz#2148ffc38b82e8c7057dfed48425b3e61f0f24a5" @@ -4417,7 +4843,7 @@ fast-diff@^1.1.2: resolved "https://registry.yarnpkg.com/fast-diff/-/fast-diff-1.2.0.tgz#73ee11982d86caaf7959828d519cfe927fac5f03" integrity sha512-xJuoT5+L99XlZ8twedaRf6Ax2TgQVxvgZOYoPKqZufmJib0tL2tegPBOZb1pVNgIhlqDlA0eO0c3wBvQcmzx4w== -fast-glob@^3.2.11, fast-glob@^3.2.9: +fast-glob@^3.2.11, fast-glob@^3.2.12, fast-glob@^3.2.9: version "3.2.12" resolved "https://registry.yarnpkg.com/fast-glob/-/fast-glob-3.2.12.tgz#7f39ec99c2e6ab030337142da9e0c18f37afae80" integrity sha512-DVj4CQIYYow0BlaelwK1pHl5n5cRSJfM60UA0zK891sVInoPri2Ekj7+e1CT3/3qxXenpI+nBBmQAcJPJgaj4w== @@ -4680,6 +5106,11 @@ get-package-type@^0.1.0: resolved "https://registry.yarnpkg.com/get-package-type/-/get-package-type-0.1.0.tgz#8de2d803cff44df3bc6c456e6668b36c3926e11a" integrity sha512-pjzuKtY64GYfWizNAJ0fr9VqttZkNiK2iS430LtIHzjBEr6bX8Am2zm4sW4Ro5wjWW5cAlRL1qAMTcXbjNAO2Q== +get-set-props@^0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/get-set-props/-/get-set-props-0.1.0.tgz#998475c178445686d0b32246da5df8dbcfbe8ea3" + integrity sha512-7oKuKzAGKj0ag+eWZwcGw2fjiZ78tXnXQoBgY0aU7ZOxTu4bB7hSuQSDgtKy978EDH062P5FmD2EWiDpQS9K9Q== + get-stream@^6.0.0, get-stream@^6.0.1: version "6.0.1" resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-6.0.1.tgz#a262d8eef67aced57c2852ad6167526a43cbf7b7" @@ -4746,7 +5177,7 @@ glob@^7.1.1, glob@^7.1.3, glob@^7.1.4: once "^1.3.0" path-is-absolute "^1.0.0" -globals@^11.1.0: +globals@^11.1.0, globals@^11.12.0: version "11.12.0" resolved "https://registry.yarnpkg.com/globals/-/globals-11.12.0.tgz#ab8795338868a0babd8525758018c2a7eb95c42e" integrity sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA== @@ -4853,6 +5284,29 @@ graphql-config@4.3.6: ts-node "^10.8.1" tslib "^2.4.0" +graphql-config@^4.4.0: + version "4.4.0" + resolved "https://registry.yarnpkg.com/graphql-config/-/graphql-config-4.4.0.tgz#4b2d34d846bd4b9a40afbadfc5a4426668963c43" + integrity sha512-QUrX7R4htnTBTi83a0IlIilWVfiLEG8ANFlHRcxoZiTvOXTbgan67SUdGe1OlopbDuyNgtcy4ladl3Gvk4C36A== + dependencies: + "@graphql-tools/graphql-file-loader" "^7.3.7" + "@graphql-tools/json-file-loader" "^7.3.7" + "@graphql-tools/load" "^7.5.5" + "@graphql-tools/merge" "^8.2.6" + "@graphql-tools/url-loader" "^7.9.7" + "@graphql-tools/utils" "^9.0.0" + cosmiconfig "8.0.0" + minimatch "4.2.1" + string-env-interpolation "1.0.1" + tslib "^2.4.0" + +graphql-depth-limit@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/graphql-depth-limit/-/graphql-depth-limit-1.1.0.tgz#59fe6b2acea0ab30ee7344f4c75df39cc18244e8" + integrity sha512-+3B2BaG8qQ8E18kzk9yiSdAa75i/hnnOwgSeAxVJctGQPvmeiLtqKOYF6HETCyRjiF7Xfsyal0HbLlxCQkgkrw== + dependencies: + arrify "^1.0.1" + graphql-request@^5.0.0: version "5.1.0" resolved "https://registry.yarnpkg.com/graphql-request/-/graphql-request-5.1.0.tgz#dbc8feee27d21b993cd5da2d3af67821827b240a" @@ -5048,6 +5502,11 @@ ieee754@^1.1.13: resolved "https://registry.yarnpkg.com/ieee754/-/ieee754-1.2.1.tgz#8eb7a10a63fff25d15a57b001586d177d1b0d352" integrity sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA== +ignore@^5.0.5, ignore@^5.1.1: + version "5.2.4" + resolved "https://registry.yarnpkg.com/ignore/-/ignore-5.2.4.tgz#a291c0c6178ff1b960befe47fcdec301674a6324" + integrity sha512-MAb38BcSbH0eHNBxn7ql2NH/kX33OkB3lZ1BNdh7ENeRChHTYsTvWrMubiIAMNS2llXEEgZ1MUOBtXChP3kaFQ== + ignore@^5.2.0: version "5.2.0" resolved "https://registry.yarnpkg.com/ignore/-/ignore-5.2.0.tgz#6d3bac8fa7fe0d45d9f9be7bac2fc279577e345a" @@ -5084,6 +5543,11 @@ import-local@^3.0.2: pkg-dir "^4.2.0" resolve-cwd "^3.0.0" +import-modules@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/import-modules/-/import-modules-2.1.0.tgz#abe7df297cb6c1f19b57246eb8b8bd9664b6d8c2" + integrity sha512-8HEWcnkbGpovH9yInoisxaSoIg9Brbul+Ju3Kqe2UsYDUBJD/iQjSgEj0zPcTDPKfPp2fs5xlv1i+JSye/m1/A== + imurmurhash@^0.1.4: version "0.1.4" resolved "https://registry.yarnpkg.com/imurmurhash/-/imurmurhash-0.1.4.tgz#9218b9b2b928a238b13dc4fb6b6d576f231453ea" @@ -5329,6 +5793,14 @@ is-generator-function@^1.0.7: dependencies: has-tostringtag "^1.0.0" +is-get-set-prop@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-get-set-prop/-/is-get-set-prop-1.0.0.tgz#2731877e4d78a6a69edcce6bb9d68b0779e76312" + integrity sha512-DvAYZ1ZgGUz4lzxKMPYlt08qAUqyG9ckSg2pIjfvcQ7+pkVNUHk8yVLXOnCLe5WKXhLop8oorWFBJHpwWQpszQ== + dependencies: + get-set-props "^0.1.0" + lowercase-keys "^1.0.0" + is-glob@4.0.3, is-glob@^4.0.0, is-glob@^4.0.1, is-glob@^4.0.3, is-glob@~4.0.1: version "4.0.3" resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-4.0.3.tgz#64f61e42cbbb2eec2071a9dac0b28ba1e65d5084" @@ -5341,6 +5813,13 @@ is-interactive@^1.0.0: resolved "https://registry.yarnpkg.com/is-interactive/-/is-interactive-1.0.0.tgz#cea6e6ae5c870a7b0a0004070b7b587e0252912e" integrity sha512-2HvIEKRoqS62guEC+qBjpvRubdX910WCMuJTZ+I9yvqKU2/12eSL549HMwtabb4oupdj2sMP50k+XJfB/8JE6w== +is-js-type@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/is-js-type/-/is-js-type-2.0.0.tgz#73617006d659b4eb4729bba747d28782df0f7e22" + integrity sha512-Aj13l47+uyTjlQNHtXBV8Cji3jb037vxwMWCgopRR8h6xocgBGW3qG8qGlIOEmbXQtkKShKuBM9e8AA1OeQ+xw== + dependencies: + js-types "^1.0.0" + is-lower-case@^2.0.2: version "2.0.2" resolved "https://registry.yarnpkg.com/is-lower-case/-/is-lower-case-2.0.2.tgz#1c0884d3012c841556243483aa5d522f47396d2a" @@ -5382,6 +5861,14 @@ is-number@^7.0.0: resolved "https://registry.yarnpkg.com/is-number/-/is-number-7.0.0.tgz#7535345b896734d5f80c4d06c50955527a14f12b" integrity sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng== +is-obj-prop@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-obj-prop/-/is-obj-prop-1.0.0.tgz#b34de79c450b8d7c73ab2cdf67dc875adb85f80e" + integrity sha512-5Idb61slRlJlsAzi0Wsfwbp+zZY+9LXKUAZpvT/1ySw+NxKLRWfa0Bzj+wXI3fX5O9hiddm5c3DAaRSNP/yl2w== + dependencies: + lowercase-keys "^1.0.0" + obj-props "^1.0.0" + is-path-inside@^3.0.3: version "3.0.3" resolved "https://registry.yarnpkg.com/is-path-inside/-/is-path-inside-3.0.3.tgz#d231362e53a07ff2b0e0ea7fed049161ffd16283" @@ -5399,6 +5886,14 @@ is-potential-custom-element-name@^1.0.1: resolved "https://registry.yarnpkg.com/is-potential-custom-element-name/-/is-potential-custom-element-name-1.0.1.tgz#171ed6f19e3ac554394edf78caa05784a45bebb5" integrity sha512-bCYeRA2rVibKZd+s2625gGnGF/t7DSqDs4dP7CrLA1m7jKWz6pps0LpYLJN8Q64HtmPKJ1hrN3nzPNKFEKOUiQ== +is-proto-prop@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/is-proto-prop/-/is-proto-prop-2.0.0.tgz#99ab2863462e44090fd083efd1929058f9d935e1" + integrity sha512-jl3NbQ/fGLv5Jhan4uX+Ge9ohnemqyblWVVCpAvtTQzNFvV2xhJq+esnkIbYQ9F1nITXoLfDDQLp7LBw/zzncg== + dependencies: + lowercase-keys "^1.0.0" + proto-props "^2.0.0" + is-regex@^1.1.4: version "1.1.4" resolved "https://registry.yarnpkg.com/is-regex/-/is-regex-1.1.4.tgz#eef5663cd59fa4c0ae339505323df6854bb15958" @@ -5989,6 +6484,11 @@ js-sdsl@^4.1.4: resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-4.0.0.tgz#19203fb59991df98e3a287050d4647cdeaf32499" integrity sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ== +js-types@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/js-types/-/js-types-1.0.0.tgz#d242e6494ed572ad3c92809fc8bed7f7687cbf03" + integrity sha512-bfwqBW9cC/Lp7xcRpug7YrXm0IVw+T9e3g4mCYnv0Pjr3zIzU9PCQElYU9oSGAWzXlbdl9X5SAMPejO9sxkeUw== + js-yaml@^3.13.1: version "3.14.1" resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.14.1.tgz#dae812fdb3825fa306609a8717383c50c36a0537" @@ -6004,6 +6504,16 @@ js-yaml@^4.0.0, js-yaml@^4.1.0: dependencies: argparse "^2.0.1" +jsdoc-type-pratt-parser@~3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/jsdoc-type-pratt-parser/-/jsdoc-type-pratt-parser-3.1.0.tgz#a4a56bdc6e82e5865ffd9febc5b1a227ff28e67e" + integrity sha512-MgtD0ZiCDk9B+eI73BextfRrVQl0oyzRG8B2BjORts6jbunj4ScKPcyXGTbB6eXL4y9TzxCm6hyeLq/2ASzNdw== + +jsdoctypeparser@^9.0.0: + version "9.0.0" + resolved "https://registry.yarnpkg.com/jsdoctypeparser/-/jsdoctypeparser-9.0.0.tgz#8c97e2fb69315eb274b0f01377eaa5c940bd7b26" + integrity sha512-jrTA2jJIL6/DAEILBEh2/w9QxCuwmvNXIry39Ay/HVfhE3o2yVV0U44blYkqdHA/OKloJEqvJy0xU+GSdE2SIw== + jsdom@^20.0.0: version "20.0.3" resolved "https://registry.yarnpkg.com/jsdom/-/jsdom-20.0.3.tgz#886a41ba1d4726f67a8858028c99489fed6ad4db" @@ -6066,6 +6576,11 @@ json-schema-traverse@^0.4.1: resolved "https://registry.yarnpkg.com/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz#69f6a87d9513ab8bb8fe63bdb0979c448e684660" integrity sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg== +json-schema@^0.4.0: + version "0.4.0" + resolved "https://registry.yarnpkg.com/json-schema/-/json-schema-0.4.0.tgz#f7de4cf6efab838ebaeb3236474cbba5a1930ab5" + integrity sha512-es94M3nTIfsEPisRafak+HDLfHXnKBhV3vU5eqPcS3flIWqcxJWgXHXiey3YrpaNsanY5ei1VoYEbOzijuq9BA== + json-stable-stringify-without-jsonify@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz#9db7b59496ad3f3cfef30a75142d2d930ad72651" @@ -6105,6 +6620,16 @@ json5@^2.2.1, json5@^2.2.2: resolved "https://registry.yarnpkg.com/json5/-/json5-2.2.3.tgz#78cd6f1a19bdc12b73db5ad0c61efd66c1e29283" integrity sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg== +jsonc-eslint-parser@^2.0.4: + version "2.1.0" + resolved "https://registry.yarnpkg.com/jsonc-eslint-parser/-/jsonc-eslint-parser-2.1.0.tgz#4c126b530aa583d85308d0b3041ff81ce402bbb2" + integrity sha512-qCRJWlbP2v6HbmKW7R3lFbeiVWHo+oMJ0j+MizwvauqnCV/EvtAeEeuCgoc/ErtsuoKgYB8U4Ih8AxJbXoE6/g== + dependencies: + acorn "^8.5.0" + eslint-visitor-keys "^3.0.0" + espree "^9.0.0" + semver "^7.3.5" + jsonfile@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/jsonfile/-/jsonfile-4.0.0.tgz#8771aae0799b64076b76640fca058f9c10e33ecb" @@ -6127,7 +6652,7 @@ jsonwebtoken@^9.0.0: ms "^2.1.1" semver "^7.3.8" -"jsx-ast-utils@^2.4.1 || ^3.0.0", jsx-ast-utils@^3.3.2: +"jsx-ast-utils@^2.4.1 || ^3.0.0", jsx-ast-utils@^3.3.3: version "3.3.3" resolved "https://registry.yarnpkg.com/jsx-ast-utils/-/jsx-ast-utils-3.3.3.tgz#76b3e6e6cece5c69d49a5792c3d01bd1a0cdc7ea" integrity sha512-fYQHZTZ8jSfmWZ0iyzfwiU4WDX4HpHbMCZ3gPlWYiCl3BoeOTsqKBqnTVfH2rYT7eP5c3sVbeSPHnnJOaTrWiw== @@ -6205,7 +6730,7 @@ language-subtag-registry@~0.3.2: resolved "https://registry.yarnpkg.com/language-subtag-registry/-/language-subtag-registry-0.3.22.tgz#2e1500861b2e457eba7e7ae86877cbd08fa1fd1d" integrity sha512-tN0MCzyWnoz/4nHS6uxdlFWoUZT7ABptwKPQ52Ea7URk6vll88bWBVhodtnlfEuCcKWNGoc+uGbw1cwa9IKh/w== -language-tags@^1.0.5: +language-tags@=1.0.5: version "1.0.5" resolved "https://registry.yarnpkg.com/language-tags/-/language-tags-1.0.5.tgz#d321dbc4da30ba8bf3024e040fa5c14661f9193a" integrity sha512-qJhlO9cGXi6hBGKoxEG/sKZDAHD5Hnu9Hs4WbOY3pCWXDhw0N8x1NenNzm2EnNLkLkk7J2SdxAkDSbb6ftT+UQ== @@ -6290,6 +6815,16 @@ locate-path@^6.0.0: dependencies: p-locate "^5.0.0" +lodash.get@^4.3.0, lodash.get@^4.4.2: + version "4.4.2" + resolved "https://registry.yarnpkg.com/lodash.get/-/lodash.get-4.4.2.tgz#2d177f652fa31e939b4438d5341499dfa3825e99" + integrity sha512-z+Uw/vLuy6gQe8cfaFWD7p0wVv8fJl3mbzXh33RS+0oW2wvUqiRXiQ69gLWSLpgB5/6sU+r6BlQR0MBILadqTQ== + +lodash.lowercase@^4.3.0: + version "4.3.0" + resolved "https://registry.yarnpkg.com/lodash.lowercase/-/lodash.lowercase-4.3.0.tgz#46515aced4acb0b7093133333af068e4c3b14e9d" + integrity sha512-UcvP1IZYyDKyEL64mmrwoA1AbFu5ahojhTtkOUr1K9dbuxzS9ev8i4TxMMGCqRC9TE8uDaSoufNAXxRPNTseVA== + lodash.memoize@4.x: version "4.1.2" resolved "https://registry.yarnpkg.com/lodash.memoize/-/lodash.memoize-4.1.2.tgz#bcc6c49a42a2840ed997f323eada5ecd182e0bfe" @@ -6300,7 +6835,12 @@ lodash.merge@^4.6.2: resolved "https://registry.yarnpkg.com/lodash.merge/-/lodash.merge-4.6.2.tgz#558aa53b43b661e1925a0afdfa36a9a1085fe57a" integrity sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ== -lodash@^4.17.11, lodash@^4.17.15, lodash@^4.17.20, lodash@^4.17.21, lodash@~4.17.0: +lodash.zip@^4.2.0: + version "4.2.0" + resolved "https://registry.yarnpkg.com/lodash.zip/-/lodash.zip-4.2.0.tgz#ec6662e4896408ed4ab6c542a3990b72cc080020" + integrity sha512-C7IOaBBK/0gMORRBd8OETNx3kmOkgIWIPvyDpZSCTwUrpYmgZwJkjZeOD8ww4xbOUOs4/attY+pciKvadNfFbg== + +lodash@^4.13.1, lodash@^4.17.11, lodash@^4.17.15, lodash@^4.17.20, lodash@^4.17.21, lodash@~4.17.0: version "4.17.21" resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.21.tgz#679591c564c3bffaae8454cf0b3df370c3d6911c" integrity sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg== @@ -6344,6 +6884,11 @@ lower-case@^2.0.2: dependencies: tslib "^2.0.3" +lowercase-keys@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/lowercase-keys/-/lowercase-keys-1.0.1.tgz#6f9e30b47084d971a7c820ff15a6c5167b74c26f" + integrity sha512-G2Lj61tXDnVFFOi8VZds+SoQjtQC3dgokKdDG2mTm1tx4m50NUHBOZSBwQQHyy0V12A0JTG4icfZQH+xPyh8VA== + lowercase-keys@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/lowercase-keys/-/lowercase-keys-3.0.0.tgz#c5e7d442e37ead247ae9db117a9d0a467c89d4f2" @@ -6422,6 +6967,11 @@ meros@1.2.1: resolved "https://registry.yarnpkg.com/meros/-/meros-1.2.1.tgz#056f7a76e8571d0aaf3c7afcbe7eb6407ff7329e" integrity sha512-R2f/jxYqCAGI19KhAvaxSOxALBMkaXWH2a7rOyqQw+ZmizX5bKkEYWLzdhC+U82ZVVPVp6MCXe3EkVligh+12g== +micro-spelling-correcter@^1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/micro-spelling-correcter/-/micro-spelling-correcter-1.1.1.tgz#805a06a26ccfcad8f3e5c6a1ac5ff29d4530166e" + integrity sha512-lkJ3Rj/mtjlRcHk6YyCbvZhyWTOzdBvTHsxMmZSk5jxN1YyVSQ+JETAom55mdzfcyDrY/49Z7UCW760BK30crg== + micromatch@^3.1.4: version "3.1.10" resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-3.1.10.tgz#70859bc95c9840952f359a068a3fc49f9ecfac23" @@ -6757,6 +7307,11 @@ nwsapi@^2.2.2: resolved "https://registry.yarnpkg.com/nwsapi/-/nwsapi-2.2.2.tgz#e5418863e7905df67d51ec95938d67bf801f0bb0" integrity sha512-90yv+6538zuvUMnN+zCr8LuV6bPFdq50304114vJYJ8RDyK8D5O9Phpbd6SZWgI7PwzmmfN1upeOJlvybDSgCw== +obj-props@^1.0.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/obj-props/-/obj-props-1.4.0.tgz#9a9beebb6faf8b287ff7dc1cd133a4247dc85641" + integrity sha512-p7p/7ltzPDiBs6DqxOrIbtRdwxxVRBj5ROukeNb9RgA+fawhrz5n2hpNz8DDmYR//tviJSj7nUnlppGmONkjiQ== + object-assign@^4.1.0, object-assign@^4.1.1: version "4.1.1" resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863" @@ -6796,7 +7351,7 @@ object-visit@^1.0.0: dependencies: isobject "^3.0.0" -object.assign@^4.1.2, object.assign@^4.1.3, object.assign@^4.1.4: +object.assign@^4.1.3, object.assign@^4.1.4: version "4.1.4" resolved "https://registry.yarnpkg.com/object.assign/-/object.assign-4.1.4.tgz#9673c7c7c351ab8c4d0b516f4343ebf4dfb7799f" integrity sha512-1mxKf0e58bvyjSCtKYY4sRe9itRk3PJpquJOjeIkz885CczcI4IvJJDLPS72oowuSh+pBxUFROpX+TU++hxhZQ== @@ -6806,7 +7361,7 @@ object.assign@^4.1.2, object.assign@^4.1.3, object.assign@^4.1.4: has-symbols "^1.0.3" object-keys "^1.1.1" -object.entries@^1.1.5, object.entries@^1.1.6: +object.entries@^1.1.6: version "1.1.6" resolved "https://registry.yarnpkg.com/object.entries/-/object.entries-1.1.6.tgz#9737d0e5b8291edd340a3e3264bb8a3b00d5fa23" integrity sha512-leTPzo4Zvg3pmbQ3rDK69Rl8GQvIqMWubrkxONG9/ojtFE2rD9fjMKfSI5BxW3osRH1m6VdzmqK8oAY9aT4x5w== @@ -6815,7 +7370,7 @@ object.entries@^1.1.5, object.entries@^1.1.6: define-properties "^1.1.4" es-abstract "^1.20.4" -object.fromentries@^2.0.5, object.fromentries@^2.0.6: +object.fromentries@^2.0.6: version "2.0.6" resolved "https://registry.yarnpkg.com/object.fromentries/-/object.fromentries-2.0.6.tgz#cdb04da08c539cffa912dcd368b886e0904bfa73" integrity sha512-VciD13dswC4j1Xt5394WR4MzmAQmlgN72phd/riNp9vtD7tp4QQWJ0R4wvclXcafgcYK8veHRed2W6XeGBvcfg== @@ -6824,7 +7379,7 @@ object.fromentries@^2.0.5, object.fromentries@^2.0.6: define-properties "^1.1.4" es-abstract "^1.20.4" -object.hasown@^1.1.0, object.hasown@^1.1.2: +object.hasown@^1.1.2: version "1.1.2" resolved "https://registry.yarnpkg.com/object.hasown/-/object.hasown-1.1.2.tgz#f919e21fad4eb38a57bc6345b3afd496515c3f92" integrity sha512-B5UIT3J1W+WuWIU55h0mjlwaqxiE5vYENJXIXZ4VFe05pNYrkKuK0U/6aFcb0pKywYJh7IhfoqUfKVmrJJHZHw== @@ -7132,6 +7687,13 @@ pkg-dir@^4.2.0: dependencies: find-up "^4.0.0" +pkg-dir@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/pkg-dir/-/pkg-dir-5.0.0.tgz#a02d6aebe6ba133a928f74aec20bafdfe6b8e760" + integrity sha512-NPE8TDbzl/3YQYY7CSS228s3g2ollTFnc+Qi3tqmqJp9Vg2ovUpixcJEo2HJScN2Ez+kEaal6y70c0ehqJBJeA== + dependencies: + find-up "^5.0.0" + pluralize@^8.0.0: version "8.0.0" resolved "https://registry.yarnpkg.com/pluralize/-/pluralize-8.0.0.tgz#1a6fa16a38d12a1901e0320fa017051c539ce3b1" @@ -7191,6 +7753,11 @@ prettier-linter-helpers@^1.0.0: dependencies: fast-diff "^1.1.2" +prettier@^2.8.1: + version "2.8.3" + resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.8.3.tgz#ab697b1d3dd46fb4626fbe2f543afe0cc98d8632" + integrity sha512-tJ/oJ4amDihPoufT5sM0Z1SKEuKay8LfVAMlbbhnnkvt6BUserZylqo2PN+p9KeljLr0OHa2rXHU1T8reeoTrw== + prettier@^2.8.2: version "2.8.2" resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.8.2.tgz#c4ea1b5b454d7c4b59966db2e06ed7eec5dfd160" @@ -7238,6 +7805,11 @@ prop-types@^15.7.2, prop-types@^15.8.1: object-assign "^4.1.1" react-is "^16.13.1" +proto-props@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/proto-props/-/proto-props-2.0.0.tgz#8ac6e6dec658545815c623a3bc81580deda9a181" + integrity sha512-2yma2tog9VaRZY2mn3Wq51uiSW4NcPYT1cQdBagwyrznrilKSZwIZ0UG3ZPL/mx+axEns0hE35T5ufOYZXEnBQ== + proxy-from-env@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/proxy-from-env/-/proxy-from-env-1.1.0.tgz#e102f16ca355424865755d2c9e8ea4f24d58c3e2" @@ -7298,6 +7870,16 @@ radash@^10.4.0: resolved "https://registry.yarnpkg.com/radash/-/radash-10.4.0.tgz#a1e26fe1efcff5b7af6a7f59c0b0bee1d06cd7d9" integrity sha512-ipoALkgQV+2RxRa2v3No7ZVi7ATcKN612gJQkauc9yQPfHT/NNrL8DmMXc1Vi+CZzioL1VvotbOLumsVDLAVHw== +rambda@^7.1.0: + version "7.4.0" + resolved "https://registry.yarnpkg.com/rambda/-/rambda-7.4.0.tgz#61ec9de31d3dd6affe804de3bae04a5b818781e5" + integrity sha512-A9hihu7dUTLOUCM+I8E61V4kRXnN4DwYeK0DwCBydC1MqNI1PidyAtbtpsJlBBzK4icSctEcCQ1bGcLpBuETUQ== + +ramda@^0.28.0: + version "0.28.0" + resolved "https://registry.yarnpkg.com/ramda/-/ramda-0.28.0.tgz#acd785690100337e8b063cab3470019be427cc97" + integrity sha512-9QnLuG/kPVgWvMQ4aODhsBUFKOUmnbUnsSXACv+NCQZcHbeb+v8Lodp8OVxtRULN1/xOyYLLaL6npE6dMq5QTA== + rc-align@^4.0.0: version "4.0.15" resolved "https://registry.yarnpkg.com/rc-align/-/rc-align-4.0.15.tgz#2bbd665cf85dfd0b0244c5a752b07565e9098577" @@ -7765,6 +8347,13 @@ redent@^3.0.0: indent-string "^4.0.0" strip-indent "^3.0.0" +refa@^0.9.0: + version "0.9.1" + resolved "https://registry.yarnpkg.com/refa/-/refa-0.9.1.tgz#12731fce378d235731b1f73182b20083c8a75ca8" + integrity sha512-egU8LgFq2VXlAfUi8Jcbr5X38wEOadMFf8tCbshgcpVCYlE7k84pJOSlnvXF+muDB4igkdVMq7Z/kiNPqDT9TA== + dependencies: + regexpp "^3.2.0" + reflexbox@^4.0.6: version "4.0.6" resolved "https://registry.yarnpkg.com/reflexbox/-/reflexbox-4.0.6.tgz#fc756d2cc1ca493baf9b96bb27dd640ad8154cf1" @@ -7776,7 +8365,7 @@ reflexbox@^4.0.6: "@styled-system/should-forward-prop" "^5.0.0" styled-system "^5.0.0" -regenerator-runtime@^0.13.10, regenerator-runtime@^0.13.11: +regenerator-runtime@^0.13.11: version "0.13.11" resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.13.11.tgz#f6dca3e7ceec20590d07ada785636a90cdca17f9" integrity sha512-kY1AZVr2Ra+t+piVaJ4gxaFaReZVH40AKNo7UCX6W+dEwBo/2oZJzqfuN1qLq1oL45o56cPaTXELwrTh8Fpggg== @@ -7789,6 +8378,22 @@ regex-not@^1.0.0, regex-not@^1.0.2: extend-shallow "^3.0.2" safe-regex "^1.1.0" +regexp-ast-analysis@^0.2.3: + version "0.2.4" + resolved "https://registry.yarnpkg.com/regexp-ast-analysis/-/regexp-ast-analysis-0.2.4.tgz#a497a7c8bfbba51438693821e4b0e3ed43e20f1b" + integrity sha512-8L7kOZQaKPxKKAwGuUZxTQtlO3WZ+tiXy4s6G6PKL6trbOXcZoumwC3AOHHFtI/xoSbNxt7jgLvCnP1UADLWqg== + dependencies: + refa "^0.9.0" + regexpp "^3.2.0" + +regexp-ast-analysis@^0.5.1: + version "0.5.1" + resolved "https://registry.yarnpkg.com/regexp-ast-analysis/-/regexp-ast-analysis-0.5.1.tgz#f7c94e6199d6752f3430ae7a1d7a5978114197fb" + integrity sha512-Ca/g9gaTNuMewLuu+mBIq4vCrGRSO8AE9bP32NMQjJ/wBTdWq0g96qLkBb0NbGwEbp7S/q+NQF3o7veeuRfg0g== + dependencies: + refa "^0.9.0" + regexpp "^3.2.0" + regexp-tree@^0.1.24, regexp-tree@~0.1.1: version "0.1.24" resolved "https://registry.yarnpkg.com/regexp-tree/-/regexp-tree-0.1.24.tgz#3d6fa238450a4d66e5bc9c4c14bb720e2196829d" @@ -7803,7 +8408,7 @@ regexp.prototype.flags@^1.4.3: define-properties "^1.1.3" functions-have-names "^1.2.2" -regexpp@^3.2.0: +regexpp@^3.0.0, regexpp@^3.2.0: version "3.2.0" resolved "https://registry.yarnpkg.com/regexpp/-/regexpp-3.2.0.tgz#0425a2768d8f23bad70ca4b90461fa2f1213e1b2" integrity sha512-pq2bWo9mVD43nbts2wGv17XLiNLya+GklZ8kaDLV2Z08gDCsGpnKn9BFMepvWuHCbyVvY7J5o5+BVvoQbmlJLg== @@ -7849,6 +8454,11 @@ repeat-string@^1.6.1: resolved "https://registry.yarnpkg.com/repeat-string/-/repeat-string-1.6.1.tgz#8dcae470e1c88abc2d600fff4a776286da75e637" integrity sha512-PV0dzCYDNfRi1jCDbJzpW7jNNDRuCOG/jI5ctQcGKt/clZD+YcPS3yIlWuTJMmESC8aevCFmWJy5wjAFgNqN6w== +req-all@^0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/req-all/-/req-all-0.1.0.tgz#130051e2ace58a02eacbfc9d448577a736a9273a" + integrity sha512-ZdvPr8uXy9ujX3KujwE2P1HWkMYgogIhqeAeyb47MqWjSfyxERSm0TNbN/IapCCmWDufXab04AYrRgObaJCJ6Q== + require-directory@^2.1.1: version "2.1.1" resolved "https://registry.yarnpkg.com/require-directory/-/require-directory-2.1.1.tgz#8c64ad5fd30dab1c976e2344ffe7f792a6a6df42" @@ -7859,6 +8469,11 @@ require-main-filename@^2.0.0: resolved "https://registry.yarnpkg.com/require-main-filename/-/require-main-filename-2.0.0.tgz#d0b329ecc7cc0f61649f62215be69af54aa8989b" integrity sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg== +requireindex@~1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/requireindex/-/requireindex-1.1.0.tgz#e5404b81557ef75db6e49c5a72004893fe03e162" + integrity sha512-LBnkqsDE7BZKvqylbmn7lTIVdpx4K/QCduRATpO5R+wtPmky/a8pN1bO2D6wXppn1497AJF9mNjqAXr6bdl9jg== + requires-port@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/requires-port/-/requires-port-1.0.0.tgz#925d2601d39ac485e091cf0da5c6e694dc3dcaff" @@ -7901,7 +8516,7 @@ resolve.exports@^1.1.0: resolved "https://registry.yarnpkg.com/resolve.exports/-/resolve.exports-1.1.0.tgz#5ce842b94b05146c0e03076985d1d0e7e48c90c9" integrity sha512-J1l+Zxxp4XK3LUDZ9m60LRJF/mAe4z6a4xyabPHk7pvK5t35dACV32iIjJDFeWZFfZlO29w6SZ67knR0tHzJtQ== -resolve@^1.10.0, resolve@^1.12.0, resolve@^1.20.0, resolve@^1.22.0: +resolve@^1.10.0, resolve@^1.10.1, resolve@^1.12.0, resolve@^1.20.0, resolve@^1.22.0: version "1.22.1" resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.22.1.tgz#27cb2ebb53f91abb49470a928bba7558066ac177" integrity sha512-nBpuuYuY5jFsli/JIs1oldw6fOQCBioohqWZg/2hiaOybXOft4lonv85uDOKXdf8rhyK159cxU5cDcK/NKk8zw== @@ -7910,7 +8525,7 @@ resolve@^1.10.0, resolve@^1.12.0, resolve@^1.20.0, resolve@^1.22.0: path-parse "^1.0.7" supports-preserve-symlinks-flag "^1.0.0" -resolve@^2.0.0-next.3: +resolve@^2.0.0-next.4: version "2.0.0-next.4" resolved "https://registry.yarnpkg.com/resolve/-/resolve-2.0.0-next.4.tgz#3d37a113d6429f496ec4752d2a2e58efb1fd4660" integrity sha512-iMDbmAWtfU+MHpxt/I5iWI7cY6YVEZUQ3MBgPQ++XD1PELuJHIl82xBmObyP2KyQmkNB2dsqF7seoQQiAn5yDQ== @@ -8046,6 +8661,15 @@ scroll-into-view-if-needed@^2.2.25: dependencies: compute-scroll-into-view "^1.0.20" +scslre@^0.1.6: + version "0.1.6" + resolved "https://registry.yarnpkg.com/scslre/-/scslre-0.1.6.tgz#71a2832e4bf3a9254973a04fbed90aec94f75757" + integrity sha512-JORxVRlQTfjvlOAaiQKebgFElyAm5/W8b50lgaZ0OkEnKnagJW2ufDh3xRfU75UD9z3FGIu1gL1IyR3Poa6Qmw== + dependencies: + refa "^0.9.0" + regexp-ast-analysis "^0.2.3" + regexpp "^3.2.0" + scuid@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/scuid/-/scuid-1.1.0.tgz#d3f9f920956e737a60f72d0e4ad280bf324d5dab" @@ -8070,7 +8694,7 @@ semver@7.x, semver@^7.3.5, semver@^7.3.7, semver@^7.3.8: dependencies: lru-cache "^6.0.0" -semver@^6.0.0, semver@^6.3.0: +semver@^6.0.0, semver@^6.1.0, semver@^6.3.0: version "6.3.0" resolved "https://registry.yarnpkg.com/semver/-/semver-6.3.0.tgz#ee0a64c8af5e8ceea67687b133761e1becbd1d3d" integrity sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw== @@ -8332,7 +8956,7 @@ spdx-exceptions@^2.1.0: resolved "https://registry.yarnpkg.com/spdx-exceptions/-/spdx-exceptions-2.3.0.tgz#3f28ce1a77a00372683eade4a433183527a2163d" integrity sha512-/tTrYOC7PPI1nUAgx34hUpqXuyJG+DTHJTnIULG4rDygi4xu/tfgmq1e1cIRwRzwZgo4NLySi+ricLkZkw4i5A== -spdx-expression-parse@^3.0.0: +spdx-expression-parse@^3.0.0, spdx-expression-parse@^3.0.1: version "3.0.1" resolved "https://registry.yarnpkg.com/spdx-expression-parse/-/spdx-expression-parse-3.0.1.tgz#cf70f50482eefdc98e3ce0a6833e4a53ceeba679" integrity sha512-cbqHunsQWnJNE6KhVSMsMeH5H/L9EpymbzqTQ3uLwNCLZ1Q481oWaofqH7nO6V07xlXwY6PhQdQ2IedWx/ZK4Q== @@ -8409,6 +9033,11 @@ string-length@^4.0.1: char-regex "^1.0.2" strip-ansi "^6.0.0" +string-natural-compare@^3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/string-natural-compare/-/string-natural-compare-3.0.1.tgz#7a42d58474454963759e8e8b7ae63d71c1e7fdf4" + integrity sha512-n3sPwynL1nwKi3WJ6AIsClwBMa0zTi54fn2oLU6ndfTSIO05xaznjSf15PcBZU6FNWbmN5Q6cxT4V5hGvB4taw== + string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3: version "4.2.3" resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010" @@ -8418,7 +9047,7 @@ string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3: is-fullwidth-code-point "^3.0.0" strip-ansi "^6.0.1" -string.prototype.matchall@^4.0.6, string.prototype.matchall@^4.0.8: +string.prototype.matchall@^4.0.8: version "4.0.8" resolved "https://registry.yarnpkg.com/string.prototype.matchall/-/string.prototype.matchall-4.0.8.tgz#3bf85722021816dcd1bf38bb714915887ca79fd3" integrity sha512-6zOCOcJ+RJAQshcTvXPHoxoQGONa3e/Lqx90wUA+wEzX78sg5Bo+1tQo4N0pohS0erG9qtCqJDjNCQBjeWVxyg== @@ -9266,6 +9895,13 @@ xmlchars@^2.2.0: resolved "https://registry.yarnpkg.com/xmlchars/-/xmlchars-2.2.0.tgz#060fe1bcb7f9c76fe2a17db86a9bc3ab894210cb" integrity sha512-JZnDKK8B0RCDw84FNdDAIpZK+JuJw+s7Lz8nksI7SIuU3UXJJslUthsi+uWBUYOwPFwW7W7PRLRfUKpxjtjFCw== +xregexp@^5.1.1: + version "5.1.1" + resolved "https://registry.yarnpkg.com/xregexp/-/xregexp-5.1.1.tgz#6d3fe18819e3143aaf52f9284d34f49a59583ebb" + integrity sha512-fKXeVorD+CzWvFs7VBuKTYIW63YD1e1osxwQ8caZ6o1jg6pDAbABDG54LCIq0j5cy7PjRvGIq6sef9DYPXpncg== + dependencies: + "@babel/runtime-corejs3" "^7.16.5" + y18n@^4.0.0: version "4.0.3" resolved "https://registry.yarnpkg.com/y18n/-/y18n-4.0.3.tgz#b5f259c82cd6e336921efd7bfd8bf560de9eeedf" @@ -9291,11 +9927,25 @@ yaml-ast-parser@^0.0.43: resolved "https://registry.yarnpkg.com/yaml-ast-parser/-/yaml-ast-parser-0.0.43.tgz#e8a23e6fb4c38076ab92995c5dca33f3d3d7c9bb" integrity sha512-2PTINUwsRqSd+s8XxKaJWQlUuEMHJQyEuh2edBbW8KNJz0SJPwUSD2zRWqezFEdN7IzAgeuYHFUCF7o8zRdZ0A== +yaml-eslint-parser@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/yaml-eslint-parser/-/yaml-eslint-parser-1.1.0.tgz#62703e2f4afbe5a17d3fe297882740bf89504e78" + integrity sha512-b464Q1fYiX1oYx2kE8k4mEp6S9Prk+tfDsY/IPxQ0FCjEuj3AKko5Skf3/yQJeYTTDyjDE+aWIJemnv29HvEWQ== + dependencies: + eslint-visitor-keys "^3.0.0" + lodash "^4.17.21" + yaml "^2.0.0" + yaml@^1.10.0, yaml@^1.7.2: version "1.10.2" resolved "https://registry.yarnpkg.com/yaml/-/yaml-1.10.2.tgz#2301c5ffbf12b467de8da2333a459e29e7920e4b" integrity sha512-r3vXyErRCYJ7wg28yvBY5VSoAF8ZvlcW9/BwUzEtUsjvX/DKs24dIkuwjtuprwJJHsbyUbLApepYTR1BN4uHrg== +yaml@^2.0.0: + version "2.2.1" + resolved "https://registry.yarnpkg.com/yaml/-/yaml-2.2.1.tgz#3014bf0482dcd15147aa8e56109ce8632cd60ce4" + integrity sha512-e0WHiYql7+9wr4cWMx3TVQrNwejKaEe7/rHNmQmqRjazfOP5W8PB6Jpebb5o6fIapbz9o9+2ipcaTM2ZwDI6lw== + yargs-parser@^18.1.2: version "18.1.3" resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-18.1.3.tgz#be68c4975c6b2abf469236b0c870362fab09a7b0"