diff --git a/src/core/config/initialOptions.ts b/src/core/config/initialOptions.ts index 86aa500..09885d7 100644 --- a/src/core/config/initialOptions.ts +++ b/src/core/config/initialOptions.ts @@ -1,6 +1,7 @@ import { TElements } from 'core/types/elements'; +import { TElementOption } from 'core/types/Calculation/options'; -const initialOptions: TElements = { +const initialOptions: TElements = { selectChannel: [ { name: 'От агента-ФЛ-сотрудника поставщика', diff --git a/src/core/fakeData/calculation.ts b/src/core/fakeData/calculation.ts index 9b403d3..9a14911 100644 --- a/src/core/fakeData/calculation.ts +++ b/src/core/fakeData/calculation.ts @@ -1,7 +1,8 @@ +import { TElementOption } from 'core/types/Calculation/options'; import { TElements } from 'core/types/elements'; import faker from 'faker'; -const calculationFakeData: TElements = { +const calculationFakeData: TElements = { selectSupplier: [ { name: 'RENAULT (Престиж)', @@ -282,43 +283,54 @@ const calculationFakeData: TElements = { selectLead: [ { name: '100_ООО "Архимаг', - value: faker.random.uuid(), + id: 'arhimagLead', + value: 'arhimagLead', + evo_opportunityid: 'arhimagOpportunity', }, { name: '150_ООО "Некромант', - value: faker.random.uuid(), + id: 'nekrolead', + value: 'nekrolead', }, { name: '200_ООО "Кардинал', - value: faker.random.uuid(), + id: 'kardinalLead', + value: 'kardinalLead', }, ], selectOpportunity: [ { name: '112345_ООО "Архимаг', - value: faker.random.uuid(), + id: 'arhimagOpportunity', + value: 'arhimagOpportunity', }, { name: '145678_ООО "Некромант', - value: faker.random.uuid(), + id: 'nekroOpportunity', + value: 'nekroOpportunity', }, { name: '243910_ООО Кардинал', - value: faker.random.uuid(), + id: 'kardinalOpportunity', + value: 'kardinalOpportunity', }, ], selectQuote: [ { name: '2345_ООО "Архимаг"', - value: faker.random.uuid(), + id: 'arhimagQuote', + value: 'arhimagQuote', + evo_leadid: 'arhimagLead', }, { name: '6789_ООО "Некромант"', - value: faker.random.uuid(), + id: 'nekroQuote', + value: 'nekroQuote', }, { name: '8765_ООО "Кардинал', - value: faker.random.uuid(), + id: 'kardinalQuote', + value: 'kardinalQuote', }, ], selectBroker: [ diff --git a/src/core/types/Calculation/options.ts b/src/core/types/Calculation/options.ts new file mode 100644 index 0000000..2d6439f --- /dev/null +++ b/src/core/types/Calculation/options.ts @@ -0,0 +1,5 @@ +export type TElementOption = { + name: string; + value: any; + [key: string]: any; +}; diff --git a/src/core/types/stores.ts b/src/core/types/stores.ts index e934efc..b4b984f 100644 --- a/src/core/types/stores.ts +++ b/src/core/types/stores.ts @@ -7,9 +7,10 @@ import { import { TValues, ValuesNames } from './values'; import { TElements, ElementsNames } from './elements'; import { TStatuses, Status } from './statuses'; +import { TElementOption } from 'core/types/Calculation/options'; export interface ICalculationStore { - options: TElements; + options: TElements; applyOptions: (options: TElements) => void; filters: TElements;