diff --git a/src/client/Containers/Calculation/Sections/list.js b/src/client/Containers/Calculation/Sections/list.ts similarity index 99% rename from src/client/Containers/Calculation/Sections/list.js rename to src/client/Containers/Calculation/Sections/list.ts index 8b592e6..99639ce 100644 --- a/src/client/Containers/Calculation/Sections/list.js +++ b/src/client/Containers/Calculation/Sections/list.ts @@ -14,8 +14,9 @@ import { validateKpp, validatePhone, } from 'client/tools/validate'; +import { ISections } from 'core/types/Calculation/components'; -export default [ +const sections: ISections[] = [ { title: 'Интерес/ЛС', groups: [ @@ -1656,3 +1657,5 @@ export default [ ], }, ]; + +export default sections; diff --git a/src/core/types/Calculation/components.ts b/src/core/types/Calculation/components.ts new file mode 100644 index 0000000..f074ddd --- /dev/null +++ b/src/core/types/Calculation/components.ts @@ -0,0 +1,29 @@ +import { ElementsNames } from 'core/types/elements'; +import { ValuesNames } from 'core/types/values'; + +interface IElement { + isTable?: boolean; + title?: string; + Component: () => JSX.Element; + props: { + name: ElementsNames; + valueName?: ValuesNames; + [key: string]: any; + }; +} + +interface IBlock { + title?: string; + elements: IElement[]; + [key: string]: any; +} + +interface IGroup { + title?: string; + blocks?: IBlock[]; +} + +export interface ISections { + title?: string; + groups?: IGroup[]; +} diff --git a/src/core/types/elements.ts b/src/core/types/elements.ts index b5fdc93..3b225e4 100644 --- a/src/core/types/elements.ts +++ b/src/core/types/elements.ts @@ -2,7 +2,7 @@ export type ElementsNames = | 'selectLead' | 'selectOpportunity' | 'selectQuote' - | 'cbxRecalcWthtRevision' + | 'cbxRecalcWithRevision' | 'selectTemplate' | 'selectChannel' | 'tbxNewClient' @@ -110,7 +110,7 @@ export type ElementsNames = | 'cbxAddEquipment' | 'cbxRegistrationQuote' | 'cbxTechnicalCardQuote' - | 'cbxNSiB' + | 'cbxNSIB' | 'tbxQuoteName' | 'radioQuoteContactGender' | 'btnCreateKP' @@ -123,7 +123,7 @@ export type ElementsNames = | 'cbxInsuranceDecentral' | 'tbxMaxPriceChange' | 'tbxImporterRewardPerc' - | 'tbxImrovterRewardRub' + | 'tbxImporterRewardRub' | 'cbxDisableChecks' | 'btnFranschise' | 'btnDriversApplication' @@ -131,7 +131,8 @@ export type ElementsNames = | 'tbxBusinessUnit' | 'tbxLeadNumber' | 'tbxOpportunityNumber' - | 'radioInsuranceOPF'; + | 'radioInsuranceOPF' + | 'tableInsurance'; export type TElements = { [elementName in ElementsNames]?: T;