merge migration/random-1
This commit is contained in:
parent
d6db50a582
commit
96c4a095b1
@ -1,4 +1,5 @@
|
|||||||
.next
|
.next
|
||||||
public
|
public
|
||||||
graphql
|
**/graphql/*.types.ts
|
||||||
|
**/graphql/*.schema.graphql
|
||||||
node_modules
|
node_modules
|
||||||
@ -6,6 +6,7 @@ generates:
|
|||||||
plugins:
|
plugins:
|
||||||
- typescript
|
- typescript
|
||||||
- typescript-operations
|
- typescript-operations
|
||||||
|
- typed-document-node
|
||||||
config:
|
config:
|
||||||
onlyOperationTypes: true
|
onlyOperationTypes: true
|
||||||
useTypeImports: true
|
useTypeImports: true
|
||||||
|
|||||||
@ -9,7 +9,7 @@ export type RowValues = z.infer<typeof RowSchema>;
|
|||||||
export type Values = Exclude<keyof RowValues, 'key'>;
|
export type Values = Exclude<keyof RowValues, 'key'>;
|
||||||
|
|
||||||
export type RowOptions = {
|
export type RowOptions = {
|
||||||
[ValueName in Values]?: BaseOption<RowValues[ValueName]>[];
|
[ValueName in Values]: BaseOption<RowValues[ValueName]>[];
|
||||||
};
|
};
|
||||||
|
|
||||||
export type RowStatuses = Record<Values, Status>;
|
export type RowStatuses = Record<Values, Status>;
|
||||||
|
|||||||
@ -9,4 +9,5 @@ export const rows: FormTabRows = [
|
|||||||
[['selectLeaseObjectCategory', 'tbxMileage', 'tbxINNForCalc']],
|
[['selectLeaseObjectCategory', 'tbxMileage', 'tbxINNForCalc']],
|
||||||
[['tbxLeaseObjectMotorPower', 'cbxWithTrailer', 'selectGPSBrand']],
|
[['tbxLeaseObjectMotorPower', 'cbxWithTrailer', 'selectGPSBrand']],
|
||||||
[['tbxEngineVolume', 'cbxInsDecentral', 'selectGPSModel']],
|
[['tbxEngineVolume', 'cbxInsDecentral', 'selectGPSModel']],
|
||||||
|
[['selectLeasingWithoutKasko', 'selectInsNSIB']],
|
||||||
];
|
];
|
||||||
|
|||||||
@ -1,25 +1,14 @@
|
|||||||
import { gql, useQuery } from '@apollo/client';
|
import { useQuery } from '@apollo/client';
|
||||||
import type * as CRMTypes from 'graphql/crm.types';
|
import * as CRMTypes from 'graphql/crm.types';
|
||||||
import { observer } from 'mobx-react-lite';
|
import { observer } from 'mobx-react-lite';
|
||||||
import { useStore } from 'stores/hooks';
|
import { useStore } from 'stores/hooks';
|
||||||
|
|
||||||
const QUERY_GET_CURRENCY_SYMBOL = gql`
|
|
||||||
query GetCurrencySymbol($currencyid: Uuid!) {
|
|
||||||
transactioncurrency(transactioncurrencyid: $currencyid) {
|
|
||||||
currencysymbol
|
|
||||||
}
|
|
||||||
}
|
|
||||||
`;
|
|
||||||
|
|
||||||
const CurrencyAddon = observer(() => {
|
const CurrencyAddon = observer(() => {
|
||||||
const { $calculation } = useStore();
|
const { $calculation } = useStore();
|
||||||
|
|
||||||
const currencyid = $calculation.element('selectSupplierCurrency').getValue();
|
const currencyid = $calculation.element('selectSupplierCurrency').getValue();
|
||||||
|
|
||||||
const { data } = useQuery<
|
const { data } = useQuery(CRMTypes.GetTransactionCurrencyDocument, {
|
||||||
CRMTypes.GetCurrencySymbolQuery,
|
|
||||||
CRMTypes.GetCurrencySymbolQueryVariables
|
|
||||||
>(QUERY_GET_CURRENCY_SYMBOL, {
|
|
||||||
variables: {
|
variables: {
|
||||||
currencyid: currencyid!,
|
currencyid: currencyid!,
|
||||||
},
|
},
|
||||||
|
|||||||
4
apps/web/Components/Calculation/builders/index.js
Normal file
4
apps/web/Components/Calculation/builders/index.js
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
export { default as buildAction } from './build-action';
|
||||||
|
export { default as buildOptions } from './build-options';
|
||||||
|
export { default as buildReadonly } from './build-readonly';
|
||||||
|
export { default as buildValue } from './build-value';
|
||||||
@ -1,153 +0,0 @@
|
|||||||
import buildAction from '../builders/build-action';
|
|
||||||
import buildOptions from '../builders/build-options';
|
|
||||||
import buildReadonly from '../builders/build-readonly';
|
|
||||||
import buildValue from '../builders/build-value';
|
|
||||||
import type { Elements as ActionElements } from './map/actions';
|
|
||||||
import type { Elements as ValuesElements } from './map/values';
|
|
||||||
|
|
||||||
function wrapElementsBuilders<C, T extends Record<ValuesElements | ActionElements, C>>(arg: T) {
|
|
||||||
return arg;
|
|
||||||
}
|
|
||||||
|
|
||||||
const builders = wrapElementsBuilders({
|
|
||||||
cbxRecalcWithRevision: buildValue,
|
|
||||||
tbxLeaseObjectPrice: buildValue,
|
|
||||||
tbxLeaseObjectPriceWthtVAT: buildValue,
|
|
||||||
tbxVATInLeaseObjectPrice: buildValue,
|
|
||||||
tbxEngineHours: buildValue,
|
|
||||||
tbxSupplierDiscountRub: buildValue,
|
|
||||||
tbxSupplierDiscountPerc: buildValue,
|
|
||||||
tbxLeasingPeriod: buildValue,
|
|
||||||
tbxFirstPaymentPerc: buildValue,
|
|
||||||
tbxFirstPaymentRub: buildValue,
|
|
||||||
tbxLastPaymentPerc: buildValue,
|
|
||||||
tbxLastPaymentRub: buildValue,
|
|
||||||
selectImportProgram: buildOptions,
|
|
||||||
tbxImportProgramSum: buildReadonly,
|
|
||||||
tbxAddEquipmentPrice: buildValue,
|
|
||||||
tbxRedemptionPaymentSum: buildValue,
|
|
||||||
tbxParmentsDecreasePercent: buildValue,
|
|
||||||
tbxComissionPerc: buildValue,
|
|
||||||
tbxComissionRub: buildValue,
|
|
||||||
tbxSaleBonus: buildValue,
|
|
||||||
tbxIRR_Perc: buildValue,
|
|
||||||
tbxLeaseObjectCount: buildValue,
|
|
||||||
cbxWithTrailer: buildValue,
|
|
||||||
cbxLeaseObjectUsed: buildValue,
|
|
||||||
tbxMaxMass: buildValue,
|
|
||||||
tbxCountSeats: buildValue,
|
|
||||||
tbxMaxSpeed: buildValue,
|
|
||||||
tbxLeaseObjectYear: buildValue,
|
|
||||||
tbxLeaseObjectMotorPower: buildValue,
|
|
||||||
tbxEngineVolume: buildValue,
|
|
||||||
tbxDealerRewardSumm: buildValue,
|
|
||||||
tbxDealerBrokerRewardSumm: buildValue,
|
|
||||||
tbxIndAgentRewardSumm: buildValue,
|
|
||||||
tbxCalcDoubleAgentRewardSumm: buildValue,
|
|
||||||
tbxCalcBrokerRewardSum: buildValue,
|
|
||||||
tbxFinDepartmentRewardSumm: buildValue,
|
|
||||||
cbxInsDecentral: buildValue,
|
|
||||||
tbxInsFranchise: buildValue,
|
|
||||||
cbxInsUnlimitDrivers: buildValue,
|
|
||||||
tbxInsAgeDrivers: buildValue,
|
|
||||||
tbxInsExpDrivers: buildValue,
|
|
||||||
tbxINNForCalc: buildValue,
|
|
||||||
cbxLastPaymentRedemption: buildValue,
|
|
||||||
cbxPriceWithDiscount: buildValue,
|
|
||||||
cbxFullPriceWithDiscount: buildValue,
|
|
||||||
cbxCostIncrease: buildValue,
|
|
||||||
cbxInsurance: buildValue,
|
|
||||||
cbxRegistrationQuote: buildValue,
|
|
||||||
cbxTechnicalCardQuote: buildValue,
|
|
||||||
cbxNSIB: buildValue,
|
|
||||||
tbxQuoteName: buildValue,
|
|
||||||
cbxQuoteRedemptionGraph: buildValue,
|
|
||||||
cbxShowFinGAP: buildValue,
|
|
||||||
tbxCreditRate: buildValue,
|
|
||||||
tbxMaxPriceChange: buildValue,
|
|
||||||
tbxImporterRewardPerc: buildValue,
|
|
||||||
tbxImporterRewardRub: buildValue,
|
|
||||||
cbxDisableChecks: buildValue,
|
|
||||||
tbxMileage: buildValue,
|
|
||||||
tbxTotalPayments: buildValue,
|
|
||||||
tbxVehicleTaxInYear: buildValue,
|
|
||||||
tbxVehicleTaxInLeasingPeriod: buildValue,
|
|
||||||
tbxMinPriceChange: buildValue,
|
|
||||||
|
|
||||||
selectProduct: buildOptions,
|
|
||||||
selectClientRisk: buildOptions,
|
|
||||||
selectClientType: buildOptions,
|
|
||||||
selectSupplierCurrency: buildOptions,
|
|
||||||
selectSeasonType: buildOptions,
|
|
||||||
selectHighSeasonStart: buildOptions,
|
|
||||||
selectLeaseObjectType: buildOptions,
|
|
||||||
selectBrand: buildOptions,
|
|
||||||
selectModel: buildOptions,
|
|
||||||
selectConfiguration: buildOptions,
|
|
||||||
selectLeaseObjectUseFor: buildOptions,
|
|
||||||
selectLeaseObjectCategory: buildOptions,
|
|
||||||
selectEngineType: buildOptions,
|
|
||||||
selectDealer: buildOptions,
|
|
||||||
selectDealerPerson: buildOptions,
|
|
||||||
selectDealerRewardCondition: buildOptions,
|
|
||||||
selectDealerBroker: buildOptions,
|
|
||||||
selectDealerBrokerRewardCondition: buildOptions,
|
|
||||||
selectIndAgent: buildOptions,
|
|
||||||
selectIndAgentRewardCondition: buildOptions,
|
|
||||||
selectCalcDoubleAgent: buildOptions,
|
|
||||||
selectCalcDoubleAgentRewardCondition: buildOptions,
|
|
||||||
selectCalcBroker: buildOptions,
|
|
||||||
selectCalcBrokerRewardCondition: buildOptions,
|
|
||||||
selectCalcFinDepartment: buildOptions,
|
|
||||||
selectFinDepartmentRewardCondtion: buildOptions,
|
|
||||||
selectGPSBrand: buildOptions,
|
|
||||||
selectGPSModel: buildOptions,
|
|
||||||
selectRegionRegistration: buildOptions,
|
|
||||||
selectTownRegistration: buildOptions,
|
|
||||||
selectRegistration: buildOptions,
|
|
||||||
selectInsNSIB: buildOptions,
|
|
||||||
selectTracker: buildOptions,
|
|
||||||
selectTelematic: buildOptions,
|
|
||||||
selectTechnicalCard: buildOptions,
|
|
||||||
selectTarif: buildOptions,
|
|
||||||
selectRate: buildOptions,
|
|
||||||
selectLead: buildOptions,
|
|
||||||
selectOpportunity: buildOptions,
|
|
||||||
selectQuote: buildOptions,
|
|
||||||
selectObjectRegionRegistration: buildOptions,
|
|
||||||
selectObjectCategoryTax: buildOptions,
|
|
||||||
selectObjectTypeTax: buildOptions,
|
|
||||||
selectLegalClientRegion: buildOptions,
|
|
||||||
selectLegalClientTown: buildOptions,
|
|
||||||
selectSubsidy: buildOptions,
|
|
||||||
selectFuelCard: buildOptions,
|
|
||||||
radioBalanceHolder: buildOptions,
|
|
||||||
radioLastPaymentRule: buildOptions,
|
|
||||||
radioGraphType: buildOptions,
|
|
||||||
radioDeliveryTime: buildOptions,
|
|
||||||
radioInsKaskoType: buildOptions,
|
|
||||||
radioInfuranceOPF: buildOptions,
|
|
||||||
selectRequirementTelematic: buildOptions,
|
|
||||||
radioQuoteContactGender: buildOptions,
|
|
||||||
radioCalcType: buildOptions,
|
|
||||||
radioObjectRegistration: buildOptions,
|
|
||||||
radioTypePTS: buildOptions,
|
|
||||||
tbxBonusCoefficient: buildValue,
|
|
||||||
|
|
||||||
labelLeaseObjectRisk: buildReadonly,
|
|
||||||
tbxInsKaskoPriceLeasePeriod: buildReadonly,
|
|
||||||
labelIrrInfo: buildReadonly,
|
|
||||||
labelRegistrationDescription: buildReadonly,
|
|
||||||
labelDepreciationGroup: buildReadonly,
|
|
||||||
tbxSubsidySum: buildReadonly,
|
|
||||||
|
|
||||||
btnCreateKP: buildAction,
|
|
||||||
btnCalculate: buildAction,
|
|
||||||
|
|
||||||
linkDownloadKp: buildReadonly,
|
|
||||||
linkLeadUrl: buildReadonly,
|
|
||||||
linkOpportunityUrl: buildReadonly,
|
|
||||||
linkQuoteUrl: buildReadonly,
|
|
||||||
});
|
|
||||||
|
|
||||||
export default builders;
|
|
||||||
@ -1,5 +1,5 @@
|
|||||||
import type { ComponentProps } from 'react';
|
import type { ComponentProps } from 'react';
|
||||||
import * as elements from 'ui/elements';
|
import * as e from 'ui/elements';
|
||||||
import type { Elements as ActionElements } from './map/actions';
|
import type { Elements as ActionElements } from './map/actions';
|
||||||
import type { Elements as ValuesElements } from './map/values';
|
import type { Elements as ValuesElements } from './map/values';
|
||||||
|
|
||||||
@ -8,146 +8,147 @@ function wrapComponentsMap<C, T extends Record<ValuesElements | ActionElements,
|
|||||||
}
|
}
|
||||||
|
|
||||||
const components = wrapComponentsMap({
|
const components = wrapComponentsMap({
|
||||||
selectProduct: elements.Select,
|
selectProduct: e.Select,
|
||||||
selectClientRisk: elements.Select,
|
selectClientRisk: e.Select,
|
||||||
selectClientType: elements.Select,
|
selectClientType: e.Select,
|
||||||
selectSupplierCurrency: elements.Select,
|
selectSupplierCurrency: e.Select,
|
||||||
tbxLeaseObjectPrice: elements.InputNumber,
|
tbxLeaseObjectPrice: e.InputNumber,
|
||||||
tbxLeaseObjectPriceWthtVAT: elements.InputNumber,
|
tbxLeaseObjectPriceWthtVAT: e.InputNumber,
|
||||||
tbxVATInLeaseObjectPrice: elements.InputNumber,
|
tbxVATInLeaseObjectPrice: e.InputNumber,
|
||||||
tbxSupplierDiscountRub: elements.InputNumber,
|
tbxSupplierDiscountRub: e.InputNumber,
|
||||||
tbxSupplierDiscountPerc: elements.InputNumber,
|
tbxSupplierDiscountPerc: e.InputNumber,
|
||||||
radioBalanceHolder: elements.Radio,
|
radioBalanceHolder: e.Radio,
|
||||||
tbxSaleBonus: elements.InputNumber,
|
tbxSaleBonus: e.InputNumber,
|
||||||
tbxFirstPaymentPerc: elements.InputNumber,
|
tbxFirstPaymentPerc: e.InputNumber,
|
||||||
tbxFirstPaymentRub: elements.InputNumber,
|
tbxFirstPaymentRub: e.InputNumber,
|
||||||
radioLastPaymentRule: elements.Segmented,
|
radioLastPaymentRule: e.Segmented,
|
||||||
tbxLastPaymentPerc: elements.InputNumber,
|
tbxLastPaymentPerc: e.InputNumber,
|
||||||
tbxLastPaymentRub: elements.InputNumber,
|
tbxLastPaymentRub: e.InputNumber,
|
||||||
selectImportProgram: elements.Select,
|
selectImportProgram: e.Select,
|
||||||
tbxImportProgramSum: elements.InputNumber,
|
tbxImportProgramSum: e.InputNumber,
|
||||||
tbxAddEquipmentPrice: elements.InputNumber,
|
tbxAddEquipmentPrice: e.InputNumber,
|
||||||
tbxRedemptionPaymentSum: elements.InputNumber,
|
tbxRedemptionPaymentSum: e.InputNumber,
|
||||||
tbxLeasingPeriod: elements.InputNumber,
|
tbxLeasingPeriod: e.InputNumber,
|
||||||
radioGraphType: elements.Radio,
|
radioGraphType: e.Radio,
|
||||||
tbxParmentsDecreasePercent: elements.InputNumber,
|
tbxParmentsDecreasePercent: e.InputNumber,
|
||||||
selectSeasonType: elements.Select,
|
selectSeasonType: e.Select,
|
||||||
selectHighSeasonStart: elements.Select,
|
selectHighSeasonStart: e.Select,
|
||||||
tbxComissionPerc: elements.InputNumber,
|
tbxComissionPerc: e.InputNumber,
|
||||||
tbxComissionRub: elements.InputNumber,
|
tbxComissionRub: e.InputNumber,
|
||||||
selectLeaseObjectType: elements.Select,
|
selectLeaseObjectType: e.Select,
|
||||||
selectBrand: elements.Select,
|
selectBrand: e.Select,
|
||||||
selectModel: elements.Select,
|
selectModel: e.Select,
|
||||||
selectConfiguration: elements.Select,
|
selectConfiguration: e.Select,
|
||||||
cbxLeaseObjectUsed: elements.Checkbox,
|
cbxLeaseObjectUsed: e.Checkbox,
|
||||||
radioDeliveryTime: elements.Segmented,
|
radioDeliveryTime: e.Segmented,
|
||||||
tbxLeaseObjectCount: elements.InputNumber,
|
tbxLeaseObjectCount: e.InputNumber,
|
||||||
selectLeaseObjectUseFor: elements.Select,
|
selectLeaseObjectUseFor: e.Select,
|
||||||
tbxLeaseObjectYear: elements.InputNumber,
|
tbxLeaseObjectYear: e.InputNumber,
|
||||||
selectLeaseObjectCategory: elements.Select,
|
selectLeaseObjectCategory: e.Select,
|
||||||
selectEngineType: elements.Select,
|
selectEngineType: e.Select,
|
||||||
tbxLeaseObjectMotorPower: elements.InputNumber,
|
tbxLeaseObjectMotorPower: e.InputNumber,
|
||||||
tbxEngineVolume: elements.InputNumber,
|
tbxEngineVolume: e.InputNumber,
|
||||||
tbxMaxMass: elements.InputNumber,
|
tbxMaxMass: e.InputNumber,
|
||||||
tbxCountSeats: elements.InputNumber,
|
tbxCountSeats: e.InputNumber,
|
||||||
tbxMaxSpeed: elements.InputNumber,
|
tbxMaxSpeed: e.InputNumber,
|
||||||
cbxWithTrailer: elements.Checkbox,
|
cbxWithTrailer: e.Checkbox,
|
||||||
selectDealer: elements.Select,
|
selectDealer: e.Select,
|
||||||
selectDealerPerson: elements.Select,
|
selectDealerPerson: e.Select,
|
||||||
selectDealerRewardCondition: elements.Select,
|
selectDealerRewardCondition: e.Select,
|
||||||
tbxDealerRewardSumm: elements.InputNumber,
|
tbxDealerRewardSumm: e.InputNumber,
|
||||||
selectDealerBroker: elements.Select,
|
selectDealerBroker: e.Select,
|
||||||
selectDealerBrokerRewardCondition: elements.Select,
|
selectDealerBrokerRewardCondition: e.Select,
|
||||||
tbxDealerBrokerRewardSumm: elements.InputNumber,
|
tbxDealerBrokerRewardSumm: e.InputNumber,
|
||||||
selectIndAgent: elements.Select,
|
selectIndAgent: e.Select,
|
||||||
selectIndAgentRewardCondition: elements.Select,
|
selectIndAgentRewardCondition: e.Select,
|
||||||
tbxIndAgentRewardSumm: elements.InputNumber,
|
tbxIndAgentRewardSumm: e.InputNumber,
|
||||||
selectCalcDoubleAgent: elements.Select,
|
selectCalcDoubleAgent: e.Select,
|
||||||
selectCalcDoubleAgentRewardCondition: elements.Select,
|
selectCalcDoubleAgentRewardCondition: e.Select,
|
||||||
tbxCalcDoubleAgentRewardSumm: elements.InputNumber,
|
tbxCalcDoubleAgentRewardSumm: e.InputNumber,
|
||||||
selectCalcBroker: elements.Select,
|
selectCalcBroker: e.Select,
|
||||||
selectCalcBrokerRewardCondition: elements.Select,
|
selectCalcBrokerRewardCondition: e.Select,
|
||||||
tbxCalcBrokerRewardSum: elements.InputNumber,
|
tbxCalcBrokerRewardSum: e.InputNumber,
|
||||||
selectCalcFinDepartment: elements.Select,
|
selectCalcFinDepartment: e.Select,
|
||||||
selectFinDepartmentRewardCondtion: elements.Select,
|
selectFinDepartmentRewardCondtion: e.Select,
|
||||||
tbxFinDepartmentRewardSumm: elements.InputNumber,
|
tbxFinDepartmentRewardSumm: e.InputNumber,
|
||||||
cbxInsDecentral: elements.Switch,
|
cbxInsDecentral: e.Switch,
|
||||||
radioInsKaskoType: elements.Radio,
|
radioInsKaskoType: e.Radio,
|
||||||
tbxInsFranchise: elements.InputNumber,
|
tbxInsFranchise: e.InputNumber,
|
||||||
cbxInsUnlimitDrivers: elements.Switch,
|
cbxInsUnlimitDrivers: e.Switch,
|
||||||
tbxInsAgeDrivers: elements.InputNumber,
|
tbxInsAgeDrivers: e.InputNumber,
|
||||||
tbxInsExpDrivers: elements.InputNumber,
|
tbxInsExpDrivers: e.InputNumber,
|
||||||
tbxINNForCalc: elements.InputNumber,
|
tbxINNForCalc: e.InputNumber,
|
||||||
selectGPSBrand: elements.Select,
|
selectGPSBrand: e.Select,
|
||||||
selectGPSModel: elements.Select,
|
selectGPSModel: e.Select,
|
||||||
selectRegionRegistration: elements.Select,
|
selectRegionRegistration: e.Select,
|
||||||
selectTownRegistration: elements.Select,
|
selectTownRegistration: e.Select,
|
||||||
radioInfuranceOPF: elements.Radio,
|
radioInfuranceOPF: e.Radio,
|
||||||
selectRegistration: elements.Select,
|
selectRegistration: e.Select,
|
||||||
selectInsNSIB: elements.Select,
|
selectInsNSIB: e.Select,
|
||||||
selectRequirementTelematic: elements.Select,
|
selectRequirementTelematic: e.Select,
|
||||||
selectTracker: elements.Select,
|
selectTracker: e.Select,
|
||||||
selectTelematic: elements.Select,
|
selectTelematic: e.Select,
|
||||||
selectTechnicalCard: elements.Select,
|
selectTechnicalCard: e.Select,
|
||||||
cbxLastPaymentRedemption: elements.Switch,
|
cbxLastPaymentRedemption: e.Switch,
|
||||||
cbxPriceWithDiscount: elements.Switch,
|
cbxPriceWithDiscount: e.Switch,
|
||||||
cbxFullPriceWithDiscount: elements.Switch,
|
cbxFullPriceWithDiscount: e.Switch,
|
||||||
cbxCostIncrease: elements.Switch,
|
cbxCostIncrease: e.Switch,
|
||||||
cbxInsurance: elements.Switch,
|
cbxInsurance: e.Switch,
|
||||||
cbxRegistrationQuote: elements.Switch,
|
cbxRegistrationQuote: e.Switch,
|
||||||
cbxTechnicalCardQuote: elements.Switch,
|
cbxTechnicalCardQuote: e.Switch,
|
||||||
cbxNSIB: elements.Switch,
|
cbxNSIB: e.Switch,
|
||||||
cbxQuoteRedemptionGraph: elements.Switch,
|
cbxQuoteRedemptionGraph: e.Switch,
|
||||||
cbxShowFinGAP: elements.Switch,
|
cbxShowFinGAP: e.Switch,
|
||||||
tbxQuoteName: elements.Input,
|
tbxQuoteName: e.Input,
|
||||||
radioQuoteContactGender: elements.Radio,
|
radioQuoteContactGender: e.Radio,
|
||||||
cbxDisableChecks: elements.Switch,
|
cbxDisableChecks: e.Switch,
|
||||||
selectTarif: elements.Select,
|
selectTarif: e.Select,
|
||||||
tbxCreditRate: elements.InputNumber,
|
tbxCreditRate: e.InputNumber,
|
||||||
selectRate: elements.Select,
|
selectRate: e.Select,
|
||||||
tbxMaxPriceChange: elements.InputNumber,
|
tbxMaxPriceChange: e.InputNumber,
|
||||||
tbxImporterRewardPerc: elements.InputNumber,
|
tbxImporterRewardPerc: e.InputNumber,
|
||||||
tbxImporterRewardRub: elements.InputNumber,
|
tbxImporterRewardRub: e.InputNumber,
|
||||||
selectLead: elements.Select,
|
selectLead: e.Select,
|
||||||
selectOpportunity: elements.Select,
|
selectOpportunity: e.Select,
|
||||||
selectQuote: elements.Select,
|
selectQuote: e.Select,
|
||||||
cbxRecalcWithRevision: elements.Checkbox,
|
cbxRecalcWithRevision: e.Checkbox,
|
||||||
tbxIRR_Perc: elements.InputNumber,
|
tbxIRR_Perc: e.InputNumber,
|
||||||
tbxMileage: elements.InputNumber,
|
tbxMileage: e.InputNumber,
|
||||||
tbxEngineHours: elements.InputNumber,
|
tbxEngineHours: e.InputNumber,
|
||||||
radioCalcType: elements.Segmented,
|
radioCalcType: e.Segmented,
|
||||||
tbxTotalPayments: elements.InputNumber,
|
tbxTotalPayments: e.InputNumber,
|
||||||
radioObjectRegistration: elements.Radio,
|
radioObjectRegistration: e.Radio,
|
||||||
selectObjectRegionRegistration: elements.Select,
|
selectObjectRegionRegistration: e.Select,
|
||||||
tbxVehicleTaxInYear: elements.InputNumber,
|
tbxVehicleTaxInYear: e.InputNumber,
|
||||||
tbxVehicleTaxInLeasingPeriod: elements.InputNumber,
|
tbxVehicleTaxInLeasingPeriod: e.InputNumber,
|
||||||
selectObjectCategoryTax: elements.Select,
|
selectObjectCategoryTax: e.Select,
|
||||||
selectObjectTypeTax: elements.Select,
|
selectObjectTypeTax: e.Select,
|
||||||
radioTypePTS: elements.Radio,
|
radioTypePTS: e.Radio,
|
||||||
selectLegalClientRegion: elements.Select,
|
selectLegalClientRegion: e.Select,
|
||||||
selectLegalClientTown: elements.Select,
|
selectLegalClientTown: e.Select,
|
||||||
selectSubsidy: elements.Select,
|
selectSubsidy: e.Select,
|
||||||
selectFuelCard: elements.Select,
|
selectFuelCard: e.Select,
|
||||||
tbxMinPriceChange: elements.InputNumber,
|
tbxMinPriceChange: e.InputNumber,
|
||||||
tbxBonusCoefficient: elements.InputNumber,
|
tbxBonusCoefficient: e.InputNumber,
|
||||||
|
selectLeasingWithoutKasko: e.Select,
|
||||||
|
|
||||||
/** Readonly Elements */
|
/** Readonly Elements */
|
||||||
labelLeaseObjectRisk: elements.Text,
|
labelLeaseObjectRisk: e.Text,
|
||||||
tbxInsKaskoPriceLeasePeriod: elements.InputNumber,
|
tbxInsKaskoPriceLeasePeriod: e.InputNumber,
|
||||||
labelIrrInfo: elements.Text,
|
labelIrrInfo: e.Text,
|
||||||
labelRegistrationDescription: elements.Text,
|
labelRegistrationDescription: e.Text,
|
||||||
labelDepreciationGroup: elements.Text,
|
labelDepreciationGroup: e.Text,
|
||||||
tbxSubsidySum: elements.InputNumber,
|
tbxSubsidySum: e.InputNumber,
|
||||||
|
|
||||||
/** Button Elements */
|
/** Button Elements */
|
||||||
btnCreateKP: elements.Button,
|
btnCreateKP: e.Button,
|
||||||
btnCalculate: elements.Button,
|
btnCalculate: e.Button,
|
||||||
|
|
||||||
/** Link Elements */
|
/** Link Elements */
|
||||||
linkDownloadKp: elements.Link,
|
linkDownloadKp: e.Link,
|
||||||
linkLeadUrl: elements.Link,
|
linkLeadUrl: e.Link,
|
||||||
linkOpportunityUrl: elements.Link,
|
linkOpportunityUrl: e.Link,
|
||||||
linkQuoteUrl: elements.Link,
|
linkQuoteUrl: e.Link,
|
||||||
});
|
});
|
||||||
|
|
||||||
export default components;
|
export default components;
|
||||||
|
|||||||
@ -6,10 +6,10 @@ import { useStore } from 'stores/hooks';
|
|||||||
import Link from 'ui/elements/Link';
|
import Link from 'ui/elements/Link';
|
||||||
import Tooltip from 'ui/elements/Tooltip';
|
import Tooltip from 'ui/elements/Tooltip';
|
||||||
import buildReadonly from '../../builders/build-readonly';
|
import buildReadonly from '../../builders/build-readonly';
|
||||||
import builders from '../elements-builders';
|
|
||||||
import components from '../elements-components';
|
import components from '../elements-components';
|
||||||
import elementsProps from '../elements-props';
|
import elementsProps from '../elements-props';
|
||||||
import titles from '../elements-titles';
|
import titles from '../elements-titles';
|
||||||
|
import types from '../elements-types';
|
||||||
import map from '../map';
|
import map from '../map';
|
||||||
import type { RenderProps } from './types';
|
import type { RenderProps } from './types';
|
||||||
|
|
||||||
@ -26,7 +26,7 @@ const overrideRender: Partial<Record<keyof typeof map, RenderProps>> = {
|
|||||||
const valueName = map.selectLead;
|
const valueName = map.selectLead;
|
||||||
const Component = components.selectLead;
|
const Component = components.selectLead;
|
||||||
const props = elementsProps.selectLead;
|
const props = elementsProps.selectLead;
|
||||||
const builder = builders.selectLead;
|
const { builder } = types.selectLead();
|
||||||
|
|
||||||
const Element = builder(Component, {
|
const Element = builder(Component, {
|
||||||
elementName,
|
elementName,
|
||||||
@ -58,7 +58,7 @@ const overrideRender: Partial<Record<keyof typeof map, RenderProps>> = {
|
|||||||
const valueName = map.selectOpportunity;
|
const valueName = map.selectOpportunity;
|
||||||
const Component = components.selectOpportunity;
|
const Component = components.selectOpportunity;
|
||||||
const props = elementsProps.selectOpportunity;
|
const props = elementsProps.selectOpportunity;
|
||||||
const builder = builders.selectOpportunity;
|
const { builder } = types.selectOpportunity();
|
||||||
|
|
||||||
const Element = builder(Component, {
|
const Element = builder(Component, {
|
||||||
elementName,
|
elementName,
|
||||||
@ -90,7 +90,7 @@ const overrideRender: Partial<Record<keyof typeof map, RenderProps>> = {
|
|||||||
const valueName = map.selectQuote;
|
const valueName = map.selectQuote;
|
||||||
const Component = components.selectQuote;
|
const Component = components.selectQuote;
|
||||||
const props = elementsProps.selectQuote;
|
const props = elementsProps.selectQuote;
|
||||||
const builder = builders.selectQuote;
|
const { builder } = types.selectQuote();
|
||||||
|
|
||||||
const Element = builder(Component, {
|
const Element = builder(Component, {
|
||||||
elementName,
|
elementName,
|
||||||
@ -122,7 +122,7 @@ const overrideRender: Partial<Record<keyof typeof map, RenderProps>> = {
|
|||||||
const valueName = map.tbxVehicleTaxInYear;
|
const valueName = map.tbxVehicleTaxInYear;
|
||||||
const Component = components.tbxVehicleTaxInYear;
|
const Component = components.tbxVehicleTaxInYear;
|
||||||
const props = elementsProps.tbxVehicleTaxInYear;
|
const props = elementsProps.tbxVehicleTaxInYear;
|
||||||
const builder = builders.tbxVehicleTaxInYear;
|
const { builder } = types.tbxVehicleTaxInYear();
|
||||||
|
|
||||||
const Element = builder(Component, {
|
const Element = builder(Component, {
|
||||||
elementName,
|
elementName,
|
||||||
@ -147,7 +147,7 @@ const overrideRender: Partial<Record<keyof typeof map, RenderProps>> = {
|
|||||||
const valueName = map.selectHighSeasonStart;
|
const valueName = map.selectHighSeasonStart;
|
||||||
const Component = components.selectHighSeasonStart;
|
const Component = components.selectHighSeasonStart;
|
||||||
const props = elementsProps.selectHighSeasonStart;
|
const props = elementsProps.selectHighSeasonStart;
|
||||||
const builder = builders.selectHighSeasonStart;
|
const { builder } = types.selectHighSeasonStart();
|
||||||
|
|
||||||
const Element = builder(Component, {
|
const Element = builder(Component, {
|
||||||
elementName,
|
elementName,
|
||||||
@ -171,7 +171,7 @@ const overrideRender: Partial<Record<keyof typeof map, RenderProps>> = {
|
|||||||
const valueName = map.selectSeasonType;
|
const valueName = map.selectSeasonType;
|
||||||
const Component = components.selectSeasonType;
|
const Component = components.selectSeasonType;
|
||||||
const props = elementsProps.selectSeasonType;
|
const props = elementsProps.selectSeasonType;
|
||||||
const builder = builders.selectSeasonType;
|
const { builder } = types.selectSeasonType();
|
||||||
|
|
||||||
const Element = builder(Component, {
|
const Element = builder(Component, {
|
||||||
elementName,
|
elementName,
|
||||||
|
|||||||
@ -1,9 +1,9 @@
|
|||||||
/* eslint-disable object-curly-newline */
|
/* eslint-disable object-curly-newline */
|
||||||
import { Container, Head } from 'Components/Layout/Element';
|
import { Container, Head } from 'Components/Layout/Element';
|
||||||
import builders from '../elements-builders';
|
|
||||||
import components from '../elements-components';
|
import components from '../elements-components';
|
||||||
import elementsProps from '../elements-props';
|
import elementsProps from '../elements-props';
|
||||||
import titles from '../elements-titles';
|
import titles from '../elements-titles';
|
||||||
|
import types from '../elements-types';
|
||||||
import map from '../map';
|
import map from '../map';
|
||||||
|
|
||||||
const render = Object.keys(map).reduce((acc, elementName) => {
|
const render = Object.keys(map).reduce((acc, elementName) => {
|
||||||
@ -11,7 +11,7 @@ const render = Object.keys(map).reduce((acc, elementName) => {
|
|||||||
const valueName = map[elementName];
|
const valueName = map[elementName];
|
||||||
const Component = components[elementName];
|
const Component = components[elementName];
|
||||||
const props = elementsProps[elementName];
|
const props = elementsProps[elementName];
|
||||||
const builder = builders[elementName];
|
const { builder } = types[elementName]();
|
||||||
|
|
||||||
const Element = builder(Component, {
|
const Element = builder(Component, {
|
||||||
elementName,
|
elementName,
|
||||||
|
|||||||
@ -124,6 +124,7 @@ const titles: Record<ValuesElements | ActionElements, string> = {
|
|||||||
tbxLeaseObjectPriceWthtVAT: 'Стоимость ПЛ без НДС',
|
tbxLeaseObjectPriceWthtVAT: 'Стоимость ПЛ без НДС',
|
||||||
tbxVATInLeaseObjectPrice: 'НДС в стоимости ПЛ',
|
tbxVATInLeaseObjectPrice: 'НДС в стоимости ПЛ',
|
||||||
tbxBonusCoefficient: 'Коэффициент снижения бонуса',
|
tbxBonusCoefficient: 'Коэффициент снижения бонуса',
|
||||||
|
selectLeasingWithoutKasko: 'Лизинг без КАСКО',
|
||||||
|
|
||||||
/** Link Elements */
|
/** Link Elements */
|
||||||
linkDownloadKp: '',
|
linkDownloadKp: '',
|
||||||
|
|||||||
182
apps/web/Components/Calculation/config/elements-types.ts
Normal file
182
apps/web/Components/Calculation/config/elements-types.ts
Normal file
@ -0,0 +1,182 @@
|
|||||||
|
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 GetType = () => {
|
||||||
|
typeName: ElementTypes;
|
||||||
|
builder: Builders;
|
||||||
|
};
|
||||||
|
|
||||||
|
function wrapTypeGetters<G extends GetType, E extends Record<ElementTypes, G>>(arg: E) {
|
||||||
|
return arg;
|
||||||
|
}
|
||||||
|
|
||||||
|
const t = wrapTypeGetters({
|
||||||
|
Value: () => ({
|
||||||
|
typeName: 'Value',
|
||||||
|
builder: buildValue,
|
||||||
|
}),
|
||||||
|
Readonly: () => ({
|
||||||
|
typeName: 'Readonly',
|
||||||
|
builder: buildReadonly,
|
||||||
|
}),
|
||||||
|
Options: () => ({
|
||||||
|
typeName: 'Options',
|
||||||
|
builder: buildOptions,
|
||||||
|
}),
|
||||||
|
Action: () => ({
|
||||||
|
typeName: 'Action',
|
||||||
|
builder: buildAction,
|
||||||
|
}),
|
||||||
|
});
|
||||||
|
|
||||||
|
function wrapElementsTypes<T, E extends Record<ValuesElements | ActionElements, T>>(arg: E) {
|
||||||
|
return arg;
|
||||||
|
}
|
||||||
|
|
||||||
|
const types = wrapElementsTypes({
|
||||||
|
cbxRecalcWithRevision: t.Value,
|
||||||
|
tbxLeaseObjectPrice: t.Value,
|
||||||
|
tbxLeaseObjectPriceWthtVAT: t.Value,
|
||||||
|
tbxVATInLeaseObjectPrice: t.Value,
|
||||||
|
tbxEngineHours: t.Value,
|
||||||
|
tbxSupplierDiscountRub: t.Value,
|
||||||
|
tbxSupplierDiscountPerc: t.Value,
|
||||||
|
tbxLeasingPeriod: t.Value,
|
||||||
|
tbxFirstPaymentPerc: t.Value,
|
||||||
|
tbxFirstPaymentRub: t.Value,
|
||||||
|
tbxLastPaymentPerc: t.Value,
|
||||||
|
tbxLastPaymentRub: t.Value,
|
||||||
|
selectImportProgram: t.Options,
|
||||||
|
tbxImportProgramSum: t.Readonly,
|
||||||
|
tbxAddEquipmentPrice: t.Value,
|
||||||
|
tbxRedemptionPaymentSum: t.Value,
|
||||||
|
tbxParmentsDecreasePercent: t.Value,
|
||||||
|
tbxComissionPerc: t.Value,
|
||||||
|
tbxComissionRub: t.Value,
|
||||||
|
tbxSaleBonus: t.Value,
|
||||||
|
tbxIRR_Perc: t.Value,
|
||||||
|
tbxLeaseObjectCount: t.Value,
|
||||||
|
cbxWithTrailer: t.Value,
|
||||||
|
cbxLeaseObjectUsed: t.Value,
|
||||||
|
tbxMaxMass: t.Value,
|
||||||
|
tbxCountSeats: t.Value,
|
||||||
|
tbxMaxSpeed: t.Value,
|
||||||
|
tbxLeaseObjectYear: t.Value,
|
||||||
|
tbxLeaseObjectMotorPower: t.Value,
|
||||||
|
tbxEngineVolume: t.Value,
|
||||||
|
tbxDealerRewardSumm: t.Value,
|
||||||
|
tbxDealerBrokerRewardSumm: t.Value,
|
||||||
|
tbxIndAgentRewardSumm: t.Value,
|
||||||
|
tbxCalcDoubleAgentRewardSumm: t.Value,
|
||||||
|
tbxCalcBrokerRewardSum: t.Value,
|
||||||
|
tbxFinDepartmentRewardSumm: t.Value,
|
||||||
|
cbxInsDecentral: t.Value,
|
||||||
|
tbxInsFranchise: t.Value,
|
||||||
|
cbxInsUnlimitDrivers: t.Value,
|
||||||
|
tbxInsAgeDrivers: t.Value,
|
||||||
|
tbxInsExpDrivers: t.Value,
|
||||||
|
tbxINNForCalc: t.Value,
|
||||||
|
cbxLastPaymentRedemption: t.Value,
|
||||||
|
cbxPriceWithDiscount: t.Value,
|
||||||
|
cbxFullPriceWithDiscount: t.Value,
|
||||||
|
cbxCostIncrease: t.Value,
|
||||||
|
cbxInsurance: t.Value,
|
||||||
|
cbxRegistrationQuote: t.Value,
|
||||||
|
cbxTechnicalCardQuote: t.Value,
|
||||||
|
cbxNSIB: t.Value,
|
||||||
|
tbxQuoteName: t.Value,
|
||||||
|
cbxQuoteRedemptionGraph: t.Value,
|
||||||
|
cbxShowFinGAP: t.Value,
|
||||||
|
tbxCreditRate: t.Value,
|
||||||
|
tbxMaxPriceChange: t.Value,
|
||||||
|
tbxImporterRewardPerc: t.Value,
|
||||||
|
tbxImporterRewardRub: t.Value,
|
||||||
|
cbxDisableChecks: t.Value,
|
||||||
|
tbxMileage: t.Value,
|
||||||
|
tbxTotalPayments: t.Value,
|
||||||
|
tbxVehicleTaxInYear: t.Value,
|
||||||
|
tbxVehicleTaxInLeasingPeriod: t.Value,
|
||||||
|
tbxMinPriceChange: t.Value,
|
||||||
|
|
||||||
|
selectProduct: t.Options,
|
||||||
|
selectClientRisk: t.Options,
|
||||||
|
selectClientType: t.Options,
|
||||||
|
selectSupplierCurrency: t.Options,
|
||||||
|
selectSeasonType: t.Options,
|
||||||
|
selectHighSeasonStart: t.Options,
|
||||||
|
selectLeaseObjectType: t.Options,
|
||||||
|
selectBrand: t.Options,
|
||||||
|
selectModel: t.Options,
|
||||||
|
selectConfiguration: t.Options,
|
||||||
|
selectLeaseObjectUseFor: t.Options,
|
||||||
|
selectLeaseObjectCategory: t.Options,
|
||||||
|
selectEngineType: t.Options,
|
||||||
|
selectDealer: t.Options,
|
||||||
|
selectDealerPerson: t.Options,
|
||||||
|
selectDealerRewardCondition: t.Options,
|
||||||
|
selectDealerBroker: t.Options,
|
||||||
|
selectDealerBrokerRewardCondition: t.Options,
|
||||||
|
selectIndAgent: t.Options,
|
||||||
|
selectIndAgentRewardCondition: t.Options,
|
||||||
|
selectCalcDoubleAgent: t.Options,
|
||||||
|
selectCalcDoubleAgentRewardCondition: t.Options,
|
||||||
|
selectCalcBroker: t.Options,
|
||||||
|
selectCalcBrokerRewardCondition: t.Options,
|
||||||
|
selectCalcFinDepartment: t.Options,
|
||||||
|
selectFinDepartmentRewardCondtion: t.Options,
|
||||||
|
selectGPSBrand: t.Options,
|
||||||
|
selectGPSModel: t.Options,
|
||||||
|
selectRegionRegistration: t.Options,
|
||||||
|
selectTownRegistration: t.Options,
|
||||||
|
selectRegistration: t.Options,
|
||||||
|
selectInsNSIB: t.Options,
|
||||||
|
selectTracker: t.Options,
|
||||||
|
selectTelematic: t.Options,
|
||||||
|
selectTechnicalCard: t.Options,
|
||||||
|
selectTarif: t.Options,
|
||||||
|
selectRate: t.Options,
|
||||||
|
selectLead: t.Options,
|
||||||
|
selectOpportunity: t.Options,
|
||||||
|
selectQuote: t.Options,
|
||||||
|
selectObjectRegionRegistration: t.Options,
|
||||||
|
selectObjectCategoryTax: t.Options,
|
||||||
|
selectObjectTypeTax: t.Options,
|
||||||
|
selectLegalClientRegion: t.Options,
|
||||||
|
selectLegalClientTown: t.Options,
|
||||||
|
selectSubsidy: t.Options,
|
||||||
|
selectFuelCard: t.Options,
|
||||||
|
radioBalanceHolder: t.Options,
|
||||||
|
radioLastPaymentRule: t.Options,
|
||||||
|
radioGraphType: t.Options,
|
||||||
|
radioDeliveryTime: t.Options,
|
||||||
|
radioInsKaskoType: t.Options,
|
||||||
|
radioInfuranceOPF: t.Options,
|
||||||
|
selectRequirementTelematic: t.Options,
|
||||||
|
radioQuoteContactGender: t.Options,
|
||||||
|
radioCalcType: t.Options,
|
||||||
|
radioObjectRegistration: t.Options,
|
||||||
|
radioTypePTS: t.Options,
|
||||||
|
tbxBonusCoefficient: t.Value,
|
||||||
|
selectLeasingWithoutKasko: t.Options,
|
||||||
|
|
||||||
|
labelLeaseObjectRisk: t.Readonly,
|
||||||
|
tbxInsKaskoPriceLeasePeriod: t.Readonly,
|
||||||
|
labelIrrInfo: t.Readonly,
|
||||||
|
labelRegistrationDescription: t.Readonly,
|
||||||
|
labelDepreciationGroup: t.Readonly,
|
||||||
|
tbxSubsidySum: t.Readonly,
|
||||||
|
|
||||||
|
btnCreateKP: t.Action,
|
||||||
|
btnCalculate: t.Action,
|
||||||
|
|
||||||
|
linkDownloadKp: t.Readonly,
|
||||||
|
linkLeadUrl: t.Readonly,
|
||||||
|
linkOpportunityUrl: t.Readonly,
|
||||||
|
linkQuoteUrl: t.Readonly,
|
||||||
|
});
|
||||||
|
|
||||||
|
export default types;
|
||||||
@ -135,6 +135,7 @@ const elementsToValues = wrapElementsMap({
|
|||||||
labelIrrInfo: 'irrInfo',
|
labelIrrInfo: 'irrInfo',
|
||||||
labelRegistrationDescription: 'registrationDescription',
|
labelRegistrationDescription: 'registrationDescription',
|
||||||
labelDepreciationGroup: 'depreciationGroup',
|
labelDepreciationGroup: 'depreciationGroup',
|
||||||
|
selectLeasingWithoutKasko: 'leasingWithoutKasko',
|
||||||
|
|
||||||
/** Link Elements */
|
/** Link Elements */
|
||||||
linkDownloadKp: 'kpUrl',
|
linkDownloadKp: 'kpUrl',
|
||||||
|
|||||||
@ -48,8 +48,11 @@ function getPaymentsTableErrors($tables) {
|
|||||||
function getInsuranceTableErrors($tables) {
|
function getInsuranceTableErrors($tables) {
|
||||||
const { insurance } = $tables;
|
const { insurance } = $tables;
|
||||||
const messages = insurance.validation.getMessages();
|
const messages = insurance.validation.getMessages();
|
||||||
|
const title = insurance.validation.params.err_title;
|
||||||
|
|
||||||
return messages.map((message) => <Alert type="error" showIcon message={message} />);
|
return messages.map((message) => (
|
||||||
|
<Alert type="error" showIcon message={Message(title, message)} />
|
||||||
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
const Errors = observer(() => {
|
const Errors = observer(() => {
|
||||||
|
|||||||
@ -5,7 +5,12 @@ module.exports = {
|
|||||||
name: 'crmgraphql',
|
name: 'crmgraphql',
|
||||||
localSchemaFile: `${__dirname}/graphql/crm.schema.graphql`,
|
localSchemaFile: `${__dirname}/graphql/crm.schema.graphql`,
|
||||||
},
|
},
|
||||||
excludes: ['**/graphql/**/*'],
|
excludes: ['**/graphql/**/*.schema.graphql', '**/graphql/**/*.types.graphql'],
|
||||||
includes: ['**/pages/**/*', '**/process/**/*', '**/Components/**/*'],
|
includes: [
|
||||||
|
'**/pages/**/*',
|
||||||
|
'**/process/**/*',
|
||||||
|
'**/Components/**/*',
|
||||||
|
'**/graphql/**/*.query.graphql',
|
||||||
|
],
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|||||||
@ -46,6 +46,30 @@ export const selectHighSeasonStart = Array.from(
|
|||||||
})
|
})
|
||||||
);
|
);
|
||||||
|
|
||||||
|
export const radioGraphType = [
|
||||||
|
{
|
||||||
|
label: 'аннуитет',
|
||||||
|
value: 100_000_000,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: 'дегрессия (ступенчатая)',
|
||||||
|
value: 100_000_001,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: 'равноубывающий',
|
||||||
|
value: 100_000_002,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: 'сезонный',
|
||||||
|
value: 100_000_003,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: 'легкий старт',
|
||||||
|
value: 100_000_004,
|
||||||
|
disabled: true,
|
||||||
|
},
|
||||||
|
];
|
||||||
|
|
||||||
const defaultOptions: CalculationOptions = {
|
const defaultOptions: CalculationOptions = {
|
||||||
radioLastPaymentRule: [
|
radioLastPaymentRule: [
|
||||||
{
|
{
|
||||||
@ -73,28 +97,7 @@ const defaultOptions: CalculationOptions = {
|
|||||||
},
|
},
|
||||||
],
|
],
|
||||||
|
|
||||||
radioGraphType: [
|
radioGraphType,
|
||||||
{
|
|
||||||
label: 'аннуитет',
|
|
||||||
value: 100_000_000,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: 'дегрессия (ступенчатая)',
|
|
||||||
value: 100_000_001,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: 'равноубывающий',
|
|
||||||
value: 100_000_002,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: 'сезонный',
|
|
||||||
value: 100_000_003,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: 'легкий старт',
|
|
||||||
value: 100_000_004,
|
|
||||||
},
|
|
||||||
],
|
|
||||||
|
|
||||||
selectSeasonType,
|
selectSeasonType,
|
||||||
|
|
||||||
@ -503,6 +506,7 @@ const defaultOptions: CalculationOptions = {
|
|||||||
linkOpportunityUrl: [],
|
linkOpportunityUrl: [],
|
||||||
linkQuoteUrl: [],
|
linkQuoteUrl: [],
|
||||||
tbxBonusCoefficient: [],
|
tbxBonusCoefficient: [],
|
||||||
|
selectLeasingWithoutKasko: [],
|
||||||
};
|
};
|
||||||
|
|
||||||
export default defaultOptions;
|
export default defaultOptions;
|
||||||
|
|||||||
@ -135,6 +135,7 @@ const defaultStatuses: CalculationStatuses = {
|
|||||||
tbxBonusCoefficient: 'Default',
|
tbxBonusCoefficient: 'Default',
|
||||||
btnCalculate: 'Default',
|
btnCalculate: 'Default',
|
||||||
btnCreateKP: 'Default',
|
btnCreateKP: 'Default',
|
||||||
|
selectLeasingWithoutKasko: 'Default',
|
||||||
};
|
};
|
||||||
|
|
||||||
export default defaultStatuses;
|
export default defaultStatuses;
|
||||||
|
|||||||
@ -80,7 +80,7 @@ const defaultValues: CalculationValues = {
|
|||||||
importerRewardRub: 0,
|
importerRewardRub: 0,
|
||||||
disableChecks: false,
|
disableChecks: false,
|
||||||
insFranchise: 0,
|
insFranchise: 0,
|
||||||
rate: 'BASE',
|
rate: null,
|
||||||
calcType: 100_000_000,
|
calcType: 100_000_000,
|
||||||
totalPayments: 0,
|
totalPayments: 0,
|
||||||
vehicleTaxInYear: 0,
|
vehicleTaxInYear: 0,
|
||||||
@ -137,6 +137,7 @@ const defaultValues: CalculationValues = {
|
|||||||
bonusCoefficient: 1,
|
bonusCoefficient: 1,
|
||||||
plPriceRub: 0,
|
plPriceRub: 0,
|
||||||
discountRub: 0,
|
discountRub: 0,
|
||||||
|
leasingWithoutKasko: null,
|
||||||
};
|
};
|
||||||
|
|
||||||
export default defaultValues;
|
export default defaultValues;
|
||||||
|
|||||||
@ -123,6 +123,7 @@ const ValuesSchema = z.object({
|
|||||||
VATInLeaseObjectPrice: z.number(),
|
VATInLeaseObjectPrice: z.number(),
|
||||||
engineHours: z.number(),
|
engineHours: z.number(),
|
||||||
bonusCoefficient: z.number(),
|
bonusCoefficient: z.number(),
|
||||||
|
leasingWithoutKasko: z.string().nullable(),
|
||||||
|
|
||||||
/** Link Values */
|
/** Link Values */
|
||||||
kpUrl: z.string().nullable(),
|
kpUrl: z.string().nullable(),
|
||||||
|
|||||||
@ -23,6 +23,9 @@ export const defaultOptions: Record<Insurance.Keys, Insurance.RowOptions> = {
|
|||||||
value: 100_000_001,
|
value: 100_000_001,
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
|
insCost: [],
|
||||||
|
insuranceCompany: [],
|
||||||
|
policyType: [],
|
||||||
},
|
},
|
||||||
kasko: {
|
kasko: {
|
||||||
insured: [
|
insured: [
|
||||||
@ -45,6 +48,9 @@ export const defaultOptions: Record<Insurance.Keys, Insurance.RowOptions> = {
|
|||||||
value: 100_000_001,
|
value: 100_000_001,
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
|
insCost: [],
|
||||||
|
insuranceCompany: [],
|
||||||
|
policyType: [],
|
||||||
},
|
},
|
||||||
fingap: {
|
fingap: {
|
||||||
insured: [
|
insured: [
|
||||||
@ -67,6 +73,9 @@ export const defaultOptions: Record<Insurance.Keys, Insurance.RowOptions> = {
|
|||||||
value: 100_000_001,
|
value: 100_000_001,
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
|
insCost: [],
|
||||||
|
insuranceCompany: [],
|
||||||
|
policyType: [],
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@ -4,3 +4,4 @@ export const MIN_INSURANCE = 3000;
|
|||||||
|
|
||||||
export const RATE = 7.75;
|
export const RATE = 7.75;
|
||||||
export const MAX_LEASING_PERIOD = 60;
|
export const MAX_LEASING_PERIOD = 60;
|
||||||
|
export const MIN_LASTPAYMENT_NSIB = 3500;
|
||||||
|
|||||||
288
apps/web/graphql/crm.query.graphql
Normal file
288
apps/web/graphql/crm.query.graphql
Normal file
@ -0,0 +1,288 @@
|
|||||||
|
query GetTransactionCurrencies {
|
||||||
|
transactioncurrencies {
|
||||||
|
label: currencyname
|
||||||
|
value: transactioncurrencyid
|
||||||
|
transactioncurrencyid
|
||||||
|
isocurrencycode
|
||||||
|
currencysymbol
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
query GetTransactionCurrency($currencyid: Uuid!) {
|
||||||
|
transactioncurrency(transactioncurrencyid: $currencyid) {
|
||||||
|
currencysymbol
|
||||||
|
isocurrencycode
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
query GetCurrencyChanges($currentDate: DateTime) {
|
||||||
|
evo_currencychanges(statecode: 0, evo_coursedate_param: { eq: $currentDate }) {
|
||||||
|
evo_currencychange
|
||||||
|
evo_ref_transactioncurrency
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
query GetLead($leadid: Uuid!) {
|
||||||
|
lead(leadid: $leadid) {
|
||||||
|
evo_agent_accountid
|
||||||
|
evo_double_agent_accountid
|
||||||
|
evo_broker_accountid
|
||||||
|
evo_fin_department_accountid
|
||||||
|
evo_opportunityidData {
|
||||||
|
label: name
|
||||||
|
value: opportunityid
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
query GetOpportunity($opportunityid: Uuid!) {
|
||||||
|
opportunity(opportunityid: $opportunityid) {
|
||||||
|
evo_leadid
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
query GetQuotes($leadid: Uuid!) {
|
||||||
|
quotes(evo_leadid: $leadid) {
|
||||||
|
label: evo_quotename
|
||||||
|
value: quoteid
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
query GetQuote($quoteId: Uuid!) {
|
||||||
|
quote(quoteId: $quoteId) {
|
||||||
|
evo_baseproductid
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
query GetTarifs($currentDate: DateTime) {
|
||||||
|
evo_tarifs(
|
||||||
|
statecode: 0
|
||||||
|
evo_datefrom_param: { lte: $currentDate }
|
||||||
|
evo_dateto_param: { gte: $currentDate }
|
||||||
|
) {
|
||||||
|
label: evo_name
|
||||||
|
value: evo_tarifid
|
||||||
|
evo_tarifid
|
||||||
|
evo_baseproductid
|
||||||
|
evo_min_period
|
||||||
|
evo_max_period
|
||||||
|
evo_delivery_time
|
||||||
|
evo_min_first_payment
|
||||||
|
evo_max_first_payment
|
||||||
|
evo_min_last_payment
|
||||||
|
evo_max_last_payment
|
||||||
|
evo_used
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
query GetTarif($tarifId: Uuid!) {
|
||||||
|
evo_tarif(evo_tarifid: $tarifId) {
|
||||||
|
evo_irr
|
||||||
|
evo_graphtype_exception
|
||||||
|
evo_seasons_type_exception
|
||||||
|
evo_min_decreasing_perc
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
query GetRates($currentDate: DateTime) {
|
||||||
|
evo_rates(
|
||||||
|
statecode: 0
|
||||||
|
evo_datefrom_param: { lte: $currentDate }
|
||||||
|
evo_dateto_param: { gte: $currentDate }
|
||||||
|
) {
|
||||||
|
label: evo_name
|
||||||
|
value: evo_rateid
|
||||||
|
evo_id
|
||||||
|
evo_tarifs {
|
||||||
|
evo_tarifid
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
query GetProducts($currentDate: DateTime) {
|
||||||
|
evo_baseproducts(
|
||||||
|
statecode: 0
|
||||||
|
evo_relation: [100000000]
|
||||||
|
evo_datefrom_param: { lte: $currentDate }
|
||||||
|
evo_dateto_param: { gte: $currentDate }
|
||||||
|
) {
|
||||||
|
label: evo_name
|
||||||
|
value: evo_baseproductid
|
||||||
|
evo_baseproductid
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
query GetProduct($productId: Uuid!) {
|
||||||
|
evo_baseproduct(evo_baseproductid: $productId) {
|
||||||
|
evo_leasingobject_types {
|
||||||
|
evo_leasingobject_typeid
|
||||||
|
}
|
||||||
|
evo_calculation_method
|
||||||
|
evo_baseproducts {
|
||||||
|
evo_baseproductid
|
||||||
|
}
|
||||||
|
evo_brands {
|
||||||
|
evo_brandid
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
query GetSubsidies($currentDate: DateTime) {
|
||||||
|
evo_subsidies(
|
||||||
|
statecode: 0
|
||||||
|
evo_datefrom_param: { lte: $currentDate }
|
||||||
|
evo_dateto_param: { gte: $currentDate }
|
||||||
|
) {
|
||||||
|
label: evo_name
|
||||||
|
value: evo_subsidyid
|
||||||
|
evo_subsidy_type
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
query GetSubsidy($subsidyId: Uuid!) {
|
||||||
|
evo_subsidy(evo_subsidyid: $subsidyId) {
|
||||||
|
evo_leasingobject_types {
|
||||||
|
evo_leasingobject_typeid
|
||||||
|
}
|
||||||
|
accounts {
|
||||||
|
accountid
|
||||||
|
}
|
||||||
|
evo_brands {
|
||||||
|
evo_brandid
|
||||||
|
}
|
||||||
|
evo_models {
|
||||||
|
evo_modelid
|
||||||
|
}
|
||||||
|
evo_subsidy_summ
|
||||||
|
evo_percent_subsidy
|
||||||
|
evo_max_subsidy_summ
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
query GetImportProgram($importProgramId: Uuid!) {
|
||||||
|
importProgram: evo_subsidy(evo_subsidyid: $importProgramId) {
|
||||||
|
evo_leasingobject_types {
|
||||||
|
evo_leasingobject_typeid
|
||||||
|
}
|
||||||
|
accounts {
|
||||||
|
accountid
|
||||||
|
}
|
||||||
|
evo_brands {
|
||||||
|
evo_brandid
|
||||||
|
}
|
||||||
|
evo_models {
|
||||||
|
evo_modelid
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
query GetRegions {
|
||||||
|
evo_regions {
|
||||||
|
label: evo_name
|
||||||
|
value: evo_regionid
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
query GetGPSBrands {
|
||||||
|
evo_gps_brands(statecode: 0) {
|
||||||
|
label: evo_name
|
||||||
|
value: evo_gps_brandid
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
query GetLeaseObjectTypes {
|
||||||
|
evo_leasingobject_types(statecode: 0) {
|
||||||
|
label: evo_name
|
||||||
|
value: evo_leasingobject_typeid
|
||||||
|
evo_leasingobject_typeid
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
query GetLeaseObjectType($leaseObjectTypeId: Uuid!) {
|
||||||
|
leaseObjectType: evo_leasingobject_type(evo_leasingobject_typeid: $leaseObjectTypeId) {
|
||||||
|
evo_vehicle_type
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
query GetBrands {
|
||||||
|
evo_brands(statecode: 0) {
|
||||||
|
label: evo_name
|
||||||
|
value: evo_brandid
|
||||||
|
evo_brandid
|
||||||
|
evo_vehicle_type
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
query GetModels($brandId: Uuid!) {
|
||||||
|
evo_models(statecode: 0, evo_brandid: $brandId) {
|
||||||
|
label: evo_name
|
||||||
|
value: evo_modelid
|
||||||
|
evo_modelid
|
||||||
|
evo_vehicle_type
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
query GetConfigurations($modelId: Uuid) {
|
||||||
|
evo_equipments(statecode: 0, evo_modelid: $modelId) {
|
||||||
|
label: evo_name
|
||||||
|
value: evo_equipmentid
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
query GetDealers {
|
||||||
|
dealers: accounts(evo_account_type: [100000001], statecode: 0, evo_legal_form: 100000001) {
|
||||||
|
label: name
|
||||||
|
value: accountid
|
||||||
|
accountid
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
query GetDealer($dealerId: Uuid!) {
|
||||||
|
dealer: account(accountid: $dealerId) {
|
||||||
|
evo_return_leasing_dealer
|
||||||
|
evo_broker_accountid
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
query GetDealerPersons($dealerId: Uuid!) {
|
||||||
|
dealerPersons: salon_providers(statecode: 0, salonaccountid: $dealerId) {
|
||||||
|
label: name
|
||||||
|
value: accountid
|
||||||
|
accountid
|
||||||
|
evo_inn
|
||||||
|
evo_kpp
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
query GetAgent($agentid: Uuid!) {
|
||||||
|
agent: account(accountid: $agentid) {
|
||||||
|
label: name
|
||||||
|
value: accountid
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
query GetRewardConditions($agentid: Uuid!, $currentDate: DateTime) {
|
||||||
|
evo_reward_conditions(
|
||||||
|
evo_agent_accountid: $agentid
|
||||||
|
evo_datefrom_param: { lte: $currentDate }
|
||||||
|
evo_dateto_param: { gte: $currentDate }
|
||||||
|
statecode: 0
|
||||||
|
evo_agency_agreementid_param: { has: true }
|
||||||
|
) {
|
||||||
|
label: evo_name
|
||||||
|
value: evo_reward_conditionid
|
||||||
|
evo_reward_summ
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
query GetRewardCondition($conditionId: Uuid!) {
|
||||||
|
evo_reward_condition(evo_reward_conditionid: $conditionId) {
|
||||||
|
evo_reward_summ
|
||||||
|
evo_reduce_reward
|
||||||
|
evo_min_reward_summ
|
||||||
|
evo_agency_agreementidData {
|
||||||
|
evo_required_reward
|
||||||
|
evo_reward_without_other_agent
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
File diff suppressed because it is too large
Load Diff
@ -1,3 +1,4 @@
|
|||||||
|
import type { TypedDocumentNode as DocumentNode } from '@graphql-typed-document-node/core';
|
||||||
export type Maybe<T> = T | null;
|
export type Maybe<T> = T | null;
|
||||||
export type InputMaybe<T> = Maybe<T>;
|
export type InputMaybe<T> = Maybe<T>;
|
||||||
export type Exact<T extends { [key: string]: unknown }> = { [K in keyof T]: T[K] };
|
export type Exact<T extends { [key: string]: unknown }> = { [K in keyof T]: T[K] };
|
||||||
@ -115,19 +116,204 @@ export type ActivitypartyInput = {
|
|||||||
partyid_systemuser?: InputMaybe<Scalars['Uuid']>;
|
partyid_systemuser?: InputMaybe<Scalars['Uuid']>;
|
||||||
};
|
};
|
||||||
|
|
||||||
export type GetCurrencySymbolQueryVariables = Exact<{
|
export type GetTransactionCurrenciesQueryVariables = Exact<{ [key: string]: never; }>;
|
||||||
|
|
||||||
|
|
||||||
|
export type GetTransactionCurrenciesQuery = { __typename?: 'Query', transactioncurrencies: Array<{ __typename?: 'transactioncurrency', transactioncurrencyid: string | null, isocurrencycode: string | null, currencysymbol: string | null, label: string | null, value: string | null } | null> | null };
|
||||||
|
|
||||||
|
export type GetTransactionCurrencyQueryVariables = Exact<{
|
||||||
currencyid: Scalars['Uuid'];
|
currencyid: Scalars['Uuid'];
|
||||||
}>;
|
}>;
|
||||||
|
|
||||||
|
|
||||||
export type GetCurrencySymbolQuery = { __typename?: 'Query', transactioncurrency: { __typename?: 'transactioncurrency', currencysymbol: string | null } | null };
|
export type GetTransactionCurrencyQuery = { __typename?: 'Query', transactioncurrency: { __typename?: 'transactioncurrency', currencysymbol: string | null, isocurrencycode: string | null } | null };
|
||||||
|
|
||||||
export type GetRisksDataFromQuoteQueryVariables = Exact<{
|
export type GetCurrencyChangesQueryVariables = Exact<{
|
||||||
|
currentDate: InputMaybe<Scalars['DateTime']>;
|
||||||
|
}>;
|
||||||
|
|
||||||
|
|
||||||
|
export type GetCurrencyChangesQuery = { __typename?: 'Query', evo_currencychanges: Array<{ __typename?: 'evo_currencychange', evo_currencychange: number | null, evo_ref_transactioncurrency: string | null } | null> | null };
|
||||||
|
|
||||||
|
export type GetLeadQueryVariables = Exact<{
|
||||||
|
leadid: Scalars['Uuid'];
|
||||||
|
}>;
|
||||||
|
|
||||||
|
|
||||||
|
export type GetLeadQuery = { __typename?: 'Query', lead: { __typename?: 'lead', evo_agent_accountid: string | null, evo_double_agent_accountid: string | null, evo_broker_accountid: string | null, evo_fin_department_accountid: string | null, evo_opportunityidData: { __typename?: 'opportunity', label: string | null, value: string | null } | null } | null };
|
||||||
|
|
||||||
|
export type GetOpportunityQueryVariables = Exact<{
|
||||||
|
opportunityid: Scalars['Uuid'];
|
||||||
|
}>;
|
||||||
|
|
||||||
|
|
||||||
|
export type GetOpportunityQuery = { __typename?: 'Query', opportunity: { __typename?: 'opportunity', evo_leadid: string | null } | null };
|
||||||
|
|
||||||
|
export type GetQuotesQueryVariables = Exact<{
|
||||||
|
leadid: Scalars['Uuid'];
|
||||||
|
}>;
|
||||||
|
|
||||||
|
|
||||||
|
export type GetQuotesQuery = { __typename?: 'Query', quotes: Array<{ __typename?: 'quote', label: string | null, value: string | null } | null> | null };
|
||||||
|
|
||||||
|
export type GetQuoteQueryVariables = Exact<{
|
||||||
quoteId: Scalars['Uuid'];
|
quoteId: Scalars['Uuid'];
|
||||||
}>;
|
}>;
|
||||||
|
|
||||||
|
|
||||||
export type GetRisksDataFromQuoteQuery = { __typename?: 'Query', quote: { __typename?: 'quote', evo_fingap_accountid: string | null, evo_fingap_payer: number | null, evo_fingap_period: number | null, evo_product_risks: Array<{ __typename?: 'evo_product_risk', evo_addproduct_typeid: string | null }> | null } | null };
|
export type GetQuoteQuery = { __typename?: 'Query', quote: { __typename?: 'quote', evo_baseproductid: string | null } | null };
|
||||||
|
|
||||||
|
export type GetTarifsQueryVariables = Exact<{
|
||||||
|
currentDate: InputMaybe<Scalars['DateTime']>;
|
||||||
|
}>;
|
||||||
|
|
||||||
|
|
||||||
|
export type GetTarifsQuery = { __typename?: 'Query', evo_tarifs: Array<{ __typename?: 'evo_tarif', evo_tarifid: string | null, evo_baseproductid: string | null, evo_min_period: number | null, evo_max_period: number | null, evo_delivery_time: Array<number> | null, evo_min_first_payment: number | null, evo_max_first_payment: number | null, evo_min_last_payment: number | null, evo_max_last_payment: number | null, evo_used: boolean | null, label: string | null, value: string | null } | null> | null };
|
||||||
|
|
||||||
|
export type GetTarifQueryVariables = Exact<{
|
||||||
|
tarifId: Scalars['Uuid'];
|
||||||
|
}>;
|
||||||
|
|
||||||
|
|
||||||
|
export type GetTarifQuery = { __typename?: 'Query', evo_tarif: { __typename?: 'evo_tarif', evo_irr: number | null, evo_graphtype_exception: Array<number> | null, evo_seasons_type_exception: Array<number> | null, evo_min_decreasing_perc: number | null } | null };
|
||||||
|
|
||||||
|
export type GetRatesQueryVariables = Exact<{
|
||||||
|
currentDate: InputMaybe<Scalars['DateTime']>;
|
||||||
|
}>;
|
||||||
|
|
||||||
|
|
||||||
|
export type GetRatesQuery = { __typename?: 'Query', evo_rates: Array<{ __typename?: 'evo_rate', evo_id: string | null, label: string | null, value: string | null, evo_tarifs: Array<{ __typename?: 'evo_tarif', evo_tarifid: string | null } | null> | null } | null> | null };
|
||||||
|
|
||||||
|
export type GetProductsQueryVariables = Exact<{
|
||||||
|
currentDate: InputMaybe<Scalars['DateTime']>;
|
||||||
|
}>;
|
||||||
|
|
||||||
|
|
||||||
|
export type GetProductsQuery = { __typename?: 'Query', evo_baseproducts: Array<{ __typename?: 'evo_baseproduct', evo_baseproductid: string | null, label: string | null, value: string | null } | null> | null };
|
||||||
|
|
||||||
|
export type GetProductQueryVariables = Exact<{
|
||||||
|
productId: Scalars['Uuid'];
|
||||||
|
}>;
|
||||||
|
|
||||||
|
|
||||||
|
export type GetProductQuery = { __typename?: 'Query', evo_baseproduct: { __typename?: 'evo_baseproduct', evo_calculation_method: Array<number> | null, evo_leasingobject_types: Array<{ __typename?: 'evo_leasingobject_type', evo_leasingobject_typeid: string | null } | null> | null, evo_baseproducts: Array<{ __typename?: 'evo_baseproduct', evo_baseproductid: string | null } | null> | null, evo_brands: Array<{ __typename?: 'evo_brand', evo_brandid: string | null } | null> | null } | null };
|
||||||
|
|
||||||
|
export type GetSubsidiesQueryVariables = Exact<{
|
||||||
|
currentDate: InputMaybe<Scalars['DateTime']>;
|
||||||
|
}>;
|
||||||
|
|
||||||
|
|
||||||
|
export type GetSubsidiesQuery = { __typename?: 'Query', evo_subsidies: Array<{ __typename?: 'evo_subsidy', evo_subsidy_type: number | null, label: string | null, value: string | null } | null> | null };
|
||||||
|
|
||||||
|
export type GetSubsidyQueryVariables = Exact<{
|
||||||
|
subsidyId: Scalars['Uuid'];
|
||||||
|
}>;
|
||||||
|
|
||||||
|
|
||||||
|
export type GetSubsidyQuery = { __typename?: 'Query', evo_subsidy: { __typename?: 'evo_subsidy', evo_subsidy_summ: number | null, evo_percent_subsidy: number | null, evo_max_subsidy_summ: number | null, evo_leasingobject_types: Array<{ __typename?: 'evo_leasingobject_type', evo_leasingobject_typeid: string | null } | null> | null, accounts: Array<{ __typename?: 'account', accountid: string | null } | null> | null, evo_brands: Array<{ __typename?: 'evo_brand', evo_brandid: string | null } | null> | null, evo_models: Array<{ __typename?: 'evo_model', evo_modelid: string | null } | null> | null } | null };
|
||||||
|
|
||||||
|
export type GetImportProgramQueryVariables = Exact<{
|
||||||
|
importProgramId: Scalars['Uuid'];
|
||||||
|
}>;
|
||||||
|
|
||||||
|
|
||||||
|
export type GetImportProgramQuery = { __typename?: 'Query', importProgram: { __typename?: 'evo_subsidy', evo_leasingobject_types: Array<{ __typename?: 'evo_leasingobject_type', evo_leasingobject_typeid: string | null } | null> | null, accounts: Array<{ __typename?: 'account', accountid: string | null } | null> | null, evo_brands: Array<{ __typename?: 'evo_brand', evo_brandid: string | null } | null> | null, evo_models: Array<{ __typename?: 'evo_model', evo_modelid: string | null } | null> | null } | null };
|
||||||
|
|
||||||
|
export type GetRegionsQueryVariables = Exact<{ [key: string]: never; }>;
|
||||||
|
|
||||||
|
|
||||||
|
export type GetRegionsQuery = { __typename?: 'Query', evo_regions: Array<{ __typename?: 'evo_region', label: string | null, value: string | null } | null> | null };
|
||||||
|
|
||||||
|
export type GetGpsBrandsQueryVariables = Exact<{ [key: string]: never; }>;
|
||||||
|
|
||||||
|
|
||||||
|
export type GetGpsBrandsQuery = { __typename?: 'Query', evo_gps_brands: Array<{ __typename?: 'evo_gps_brand', label: string | null, value: string | null } | null> | null };
|
||||||
|
|
||||||
|
export type GetLeaseObjectTypesQueryVariables = Exact<{ [key: string]: never; }>;
|
||||||
|
|
||||||
|
|
||||||
|
export type GetLeaseObjectTypesQuery = { __typename?: 'Query', evo_leasingobject_types: Array<{ __typename?: 'evo_leasingobject_type', evo_leasingobject_typeid: string | null, label: string | null, value: string | null } | null> | null };
|
||||||
|
|
||||||
|
export type GetLeaseObjectTypeQueryVariables = Exact<{
|
||||||
|
leaseObjectTypeId: Scalars['Uuid'];
|
||||||
|
}>;
|
||||||
|
|
||||||
|
|
||||||
|
export type GetLeaseObjectTypeQuery = { __typename?: 'Query', leaseObjectType: { __typename?: 'evo_leasingobject_type', evo_vehicle_type: Array<number> | null } | null };
|
||||||
|
|
||||||
|
export type GetBrandsQueryVariables = Exact<{ [key: string]: never; }>;
|
||||||
|
|
||||||
|
|
||||||
|
export type GetBrandsQuery = { __typename?: 'Query', evo_brands: Array<{ __typename?: 'evo_brand', evo_brandid: string | null, evo_vehicle_type: Array<number> | null, label: string | null, value: string | null } | null> | null };
|
||||||
|
|
||||||
|
export type GetModelsQueryVariables = Exact<{
|
||||||
|
brandId: Scalars['Uuid'];
|
||||||
|
}>;
|
||||||
|
|
||||||
|
|
||||||
|
export type GetModelsQuery = { __typename?: 'Query', evo_models: Array<{ __typename?: 'evo_model', evo_modelid: string | null, evo_vehicle_type: number | null, label: string | null, value: string | null } | null> | null };
|
||||||
|
|
||||||
|
export type GetConfigurationsQueryVariables = Exact<{
|
||||||
|
modelId: InputMaybe<Scalars['Uuid']>;
|
||||||
|
}>;
|
||||||
|
|
||||||
|
|
||||||
|
export type GetConfigurationsQuery = { __typename?: 'Query', evo_equipments: Array<{ __typename?: 'evo_equipment', label: string | null, value: string | null } | null> | null };
|
||||||
|
|
||||||
|
export type GetDealersQueryVariables = Exact<{ [key: string]: never; }>;
|
||||||
|
|
||||||
|
|
||||||
|
export type GetDealersQuery = { __typename?: 'Query', dealers: Array<{ __typename?: 'account', accountid: string | null, label: string | null, value: string | null } | null> | null };
|
||||||
|
|
||||||
|
export type GetDealerQueryVariables = Exact<{
|
||||||
|
dealerId: Scalars['Uuid'];
|
||||||
|
}>;
|
||||||
|
|
||||||
|
|
||||||
|
export type GetDealerQuery = { __typename?: 'Query', dealer: { __typename?: 'account', evo_return_leasing_dealer: boolean | null, evo_broker_accountid: string | null } | null };
|
||||||
|
|
||||||
|
export type GetDealerPersonsQueryVariables = Exact<{
|
||||||
|
dealerId: Scalars['Uuid'];
|
||||||
|
}>;
|
||||||
|
|
||||||
|
|
||||||
|
export type GetDealerPersonsQuery = { __typename?: 'Query', dealerPersons: Array<{ __typename?: 'account', accountid: string | null, evo_inn: string | null, evo_kpp: string | null, label: string | null, value: string | null } | null> | null };
|
||||||
|
|
||||||
|
export type GetAgentQueryVariables = Exact<{
|
||||||
|
agentid: Scalars['Uuid'];
|
||||||
|
}>;
|
||||||
|
|
||||||
|
|
||||||
|
export type GetAgentQuery = { __typename?: 'Query', agent: { __typename?: 'account', label: string | null, value: string | null } | null };
|
||||||
|
|
||||||
|
export type GetRewardConditionsQueryVariables = Exact<{
|
||||||
|
agentid: Scalars['Uuid'];
|
||||||
|
currentDate: InputMaybe<Scalars['DateTime']>;
|
||||||
|
}>;
|
||||||
|
|
||||||
|
|
||||||
|
export type GetRewardConditionsQuery = { __typename?: 'Query', evo_reward_conditions: Array<{ __typename?: 'evo_reward_condition', evo_reward_summ: number | null, label: string | null, value: string | null } | null> | null };
|
||||||
|
|
||||||
|
export type GetRewardConditionQueryVariables = Exact<{
|
||||||
|
conditionId: Scalars['Uuid'];
|
||||||
|
}>;
|
||||||
|
|
||||||
|
|
||||||
|
export type GetRewardConditionQuery = { __typename?: 'Query', evo_reward_condition: { __typename?: 'evo_reward_condition', evo_reward_summ: number | null, evo_reduce_reward: boolean | null, evo_min_reward_summ: number | null, evo_agency_agreementidData: { __typename?: 'evo_agency_agreement', evo_required_reward: boolean | null, evo_reward_without_other_agent: boolean | null } | null } | null };
|
||||||
|
|
||||||
|
export type GetConfiguratorDataFromQuoteQueryVariables = Exact<{
|
||||||
|
quoteId: Scalars['Uuid'];
|
||||||
|
}>;
|
||||||
|
|
||||||
|
|
||||||
|
export type GetConfiguratorDataFromQuoteQuery = { __typename?: 'Query', quote: { __typename?: 'quote', evo_baseproductid: string | null } | null };
|
||||||
|
|
||||||
|
export type GetFingapDataFromQuoteQueryVariables = Exact<{
|
||||||
|
quoteId: Scalars['Uuid'];
|
||||||
|
}>;
|
||||||
|
|
||||||
|
|
||||||
|
export type GetFingapDataFromQuoteQuery = { __typename?: 'Query', quote: { __typename?: 'quote', evo_fingap_accountid: string | null, evo_fingap_payer: number | null, evo_fingap_period: number | null, evo_product_risks: Array<{ __typename?: 'evo_product_risk', evo_addproduct_typeid: string | null } | null> | null } | null };
|
||||||
|
|
||||||
export type GetFinGapAddProductTypesQueryVariables = Exact<{
|
export type GetFinGapAddProductTypesQueryVariables = Exact<{
|
||||||
currentDate: InputMaybe<Scalars['DateTime']>;
|
currentDate: InputMaybe<Scalars['DateTime']>;
|
||||||
@ -143,38 +329,11 @@ export type GetInsuranceDataQueryVariables = Exact<{
|
|||||||
|
|
||||||
export type GetInsuranceDataQuery = { __typename?: 'Query', osago: Array<{ __typename?: 'account', value: string | null, label: string | null } | null> | null, kasko: Array<{ __typename?: 'account', value: string | null, label: string | null } | null> | null, fingap: Array<{ __typename?: 'account', value: string | null, label: string | null } | null> | null };
|
export type GetInsuranceDataQuery = { __typename?: 'Query', osago: Array<{ __typename?: 'account', value: string | null, label: string | null } | null> | null, kasko: Array<{ __typename?: 'account', value: string | null, label: string | null } | null> | null, fingap: Array<{ __typename?: 'account', value: string | null, label: string | null } | null> | null };
|
||||||
|
|
||||||
export type GetMainOptionsQueryVariables = Exact<{
|
export type GetAddproductTypesQueryVariables = Exact<{
|
||||||
currentDate: InputMaybe<Scalars['DateTime']>;
|
currentDate: InputMaybe<Scalars['DateTime']>;
|
||||||
}>;
|
}>;
|
||||||
|
|
||||||
|
|
||||||
export type GetMainOptionsQuery = { __typename?: 'Query', selectSupplierCurrency: Array<{ __typename?: 'transactioncurrency', currencysymbol: string | null, label: string | null, value: string | null } | null> | null, selectProduct: Array<{ __typename?: 'evo_baseproduct', label: string | null, value: string | null } | null> | null, selectLeaseObjectType: Array<{ __typename?: 'evo_leasingobject_type', label: string | null, value: string | null } | null> | null, selectGPSBrand: Array<{ __typename?: 'evo_gps_brand', label: string | null, value: string | null } | null> | null };
|
|
||||||
|
|
||||||
export type GetSubsidiesQueryVariables = Exact<{
|
|
||||||
currentDate: InputMaybe<Scalars['DateTime']>;
|
|
||||||
}>;
|
|
||||||
|
|
||||||
|
|
||||||
export type GetSubsidiesQuery = { __typename?: 'Query', evo_subsidies: Array<{ __typename?: 'evo_subsidy', evo_subsidy_type: number | null, label: string | null, value: string | null } | null> | null };
|
|
||||||
|
|
||||||
export type GetRegionsQueryVariables = Exact<{ [key: string]: never; }>;
|
|
||||||
|
|
||||||
|
|
||||||
export type GetRegionsQuery = { __typename?: 'Query', evo_regions: Array<{ __typename?: 'evo_region', label: string | null, value: string | null } | null> | null };
|
|
||||||
|
|
||||||
export type GetBrandsQueryVariables = Exact<{ [key: string]: never; }>;
|
|
||||||
|
|
||||||
|
|
||||||
export type GetBrandsQuery = { __typename?: 'Query', selectBrand: Array<{ __typename?: 'evo_brand', label: string | null, value: string | null } | null> | null };
|
|
||||||
|
|
||||||
export type GetDealersQueryVariables = Exact<{ [key: string]: never; }>;
|
|
||||||
|
|
||||||
|
|
||||||
export type GetDealersQuery = { __typename?: 'Query', selectDealer: Array<{ __typename?: 'account', label: string | null, value: string | null } | null> | null };
|
|
||||||
|
|
||||||
export type GetAddproductTypesQueryVariables = Exact<{ [key: string]: never; }>;
|
|
||||||
|
|
||||||
|
|
||||||
export type GetAddproductTypesQuery = { __typename?: 'Query', evo_addproduct_types: Array<{ __typename?: 'evo_addproduct_type', evo_graph_price: number | null, evo_product_type: number | null, label: string | null, value: string | null } | null> | null };
|
export type GetAddproductTypesQuery = { __typename?: 'Query', evo_addproduct_types: Array<{ __typename?: 'evo_addproduct_type', evo_graph_price: number | null, evo_product_type: number | null, label: string | null, value: string | null } | null> | null };
|
||||||
|
|
||||||
export type GetOwnerDataQueryVariables = Exact<{
|
export type GetOwnerDataQueryVariables = Exact<{
|
||||||
@ -184,32 +343,6 @@ export type GetOwnerDataQueryVariables = Exact<{
|
|||||||
|
|
||||||
export type GetOwnerDataQuery = { __typename?: 'Query', selectLead: Array<{ __typename?: 'lead', label: string | null, value: string | null } | null> | null, selectOpportunity: Array<{ __typename?: 'opportunity', label: string | null, value: string | null } | null> | null };
|
export type GetOwnerDataQuery = { __typename?: 'Query', selectLead: Array<{ __typename?: 'lead', label: string | null, value: string | null } | null> | null, selectOpportunity: Array<{ __typename?: 'opportunity', label: string | null, value: string | null } | null> | null };
|
||||||
|
|
||||||
export type GetTransactionCurrenciesQueryVariables = Exact<{ [key: string]: never; }>;
|
|
||||||
|
|
||||||
|
|
||||||
export type GetTransactionCurrenciesQuery = { __typename?: 'Query', transactioncurrencies: Array<{ __typename?: 'transactioncurrency', isocurrencycode: string | null, transactioncurrencyid: string | null } | null> | null };
|
|
||||||
|
|
||||||
export type GetOpportunityByLeadQueryVariables = Exact<{
|
|
||||||
leadid: Scalars['Uuid'];
|
|
||||||
}>;
|
|
||||||
|
|
||||||
|
|
||||||
export type GetOpportunityByLeadQuery = { __typename?: 'Query', lead: { __typename?: 'lead', evo_opportunityidData: { __typename?: 'opportunity', label: string | null, value: string | null } | null } | null };
|
|
||||||
|
|
||||||
export type GetLeadidByOpportunityQueryVariables = Exact<{
|
|
||||||
opportunityid: Scalars['Uuid'];
|
|
||||||
}>;
|
|
||||||
|
|
||||||
|
|
||||||
export type GetLeadidByOpportunityQuery = { __typename?: 'Query', opportunity: { __typename?: 'opportunity', evo_leadid: string | null } | null };
|
|
||||||
|
|
||||||
export type GetQuotesByLeadQueryVariables = Exact<{
|
|
||||||
leadid: Scalars['Uuid'];
|
|
||||||
}>;
|
|
||||||
|
|
||||||
|
|
||||||
export type GetQuotesByLeadQuery = { __typename?: 'Query', quotes: Array<{ __typename?: 'quote', label: string | null, value: string | null } | null> | null };
|
|
||||||
|
|
||||||
export type GetLeadUrlQueryVariables = Exact<{
|
export type GetLeadUrlQueryVariables = Exact<{
|
||||||
id: Scalars['Uuid'];
|
id: Scalars['Uuid'];
|
||||||
}>;
|
}>;
|
||||||
@ -231,26 +364,33 @@ export type GetQuoteUrlQueryVariables = Exact<{
|
|||||||
|
|
||||||
export type GetQuoteUrlQuery = { __typename?: 'Query', entity: { __typename?: 'quote', link: string | null } | null };
|
export type GetQuoteUrlQuery = { __typename?: 'Query', entity: { __typename?: 'quote', link: string | null } | null };
|
||||||
|
|
||||||
|
export type GetLeasingObjectDataFromQuoteQueryVariables = Exact<{
|
||||||
|
quoteId: Scalars['Uuid'];
|
||||||
|
}>;
|
||||||
|
|
||||||
|
|
||||||
|
export type GetLeasingObjectDataFromQuoteQuery = { __typename?: 'Query', quote: { __typename?: 'quote', evo_brandid: string | null, evo_modelid: string | null, evo_equipmentid: string | null, evo_leasingobject_typeid: string | null } | null };
|
||||||
|
|
||||||
|
export type GetLeasingWithoutKaskoOptionsQueryVariables = Exact<{
|
||||||
|
currentDate: InputMaybe<Scalars['DateTime']>;
|
||||||
|
}>;
|
||||||
|
|
||||||
|
|
||||||
|
export type GetLeasingWithoutKaskoOptionsQuery = { __typename?: 'Query', evo_addproduct_types: Array<{ __typename?: 'evo_addproduct_type', evo_product_type: number | null, evo_min_period: number | null, evo_max_period: number | null, evo_min_price: number | null, evo_max_price: number | null, evo_visible_calc: boolean | null, evo_min_first_payment_perc: number | null, evo_max_first_payment_perc: number | null, label: string | null, value: string | null, evo_leasingobject_types: Array<{ __typename?: 'evo_leasingobject_type', evo_leasingobject_typeid: string | null } | null> | null, evo_models: Array<{ __typename?: 'evo_model', evo_modelid: string | null } | null> | null } | null> | null };
|
||||||
|
|
||||||
export type GetPaymentsDataFromQuoteQueryVariables = Exact<{
|
export type GetPaymentsDataFromQuoteQueryVariables = Exact<{
|
||||||
quoteId: Scalars['Uuid'];
|
quoteId: Scalars['Uuid'];
|
||||||
}>;
|
}>;
|
||||||
|
|
||||||
|
|
||||||
export type GetPaymentsDataFromQuoteQuery = { __typename?: 'Query', quote: { __typename?: 'quote', evo_period: number | null, evo_accept_period: number | null, evo_first_payment_perc: number | null, evo_last_payment_perc: number | null, evo_graph_type: number | null, evo_payments_decrease_perc: number | null, evo_seasons_type: number | null, evo_high_season: number | null, evo_graphs: Array<{ __typename?: 'evo_graph', createdon: string, evo_sumpay_withnds: number | null, evo_planpayments: Array<{ __typename?: 'evo_planpayment', evo_payment_ratio: number | null }> | null }> | null } | null };
|
export type GetPaymentsDataFromQuoteQuery = { __typename?: 'Query', quote: { __typename?: 'quote', evo_period: number | null, evo_accept_period: number | null, evo_first_payment_perc: number | null, evo_last_payment_perc: number | null, evo_graph_type: number | null, evo_payments_decrease_perc: number | null, evo_seasons_type: number | null, evo_high_season: number | null, evo_graphs: Array<{ __typename?: 'evo_graph', createdon: string | null, evo_sumpay_withnds: number | null, evo_planpayments: Array<{ __typename?: 'evo_planpayment', evo_payment_ratio: number | null } | null> | null } | null> | null } | null };
|
||||||
|
|
||||||
export type GetCurrencyChangesQueryVariables = Exact<{
|
export type GetPriceDataFromQuoteQueryVariables = Exact<{
|
||||||
currentDate: InputMaybe<Scalars['DateTime']>;
|
quoteId: Scalars['Uuid'];
|
||||||
}>;
|
}>;
|
||||||
|
|
||||||
|
|
||||||
export type GetCurrencyChangesQuery = { __typename?: 'Query', evo_currencychanges: Array<{ __typename?: 'evo_currencychange', evo_currencychange: number | null, evo_ref_transactioncurrency: string | null } | null> | null };
|
export type GetPriceDataFromQuoteQuery = { __typename?: 'Query', quote: { __typename?: 'quote', evo_supplier_currency_price: number | null, evo_price_without_nds_supplier_currency: number | null, evo_nds_in_price_supplier_currency: number | null, evo_last_payment_rub: number | null, evo_last_payment_calc: number | null, evo_transactioncurrencyid: string | null, evo_discount_supplier_currency: number | null, evo_discount_perc: number | null, evo_comission_perc: number | null, evo_comission_rub: number | null, evo_sale_bonus: number | null } | null };
|
||||||
|
|
||||||
export type GetCurrencyIsoCodeQueryVariables = Exact<{
|
|
||||||
id: Scalars['Uuid'];
|
|
||||||
}>;
|
|
||||||
|
|
||||||
|
|
||||||
export type GetCurrencyIsoCodeQuery = { __typename?: 'Query', transactioncurrency: { __typename?: 'transactioncurrency', isocurrencycode: string | null } | null };
|
|
||||||
|
|
||||||
export type GetRewardRulesQueryVariables = Exact<{
|
export type GetRewardRulesQueryVariables = Exact<{
|
||||||
conditionId: Scalars['Uuid'];
|
conditionId: Scalars['Uuid'];
|
||||||
@ -266,87 +406,47 @@ export type GetAgentsDataFromQuoteQueryVariables = Exact<{
|
|||||||
|
|
||||||
export type GetAgentsDataFromQuoteQuery = { __typename?: 'Query', quote: { __typename?: 'quote', evo_supplier_accountid: string | null, evo_dealer_person_accountid: string | null, evo_dealer_reward_conditionid: string | null, evo_dealer_reward_total: number | null, evo_dealer_reward_summ: number | null, evo_dealer_broker_accountid: string | null, evo_dealer_broker_reward_conditionid: string | null, evo_dealer_broker_reward_total: number | null, evo_dealer_broker_reward_summ: number | null, evo_agent_accountid: string | null, evo_agent_reward_conditionid: string | null, evo_agent_reward_total: number | null, evo_agent_reward_summ: number | null, evo_double_agent_accountid: string | null, evo_double_agent_reward_conditionid: string | null, evo_double_agent_reward_total: number | null, evo_double_agent_reward_summ: number | null, evo_broker_accountid: string | null, evo_broker_reward_conditionid: string | null, evo_broker_reward_total: number | null, evo_broker_reward_summ: number | null, evo_fin_department_accountid: string | null, evo_fin_department_reward_conditionid: string | null, evo_fin_department_reward_total: number | null, evo_fin_department_reward_summ: number | null } | null };
|
export type GetAgentsDataFromQuoteQuery = { __typename?: 'Query', quote: { __typename?: 'quote', evo_supplier_accountid: string | null, evo_dealer_person_accountid: string | null, evo_dealer_reward_conditionid: string | null, evo_dealer_reward_total: number | null, evo_dealer_reward_summ: number | null, evo_dealer_broker_accountid: string | null, evo_dealer_broker_reward_conditionid: string | null, evo_dealer_broker_reward_total: number | null, evo_dealer_broker_reward_summ: number | null, evo_agent_accountid: string | null, evo_agent_reward_conditionid: string | null, evo_agent_reward_total: number | null, evo_agent_reward_summ: number | null, evo_double_agent_accountid: string | null, evo_double_agent_reward_conditionid: string | null, evo_double_agent_reward_total: number | null, evo_double_agent_reward_summ: number | null, evo_broker_accountid: string | null, evo_broker_reward_conditionid: string | null, evo_broker_reward_total: number | null, evo_broker_reward_summ: number | null, evo_fin_department_accountid: string | null, evo_fin_department_reward_conditionid: string | null, evo_fin_department_reward_total: number | null, evo_fin_department_reward_summ: number | null } | null };
|
||||||
|
|
||||||
export type GetRewardConditionsQueryVariables = Exact<{
|
|
||||||
agentid: Scalars['Uuid'];
|
|
||||||
currentDate: InputMaybe<Scalars['DateTime']>;
|
|
||||||
}>;
|
|
||||||
|
|
||||||
|
export const GetTransactionCurrenciesDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetTransactionCurrencies"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"transactioncurrencies"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"label"},"name":{"kind":"Name","value":"currencyname"}},{"kind":"Field","alias":{"kind":"Name","value":"value"},"name":{"kind":"Name","value":"transactioncurrencyid"}},{"kind":"Field","name":{"kind":"Name","value":"transactioncurrencyid"}},{"kind":"Field","name":{"kind":"Name","value":"isocurrencycode"}},{"kind":"Field","name":{"kind":"Name","value":"currencysymbol"}}]}}]}}]} as unknown as DocumentNode<GetTransactionCurrenciesQuery, GetTransactionCurrenciesQueryVariables>;
|
||||||
export type GetRewardConditionsQuery = { __typename?: 'Query', evo_reward_conditions: Array<{ __typename?: 'evo_reward_condition', evo_reward_summ: number | null, label: string | null, value: string | null } | null> | null };
|
export const GetTransactionCurrencyDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetTransactionCurrency"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"currencyid"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"Uuid"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"transactioncurrency"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"transactioncurrencyid"},"value":{"kind":"Variable","name":{"kind":"Name","value":"currencyid"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"currencysymbol"}},{"kind":"Field","name":{"kind":"Name","value":"isocurrencycode"}}]}}]}}]} as unknown as DocumentNode<GetTransactionCurrencyQuery, GetTransactionCurrencyQueryVariables>;
|
||||||
|
export const GetCurrencyChangesDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetCurrencyChanges"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"currentDate"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"DateTime"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"evo_currencychanges"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"statecode"},"value":{"kind":"IntValue","value":"0"}},{"kind":"Argument","name":{"kind":"Name","value":"evo_coursedate_param"},"value":{"kind":"ObjectValue","fields":[{"kind":"ObjectField","name":{"kind":"Name","value":"eq"},"value":{"kind":"Variable","name":{"kind":"Name","value":"currentDate"}}}]}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"evo_currencychange"}},{"kind":"Field","name":{"kind":"Name","value":"evo_ref_transactioncurrency"}}]}}]}}]} as unknown as DocumentNode<GetCurrencyChangesQuery, GetCurrencyChangesQueryVariables>;
|
||||||
export type GetRewardSummQueryVariables = Exact<{
|
export const GetLeadDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetLead"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"leadid"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"Uuid"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"lead"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"leadid"},"value":{"kind":"Variable","name":{"kind":"Name","value":"leadid"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"evo_agent_accountid"}},{"kind":"Field","name":{"kind":"Name","value":"evo_double_agent_accountid"}},{"kind":"Field","name":{"kind":"Name","value":"evo_broker_accountid"}},{"kind":"Field","name":{"kind":"Name","value":"evo_fin_department_accountid"}},{"kind":"Field","name":{"kind":"Name","value":"evo_opportunityidData"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"label"},"name":{"kind":"Name","value":"name"}},{"kind":"Field","alias":{"kind":"Name","value":"value"},"name":{"kind":"Name","value":"opportunityid"}}]}}]}}]}}]} as unknown as DocumentNode<GetLeadQuery, GetLeadQueryVariables>;
|
||||||
conditionId: Scalars['Uuid'];
|
export const GetOpportunityDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetOpportunity"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"opportunityid"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"Uuid"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"opportunity"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"opportunityid"},"value":{"kind":"Variable","name":{"kind":"Name","value":"opportunityid"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"evo_leadid"}}]}}]}}]} as unknown as DocumentNode<GetOpportunityQuery, GetOpportunityQueryVariables>;
|
||||||
}>;
|
export const GetQuotesDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetQuotes"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"leadid"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"Uuid"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"quotes"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"evo_leadid"},"value":{"kind":"Variable","name":{"kind":"Name","value":"leadid"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"label"},"name":{"kind":"Name","value":"evo_quotename"}},{"kind":"Field","alias":{"kind":"Name","value":"value"},"name":{"kind":"Name","value":"quoteid"}}]}}]}}]} as unknown as DocumentNode<GetQuotesQuery, GetQuotesQueryVariables>;
|
||||||
|
export const GetQuoteDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetQuote"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"quoteId"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"Uuid"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"quote"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"quoteId"},"value":{"kind":"Variable","name":{"kind":"Name","value":"quoteId"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"evo_baseproductid"}}]}}]}}]} as unknown as DocumentNode<GetQuoteQuery, GetQuoteQueryVariables>;
|
||||||
|
export const GetTarifsDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetTarifs"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"currentDate"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"DateTime"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"evo_tarifs"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"statecode"},"value":{"kind":"IntValue","value":"0"}},{"kind":"Argument","name":{"kind":"Name","value":"evo_datefrom_param"},"value":{"kind":"ObjectValue","fields":[{"kind":"ObjectField","name":{"kind":"Name","value":"lte"},"value":{"kind":"Variable","name":{"kind":"Name","value":"currentDate"}}}]}},{"kind":"Argument","name":{"kind":"Name","value":"evo_dateto_param"},"value":{"kind":"ObjectValue","fields":[{"kind":"ObjectField","name":{"kind":"Name","value":"gte"},"value":{"kind":"Variable","name":{"kind":"Name","value":"currentDate"}}}]}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"label"},"name":{"kind":"Name","value":"evo_name"}},{"kind":"Field","alias":{"kind":"Name","value":"value"},"name":{"kind":"Name","value":"evo_tarifid"}},{"kind":"Field","name":{"kind":"Name","value":"evo_tarifid"}},{"kind":"Field","name":{"kind":"Name","value":"evo_baseproductid"}},{"kind":"Field","name":{"kind":"Name","value":"evo_min_period"}},{"kind":"Field","name":{"kind":"Name","value":"evo_max_period"}},{"kind":"Field","name":{"kind":"Name","value":"evo_delivery_time"}},{"kind":"Field","name":{"kind":"Name","value":"evo_min_first_payment"}},{"kind":"Field","name":{"kind":"Name","value":"evo_max_first_payment"}},{"kind":"Field","name":{"kind":"Name","value":"evo_min_last_payment"}},{"kind":"Field","name":{"kind":"Name","value":"evo_max_last_payment"}},{"kind":"Field","name":{"kind":"Name","value":"evo_used"}}]}}]}}]} as unknown as DocumentNode<GetTarifsQuery, GetTarifsQueryVariables>;
|
||||||
export type GetRewardSummQuery = { __typename?: 'Query', evo_reward_condition: { __typename?: 'evo_reward_condition', evo_reward_summ: number | null } | null };
|
export const GetTarifDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetTarif"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"tarifId"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"Uuid"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"evo_tarif"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"evo_tarifid"},"value":{"kind":"Variable","name":{"kind":"Name","value":"tarifId"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"evo_irr"}},{"kind":"Field","name":{"kind":"Name","value":"evo_graphtype_exception"}},{"kind":"Field","name":{"kind":"Name","value":"evo_seasons_type_exception"}},{"kind":"Field","name":{"kind":"Name","value":"evo_min_decreasing_perc"}}]}}]}}]} as unknown as DocumentNode<GetTarifQuery, GetTarifQueryVariables>;
|
||||||
|
export const GetRatesDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetRates"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"currentDate"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"DateTime"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"evo_rates"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"statecode"},"value":{"kind":"IntValue","value":"0"}},{"kind":"Argument","name":{"kind":"Name","value":"evo_datefrom_param"},"value":{"kind":"ObjectValue","fields":[{"kind":"ObjectField","name":{"kind":"Name","value":"lte"},"value":{"kind":"Variable","name":{"kind":"Name","value":"currentDate"}}}]}},{"kind":"Argument","name":{"kind":"Name","value":"evo_dateto_param"},"value":{"kind":"ObjectValue","fields":[{"kind":"ObjectField","name":{"kind":"Name","value":"gte"},"value":{"kind":"Variable","name":{"kind":"Name","value":"currentDate"}}}]}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"label"},"name":{"kind":"Name","value":"evo_name"}},{"kind":"Field","alias":{"kind":"Name","value":"value"},"name":{"kind":"Name","value":"evo_rateid"}},{"kind":"Field","name":{"kind":"Name","value":"evo_id"}},{"kind":"Field","name":{"kind":"Name","value":"evo_tarifs"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"evo_tarifid"}}]}}]}}]}}]} as unknown as DocumentNode<GetRatesQuery, GetRatesQueryVariables>;
|
||||||
export type GetRewardConditionQueryVariables = Exact<{
|
export const GetProductsDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetProducts"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"currentDate"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"DateTime"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"evo_baseproducts"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"statecode"},"value":{"kind":"IntValue","value":"0"}},{"kind":"Argument","name":{"kind":"Name","value":"evo_relation"},"value":{"kind":"ListValue","values":[{"kind":"IntValue","value":"100000000"}]}},{"kind":"Argument","name":{"kind":"Name","value":"evo_datefrom_param"},"value":{"kind":"ObjectValue","fields":[{"kind":"ObjectField","name":{"kind":"Name","value":"lte"},"value":{"kind":"Variable","name":{"kind":"Name","value":"currentDate"}}}]}},{"kind":"Argument","name":{"kind":"Name","value":"evo_dateto_param"},"value":{"kind":"ObjectValue","fields":[{"kind":"ObjectField","name":{"kind":"Name","value":"gte"},"value":{"kind":"Variable","name":{"kind":"Name","value":"currentDate"}}}]}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"label"},"name":{"kind":"Name","value":"evo_name"}},{"kind":"Field","alias":{"kind":"Name","value":"value"},"name":{"kind":"Name","value":"evo_baseproductid"}},{"kind":"Field","name":{"kind":"Name","value":"evo_baseproductid"}}]}}]}}]} as unknown as DocumentNode<GetProductsQuery, GetProductsQueryVariables>;
|
||||||
conditionId: Scalars['Uuid'];
|
export const GetProductDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetProduct"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"productId"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"Uuid"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"evo_baseproduct"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"evo_baseproductid"},"value":{"kind":"Variable","name":{"kind":"Name","value":"productId"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"evo_leasingobject_types"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"evo_leasingobject_typeid"}}]}},{"kind":"Field","name":{"kind":"Name","value":"evo_calculation_method"}},{"kind":"Field","name":{"kind":"Name","value":"evo_baseproducts"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"evo_baseproductid"}}]}},{"kind":"Field","name":{"kind":"Name","value":"evo_brands"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"evo_brandid"}}]}}]}}]}}]} as unknown as DocumentNode<GetProductQuery, GetProductQueryVariables>;
|
||||||
}>;
|
export const GetSubsidiesDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetSubsidies"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"currentDate"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"DateTime"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"evo_subsidies"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"statecode"},"value":{"kind":"IntValue","value":"0"}},{"kind":"Argument","name":{"kind":"Name","value":"evo_datefrom_param"},"value":{"kind":"ObjectValue","fields":[{"kind":"ObjectField","name":{"kind":"Name","value":"lte"},"value":{"kind":"Variable","name":{"kind":"Name","value":"currentDate"}}}]}},{"kind":"Argument","name":{"kind":"Name","value":"evo_dateto_param"},"value":{"kind":"ObjectValue","fields":[{"kind":"ObjectField","name":{"kind":"Name","value":"gte"},"value":{"kind":"Variable","name":{"kind":"Name","value":"currentDate"}}}]}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"label"},"name":{"kind":"Name","value":"evo_name"}},{"kind":"Field","alias":{"kind":"Name","value":"value"},"name":{"kind":"Name","value":"evo_subsidyid"}},{"kind":"Field","name":{"kind":"Name","value":"evo_subsidy_type"}}]}}]}}]} as unknown as DocumentNode<GetSubsidiesQuery, GetSubsidiesQueryVariables>;
|
||||||
|
export const GetSubsidyDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetSubsidy"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"subsidyId"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"Uuid"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"evo_subsidy"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"evo_subsidyid"},"value":{"kind":"Variable","name":{"kind":"Name","value":"subsidyId"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"evo_leasingobject_types"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"evo_leasingobject_typeid"}}]}},{"kind":"Field","name":{"kind":"Name","value":"accounts"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"accountid"}}]}},{"kind":"Field","name":{"kind":"Name","value":"evo_brands"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"evo_brandid"}}]}},{"kind":"Field","name":{"kind":"Name","value":"evo_models"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"evo_modelid"}}]}},{"kind":"Field","name":{"kind":"Name","value":"evo_subsidy_summ"}},{"kind":"Field","name":{"kind":"Name","value":"evo_percent_subsidy"}},{"kind":"Field","name":{"kind":"Name","value":"evo_max_subsidy_summ"}}]}}]}}]} as unknown as DocumentNode<GetSubsidyQuery, GetSubsidyQueryVariables>;
|
||||||
|
export const GetImportProgramDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetImportProgram"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"importProgramId"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"Uuid"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"importProgram"},"name":{"kind":"Name","value":"evo_subsidy"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"evo_subsidyid"},"value":{"kind":"Variable","name":{"kind":"Name","value":"importProgramId"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"evo_leasingobject_types"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"evo_leasingobject_typeid"}}]}},{"kind":"Field","name":{"kind":"Name","value":"accounts"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"accountid"}}]}},{"kind":"Field","name":{"kind":"Name","value":"evo_brands"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"evo_brandid"}}]}},{"kind":"Field","name":{"kind":"Name","value":"evo_models"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"evo_modelid"}}]}}]}}]}}]} as unknown as DocumentNode<GetImportProgramQuery, GetImportProgramQueryVariables>;
|
||||||
export type GetRewardConditionQuery = { __typename?: 'Query', evo_reward_condition: { __typename?: 'evo_reward_condition', evo_reward_summ: number | null, evo_reduce_reward: boolean | null, evo_min_reward_summ: number | null, evo_agency_agreementidData: { __typename?: 'evo_agency_agreement', evo_required_reward: boolean | null } | null } | null };
|
export const GetRegionsDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetRegions"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"evo_regions"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"label"},"name":{"kind":"Name","value":"evo_name"}},{"kind":"Field","alias":{"kind":"Name","value":"value"},"name":{"kind":"Name","value":"evo_regionid"}}]}}]}}]} as unknown as DocumentNode<GetRegionsQuery, GetRegionsQueryVariables>;
|
||||||
|
export const GetGpsBrandsDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetGPSBrands"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"evo_gps_brands"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"statecode"},"value":{"kind":"IntValue","value":"0"}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"label"},"name":{"kind":"Name","value":"evo_name"}},{"kind":"Field","alias":{"kind":"Name","value":"value"},"name":{"kind":"Name","value":"evo_gps_brandid"}}]}}]}}]} as unknown as DocumentNode<GetGpsBrandsQuery, GetGpsBrandsQueryVariables>;
|
||||||
export type GetAgentAccountIdFromLeadQueryVariables = Exact<{
|
export const GetLeaseObjectTypesDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetLeaseObjectTypes"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"evo_leasingobject_types"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"statecode"},"value":{"kind":"IntValue","value":"0"}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"label"},"name":{"kind":"Name","value":"evo_name"}},{"kind":"Field","alias":{"kind":"Name","value":"value"},"name":{"kind":"Name","value":"evo_leasingobject_typeid"}},{"kind":"Field","name":{"kind":"Name","value":"evo_leasingobject_typeid"}}]}}]}}]} as unknown as DocumentNode<GetLeaseObjectTypesQuery, GetLeaseObjectTypesQueryVariables>;
|
||||||
leadid: Scalars['Uuid'];
|
export const GetLeaseObjectTypeDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetLeaseObjectType"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"leaseObjectTypeId"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"Uuid"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"leaseObjectType"},"name":{"kind":"Name","value":"evo_leasingobject_type"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"evo_leasingobject_typeid"},"value":{"kind":"Variable","name":{"kind":"Name","value":"leaseObjectTypeId"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"evo_vehicle_type"}}]}}]}}]} as unknown as DocumentNode<GetLeaseObjectTypeQuery, GetLeaseObjectTypeQueryVariables>;
|
||||||
}>;
|
export const GetBrandsDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetBrands"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"evo_brands"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"statecode"},"value":{"kind":"IntValue","value":"0"}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"label"},"name":{"kind":"Name","value":"evo_name"}},{"kind":"Field","alias":{"kind":"Name","value":"value"},"name":{"kind":"Name","value":"evo_brandid"}},{"kind":"Field","name":{"kind":"Name","value":"evo_brandid"}},{"kind":"Field","name":{"kind":"Name","value":"evo_vehicle_type"}}]}}]}}]} as unknown as DocumentNode<GetBrandsQuery, GetBrandsQueryVariables>;
|
||||||
|
export const GetModelsDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetModels"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"brandId"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"Uuid"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"evo_models"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"statecode"},"value":{"kind":"IntValue","value":"0"}},{"kind":"Argument","name":{"kind":"Name","value":"evo_brandid"},"value":{"kind":"Variable","name":{"kind":"Name","value":"brandId"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"label"},"name":{"kind":"Name","value":"evo_name"}},{"kind":"Field","alias":{"kind":"Name","value":"value"},"name":{"kind":"Name","value":"evo_modelid"}},{"kind":"Field","name":{"kind":"Name","value":"evo_modelid"}},{"kind":"Field","name":{"kind":"Name","value":"evo_vehicle_type"}}]}}]}}]} as unknown as DocumentNode<GetModelsQuery, GetModelsQueryVariables>;
|
||||||
|
export const GetConfigurationsDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetConfigurations"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"modelId"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"Uuid"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"evo_equipments"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"statecode"},"value":{"kind":"IntValue","value":"0"}},{"kind":"Argument","name":{"kind":"Name","value":"evo_modelid"},"value":{"kind":"Variable","name":{"kind":"Name","value":"modelId"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"label"},"name":{"kind":"Name","value":"evo_name"}},{"kind":"Field","alias":{"kind":"Name","value":"value"},"name":{"kind":"Name","value":"evo_equipmentid"}}]}}]}}]} as unknown as DocumentNode<GetConfigurationsQuery, GetConfigurationsQueryVariables>;
|
||||||
export type GetAgentAccountIdFromLeadQuery = { __typename?: 'Query', lead: { __typename?: 'lead', agentid: string | null } | null };
|
export const GetDealersDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetDealers"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"dealers"},"name":{"kind":"Name","value":"accounts"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"evo_account_type"},"value":{"kind":"ListValue","values":[{"kind":"IntValue","value":"100000001"}]}},{"kind":"Argument","name":{"kind":"Name","value":"statecode"},"value":{"kind":"IntValue","value":"0"}},{"kind":"Argument","name":{"kind":"Name","value":"evo_legal_form"},"value":{"kind":"IntValue","value":"100000001"}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"label"},"name":{"kind":"Name","value":"name"}},{"kind":"Field","alias":{"kind":"Name","value":"value"},"name":{"kind":"Name","value":"accountid"}},{"kind":"Field","name":{"kind":"Name","value":"accountid"}}]}}]}}]} as unknown as DocumentNode<GetDealersQuery, GetDealersQueryVariables>;
|
||||||
|
export const GetDealerDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetDealer"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"dealerId"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"Uuid"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"dealer"},"name":{"kind":"Name","value":"account"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"accountid"},"value":{"kind":"Variable","name":{"kind":"Name","value":"dealerId"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"evo_return_leasing_dealer"}},{"kind":"Field","name":{"kind":"Name","value":"evo_broker_accountid"}}]}}]}}]} as unknown as DocumentNode<GetDealerQuery, GetDealerQueryVariables>;
|
||||||
export type GetDoubleAgentAccountIdQueryVariables = Exact<{
|
export const GetDealerPersonsDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetDealerPersons"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"dealerId"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"Uuid"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"dealerPersons"},"name":{"kind":"Name","value":"salon_providers"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"statecode"},"value":{"kind":"IntValue","value":"0"}},{"kind":"Argument","name":{"kind":"Name","value":"salonaccountid"},"value":{"kind":"Variable","name":{"kind":"Name","value":"dealerId"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"label"},"name":{"kind":"Name","value":"name"}},{"kind":"Field","alias":{"kind":"Name","value":"value"},"name":{"kind":"Name","value":"accountid"}},{"kind":"Field","name":{"kind":"Name","value":"accountid"}},{"kind":"Field","name":{"kind":"Name","value":"evo_inn"}},{"kind":"Field","name":{"kind":"Name","value":"evo_kpp"}}]}}]}}]} as unknown as DocumentNode<GetDealerPersonsQuery, GetDealerPersonsQueryVariables>;
|
||||||
leadid: Scalars['Uuid'];
|
export const GetAgentDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetAgent"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"agentid"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"Uuid"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"agent"},"name":{"kind":"Name","value":"account"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"accountid"},"value":{"kind":"Variable","name":{"kind":"Name","value":"agentid"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"label"},"name":{"kind":"Name","value":"name"}},{"kind":"Field","alias":{"kind":"Name","value":"value"},"name":{"kind":"Name","value":"accountid"}}]}}]}}]} as unknown as DocumentNode<GetAgentQuery, GetAgentQueryVariables>;
|
||||||
}>;
|
export const GetRewardConditionsDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetRewardConditions"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"agentid"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"Uuid"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"currentDate"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"DateTime"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"evo_reward_conditions"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"evo_agent_accountid"},"value":{"kind":"Variable","name":{"kind":"Name","value":"agentid"}}},{"kind":"Argument","name":{"kind":"Name","value":"evo_datefrom_param"},"value":{"kind":"ObjectValue","fields":[{"kind":"ObjectField","name":{"kind":"Name","value":"lte"},"value":{"kind":"Variable","name":{"kind":"Name","value":"currentDate"}}}]}},{"kind":"Argument","name":{"kind":"Name","value":"evo_dateto_param"},"value":{"kind":"ObjectValue","fields":[{"kind":"ObjectField","name":{"kind":"Name","value":"gte"},"value":{"kind":"Variable","name":{"kind":"Name","value":"currentDate"}}}]}},{"kind":"Argument","name":{"kind":"Name","value":"statecode"},"value":{"kind":"IntValue","value":"0"}},{"kind":"Argument","name":{"kind":"Name","value":"evo_agency_agreementid_param"},"value":{"kind":"ObjectValue","fields":[{"kind":"ObjectField","name":{"kind":"Name","value":"has"},"value":{"kind":"BooleanValue","value":true}}]}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"label"},"name":{"kind":"Name","value":"evo_name"}},{"kind":"Field","alias":{"kind":"Name","value":"value"},"name":{"kind":"Name","value":"evo_reward_conditionid"}},{"kind":"Field","name":{"kind":"Name","value":"evo_reward_summ"}}]}}]}}]} as unknown as DocumentNode<GetRewardConditionsQuery, GetRewardConditionsQueryVariables>;
|
||||||
|
export const GetRewardConditionDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetRewardCondition"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"conditionId"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"Uuid"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"evo_reward_condition"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"evo_reward_conditionid"},"value":{"kind":"Variable","name":{"kind":"Name","value":"conditionId"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"evo_reward_summ"}},{"kind":"Field","name":{"kind":"Name","value":"evo_reduce_reward"}},{"kind":"Field","name":{"kind":"Name","value":"evo_min_reward_summ"}},{"kind":"Field","name":{"kind":"Name","value":"evo_agency_agreementidData"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"evo_required_reward"}},{"kind":"Field","name":{"kind":"Name","value":"evo_reward_without_other_agent"}}]}}]}}]}}]} as unknown as DocumentNode<GetRewardConditionQuery, GetRewardConditionQueryVariables>;
|
||||||
|
export const GetConfiguratorDataFromQuoteDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetConfiguratorDataFromQuote"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"quoteId"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"Uuid"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"quote"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"quoteId"},"value":{"kind":"Variable","name":{"kind":"Name","value":"quoteId"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"evo_baseproductid"}}]}}]}}]} as unknown as DocumentNode<GetConfiguratorDataFromQuoteQuery, GetConfiguratorDataFromQuoteQueryVariables>;
|
||||||
export type GetDoubleAgentAccountIdQuery = { __typename?: 'Query', lead: { __typename?: 'lead', agentid: string | null } | null };
|
export const GetFingapDataFromQuoteDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetFingapDataFromQuote"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"quoteId"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"Uuid"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"quote"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"quoteId"},"value":{"kind":"Variable","name":{"kind":"Name","value":"quoteId"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"evo_fingap_accountid"}},{"kind":"Field","name":{"kind":"Name","value":"evo_fingap_payer"}},{"kind":"Field","name":{"kind":"Name","value":"evo_fingap_period"}},{"kind":"Field","name":{"kind":"Name","value":"evo_product_risks"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"evo_addproduct_typeid"}}]}}]}}]}}]} as unknown as DocumentNode<GetFingapDataFromQuoteQuery, GetFingapDataFromQuoteQueryVariables>;
|
||||||
|
export const GetFinGapAddProductTypesDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetFinGAPAddProductTypes"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"currentDate"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"DateTime"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"evo_addproduct_types"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"statecode"},"value":{"kind":"IntValue","value":"0"}},{"kind":"Argument","name":{"kind":"Name","value":"evo_datefrom_param"},"value":{"kind":"ObjectValue","fields":[{"kind":"ObjectField","name":{"kind":"Name","value":"lte"},"value":{"kind":"Variable","name":{"kind":"Name","value":"currentDate"}}}]}},{"kind":"Argument","name":{"kind":"Name","value":"evo_dateto_param"},"value":{"kind":"ObjectValue","fields":[{"kind":"ObjectField","name":{"kind":"Name","value":"gte"},"value":{"kind":"Variable","name":{"kind":"Name","value":"currentDate"}}}]}},{"kind":"Argument","name":{"kind":"Name","value":"evo_product_type"},"value":{"kind":"IntValue","value":"100000006"}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"evo_addproduct_typeid"}},{"kind":"Field","name":{"kind":"Name","value":"evo_name"}},{"kind":"Field","name":{"kind":"Name","value":"evo_type_calc_cerebellum"}},{"kind":"Field","name":{"kind":"Name","value":"evo_cost_service_provider_withoutnds"}},{"kind":"Field","name":{"kind":"Name","value":"evo_addproduct_types"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"evo_addproduct_typeid"}}]}}]}}]}}]} as unknown as DocumentNode<GetFinGapAddProductTypesQuery, GetFinGapAddProductTypesQueryVariables>;
|
||||||
export type GetBrokerAccountIdQueryVariables = Exact<{
|
export const GetInsuranceDataDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetInsuranceData"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"evo_account_type"}},"type":{"kind":"ListType","type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"Int"}}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"osago"},"name":{"kind":"Name","value":"accounts"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"evo_account_type"},"value":{"kind":"Variable","name":{"kind":"Name","value":"evo_account_type"}}},{"kind":"Argument","name":{"kind":"Name","value":"evo_type_ins_policy"},"value":{"kind":"ListValue","values":[{"kind":"IntValue","value":"100000001"}]}},{"kind":"Argument","name":{"kind":"Name","value":"statecode"},"value":{"kind":"IntValue","value":"0"}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"value"},"name":{"kind":"Name","value":"accountid"}},{"kind":"Field","alias":{"kind":"Name","value":"label"},"name":{"kind":"Name","value":"name"}}]}},{"kind":"Field","alias":{"kind":"Name","value":"kasko"},"name":{"kind":"Name","value":"accounts"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"evo_account_type"},"value":{"kind":"Variable","name":{"kind":"Name","value":"evo_account_type"}}},{"kind":"Argument","name":{"kind":"Name","value":"evo_type_ins_policy"},"value":{"kind":"ListValue","values":[{"kind":"IntValue","value":"100000000"}]}},{"kind":"Argument","name":{"kind":"Name","value":"statecode"},"value":{"kind":"IntValue","value":"0"}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"value"},"name":{"kind":"Name","value":"accountid"}},{"kind":"Field","alias":{"kind":"Name","value":"label"},"name":{"kind":"Name","value":"name"}}]}},{"kind":"Field","alias":{"kind":"Name","value":"fingap"},"name":{"kind":"Name","value":"accounts"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"evo_account_type"},"value":{"kind":"Variable","name":{"kind":"Name","value":"evo_account_type"}}},{"kind":"Argument","name":{"kind":"Name","value":"evo_type_ins_policy"},"value":{"kind":"ListValue","values":[{"kind":"IntValue","value":"100000002"}]}},{"kind":"Argument","name":{"kind":"Name","value":"statecode"},"value":{"kind":"IntValue","value":"0"}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"value"},"name":{"kind":"Name","value":"accountid"}},{"kind":"Field","alias":{"kind":"Name","value":"label"},"name":{"kind":"Name","value":"name"}}]}}]}}]} as unknown as DocumentNode<GetInsuranceDataQuery, GetInsuranceDataQueryVariables>;
|
||||||
leadid: Scalars['Uuid'];
|
export const GetAddproductTypesDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetAddproductTypes"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"currentDate"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"DateTime"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"evo_addproduct_types"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"statecode"},"value":{"kind":"IntValue","value":"0"}},{"kind":"Argument","name":{"kind":"Name","value":"evo_datefrom_param"},"value":{"kind":"ObjectValue","fields":[{"kind":"ObjectField","name":{"kind":"Name","value":"lte"},"value":{"kind":"Variable","name":{"kind":"Name","value":"currentDate"}}}]}},{"kind":"Argument","name":{"kind":"Name","value":"evo_dateto_param"},"value":{"kind":"ObjectValue","fields":[{"kind":"ObjectField","name":{"kind":"Name","value":"gte"},"value":{"kind":"Variable","name":{"kind":"Name","value":"currentDate"}}}]}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"label"},"name":{"kind":"Name","value":"evo_name"}},{"kind":"Field","alias":{"kind":"Name","value":"value"},"name":{"kind":"Name","value":"evo_addproduct_typeid"}},{"kind":"Field","name":{"kind":"Name","value":"evo_graph_price"}},{"kind":"Field","name":{"kind":"Name","value":"evo_product_type"}}]}}]}}]} as unknown as DocumentNode<GetAddproductTypesQuery, GetAddproductTypesQueryVariables>;
|
||||||
}>;
|
export const GetOwnerDataDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetOwnerData"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"domainname"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"selectLead"},"name":{"kind":"Name","value":"leads"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"owner_domainname"},"value":{"kind":"Variable","name":{"kind":"Name","value":"domainname"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"label"},"name":{"kind":"Name","value":"fullname"}},{"kind":"Field","alias":{"kind":"Name","value":"value"},"name":{"kind":"Name","value":"leadid"}}]}},{"kind":"Field","alias":{"kind":"Name","value":"selectOpportunity"},"name":{"kind":"Name","value":"opportunities"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"owner_domainname"},"value":{"kind":"Variable","name":{"kind":"Name","value":"domainname"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"label"},"name":{"kind":"Name","value":"name"}},{"kind":"Field","alias":{"kind":"Name","value":"value"},"name":{"kind":"Name","value":"opportunityid"}}]}}]}}]} as unknown as DocumentNode<GetOwnerDataQuery, GetOwnerDataQueryVariables>;
|
||||||
|
export const GetLeadUrlDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetLeadUrl"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"id"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"Uuid"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"entity"},"name":{"kind":"Name","value":"lead"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"leadid"},"value":{"kind":"Variable","name":{"kind":"Name","value":"id"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"link"}}]}}]}}]} as unknown as DocumentNode<GetLeadUrlQuery, GetLeadUrlQueryVariables>;
|
||||||
|
export const GetOpportunityUrlDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetOpportunityUrl"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"id"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"Uuid"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"entity"},"name":{"kind":"Name","value":"opportunity"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"opportunityid"},"value":{"kind":"Variable","name":{"kind":"Name","value":"id"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"link"}}]}}]}}]} as unknown as DocumentNode<GetOpportunityUrlQuery, GetOpportunityUrlQueryVariables>;
|
||||||
export type GetBrokerAccountIdQuery = { __typename?: 'Query', lead: { __typename?: 'lead', agentid: string | null } | null };
|
export const GetQuoteUrlDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetQuoteUrl"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"id"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"Uuid"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"entity"},"name":{"kind":"Name","value":"quote"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"quoteId"},"value":{"kind":"Variable","name":{"kind":"Name","value":"id"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"link"}}]}}]}}]} as unknown as DocumentNode<GetQuoteUrlQuery, GetQuoteUrlQueryVariables>;
|
||||||
|
export const GetLeasingObjectDataFromQuoteDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetLeasingObjectDataFromQuote"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"quoteId"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"Uuid"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"quote"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"quoteId"},"value":{"kind":"Variable","name":{"kind":"Name","value":"quoteId"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"evo_brandid"}},{"kind":"Field","name":{"kind":"Name","value":"evo_modelid"}},{"kind":"Field","name":{"kind":"Name","value":"evo_equipmentid"}},{"kind":"Field","name":{"kind":"Name","value":"evo_leasingobject_typeid"}}]}}]}}]} as unknown as DocumentNode<GetLeasingObjectDataFromQuoteQuery, GetLeasingObjectDataFromQuoteQueryVariables>;
|
||||||
export type GetFinDepartmentAccountIdQueryVariables = Exact<{
|
export const GetLeasingWithoutKaskoOptionsDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetLeasingWithoutKaskoOptions"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"currentDate"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"DateTime"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"evo_addproduct_types"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"statecode"},"value":{"kind":"IntValue","value":"0"}},{"kind":"Argument","name":{"kind":"Name","value":"evo_product_type"},"value":{"kind":"IntValue","value":"100000007"}},{"kind":"Argument","name":{"kind":"Name","value":"evo_datefrom_param"},"value":{"kind":"ObjectValue","fields":[{"kind":"ObjectField","name":{"kind":"Name","value":"lte"},"value":{"kind":"Variable","name":{"kind":"Name","value":"currentDate"}}}]}},{"kind":"Argument","name":{"kind":"Name","value":"evo_dateto_param"},"value":{"kind":"ObjectValue","fields":[{"kind":"ObjectField","name":{"kind":"Name","value":"gte"},"value":{"kind":"Variable","name":{"kind":"Name","value":"currentDate"}}}]}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"label"},"name":{"kind":"Name","value":"evo_name"}},{"kind":"Field","alias":{"kind":"Name","value":"value"},"name":{"kind":"Name","value":"evo_addproduct_typeid"}},{"kind":"Field","name":{"kind":"Name","value":"evo_product_type"}},{"kind":"Field","name":{"kind":"Name","value":"evo_min_period"}},{"kind":"Field","name":{"kind":"Name","value":"evo_max_period"}},{"kind":"Field","name":{"kind":"Name","value":"evo_min_price"}},{"kind":"Field","name":{"kind":"Name","value":"evo_max_price"}},{"kind":"Field","name":{"kind":"Name","value":"evo_leasingobject_types"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"evo_leasingobject_typeid"}}]}},{"kind":"Field","name":{"kind":"Name","value":"evo_visible_calc"}},{"kind":"Field","name":{"kind":"Name","value":"evo_min_first_payment_perc"}},{"kind":"Field","name":{"kind":"Name","value":"evo_max_first_payment_perc"}},{"kind":"Field","name":{"kind":"Name","value":"evo_models"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"evo_modelid"}}]}}]}}]}}]} as unknown as DocumentNode<GetLeasingWithoutKaskoOptionsQuery, GetLeasingWithoutKaskoOptionsQueryVariables>;
|
||||||
leadid: Scalars['Uuid'];
|
export const GetPaymentsDataFromQuoteDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetPaymentsDataFromQuote"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"quoteId"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"Uuid"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"quote"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"quoteId"},"value":{"kind":"Variable","name":{"kind":"Name","value":"quoteId"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"evo_period"}},{"kind":"Field","name":{"kind":"Name","value":"evo_accept_period"}},{"kind":"Field","name":{"kind":"Name","value":"evo_first_payment_perc"}},{"kind":"Field","name":{"kind":"Name","value":"evo_last_payment_perc"}},{"kind":"Field","name":{"kind":"Name","value":"evo_graph_type"}},{"kind":"Field","name":{"kind":"Name","value":"evo_payments_decrease_perc"}},{"kind":"Field","name":{"kind":"Name","value":"evo_seasons_type"}},{"kind":"Field","name":{"kind":"Name","value":"evo_high_season"}},{"kind":"Field","name":{"kind":"Name","value":"evo_graphs"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"createdon"}},{"kind":"Field","name":{"kind":"Name","value":"evo_sumpay_withnds"}},{"kind":"Field","name":{"kind":"Name","value":"evo_planpayments"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"evo_payment_ratio"}}]}}]}}]}}]}}]} as unknown as DocumentNode<GetPaymentsDataFromQuoteQuery, GetPaymentsDataFromQuoteQueryVariables>;
|
||||||
}>;
|
export const GetPriceDataFromQuoteDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetPriceDataFromQuote"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"quoteId"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"Uuid"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"quote"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"quoteId"},"value":{"kind":"Variable","name":{"kind":"Name","value":"quoteId"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"evo_supplier_currency_price"}},{"kind":"Field","name":{"kind":"Name","value":"evo_price_without_nds_supplier_currency"}},{"kind":"Field","name":{"kind":"Name","value":"evo_nds_in_price_supplier_currency"}},{"kind":"Field","name":{"kind":"Name","value":"evo_last_payment_rub"}},{"kind":"Field","name":{"kind":"Name","value":"evo_last_payment_calc"}},{"kind":"Field","name":{"kind":"Name","value":"evo_transactioncurrencyid"}},{"kind":"Field","name":{"kind":"Name","value":"evo_discount_supplier_currency"}},{"kind":"Field","name":{"kind":"Name","value":"evo_discount_perc"}},{"kind":"Field","name":{"kind":"Name","value":"evo_comission_perc"}},{"kind":"Field","name":{"kind":"Name","value":"evo_comission_rub"}},{"kind":"Field","name":{"kind":"Name","value":"evo_sale_bonus"}}]}}]}}]} as unknown as DocumentNode<GetPriceDataFromQuoteQuery, GetPriceDataFromQuoteQueryVariables>;
|
||||||
|
export const GetRewardRulesDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetRewardRules"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"conditionId"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"Uuid"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"evo_reward_condition"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"evo_reward_conditionid"},"value":{"kind":"Variable","name":{"kind":"Name","value":"conditionId"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"evo_calc_reward_rules"}}]}}]}}]} as unknown as DocumentNode<GetRewardRulesQuery, GetRewardRulesQueryVariables>;
|
||||||
|
export const GetAgentsDataFromQuoteDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetAgentsDataFromQuote"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"quoteId"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"Uuid"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"quote"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"quoteId"},"value":{"kind":"Variable","name":{"kind":"Name","value":"quoteId"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"evo_supplier_accountid"}},{"kind":"Field","name":{"kind":"Name","value":"evo_dealer_person_accountid"}},{"kind":"Field","name":{"kind":"Name","value":"evo_dealer_reward_conditionid"}},{"kind":"Field","name":{"kind":"Name","value":"evo_dealer_reward_total"}},{"kind":"Field","name":{"kind":"Name","value":"evo_dealer_reward_summ"}},{"kind":"Field","name":{"kind":"Name","value":"evo_dealer_broker_accountid"}},{"kind":"Field","name":{"kind":"Name","value":"evo_dealer_broker_reward_conditionid"}},{"kind":"Field","name":{"kind":"Name","value":"evo_dealer_broker_reward_total"}},{"kind":"Field","name":{"kind":"Name","value":"evo_dealer_broker_reward_summ"}},{"kind":"Field","name":{"kind":"Name","value":"evo_agent_accountid"}},{"kind":"Field","name":{"kind":"Name","value":"evo_agent_reward_conditionid"}},{"kind":"Field","name":{"kind":"Name","value":"evo_agent_reward_total"}},{"kind":"Field","name":{"kind":"Name","value":"evo_agent_reward_summ"}},{"kind":"Field","name":{"kind":"Name","value":"evo_double_agent_accountid"}},{"kind":"Field","name":{"kind":"Name","value":"evo_double_agent_reward_conditionid"}},{"kind":"Field","name":{"kind":"Name","value":"evo_double_agent_reward_total"}},{"kind":"Field","name":{"kind":"Name","value":"evo_double_agent_reward_summ"}},{"kind":"Field","name":{"kind":"Name","value":"evo_broker_accountid"}},{"kind":"Field","name":{"kind":"Name","value":"evo_broker_reward_conditionid"}},{"kind":"Field","name":{"kind":"Name","value":"evo_broker_reward_total"}},{"kind":"Field","name":{"kind":"Name","value":"evo_broker_reward_summ"}},{"kind":"Field","name":{"kind":"Name","value":"evo_fin_department_accountid"}},{"kind":"Field","name":{"kind":"Name","value":"evo_fin_department_reward_conditionid"}},{"kind":"Field","name":{"kind":"Name","value":"evo_fin_department_reward_total"}},{"kind":"Field","name":{"kind":"Name","value":"evo_fin_department_reward_summ"}}]}}]}}]} as unknown as DocumentNode<GetAgentsDataFromQuoteQuery, GetAgentsDataFromQuoteQueryVariables>;
|
||||||
export type GetFinDepartmentAccountIdQuery = { __typename?: 'Query', lead: { __typename?: 'lead', agentid: string | null } | null };
|
|
||||||
|
|
||||||
export type GetAgentQueryVariables = Exact<{
|
|
||||||
agentid: Scalars['Uuid'];
|
|
||||||
}>;
|
|
||||||
|
|
||||||
|
|
||||||
export type GetAgentQuery = { __typename?: 'Query', agent: { __typename?: 'account', label: string | null, value: string | null } | null };
|
|
||||||
|
|
||||||
export type GetRewardWithoutOtherAgentQueryVariables = Exact<{
|
|
||||||
conditionId: Scalars['Uuid'];
|
|
||||||
}>;
|
|
||||||
|
|
||||||
|
|
||||||
export type GetRewardWithoutOtherAgentQuery = { __typename?: 'Query', evo_reward_condition: { __typename?: 'evo_reward_condition', evo_agency_agreementidData: { __typename?: 'evo_agency_agreement', evo_reward_without_other_agent: boolean | null } | null } | null };
|
|
||||||
|
|
||||||
export type GetDealerReturnLeasingQueryVariables = Exact<{
|
|
||||||
dealerId: Scalars['Uuid'];
|
|
||||||
}>;
|
|
||||||
|
|
||||||
|
|
||||||
export type GetDealerReturnLeasingQuery = { __typename?: 'Query', dealer: { __typename?: 'account', evo_return_leasing_dealer: boolean | null } | null };
|
|
||||||
|
|
||||||
export type GetDealerPersonQueryVariables = Exact<{
|
|
||||||
dealerId: Scalars['Uuid'];
|
|
||||||
}>;
|
|
||||||
|
|
||||||
|
|
||||||
export type GetDealerPersonQuery = { __typename?: 'Query', salon_providers: Array<{ __typename?: 'account', evo_inn: string | null, evo_kpp: string | null, label: string | null, value: string | null } | null> | null };
|
|
||||||
|
|
||||||
export type GetBrokerAccountIdFromDealerQueryVariables = Exact<{
|
|
||||||
dealerId: Scalars['Uuid'];
|
|
||||||
}>;
|
|
||||||
|
|
||||||
|
|
||||||
export type GetBrokerAccountIdFromDealerQuery = { __typename?: 'Query', dealer: { __typename?: 'account', evo_broker_accountid: string | null } | null };
|
|
||||||
@ -42,8 +42,10 @@
|
|||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@graphql-codegen/cli": "^2.16.3",
|
"@graphql-codegen/cli": "^2.16.3",
|
||||||
|
"@graphql-codegen/typed-document-node": "^2.3.13",
|
||||||
"@graphql-codegen/typescript": "^2.8.7",
|
"@graphql-codegen/typescript": "^2.8.7",
|
||||||
"@graphql-codegen/typescript-operations": "^2.5.12",
|
"@graphql-codegen/typescript-operations": "^2.5.12",
|
||||||
|
"@graphql-typed-document-node/patch-cli": "^3.0.9",
|
||||||
"@testing-library/jest-dom": "^5.16.5",
|
"@testing-library/jest-dom": "^5.16.5",
|
||||||
"@testing-library/react": "^13.4.0",
|
"@testing-library/react": "^13.4.0",
|
||||||
"@types/node": "^18.11.18",
|
"@types/node": "^18.11.18",
|
||||||
|
|||||||
@ -1,8 +1,21 @@
|
|||||||
|
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 { reaction } from 'mobx';
|
import { reaction } from 'mobx';
|
||||||
import type { ReactionsContext } from 'process/types';
|
import type { ReactionsContext } from 'process/types';
|
||||||
|
import type { BaseOption } from 'ui/elements/types';
|
||||||
|
|
||||||
|
function hasInvalidValueOrOptions(value: unknown, options: BaseOption<unknown>[]) {
|
||||||
|
if (value === null) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return (value && !options?.length) || !options.some((x) => x.value === value);
|
||||||
|
}
|
||||||
|
|
||||||
export default function validationReactions({ store }: ReactionsContext) {
|
export default function validationReactions({ store }: ReactionsContext) {
|
||||||
const { $calculation, $tables } = store;
|
const { $calculation, $tables } = store;
|
||||||
|
|
||||||
reaction(
|
reaction(
|
||||||
() => {
|
() => {
|
||||||
const hasElementsErrors = Object.values($calculation.$validation).some(
|
const hasElementsErrors = Object.values($calculation.$validation).some(
|
||||||
@ -27,4 +40,98 @@ export default function validationReactions({ store }: ReactionsContext) {
|
|||||||
fireImmediately: true,
|
fireImmediately: true,
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Проверяем, что выбранное значение элемента есть в списке
|
||||||
|
*/
|
||||||
|
function validateOptionsElement(elementName: Values.Elements) {
|
||||||
|
const type = types[elementName];
|
||||||
|
if (type().typeName !== 'Options') {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
const element = $calculation.element(elementName);
|
||||||
|
|
||||||
|
reaction(
|
||||||
|
() => {
|
||||||
|
const options = element.getOptions();
|
||||||
|
const value = element.getValue();
|
||||||
|
|
||||||
|
return {
|
||||||
|
value,
|
||||||
|
options,
|
||||||
|
};
|
||||||
|
},
|
||||||
|
({ value, options }) => {
|
||||||
|
element.validate({
|
||||||
|
invalid: hasInvalidValueOrOptions(value, options),
|
||||||
|
message: 'Выбранное значение отсутствует в списке',
|
||||||
|
silent: true,
|
||||||
|
});
|
||||||
|
},
|
||||||
|
{
|
||||||
|
delay: 100,
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
|
reaction(
|
||||||
|
() => element.getOptions(),
|
||||||
|
(options) => {
|
||||||
|
const value = element.getValue();
|
||||||
|
if (hasInvalidValueOrOptions(value, options)) {
|
||||||
|
element.resetValue();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
delay: 100,
|
||||||
|
}
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
(Object.keys(types) as Values.Elements[]).forEach((elementName) =>
|
||||||
|
validateOptionsElement(elementName)
|
||||||
|
);
|
||||||
|
|
||||||
|
function validateInsuranceCompany(rowKey: Insurance.Keys) {
|
||||||
|
const row = $tables.insurance.row(rowKey);
|
||||||
|
|
||||||
|
reaction(
|
||||||
|
() => {
|
||||||
|
const options = row.getOptions('insuranceCompany');
|
||||||
|
const value = row.getValue('insuranceCompany');
|
||||||
|
|
||||||
|
return {
|
||||||
|
value,
|
||||||
|
options,
|
||||||
|
};
|
||||||
|
},
|
||||||
|
({ value, options }) => {
|
||||||
|
$tables.insurance.validate({
|
||||||
|
invalid: hasInvalidValueOrOptions(value, options),
|
||||||
|
message: 'Выбранное значение отсутствует в списке',
|
||||||
|
silent: true,
|
||||||
|
});
|
||||||
|
},
|
||||||
|
{
|
||||||
|
delay: 100,
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
|
reaction(
|
||||||
|
() => row.getOptions('insuranceCompany'),
|
||||||
|
(options) => {
|
||||||
|
const value = row.getValue('insuranceCompany');
|
||||||
|
if (hasInvalidValueOrOptions(value, options)) {
|
||||||
|
row.resetValue('insuranceCompany');
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
delay: 100,
|
||||||
|
}
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
validateInsuranceCompany('kasko');
|
||||||
|
validateInsuranceCompany('osago');
|
||||||
|
validateInsuranceCompany('fingap');
|
||||||
}
|
}
|
||||||
|
|||||||
41
apps/web/process/configurator/get-kp-data.ts
Normal file
41
apps/web/process/configurator/get-kp-data.ts
Normal file
@ -0,0 +1,41 @@
|
|||||||
|
/* 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';
|
||||||
|
|
||||||
|
const QUERY_GET_CONFIGURATOR_DATA_FROM_QUOTE = gql`
|
||||||
|
query GetConfiguratorDataFromQuote($quoteId: Uuid!) {
|
||||||
|
quote(quoteId: $quoteId) {
|
||||||
|
evo_baseproductid
|
||||||
|
}
|
||||||
|
}
|
||||||
|
`;
|
||||||
|
|
||||||
|
type QuotePaymentsProcessData = {
|
||||||
|
values: Partial<GetQuoteDataOutput['values']>;
|
||||||
|
};
|
||||||
|
|
||||||
|
export default async function getConfiguratorDataFromKP({
|
||||||
|
values: { quote: quoteId },
|
||||||
|
}: GetQuoteDataInput): Promise<QuotePaymentsProcessData> {
|
||||||
|
const apolloClient = initializeApollo();
|
||||||
|
|
||||||
|
const {
|
||||||
|
data: { quote },
|
||||||
|
} = await apolloClient.query<
|
||||||
|
CRMTypes.GetConfiguratorDataFromQuoteQuery,
|
||||||
|
CRMTypes.GetConfiguratorDataFromQuoteQueryVariables
|
||||||
|
>({
|
||||||
|
query: QUERY_GET_CONFIGURATOR_DATA_FROM_QUOTE,
|
||||||
|
variables: {
|
||||||
|
quoteId,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
return {
|
||||||
|
values: {
|
||||||
|
product: quote?.evo_baseproductid,
|
||||||
|
},
|
||||||
|
};
|
||||||
|
}
|
||||||
370
apps/web/process/configurator/reactions/filters.ts
Normal file
370
apps/web/process/configurator/reactions/filters.ts
Normal file
@ -0,0 +1,370 @@
|
|||||||
|
/* eslint-disable @typescript-eslint/naming-convention */
|
||||||
|
import { radioGraphType, selectSeasonType } from 'config/default-options';
|
||||||
|
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';
|
||||||
|
|
||||||
|
dayjs.extend(utc);
|
||||||
|
|
||||||
|
export default function commonReactions({ store, apolloClient }: ReactionsContext) {
|
||||||
|
const { $calculation } = store;
|
||||||
|
|
||||||
|
reaction(
|
||||||
|
() => {
|
||||||
|
const { product, subsidy, importProgram, dealer } = $calculation.$values.values;
|
||||||
|
|
||||||
|
return {
|
||||||
|
productId: product,
|
||||||
|
subsidyId: subsidy,
|
||||||
|
importProgramId: importProgram,
|
||||||
|
dealerId: dealer,
|
||||||
|
};
|
||||||
|
},
|
||||||
|
async ({ productId, subsidyId, importProgramId, dealerId }) => {
|
||||||
|
/**
|
||||||
|
#1
|
||||||
|
* DYN-190 При выборе значения в поле selectSubsidy необходимо добавить
|
||||||
|
* фильтрацию в полях при условии что selectSubsidy не равно null:
|
||||||
|
|
||||||
|
Тип предмета лизинга selectLeaseObjectType
|
||||||
|
если с записью Субсидия нет связанных Типов предмета лизинга,
|
||||||
|
то указываются все записи согласно текущей фильтрации,
|
||||||
|
иначе указываются те записи, которые связаны с Субсидией, указанной в поле selectSubsidy
|
||||||
|
|
||||||
|
#2
|
||||||
|
* На изменение поля Продукт selectProduct добавляем фильтрацию списков:
|
||||||
|
в поле Тип предмета лизинга selectLeaseObjectType - указываются те, которые связаны с продуктом.
|
||||||
|
Если с Продуктом нет связанных Типов предмета лизинга,
|
||||||
|
то указывается весь список. Это надо добавить в текущие условия фильтрации данного поля
|
||||||
|
|
||||||
|
#3
|
||||||
|
Тип предмета лизинга selectLeaseObjectType
|
||||||
|
если с записью Субсидия нет связанных Типов предмета лизинга,
|
||||||
|
то указываются все записи согласно текущей фильтрации,
|
||||||
|
иначе указываются те записи, которые связаны с Субсидией, указанной в поле selectImportProgram
|
||||||
|
*/
|
||||||
|
|
||||||
|
let {
|
||||||
|
data: { evo_leasingobject_types: leaseObjectTypes = [] },
|
||||||
|
} = await apolloClient.query({
|
||||||
|
query: CRMTypes.GetLeaseObjectTypesDocument,
|
||||||
|
});
|
||||||
|
|
||||||
|
let {
|
||||||
|
data: { dealers = [] },
|
||||||
|
} = await apolloClient.query({
|
||||||
|
query: CRMTypes.GetDealersDocument,
|
||||||
|
});
|
||||||
|
|
||||||
|
let dealerPersons: CRMTypes.GetDealerPersonsQuery['dealerPersons'] = [];
|
||||||
|
if (dealerId) {
|
||||||
|
const { data } = await apolloClient.query({
|
||||||
|
query: CRMTypes.GetDealerPersonsDocument,
|
||||||
|
variables: {
|
||||||
|
dealerId,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
({ dealerPersons = [] } = data);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (productId) {
|
||||||
|
const {
|
||||||
|
data: { evo_baseproduct },
|
||||||
|
} = await apolloClient.query({
|
||||||
|
query: CRMTypes.GetProductDocument,
|
||||||
|
variables: {
|
||||||
|
productId,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
if (leaseObjectTypes) {
|
||||||
|
leaseObjectTypes = leaseObjectTypes?.filter(
|
||||||
|
(leasingObjectType) =>
|
||||||
|
!evo_baseproduct?.evo_leasingobject_types?.length ||
|
||||||
|
evo_baseproduct.evo_leasingobject_types.filter(
|
||||||
|
(baseproduct_evo_leasingobject_type) =>
|
||||||
|
baseproduct_evo_leasingobject_type?.evo_leasingobject_typeid ===
|
||||||
|
leasingObjectType?.evo_leasingobject_typeid
|
||||||
|
)?.length
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (subsidyId) {
|
||||||
|
const {
|
||||||
|
data: { evo_subsidy: subsidy },
|
||||||
|
} = await apolloClient.query({
|
||||||
|
query: CRMTypes.GetSubsidyDocument,
|
||||||
|
variables: {
|
||||||
|
subsidyId,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
if (leaseObjectTypes) {
|
||||||
|
leaseObjectTypes = leaseObjectTypes?.filter(
|
||||||
|
(leasingObjectType) =>
|
||||||
|
!subsidy?.evo_leasingobject_types?.length ||
|
||||||
|
subsidy.evo_leasingobject_types.filter(
|
||||||
|
(subsidy_evo_leasingobject_type) =>
|
||||||
|
subsidy_evo_leasingobject_type?.evo_leasingobject_typeid ===
|
||||||
|
leasingObjectType?.evo_leasingobject_typeid
|
||||||
|
)?.length
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (dealers) {
|
||||||
|
dealers = dealers.filter(
|
||||||
|
(dealer) =>
|
||||||
|
!subsidy?.accounts?.length ||
|
||||||
|
subsidy.accounts.filter(
|
||||||
|
(subsidy_account) => subsidy_account?.accountid === dealer?.accountid
|
||||||
|
)?.length
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (dealerPersons) {
|
||||||
|
dealerPersons = dealerPersons.filter(
|
||||||
|
(dealerPerson) =>
|
||||||
|
!subsidy?.accounts?.length ||
|
||||||
|
subsidy.accounts.filter(
|
||||||
|
(subsidy_account) => subsidy_account?.accountid === dealerPerson?.accountid
|
||||||
|
)?.length
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (importProgramId) {
|
||||||
|
const {
|
||||||
|
data: { importProgram },
|
||||||
|
} = await apolloClient.query<
|
||||||
|
CRMTypes.GetImportProgramQuery,
|
||||||
|
CRMTypes.GetImportProgramQueryVariables
|
||||||
|
>({
|
||||||
|
query: CRMTypes.GetImportProgramDocument,
|
||||||
|
variables: {
|
||||||
|
importProgramId,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
if (leaseObjectTypes) {
|
||||||
|
leaseObjectTypes = leaseObjectTypes?.filter(
|
||||||
|
(leasingObjectType) =>
|
||||||
|
!importProgram?.evo_leasingobject_types?.length ||
|
||||||
|
importProgram.evo_leasingobject_types.filter(
|
||||||
|
(importProgram_evo_leasingobject_type) =>
|
||||||
|
importProgram_evo_leasingobject_type?.evo_leasingobject_typeid ===
|
||||||
|
leasingObjectType?.evo_leasingobject_typeid
|
||||||
|
)?.length
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (dealers) {
|
||||||
|
dealers = dealers.filter(
|
||||||
|
(dealer) =>
|
||||||
|
!importProgram?.accounts?.length ||
|
||||||
|
importProgram.accounts.filter(
|
||||||
|
(importProgram_account) => importProgram_account?.accountid === dealer?.accountid
|
||||||
|
)?.length
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (dealerPersons) {
|
||||||
|
dealerPersons = dealerPersons.filter(
|
||||||
|
(dealerPerson) =>
|
||||||
|
!importProgram?.accounts?.length ||
|
||||||
|
importProgram.accounts.filter(
|
||||||
|
(importProgram_account) =>
|
||||||
|
importProgram_account?.accountid === dealerPerson?.accountid
|
||||||
|
)?.length
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$calculation.element('selectLeaseObjectType').setOptions(normalizeOptions(leaseObjectTypes));
|
||||||
|
$calculation.element('selectDealer').setOptions(normalizeOptions(dealers));
|
||||||
|
$calculation.element('selectDealerPerson').setOptions(normalizeOptions(dealerPersons));
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* На изменение поля Тариф selectTarif добавляем фильрацию в полях:
|
||||||
|
в поле Вид графика radioGraphType должны закрываться значения для выбора,
|
||||||
|
которые указаны в массиве поля "Недопустимые виды графиков" evo_graphtype_exception.
|
||||||
|
Если в массиве пусто, значит допустимы все значения
|
||||||
|
*/
|
||||||
|
reaction(
|
||||||
|
() => $calculation.element('selectTarif').getValue(),
|
||||||
|
async (tarifId) => {
|
||||||
|
let evo_tarif: CRMTypes.GetTarifQuery['evo_tarif'] = null;
|
||||||
|
|
||||||
|
if (tarifId) {
|
||||||
|
const { data } = await apolloClient.query({
|
||||||
|
query: CRMTypes.GetTarifDocument,
|
||||||
|
variables: {
|
||||||
|
tarifId,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
({ evo_tarif } = data);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (evo_tarif?.evo_graphtype_exception?.length) {
|
||||||
|
const filteredGraphTypes = radioGraphType.filter(
|
||||||
|
(type) => !evo_tarif?.evo_graphtype_exception?.includes(type.value)
|
||||||
|
);
|
||||||
|
|
||||||
|
$calculation.element('radioGraphType').setOptions(filteredGraphTypes);
|
||||||
|
} else {
|
||||||
|
$calculation.element('radioGraphType').resetOptions();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* в поле Тип дегрессии/сезонности selectSeasonType должны отображаться только те значения,
|
||||||
|
* которых нет в массиве поля "Недопустимые Типы дегрессий/сезонности" evo_seasons_type_exception
|
||||||
|
* (добавить в текущую фильтрацию поля)
|
||||||
|
*/
|
||||||
|
reaction(
|
||||||
|
() => ({
|
||||||
|
tarif: $calculation.element('selectTarif').getValue(),
|
||||||
|
graphType: $calculation.element('radioGraphType').getValue(),
|
||||||
|
}),
|
||||||
|
async ({ tarif, graphType }) => {
|
||||||
|
let evo_tarif: CRMTypes.GetTarifQuery['evo_tarif'] = null;
|
||||||
|
|
||||||
|
if (tarif) {
|
||||||
|
const { data } = await apolloClient.query({
|
||||||
|
query: CRMTypes.GetTarifDocument,
|
||||||
|
variables: {
|
||||||
|
tarifId: tarif,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
({ evo_tarif } = data);
|
||||||
|
}
|
||||||
|
|
||||||
|
const seasonTypesExeption = evo_tarif?.evo_seasons_type_exception || [];
|
||||||
|
let seasonTypes: Array<number> = [];
|
||||||
|
|
||||||
|
if (graphType === 100_000_001 || graphType === 100_000_003) {
|
||||||
|
seasonTypes = SEASON_TYPES[graphType];
|
||||||
|
}
|
||||||
|
|
||||||
|
const allowedSeasonTypes = diff(seasonTypes, seasonTypesExeption);
|
||||||
|
|
||||||
|
const filteredSeasonTypesOptions = selectSeasonType.filter((seasonTypeOption) =>
|
||||||
|
allowedSeasonTypes.includes(seasonTypeOption.value)
|
||||||
|
);
|
||||||
|
|
||||||
|
$calculation.element('selectSeasonType').setOptions(filteredSeasonTypesOptions);
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* При изменении Продукта selectProduct необходимо в поле "Расчет от"
|
||||||
|
* radioCalcType фильтровать значения согласно списку
|
||||||
|
* в поле "Доступные Методы расчета в калькуляторе" evo_calculation_method в selectProduct
|
||||||
|
*/
|
||||||
|
reaction(
|
||||||
|
() => $calculation.element('selectProduct').getValue(),
|
||||||
|
async (productId) => {
|
||||||
|
if (!productId) {
|
||||||
|
$calculation.element('radioCalcType').resetOptions();
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
const {
|
||||||
|
data: { evo_baseproduct },
|
||||||
|
} = await apolloClient.query<CRMTypes.GetProductQuery, CRMTypes.GetProductQueryVariables>({
|
||||||
|
query: CRMTypes.GetProductDocument,
|
||||||
|
variables: {
|
||||||
|
productId,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
if (evo_baseproduct?.evo_calculation_method) {
|
||||||
|
const filteredCalcTypeOptions = $calculation
|
||||||
|
.element('radioCalcType')
|
||||||
|
.getOptions()
|
||||||
|
.filter((calcType) => evo_baseproduct.evo_calculation_method?.includes(calcType.value));
|
||||||
|
$calculation.element('radioCalcType').setOptions(filteredCalcTypeOptions);
|
||||||
|
} else {
|
||||||
|
$calculation.element('radioCalcType').resetOptions();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
|
/* 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) => {
|
||||||
|
const currentDate = dayjs().utc(false).toISOString();
|
||||||
|
|
||||||
|
const {
|
||||||
|
data: { evo_baseproducts },
|
||||||
|
} = await apolloClient.query({
|
||||||
|
query: CRMTypes.GetProductsDocument,
|
||||||
|
variables: {
|
||||||
|
currentDate,
|
||||||
|
},
|
||||||
|
fetchPolicy: 'network-only',
|
||||||
|
});
|
||||||
|
|
||||||
|
if (!$calculation.element('cbxRecalcWithRevision').getValue()) {
|
||||||
|
$calculation.element('selectProduct').setOptions(normalizeOptions(evo_baseproducts));
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
let quote: CRMTypes.GetQuoteQuery['quote'] = null;
|
||||||
|
|
||||||
|
if (quoteId) {
|
||||||
|
const { data } = await apolloClient.query({
|
||||||
|
query: CRMTypes.GetQuoteDocument,
|
||||||
|
variables: {
|
||||||
|
quoteId,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
({ quote } = data);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (quote?.evo_baseproductid) {
|
||||||
|
const {
|
||||||
|
data: { evo_baseproduct },
|
||||||
|
} = await apolloClient.query<CRMTypes.GetProductQuery, CRMTypes.GetProductQueryVariables>({
|
||||||
|
query: CRMTypes.GetProductDocument,
|
||||||
|
variables: {
|
||||||
|
productId: quote?.evo_baseproductid,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
const allowedProducts = evo_baseproduct?.evo_baseproducts?.map(
|
||||||
|
(product) => product?.evo_baseproductid
|
||||||
|
);
|
||||||
|
|
||||||
|
const filteredSelectProductOptions = normalizeOptions(
|
||||||
|
evo_baseproducts?.filter((product) =>
|
||||||
|
allowedProducts?.includes(product?.evo_baseproductid)
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
$calculation.element('selectProduct').setOptions(filteredSelectProductOptions);
|
||||||
|
} else {
|
||||||
|
$calculation.element('selectProduct').setOptions(normalizeOptions(evo_baseproducts));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
);
|
||||||
|
}
|
||||||
3
apps/web/process/configurator/reactions/index.js
Normal file
3
apps/web/process/configurator/reactions/index.js
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
export { default as filters } from './filters';
|
||||||
|
export { default as validation } from './validation';
|
||||||
|
export { default as values } from './values';
|
||||||
45
apps/web/process/configurator/reactions/validation.ts
Normal file
45
apps/web/process/configurator/reactions/validation.ts
Normal file
@ -0,0 +1,45 @@
|
|||||||
|
import * as CRMTypes from 'graphql/crm.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 */
|
||||||
|
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) {
|
||||||
|
const { data } = await apolloClient.query({
|
||||||
|
query: CRMTypes.GetTarifDocument,
|
||||||
|
variables: {
|
||||||
|
tarifId,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
({ evo_tarif } = data);
|
||||||
|
}
|
||||||
|
|
||||||
|
$calculation.element('tbxParmentsDecreasePercent').validate({
|
||||||
|
invalid:
|
||||||
|
!!evo_tarif?.evo_min_decreasing_perc &&
|
||||||
|
parmentsDecreasePercent < evo_tarif?.evo_min_decreasing_perc,
|
||||||
|
message: `Процент убывания не может быть меньше минимального значения по данному тарифу - ${evo_tarif?.evo_min_decreasing_perc}`,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
);
|
||||||
|
}
|
||||||
142
apps/web/process/configurator/reactions/values.ts
Normal file
142
apps/web/process/configurator/reactions/values.ts
Normal file
@ -0,0 +1,142 @@
|
|||||||
|
/* eslint-disable @typescript-eslint/naming-convention */
|
||||||
|
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);
|
||||||
|
|
||||||
|
export default function valuesReactions({ store, apolloClient }: ReactionsContext) {
|
||||||
|
const { $calculation, $process } = store;
|
||||||
|
|
||||||
|
autorun(
|
||||||
|
async () => {
|
||||||
|
const {
|
||||||
|
product,
|
||||||
|
leasingPeriod,
|
||||||
|
leaseObjectUsed,
|
||||||
|
deliveryTime,
|
||||||
|
firstPaymentPerc,
|
||||||
|
lastPaymentPerc,
|
||||||
|
} = $calculation.$values.values;
|
||||||
|
|
||||||
|
const currentDate = dayjs().utc(false).toISOString();
|
||||||
|
|
||||||
|
let {
|
||||||
|
data: { evo_tarifs = [] },
|
||||||
|
} = await apolloClient.query({
|
||||||
|
query: CRMTypes.GetTarifsDocument,
|
||||||
|
variables: {
|
||||||
|
currentDate,
|
||||||
|
},
|
||||||
|
fetchPolicy: 'network-only',
|
||||||
|
});
|
||||||
|
|
||||||
|
if (product && leasingPeriod && deliveryTime && evo_tarifs) {
|
||||||
|
evo_tarifs = evo_tarifs?.filter(
|
||||||
|
(tarif) =>
|
||||||
|
tarif &&
|
||||||
|
tarif.evo_baseproductid === product &&
|
||||||
|
tarif.evo_min_period !== null &&
|
||||||
|
tarif.evo_min_period <= leasingPeriod &&
|
||||||
|
tarif.evo_max_period !== null &&
|
||||||
|
tarif.evo_max_period >= leasingPeriod &&
|
||||||
|
tarif.evo_delivery_time?.includes(deliveryTime) &&
|
||||||
|
tarif.evo_min_first_payment !== null &&
|
||||||
|
tarif.evo_min_first_payment <= firstPaymentPerc &&
|
||||||
|
tarif.evo_max_first_payment !== null &&
|
||||||
|
tarif.evo_max_first_payment >= firstPaymentPerc &&
|
||||||
|
tarif.evo_min_last_payment !== null &&
|
||||||
|
tarif.evo_min_last_payment <= lastPaymentPerc &&
|
||||||
|
tarif.evo_max_last_payment !== null &&
|
||||||
|
tarif.evo_max_last_payment >= lastPaymentPerc
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
$calculation.element('selectTarif').resetValue();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (leaseObjectUsed === true && evo_tarifs) {
|
||||||
|
evo_tarifs = evo_tarifs?.filter((tarif) => {
|
||||||
|
if (leaseObjectUsed === true) {
|
||||||
|
return tarif?.evo_used;
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
$calculation
|
||||||
|
.element('selectTarif')
|
||||||
|
.setOptions(normalizeOptions(evo_tarifs))
|
||||||
|
.setValue(evo_tarifs?.at(0)?.evo_tarifid || null);
|
||||||
|
},
|
||||||
|
{
|
||||||
|
delay: 10,
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
|
makeDisposable(
|
||||||
|
() =>
|
||||||
|
reaction(
|
||||||
|
() => $calculation.element('selectTarif').getValue(),
|
||||||
|
async (tarifId) => {
|
||||||
|
if (!tarifId) {
|
||||||
|
$calculation.element('tbxIRR_Perc').resetValue();
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
const {
|
||||||
|
data: { evo_tarif },
|
||||||
|
} = await apolloClient.query({
|
||||||
|
query: CRMTypes.GetTarifDocument,
|
||||||
|
variables: {
|
||||||
|
tarifId,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
if (evo_tarif?.evo_irr) {
|
||||||
|
$calculation.element('tbxIRR_Perc').setValue(evo_tarif?.evo_irr);
|
||||||
|
} else {
|
||||||
|
$calculation.element('tbxIRR_Perc').resetValue();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
),
|
||||||
|
|
||||||
|
() => $process.has('LoadKP')
|
||||||
|
);
|
||||||
|
|
||||||
|
reaction(
|
||||||
|
() => $calculation.element('selectTarif').getValue(),
|
||||||
|
async (tarifId) => {
|
||||||
|
if (!tarifId) {
|
||||||
|
$calculation.element('selectRate').resetValue();
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
const currentDate = dayjs().utc(false).toISOString();
|
||||||
|
|
||||||
|
const {
|
||||||
|
data: { evo_rates },
|
||||||
|
} = await apolloClient.query({
|
||||||
|
query: CRMTypes.GetRatesDocument,
|
||||||
|
variables: {
|
||||||
|
currentDate,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
const rates = evo_rates?.filter((rate) =>
|
||||||
|
rate?.evo_tarifs?.filter((tarif) => tarif?.evo_tarifid === tarifId)
|
||||||
|
);
|
||||||
|
const baseRate = rates?.find((x) => x?.evo_id === 'BASE');
|
||||||
|
|
||||||
|
$calculation
|
||||||
|
.element('selectRate')
|
||||||
|
.setOptions(normalizeOptions(rates))
|
||||||
|
.setValue(baseRate?.value ?? null);
|
||||||
|
}
|
||||||
|
);
|
||||||
|
}
|
||||||
@ -6,8 +6,8 @@ import type { GetQuoteDataInput, GetQuoteDataOutput } from '../load-kp/types';
|
|||||||
|
|
||||||
const DEFAULT_FINGAP_ROW = defaultValues.find((x) => x.key === 'fingap')!;
|
const DEFAULT_FINGAP_ROW = defaultValues.find((x) => x.key === 'fingap')!;
|
||||||
|
|
||||||
const QUERY_GET_RISKS = gql`
|
const QUERY_GET_FINGAP_DATA_FROM_QUOTE = gql`
|
||||||
query GetRisksDataFromQuote($quoteId: Uuid!) {
|
query GetFingapDataFromQuote($quoteId: Uuid!) {
|
||||||
quote(quoteId: $quoteId) {
|
quote(quoteId: $quoteId) {
|
||||||
evo_fingap_accountid
|
evo_fingap_accountid
|
||||||
evo_fingap_payer
|
evo_fingap_payer
|
||||||
@ -34,10 +34,10 @@ export default async function getFingapDataFromKP({
|
|||||||
const {
|
const {
|
||||||
data: { quote },
|
data: { quote },
|
||||||
} = await apolloClient.query<
|
} = await apolloClient.query<
|
||||||
CRMTypes.GetRisksDataFromQuoteQuery,
|
CRMTypes.GetFingapDataFromQuoteQuery,
|
||||||
CRMTypes.GetRisksDataFromQuoteQueryVariables
|
CRMTypes.GetFingapDataFromQuoteQueryVariables
|
||||||
>({
|
>({
|
||||||
query: QUERY_GET_RISKS,
|
query: QUERY_GET_FINGAP_DATA_FROM_QUOTE,
|
||||||
variables: {
|
variables: {
|
||||||
quoteId,
|
quoteId,
|
||||||
},
|
},
|
||||||
@ -45,7 +45,7 @@ export default async function getFingapDataFromKP({
|
|||||||
|
|
||||||
const keys: Array<string> = [];
|
const keys: Array<string> = [];
|
||||||
quote?.evo_product_risks?.forEach((x) => {
|
quote?.evo_product_risks?.forEach((x) => {
|
||||||
if (x.evo_addproduct_typeid) {
|
if (x?.evo_addproduct_typeid) {
|
||||||
keys.push(x.evo_addproduct_typeid);
|
keys.push(x.evo_addproduct_typeid);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
@ -2,85 +2,20 @@
|
|||||||
import { gql, useApolloClient } from '@apollo/client';
|
import { gql, useApolloClient } from '@apollo/client';
|
||||||
import dayjs from 'dayjs';
|
import dayjs from 'dayjs';
|
||||||
import utc from 'dayjs/plugin/utc';
|
import utc from 'dayjs/plugin/utc';
|
||||||
|
import * as CRMTypes from 'graphql/crm.types';
|
||||||
import { useEffect } from 'react';
|
import { useEffect } from 'react';
|
||||||
import { useStore } from 'stores/hooks';
|
import { useStore } from 'stores/hooks';
|
||||||
|
import { normalizeOptions } from 'tools';
|
||||||
|
|
||||||
dayjs.extend(utc);
|
dayjs.extend(utc);
|
||||||
|
|
||||||
const QUERY_GET_MAIN_OPTIONS = gql`
|
|
||||||
query GetMainOptions($currentDate: DateTime) {
|
|
||||||
selectSupplierCurrency: transactioncurrencies {
|
|
||||||
label: currencyname
|
|
||||||
currencysymbol
|
|
||||||
value: transactioncurrencyid
|
|
||||||
}
|
|
||||||
|
|
||||||
selectProduct: evo_baseproducts(
|
|
||||||
statecode: 0
|
|
||||||
evo_relation: [100000000]
|
|
||||||
evo_datefrom_param: { lte: $currentDate }
|
|
||||||
evo_dateto_param: { gte: $currentDate }
|
|
||||||
) {
|
|
||||||
label: evo_name
|
|
||||||
value: evo_baseproductid
|
|
||||||
}
|
|
||||||
|
|
||||||
selectLeaseObjectType: evo_leasingobject_types(statecode: 0) {
|
|
||||||
label: evo_name
|
|
||||||
value: evo_leasingobject_typeid
|
|
||||||
}
|
|
||||||
|
|
||||||
selectGPSBrand: evo_gps_brands(statecode: 0) {
|
|
||||||
label: evo_name
|
|
||||||
value: evo_gps_brandid
|
|
||||||
}
|
|
||||||
}
|
|
||||||
`;
|
|
||||||
|
|
||||||
const QUERY_GET_SUBSIDIES = gql`
|
|
||||||
query GetSubsidies($currentDate: DateTime) {
|
|
||||||
evo_subsidies(
|
|
||||||
statecode: 0
|
|
||||||
evo_datefrom_param: { lte: $currentDate }
|
|
||||||
evo_dateto_param: { gte: $currentDate }
|
|
||||||
) {
|
|
||||||
label: evo_name
|
|
||||||
value: evo_subsidyid
|
|
||||||
evo_subsidy_type
|
|
||||||
}
|
|
||||||
}
|
|
||||||
`;
|
|
||||||
|
|
||||||
const QUERY_GET_REGIONS = gql`
|
|
||||||
query GetRegions {
|
|
||||||
evo_regions {
|
|
||||||
label: evo_name
|
|
||||||
value: evo_regionid
|
|
||||||
}
|
|
||||||
}
|
|
||||||
`;
|
|
||||||
|
|
||||||
const QUERY_GET_BRANDS = gql`
|
|
||||||
query GetBrands {
|
|
||||||
selectBrand: evo_brands(statecode: 0) {
|
|
||||||
label: evo_name
|
|
||||||
value: evo_brandid
|
|
||||||
}
|
|
||||||
}
|
|
||||||
`;
|
|
||||||
|
|
||||||
const QUERY_GET_DEALERS = gql`
|
|
||||||
query GetDealers {
|
|
||||||
selectDealer: accounts(evo_account_type: [100000001], statecode: 0, evo_legal_form: 100000001) {
|
|
||||||
label: name
|
|
||||||
value: accountid
|
|
||||||
}
|
|
||||||
}
|
|
||||||
`;
|
|
||||||
|
|
||||||
const QUERY_GET_ADDPRODUCT_TYPES = gql`
|
const QUERY_GET_ADDPRODUCT_TYPES = gql`
|
||||||
query GetAddproductTypes {
|
query GetAddproductTypes($currentDate: DateTime) {
|
||||||
evo_addproduct_types(statecode: 0) {
|
evo_addproduct_types(
|
||||||
|
statecode: 0
|
||||||
|
evo_datefrom_param: { lte: $currentDate }
|
||||||
|
evo_dateto_param: { gte: $currentDate }
|
||||||
|
) {
|
||||||
label: evo_name
|
label: evo_name
|
||||||
value: evo_addproduct_typeid
|
value: evo_addproduct_typeid
|
||||||
evo_graph_price
|
evo_graph_price
|
||||||
@ -91,18 +26,55 @@ const QUERY_GET_ADDPRODUCT_TYPES = gql`
|
|||||||
|
|
||||||
const currentDate = dayjs().utc(false).toISOString();
|
const currentDate = dayjs().utc(false).toISOString();
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @param {import('@apollo/client').ApolloClient['query']} query
|
||||||
|
* @param {*} onCompleted
|
||||||
|
*/
|
||||||
function getMainData(query, onCompleted) {
|
function getMainData(query, onCompleted) {
|
||||||
query({
|
query({
|
||||||
query: QUERY_GET_MAIN_OPTIONS,
|
query: CRMTypes.GetTransactionCurrenciesDocument,
|
||||||
variables: {
|
variables: {
|
||||||
currentDate,
|
currentDate,
|
||||||
},
|
},
|
||||||
}).then(({ data }) => {
|
}).then(({ data }) => {
|
||||||
onCompleted(data);
|
onCompleted({
|
||||||
|
selectSupplierCurrency: data?.transactioncurrencies,
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
query({
|
query({
|
||||||
query: QUERY_GET_SUBSIDIES,
|
query: CRMTypes.GetLeaseObjectTypesDocument,
|
||||||
|
variables: {
|
||||||
|
currentDate,
|
||||||
|
},
|
||||||
|
}).then(({ data }) => {
|
||||||
|
onCompleted({
|
||||||
|
selectLeaseObjectType: data?.evo_baseproducts,
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
query({
|
||||||
|
query: CRMTypes.GetGpsBrandsDocument,
|
||||||
|
}).then(({ data }) => {
|
||||||
|
onCompleted({
|
||||||
|
selectGPSBrand: data?.evo_gps_brands,
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
query({
|
||||||
|
query: CRMTypes.GetProductsDocument,
|
||||||
|
variables: {
|
||||||
|
currentDate,
|
||||||
|
},
|
||||||
|
}).then(({ data }) => {
|
||||||
|
onCompleted({
|
||||||
|
selectProduct: data?.evo_baseproducts,
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
query({
|
||||||
|
query: CRMTypes.GetSubsidiesDocument,
|
||||||
variables: {
|
variables: {
|
||||||
currentDate,
|
currentDate,
|
||||||
},
|
},
|
||||||
@ -122,7 +94,7 @@ function getMainData(query, onCompleted) {
|
|||||||
});
|
});
|
||||||
|
|
||||||
query({
|
query({
|
||||||
query: QUERY_GET_REGIONS,
|
query: CRMTypes.GetRegionsDocument,
|
||||||
}).then(({ data }) => {
|
}).then(({ data }) => {
|
||||||
const selectRegionRegistration = data?.evo_regions;
|
const selectRegionRegistration = data?.evo_regions;
|
||||||
const selectObjectRegionRegistration = data?.evo_regions;
|
const selectObjectRegionRegistration = data?.evo_regions;
|
||||||
@ -136,19 +108,26 @@ function getMainData(query, onCompleted) {
|
|||||||
});
|
});
|
||||||
|
|
||||||
query({
|
query({
|
||||||
query: QUERY_GET_BRANDS,
|
query: CRMTypes.GetBrandsDocument,
|
||||||
}).then(({ data }) => {
|
}).then(({ data }) => {
|
||||||
onCompleted(data);
|
onCompleted({
|
||||||
|
selectBrand: data?.evo_brands,
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
query({
|
query({
|
||||||
query: QUERY_GET_DEALERS,
|
query: CRMTypes.GetDealersDocument,
|
||||||
}).then(({ data }) => {
|
}).then(({ data }) => {
|
||||||
onCompleted(data);
|
onCompleted({
|
||||||
|
selectDealer: data?.dealers,
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
query({
|
query({
|
||||||
query: QUERY_GET_ADDPRODUCT_TYPES,
|
query: QUERY_GET_ADDPRODUCT_TYPES,
|
||||||
|
variables: {
|
||||||
|
currentDate,
|
||||||
|
},
|
||||||
}).then(({ data }) => {
|
}).then(({ data }) => {
|
||||||
const selectRegistration = data.evo_addproduct_types
|
const selectRegistration = data.evo_addproduct_types
|
||||||
?.filter((x) => x?.evo_product_type === 100_000_001)
|
?.filter((x) => x?.evo_product_type === 100_000_001)
|
||||||
@ -182,12 +161,28 @@ function getMainData(query, onCompleted) {
|
|||||||
(x) => x?.evo_product_type === 100_000_002
|
(x) => x?.evo_product_type === 100_000_002
|
||||||
);
|
);
|
||||||
|
|
||||||
|
const selectLeasingWithoutKasko = data.evo_addproduct_types?.filter(
|
||||||
|
(x) => x?.evo_product_type === 100_000_007
|
||||||
|
);
|
||||||
|
|
||||||
onCompleted({
|
onCompleted({
|
||||||
selectRegistration,
|
selectRegistration,
|
||||||
selectTechnicalCard,
|
selectTechnicalCard,
|
||||||
selectTelematic,
|
selectTelematic,
|
||||||
selectTracker,
|
selectTracker,
|
||||||
selectInsNSIB,
|
selectInsNSIB,
|
||||||
|
selectLeasingWithoutKasko,
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
query({
|
||||||
|
query: CRMTypes.GetTarifsDocument,
|
||||||
|
variables: {
|
||||||
|
currentDate,
|
||||||
|
},
|
||||||
|
}).then(({ data }) => {
|
||||||
|
onCompleted({
|
||||||
|
selectTarif: data?.evo_tarifs,
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -199,7 +194,7 @@ export function useMainData() {
|
|||||||
function handleOnCompleted(options) {
|
function handleOnCompleted(options) {
|
||||||
Object.keys(options).forEach((elementName) => {
|
Object.keys(options).forEach((elementName) => {
|
||||||
const elementOptions = options[elementName];
|
const elementOptions = options[elementName];
|
||||||
$calculation.element(elementName).setOptions(elementOptions);
|
$calculation.element(elementName).setOptions(normalizeOptions(elementOptions));
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -1,9 +1,13 @@
|
|||||||
import loadKpReactions from 'process/load-kp/reactions';
|
import loadKpReactions from 'process/load-kp/reactions';
|
||||||
import * as calculateReactions from '../../calculate/reactions';
|
import * as calculateReactions from '../../calculate/reactions';
|
||||||
|
import * as configurator from '../../configurator/reactions';
|
||||||
import * as fingapReactions from '../../fingap/reactions';
|
import * as fingapReactions from '../../fingap/reactions';
|
||||||
import * as leadOpportunityReactions from '../../lead-opportunity/reactions';
|
import * as leadOpportunityReactions from '../../lead-opportunity/reactions';
|
||||||
|
import * as leasingObject from '../../leasing-object/reactions';
|
||||||
|
import * as leasingWithoutKaskoReactions from '../../leasing-without-kasko/reactions';
|
||||||
import paymentsReactions from '../../payments/reactions';
|
import paymentsReactions from '../../payments/reactions';
|
||||||
import * as priceReactions from '../../price/reactions';
|
import * as priceReactions from '../../price/reactions';
|
||||||
|
import * as subsidyReactions from '../../subsidy/reactions';
|
||||||
import * as agentsReactions from '../../supplier-agent/reactions/agents';
|
import * as agentsReactions from '../../supplier-agent/reactions/agents';
|
||||||
import leasebackReactions from '../../supplier-agent/reactions/leaseback';
|
import leasebackReactions from '../../supplier-agent/reactions/leaseback';
|
||||||
import * as supplierReactions from '../../supplier-agent/reactions/supplier';
|
import * as supplierReactions from '../../supplier-agent/reactions/supplier';
|
||||||
@ -21,8 +25,17 @@ export default function injectDefaultReactions(context) {
|
|||||||
agentsReactions.validationReactions(context);
|
agentsReactions.validationReactions(context);
|
||||||
leasebackReactions(context);
|
leasebackReactions(context);
|
||||||
priceReactions.computed(context);
|
priceReactions.computed(context);
|
||||||
|
priceReactions.common(context);
|
||||||
fingapReactions.common(context);
|
fingapReactions.common(context);
|
||||||
fingapReactions.validation(context);
|
fingapReactions.validation(context);
|
||||||
setInitialValuesReactions(context);
|
setInitialValuesReactions(context);
|
||||||
loadKpReactions(context);
|
loadKpReactions(context);
|
||||||
|
leasingWithoutKaskoReactions.common(context);
|
||||||
|
subsidyReactions.computedReactions(context);
|
||||||
|
subsidyReactions.commonReactions(context);
|
||||||
|
leasingObject.common(context);
|
||||||
|
leasingObject.validation(context);
|
||||||
|
configurator.filters(context);
|
||||||
|
configurator.values(context);
|
||||||
|
configurator.validation(context);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,19 +1,9 @@
|
|||||||
/* eslint-disable @typescript-eslint/naming-convention */
|
/* eslint-disable @typescript-eslint/naming-convention */
|
||||||
import { gql } from '@apollo/client';
|
import { GetTransactionCurrenciesDocument } from 'graphql/crm.types';
|
||||||
import type { GetTransactionCurrenciesQuery } from 'graphql/crm.types';
|
|
||||||
import { when } from 'mobx';
|
import { when } from 'mobx';
|
||||||
import type { ReactionsContext } from 'process/types';
|
import type { ReactionsContext } from 'process/types';
|
||||||
|
|
||||||
export default function setInitialValuesReactions({ store, apolloClient }: ReactionsContext) {
|
export default function setInitialValuesReactions({ store, apolloClient }: ReactionsContext) {
|
||||||
const QUERY_GET_TRANSACTION_CURRENCIES = gql`
|
|
||||||
query GetTransactionCurrencies {
|
|
||||||
transactioncurrencies {
|
|
||||||
isocurrencycode
|
|
||||||
transactioncurrencyid
|
|
||||||
}
|
|
||||||
}
|
|
||||||
`;
|
|
||||||
|
|
||||||
const { $calculation } = store;
|
const { $calculation } = store;
|
||||||
|
|
||||||
when(
|
when(
|
||||||
@ -21,8 +11,8 @@ export default function setInitialValuesReactions({ store, apolloClient }: React
|
|||||||
async () => {
|
async () => {
|
||||||
const {
|
const {
|
||||||
data: { transactioncurrencies },
|
data: { transactioncurrencies },
|
||||||
} = await apolloClient.query<GetTransactionCurrenciesQuery>({
|
} = await apolloClient.query({
|
||||||
query: QUERY_GET_TRANSACTION_CURRENCIES,
|
query: GetTransactionCurrenciesDocument,
|
||||||
});
|
});
|
||||||
|
|
||||||
const transactioncurrency_rub = transactioncurrencies?.find(
|
const transactioncurrency_rub = transactioncurrencies?.find(
|
||||||
|
|||||||
@ -1,6 +1,5 @@
|
|||||||
/* eslint-disable implicit-arrow-linebreak */
|
/* eslint-disable implicit-arrow-linebreak */
|
||||||
import { gql } from '@apollo/client';
|
import * as CRMTypes from 'graphql/crm.types';
|
||||||
import type * as CRMTypes from 'graphql/crm.types';
|
|
||||||
import { reaction } from 'mobx';
|
import { reaction } from 'mobx';
|
||||||
import type { ReactionsContext } from 'process/types';
|
import type { ReactionsContext } from 'process/types';
|
||||||
import { normalizeOptions } from 'tools/entity';
|
import { normalizeOptions } from 'tools/entity';
|
||||||
@ -16,17 +15,6 @@ export default function commonReactions({ store, apolloClient }: ReactionsContex
|
|||||||
* Иначе ничего не указывается
|
* Иначе ничего не указывается
|
||||||
*/
|
*/
|
||||||
|
|
||||||
const QUERY_GET_OPPORTUNITY_BY_LEAD = gql`
|
|
||||||
query GetOpportunityByLead($leadid: Uuid!) {
|
|
||||||
lead(leadid: $leadid) {
|
|
||||||
evo_opportunityidData {
|
|
||||||
label: name
|
|
||||||
value: opportunityid
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
`;
|
|
||||||
|
|
||||||
makeDisposable(
|
makeDisposable(
|
||||||
() =>
|
() =>
|
||||||
reaction(
|
reaction(
|
||||||
@ -40,11 +28,8 @@ export default function commonReactions({ store, apolloClient }: ReactionsContex
|
|||||||
|
|
||||||
const {
|
const {
|
||||||
data: { lead },
|
data: { lead },
|
||||||
} = await apolloClient.query<
|
} = await apolloClient.query({
|
||||||
CRMTypes.GetOpportunityByLeadQuery,
|
query: CRMTypes.GetLeadDocument,
|
||||||
CRMTypes.GetOpportunityByLeadQueryVariables
|
|
||||||
>({
|
|
||||||
query: QUERY_GET_OPPORTUNITY_BY_LEAD,
|
|
||||||
variables: {
|
variables: {
|
||||||
leadid,
|
leadid,
|
||||||
},
|
},
|
||||||
@ -60,20 +45,6 @@ export default function commonReactions({ store, apolloClient }: ReactionsContex
|
|||||||
() => $process.has('LoadKP')
|
() => $process.has('LoadKP')
|
||||||
);
|
);
|
||||||
|
|
||||||
/**
|
|
||||||
* если opportunity содержит данные,
|
|
||||||
то в lead подгружается значение из поля Интерес
|
|
||||||
выбранной карточки Лизинговая сделка (opportunity.evo_leadid)
|
|
||||||
иначе ничего не делать
|
|
||||||
*/
|
|
||||||
const QUERY_GET_LEADID_BY_OPPORTUNITY = gql`
|
|
||||||
query GetLeadidByOpportunity($opportunityid: Uuid!) {
|
|
||||||
opportunity(opportunityid: $opportunityid) {
|
|
||||||
evo_leadid
|
|
||||||
}
|
|
||||||
}
|
|
||||||
`;
|
|
||||||
|
|
||||||
reaction(
|
reaction(
|
||||||
() => $calculation.element('selectOpportunity').getValue(),
|
() => $calculation.element('selectOpportunity').getValue(),
|
||||||
async (opportunityid) => {
|
async (opportunityid) => {
|
||||||
@ -82,11 +53,8 @@ export default function commonReactions({ store, apolloClient }: ReactionsContex
|
|||||||
if (leadid) {
|
if (leadid) {
|
||||||
const {
|
const {
|
||||||
data: { lead },
|
data: { lead },
|
||||||
} = await apolloClient.query<
|
} = await apolloClient.query({
|
||||||
CRMTypes.GetOpportunityByLeadQuery,
|
query: CRMTypes.GetLeadDocument,
|
||||||
CRMTypes.GetOpportunityByLeadQueryVariables
|
|
||||||
>({
|
|
||||||
query: QUERY_GET_OPPORTUNITY_BY_LEAD,
|
|
||||||
variables: {
|
variables: {
|
||||||
leadid,
|
leadid,
|
||||||
},
|
},
|
||||||
@ -100,11 +68,8 @@ export default function commonReactions({ store, apolloClient }: ReactionsContex
|
|||||||
if (opportunityid) {
|
if (opportunityid) {
|
||||||
const {
|
const {
|
||||||
data: { opportunity },
|
data: { opportunity },
|
||||||
} = await apolloClient.query<
|
} = await apolloClient.query({
|
||||||
CRMTypes.GetLeadidByOpportunityQuery,
|
query: CRMTypes.GetOpportunityDocument,
|
||||||
CRMTypes.GetLeadidByOpportunityQueryVariables
|
|
||||||
>({
|
|
||||||
query: QUERY_GET_LEADID_BY_OPPORTUNITY,
|
|
||||||
variables: {
|
variables: {
|
||||||
opportunityid,
|
opportunityid,
|
||||||
},
|
},
|
||||||
@ -126,29 +91,18 @@ export default function commonReactions({ store, apolloClient }: ReactionsContex
|
|||||||
Иначе очищать поле калькулятора quote.
|
Иначе очищать поле калькулятора quote.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
const QUERY_GET_QUOTES_BY_LEAD = gql`
|
|
||||||
query GetQuotesByLead($leadid: Uuid!) {
|
|
||||||
quotes(evo_leadid: $leadid) {
|
|
||||||
label: evo_quotename
|
|
||||||
value: quoteid
|
|
||||||
}
|
|
||||||
}
|
|
||||||
`;
|
|
||||||
|
|
||||||
reaction(
|
reaction(
|
||||||
() => $calculation.element('selectLead').getValue(),
|
() => $calculation.element('selectLead').getValue(),
|
||||||
async (leadid) => {
|
async (leadid) => {
|
||||||
if (leadid) {
|
if (leadid) {
|
||||||
const {
|
const {
|
||||||
data: { quotes },
|
data: { quotes },
|
||||||
} = await apolloClient.query<
|
} = await apolloClient.query({
|
||||||
CRMTypes.GetQuotesByLeadQuery,
|
query: CRMTypes.GetQuotesDocument,
|
||||||
CRMTypes.GetQuotesByLeadQueryVariables
|
|
||||||
>({
|
|
||||||
query: QUERY_GET_QUOTES_BY_LEAD,
|
|
||||||
variables: {
|
variables: {
|
||||||
leadid,
|
leadid,
|
||||||
},
|
},
|
||||||
|
fetchPolicy: 'network-only',
|
||||||
});
|
});
|
||||||
|
|
||||||
$calculation.element('selectQuote').setOptions(normalizeOptions(quotes));
|
$calculation.element('selectQuote').setOptions(normalizeOptions(quotes));
|
||||||
|
|||||||
55
apps/web/process/leasing-object/get-kp-data.ts
Normal file
55
apps/web/process/leasing-object/get-kp-data.ts
Normal file
@ -0,0 +1,55 @@
|
|||||||
|
/* 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';
|
||||||
|
|
||||||
|
const QUERY_GET_LEASING_OBJECT_DATA_FROM_QUOTE = gql`
|
||||||
|
query GetLeasingObjectDataFromQuote($quoteId: Uuid!) {
|
||||||
|
quote(quoteId: $quoteId) {
|
||||||
|
evo_brandid
|
||||||
|
evo_modelid
|
||||||
|
evo_equipmentid
|
||||||
|
evo_leasingobject_typeid
|
||||||
|
}
|
||||||
|
}
|
||||||
|
`;
|
||||||
|
|
||||||
|
export type Quote = NonNullable<CRMTypes.GetLeasingObjectDataFromQuoteQuery['quote']>;
|
||||||
|
|
||||||
|
type QuoteLeasingObjectProcessData = {
|
||||||
|
values: Partial<GetQuoteDataOutput['values']>;
|
||||||
|
};
|
||||||
|
|
||||||
|
export default async function getLeasingObjectDataFromKP({
|
||||||
|
values: { quote: quoteId },
|
||||||
|
}: GetQuoteDataInput): Promise<QuoteLeasingObjectProcessData> {
|
||||||
|
const apolloClient = initializeApollo();
|
||||||
|
|
||||||
|
const {
|
||||||
|
data: { quote },
|
||||||
|
} = await apolloClient.query<
|
||||||
|
CRMTypes.GetLeasingObjectDataFromQuoteQuery,
|
||||||
|
CRMTypes.GetLeasingObjectDataFromQuoteQueryVariables
|
||||||
|
>({
|
||||||
|
query: QUERY_GET_LEASING_OBJECT_DATA_FROM_QUOTE,
|
||||||
|
variables: {
|
||||||
|
quoteId,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
if (!quote) {
|
||||||
|
throw new Error('Quote is empty');
|
||||||
|
}
|
||||||
|
|
||||||
|
const { evo_brandid, evo_modelid, evo_equipmentid, evo_leasingobject_typeid } = quote;
|
||||||
|
|
||||||
|
return {
|
||||||
|
values: {
|
||||||
|
brand: evo_brandid,
|
||||||
|
model: evo_modelid,
|
||||||
|
configuration: evo_equipmentid,
|
||||||
|
leaseObjectType: evo_leasingobject_typeid,
|
||||||
|
},
|
||||||
|
};
|
||||||
|
}
|
||||||
282
apps/web/process/leasing-object/reactions/common.ts
Normal file
282
apps/web/process/leasing-object/reactions/common.ts
Normal file
@ -0,0 +1,282 @@
|
|||||||
|
/* eslint-disable @typescript-eslint/naming-convention */
|
||||||
|
import * as CRMTypes from 'graphql/crm.types';
|
||||||
|
import { reaction } from 'mobx';
|
||||||
|
import type { ReactionsContext } from 'process/types';
|
||||||
|
import { intersects } from 'radash';
|
||||||
|
import { normalizeOptions } from 'tools';
|
||||||
|
|
||||||
|
export default function commonReactions({ store, apolloClient }: ReactionsContext) {
|
||||||
|
const { $calculation } = store;
|
||||||
|
|
||||||
|
reaction(
|
||||||
|
() => {
|
||||||
|
const { brand, subsidy, importProgram, leaseObjectType } = $calculation.$values.values;
|
||||||
|
|
||||||
|
return {
|
||||||
|
brandId: brand,
|
||||||
|
subsidyId: subsidy,
|
||||||
|
importProgramId: importProgram,
|
||||||
|
leaseObjectTypeId: leaseObjectType,
|
||||||
|
};
|
||||||
|
},
|
||||||
|
async ({ brandId, subsidyId, importProgramId, leaseObjectTypeId }) => {
|
||||||
|
if (!brandId) {
|
||||||
|
$calculation.element('selectModel').reset();
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
const {
|
||||||
|
data: { evo_models },
|
||||||
|
} = await apolloClient.query({
|
||||||
|
query: CRMTypes.GetModelsDocument,
|
||||||
|
variables: {
|
||||||
|
brandId,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
let models = evo_models;
|
||||||
|
|
||||||
|
if (!models) {
|
||||||
|
$calculation.element('selectModel').reset();
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (leaseObjectTypeId) {
|
||||||
|
const {
|
||||||
|
data: { leaseObjectType },
|
||||||
|
} = await apolloClient.query({
|
||||||
|
query: CRMTypes.GetLeaseObjectTypeDocument,
|
||||||
|
variables: {
|
||||||
|
leaseObjectTypeId,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
models = models?.filter((model) => {
|
||||||
|
if (
|
||||||
|
model?.evo_vehicle_type &&
|
||||||
|
leaseObjectType?.evo_vehicle_type?.includes(model.evo_vehicle_type)
|
||||||
|
) {
|
||||||
|
return model;
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
if (subsidyId) {
|
||||||
|
const {
|
||||||
|
data: { evo_subsidy: subsidy },
|
||||||
|
} = await apolloClient.query({
|
||||||
|
query: CRMTypes.GetSubsidyDocument,
|
||||||
|
variables: {
|
||||||
|
subsidyId,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
models = models?.filter((model) => {
|
||||||
|
if (
|
||||||
|
model &&
|
||||||
|
(!subsidy?.evo_models?.length ||
|
||||||
|
subsidy?.evo_models?.filter(
|
||||||
|
(subsidy_evo_model) => subsidy_evo_model?.evo_modelid === model.evo_modelid
|
||||||
|
)?.length)
|
||||||
|
) {
|
||||||
|
return model;
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
if (importProgramId) {
|
||||||
|
const {
|
||||||
|
data: { importProgram },
|
||||||
|
} = await apolloClient.query({
|
||||||
|
query: CRMTypes.GetImportProgramDocument,
|
||||||
|
variables: {
|
||||||
|
importProgramId,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
models = models?.filter((model) => {
|
||||||
|
if (
|
||||||
|
model &&
|
||||||
|
(!importProgram?.evo_models?.length ||
|
||||||
|
importProgram?.evo_models?.filter(
|
||||||
|
(importProgram_evo_model) =>
|
||||||
|
importProgram_evo_model?.evo_modelid === model.evo_modelid
|
||||||
|
)?.length)
|
||||||
|
) {
|
||||||
|
return model;
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
$calculation.element('selectModel').setOptions(normalizeOptions(models));
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
|
reaction(
|
||||||
|
() => {
|
||||||
|
const { product, subsidy, importProgram, leaseObjectType } = $calculation.$values.values;
|
||||||
|
|
||||||
|
return {
|
||||||
|
productId: product,
|
||||||
|
subsidyId: subsidy,
|
||||||
|
importProgramId: importProgram,
|
||||||
|
leaseObjectTypeId: leaseObjectType,
|
||||||
|
};
|
||||||
|
},
|
||||||
|
async ({ productId, subsidyId, importProgramId, leaseObjectTypeId }) => {
|
||||||
|
const {
|
||||||
|
data: { evo_brands },
|
||||||
|
} = await apolloClient.query({
|
||||||
|
query: CRMTypes.GetBrandsDocument,
|
||||||
|
});
|
||||||
|
|
||||||
|
let brands = evo_brands;
|
||||||
|
|
||||||
|
if (!brands) {
|
||||||
|
$calculation.element('selectBrand').reset();
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (productId) {
|
||||||
|
const {
|
||||||
|
data: { evo_baseproduct },
|
||||||
|
} = await apolloClient.query({
|
||||||
|
query: CRMTypes.GetProductDocument,
|
||||||
|
variables: {
|
||||||
|
productId,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
brands = brands?.filter((brand) => {
|
||||||
|
if (
|
||||||
|
!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) {
|
||||||
|
const {
|
||||||
|
data: { leaseObjectType },
|
||||||
|
} = await apolloClient.query({
|
||||||
|
query: CRMTypes.GetLeaseObjectTypeDocument,
|
||||||
|
variables: {
|
||||||
|
leaseObjectTypeId,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
brands = brands?.filter((brand) => {
|
||||||
|
if (
|
||||||
|
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) {
|
||||||
|
const {
|
||||||
|
data: { evo_subsidy: subsidy },
|
||||||
|
} = await apolloClient.query({
|
||||||
|
query: CRMTypes.GetSubsidyDocument,
|
||||||
|
variables: {
|
||||||
|
subsidyId,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
brands = brands?.filter((brand) => {
|
||||||
|
if (
|
||||||
|
!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) {
|
||||||
|
const {
|
||||||
|
data: { importProgram },
|
||||||
|
} = await apolloClient.query({
|
||||||
|
query: CRMTypes.GetImportProgramDocument,
|
||||||
|
variables: {
|
||||||
|
importProgramId,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
brands = brands?.filter((brand) => {
|
||||||
|
if (
|
||||||
|
!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));
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
|
reaction(
|
||||||
|
() => $calculation.element('selectLeaseObjectType').getValue(),
|
||||||
|
(leaseObjectTypeId) => {
|
||||||
|
if (!leaseObjectTypeId) {
|
||||||
|
$calculation.element('selectBrand').resetValue();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
|
reaction(
|
||||||
|
() => $calculation.element('selectModel').getValue(),
|
||||||
|
async (modelId) => {
|
||||||
|
if (!modelId) {
|
||||||
|
$calculation.element('selectConfiguration').reset();
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
const {
|
||||||
|
data: { evo_equipments },
|
||||||
|
} = await apolloClient.query({
|
||||||
|
query: CRMTypes.GetConfigurationsDocument,
|
||||||
|
variables: {
|
||||||
|
modelId,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
$calculation.element('selectConfiguration').setOptions(normalizeOptions(evo_equipments));
|
||||||
|
}
|
||||||
|
);
|
||||||
|
}
|
||||||
3
apps/web/process/leasing-object/reactions/index.js
Normal file
3
apps/web/process/leasing-object/reactions/index.js
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
/* eslint-disable import/prefer-default-export */
|
||||||
|
export { default as common } from './common';
|
||||||
|
export { default as validation } from './validation';
|
||||||
25
apps/web/process/leasing-object/reactions/validation.ts
Normal file
25
apps/web/process/leasing-object/reactions/validation.ts
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
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');
|
||||||
|
selectConfiguration.validate({
|
||||||
|
invalid: selectConfiguration.getOptions()?.length > 0 && !selectConfiguration.getValue(),
|
||||||
|
message: 'Не заполнено поле',
|
||||||
|
});
|
||||||
|
},
|
||||||
|
{
|
||||||
|
delay: 10,
|
||||||
|
}
|
||||||
|
);
|
||||||
|
}
|
||||||
127
apps/web/process/leasing-without-kasko/reactions/common.ts
Normal file
127
apps/web/process/leasing-without-kasko/reactions/common.ts
Normal file
@ -0,0 +1,127 @@
|
|||||||
|
/* eslint-disable @typescript-eslint/naming-convention */
|
||||||
|
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';
|
||||||
|
|
||||||
|
dayjs.extend(utc);
|
||||||
|
|
||||||
|
const NOTIFICATION_KEY = uid(7);
|
||||||
|
|
||||||
|
const QUERY_GET_LEASING_WITHOUT_KASKO_OPTIONS = gql`
|
||||||
|
query GetLeasingWithoutKaskoOptions($currentDate: DateTime) {
|
||||||
|
evo_addproduct_types(
|
||||||
|
statecode: 0
|
||||||
|
evo_product_type: 100000007
|
||||||
|
evo_datefrom_param: { lte: $currentDate }
|
||||||
|
evo_dateto_param: { gte: $currentDate }
|
||||||
|
) {
|
||||||
|
label: evo_name
|
||||||
|
value: evo_addproduct_typeid
|
||||||
|
evo_product_type
|
||||||
|
evo_min_period
|
||||||
|
evo_max_period
|
||||||
|
evo_min_price
|
||||||
|
evo_max_price
|
||||||
|
evo_leasingobject_types {
|
||||||
|
evo_leasingobject_typeid
|
||||||
|
}
|
||||||
|
evo_visible_calc
|
||||||
|
evo_min_first_payment_perc
|
||||||
|
evo_max_first_payment_perc
|
||||||
|
evo_models {
|
||||||
|
evo_modelid
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
`;
|
||||||
|
|
||||||
|
export default function commonReactions({ store, apolloClient, queryClient }: ReactionsContext) {
|
||||||
|
const { $calculation, $tables } = store;
|
||||||
|
|
||||||
|
reaction(
|
||||||
|
() => $calculation.element('selectLeasingWithoutKasko').getValue(),
|
||||||
|
(nextValue, prevValue) => {
|
||||||
|
if (prevValue && !nextValue) {
|
||||||
|
notification.warning({
|
||||||
|
key: NOTIFICATION_KEY,
|
||||||
|
message: 'Внимание',
|
||||||
|
description: 'Лизинг без КАСКО был сброшен',
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
|
/* eslint-disable max-len */
|
||||||
|
/**
|
||||||
|
* если "Лизинг без КАСКО" (SelectLeasingWithoutKasko) содержит данные,
|
||||||
|
* то в таблице страхования в строке ФинГАП: Страховая компания insCompany = null и закрыть для редактирования
|
||||||
|
*/
|
||||||
|
/* eslint-enable */
|
||||||
|
reaction(
|
||||||
|
() => $calculation.element('selectLeasingWithoutKasko').getValue(),
|
||||||
|
(leasingWithoutKasko) => {
|
||||||
|
if (leasingWithoutKasko) {
|
||||||
|
$tables.insurance.row('fingap').resetValue('insuranceCompany').block('insuranceCompany');
|
||||||
|
} else {
|
||||||
|
$tables.insurance.row('fingap').unblock('insuranceCompany');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
|
autorun(async () => {
|
||||||
|
const currentDate = dayjs().utc(false).toISOString();
|
||||||
|
|
||||||
|
const {
|
||||||
|
data: { evo_addproduct_types },
|
||||||
|
} = await apolloClient.query<
|
||||||
|
CRMTypes.GetLeasingWithoutKaskoOptionsQuery,
|
||||||
|
CRMTypes.GetLeasingWithoutKaskoOptionsQueryVariables
|
||||||
|
>({
|
||||||
|
query: QUERY_GET_LEASING_WITHOUT_KASKO_OPTIONS,
|
||||||
|
variables: {
|
||||||
|
currentDate,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
const {
|
||||||
|
plPriceRub,
|
||||||
|
discountRub,
|
||||||
|
importProgramSum,
|
||||||
|
leasingPeriod,
|
||||||
|
addEquipmentPrice,
|
||||||
|
leaseObjectType,
|
||||||
|
firstPaymentPerc,
|
||||||
|
model: modelId,
|
||||||
|
} = $calculation.$values.values;
|
||||||
|
|
||||||
|
const options = evo_addproduct_types?.filter(
|
||||||
|
(x) =>
|
||||||
|
x?.evo_max_period &&
|
||||||
|
x.evo_max_period >= leasingPeriod &&
|
||||||
|
x?.evo_min_period &&
|
||||||
|
x.evo_min_period <= leasingPeriod &&
|
||||||
|
x?.evo_max_price &&
|
||||||
|
x.evo_max_price >= plPriceRub - discountRub - importProgramSum + addEquipmentPrice &&
|
||||||
|
x?.evo_min_price &&
|
||||||
|
x.evo_min_price <= plPriceRub - discountRub - importProgramSum + addEquipmentPrice &&
|
||||||
|
x.evo_leasingobject_types?.find(
|
||||||
|
(evo_leasingobject_type) =>
|
||||||
|
evo_leasingobject_type?.evo_leasingobject_typeid === leaseObjectType
|
||||||
|
) &&
|
||||||
|
x.evo_visible_calc &&
|
||||||
|
x.evo_min_first_payment_perc &&
|
||||||
|
x.evo_min_first_payment_perc <= firstPaymentPerc &&
|
||||||
|
x.evo_max_first_payment_perc &&
|
||||||
|
x.evo_max_first_payment_perc >= firstPaymentPerc &&
|
||||||
|
!x.evo_models?.map((evo_model) => evo_model?.evo_modelid).includes(modelId)
|
||||||
|
);
|
||||||
|
|
||||||
|
$calculation.element('selectLeasingWithoutKasko').setOptions(normalizeOptions(options));
|
||||||
|
});
|
||||||
|
}
|
||||||
@ -0,0 +1,2 @@
|
|||||||
|
/* eslint-disable import/prefer-default-export */
|
||||||
|
export { default as common } from './common';
|
||||||
@ -23,19 +23,30 @@ export default function loadKpReactions({ store, trpcClient }: ReactionsContext)
|
|||||||
content: `Загружаем КП ${quoteName}...`,
|
content: `Загружаем КП ${quoteName}...`,
|
||||||
});
|
});
|
||||||
|
|
||||||
const payload = {
|
const { recalcWithRevision } = $calculation.$values.values;
|
||||||
values: {
|
|
||||||
quote: quoteId,
|
|
||||||
...pick($calculation.$values.values, ['recalcWithRevision']),
|
|
||||||
},
|
|
||||||
};
|
|
||||||
|
|
||||||
trpcClient.quote.getData
|
trpcClient.quote.getData
|
||||||
.query(payload)
|
.query({
|
||||||
|
values: {
|
||||||
|
quote: quoteId,
|
||||||
|
recalcWithRevision,
|
||||||
|
},
|
||||||
|
})
|
||||||
.then(({ values, payments, insurance, fingap }) => {
|
.then(({ values, payments, insurance, fingap }) => {
|
||||||
|
const savedValues = pick($calculation.$values.values, [
|
||||||
|
'lead',
|
||||||
|
'opportunity',
|
||||||
|
'quote',
|
||||||
|
'leadUrl',
|
||||||
|
'opportunityUrl',
|
||||||
|
'quoteUrl',
|
||||||
|
]);
|
||||||
|
|
||||||
$calculation.$values.setValues({
|
$calculation.$values.setValues({
|
||||||
values,
|
values: {
|
||||||
exclude: ['lead', 'opportunity', 'quote', 'leadUrl', 'opportunityUrl', 'quoteUrl'],
|
...values,
|
||||||
|
...savedValues,
|
||||||
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
$tables.payments.setValues(payments.values);
|
$tables.payments.setValues(payments.values);
|
||||||
|
|||||||
@ -56,7 +56,7 @@ export default async function getPaymentsDataFromKP({
|
|||||||
let paymentsValues: Array<number> = [];
|
let paymentsValues: Array<number> = [];
|
||||||
if (quote?.evo_graphs) {
|
if (quote?.evo_graphs) {
|
||||||
paymentsValues =
|
paymentsValues =
|
||||||
sort(quote?.evo_graphs, (evo_graph) => Date.parse(evo_graph?.createdon))
|
sort(quote?.evo_graphs, (evo_graph) => Date.parse(evo_graph?.createdon ?? '0'))
|
||||||
.at(0)
|
.at(0)
|
||||||
?.evo_planpayments?.slice(1, -1)
|
?.evo_planpayments?.slice(1, -1)
|
||||||
.slice(0, leasingPeriod - 2)
|
.slice(0, leasingPeriod - 2)
|
||||||
|
|||||||
@ -13,3 +13,8 @@ export const FORBIDDEN_HIGH_SEASON_START: Record<number, Array<string>> = {
|
|||||||
export const SEASONS_PERIOD_NUMBER = 12;
|
export const SEASONS_PERIOD_NUMBER = 12;
|
||||||
|
|
||||||
export const DEFAULT_SEASONS_VALUES = [100, 75, 50];
|
export const DEFAULT_SEASONS_VALUES = [100, 75, 50];
|
||||||
|
|
||||||
|
export const SEASON_TYPES = {
|
||||||
|
100_000_001: [100_000_003, 100_000_004, 100_000_005, 100_000_006, 100_000_007],
|
||||||
|
100_000_003: [100_000_000, 100_000_001, 100_000_002],
|
||||||
|
};
|
||||||
|
|||||||
@ -1,5 +1,6 @@
|
|||||||
/* eslint-disable implicit-arrow-linebreak */
|
/* eslint-disable implicit-arrow-linebreak */
|
||||||
import type { CalculationValues } from 'stores/calculation/values/types';
|
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_PERIODS, SEASONS_PERIOD_NUMBER } from './seasons-constants';
|
||||||
|
|
||||||
type SeasonType = NonNullable<CalculationValues['seasonType']>;
|
type SeasonType = NonNullable<CalculationValues['seasonType']>;
|
||||||
@ -53,3 +54,19 @@ export function generateSeasonsPayments(leasingPeriod: LeasingPeriod, seasons: A
|
|||||||
.concat(seasons.slice(0, (leasingPeriod - 2) % SEASONS_PERIOD_NUMBER))
|
.concat(seasons.slice(0, (leasingPeriod - 2) % SEASONS_PERIOD_NUMBER))
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function generateSeasonPaymentsRows(
|
||||||
|
seasonType: number,
|
||||||
|
shiftNumber: number,
|
||||||
|
payments: number[]
|
||||||
|
) {
|
||||||
|
const shiftedPeriods = new Set(
|
||||||
|
SEASONS_PERIODS[seasonType].map((position) => (position + shiftNumber) % SEASONS_PERIOD_NUMBER)
|
||||||
|
);
|
||||||
|
const rows: Row[] = payments.map((value, i) => ({
|
||||||
|
value,
|
||||||
|
status: shiftedPeriods.has(i) ? 'Default' : 'Disabled',
|
||||||
|
}));
|
||||||
|
|
||||||
|
return rows;
|
||||||
|
}
|
||||||
|
|||||||
@ -1,10 +1,9 @@
|
|||||||
/* eslint-disable function-paren-newline */
|
/* eslint-disable function-paren-newline */
|
||||||
/* eslint-disable implicit-arrow-linebreak */
|
/* eslint-disable implicit-arrow-linebreak */
|
||||||
import { selectHighSeasonStart, selectSeasonType } from 'config/default-options';
|
import { selectHighSeasonStart } from 'config/default-options';
|
||||||
import { comparer, reaction, toJS } from 'mobx';
|
import { comparer, reaction, toJS } from 'mobx';
|
||||||
import type { ReactionsContext } from 'process/types';
|
import type { ReactionsContext } from 'process/types';
|
||||||
import { shift } from 'radash';
|
import { shift } from 'radash';
|
||||||
import type { CalculationOptions } from 'stores/calculation/options/types';
|
|
||||||
import type { Row } from 'stores/tables/payments/types';
|
import type { Row } from 'stores/tables/payments/types';
|
||||||
import ValidationHelper from 'stores/validation/helper';
|
import ValidationHelper from 'stores/validation/helper';
|
||||||
import { difference } from 'tools/array';
|
import { difference } from 'tools/array';
|
||||||
@ -13,6 +12,22 @@ import * as seasonsConstants from './lib/seasons-constants';
|
|||||||
import * as seasonsTools from './lib/seasons-tools';
|
import * as seasonsTools from './lib/seasons-tools';
|
||||||
import validatePaymentsTable from './validation';
|
import validatePaymentsTable from './validation';
|
||||||
|
|
||||||
|
const {
|
||||||
|
generateSeasonPaymentsRows,
|
||||||
|
generateSeasons,
|
||||||
|
generateSeasonsPayments,
|
||||||
|
getPositionIndex,
|
||||||
|
getSeasonsValues,
|
||||||
|
} = seasonsTools;
|
||||||
|
|
||||||
|
const {
|
||||||
|
DEFAULT_SEASONS_VALUES,
|
||||||
|
FORBIDDEN_HIGH_SEASON_START,
|
||||||
|
SEASONS_PERIODS,
|
||||||
|
SEASONS_PERIOD_NUMBER,
|
||||||
|
SEASON_TYPES,
|
||||||
|
} = seasonsConstants;
|
||||||
|
|
||||||
export default function paymentsReactions({ store }: ReactionsContext) {
|
export default function paymentsReactions({ store }: ReactionsContext) {
|
||||||
const { $calculation, $tables, $process } = store;
|
const { $calculation, $tables, $process } = store;
|
||||||
|
|
||||||
@ -205,36 +220,36 @@ export default function paymentsReactions({ store }: ReactionsContext) {
|
|||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
/**
|
// /**
|
||||||
* Дегрессия
|
// * Дегрессия
|
||||||
*/
|
// */
|
||||||
// TODO: const exeption = tarif?.evo_seasons_type_exception
|
|
||||||
const degressionSeasonTypes = new Set([
|
|
||||||
100_000_003, 100_000_004, 100_000_005, 100_000_006, 100_000_007,
|
|
||||||
]);
|
|
||||||
const seasonSeasonTypes = new Set([100_000_000, 100_000_001, 100_000_002]);
|
|
||||||
|
|
||||||
reaction(
|
// reaction(
|
||||||
() => {
|
// () => {
|
||||||
const graphType = $calculation.element('radioGraphType').getValue();
|
// const graphType = $calculation.element('radioGraphType').getValue();
|
||||||
|
|
||||||
return graphType;
|
// return graphType;
|
||||||
},
|
// },
|
||||||
(graphType) => {
|
// (graphType) => {
|
||||||
let selectSeasonTypeOptions: CalculationOptions['selectSeasonType'] = [];
|
// if (!graphType) {
|
||||||
|
// $calculation.element('selectSeasonType').resetOptions();
|
||||||
|
|
||||||
if (graphType === 100_000_001) {
|
// return;
|
||||||
selectSeasonTypeOptions = selectSeasonType.filter((option) =>
|
// }
|
||||||
degressionSeasonTypes.has(option.value)
|
|
||||||
);
|
// if (graphType === 100_000_001 || graphType === 100_000_003) {
|
||||||
} else if (graphType === 100_000_003) {
|
// const allowedSeasonTypes = SEASON_TYPES[graphType];
|
||||||
selectSeasonTypeOptions = selectSeasonType.filter((option) =>
|
|
||||||
seasonSeasonTypes.has(option.value)
|
// const selectSeasonTypeOptions = selectSeasonType.filter((option) =>
|
||||||
);
|
// allowedSeasonTypes.includes(option.value)
|
||||||
}
|
// );
|
||||||
$calculation.element('selectSeasonType').setOptions(selectSeasonTypeOptions);
|
|
||||||
}
|
// $calculation.element('selectSeasonType').setOptions(selectSeasonTypeOptions);
|
||||||
);
|
// } else {
|
||||||
|
// $calculation.element('selectSeasonType').resetOptions();
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// );
|
||||||
|
|
||||||
const degressionSteps: { [key: number]: Array<number> } = {
|
const degressionSteps: { [key: number]: Array<number> } = {
|
||||||
100_000_003: [100, 50, 25],
|
100_000_003: [100, 50, 25],
|
||||||
@ -423,27 +438,13 @@ export default function paymentsReactions({ store }: ReactionsContext) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const highSeasonStartOptions = selectHighSeasonStart.filter(
|
const highSeasonStartOptions = selectHighSeasonStart.filter(
|
||||||
(option) => !seasonsConstants.FORBIDDEN_HIGH_SEASON_START[seasonType].includes(option.label)
|
(option) => !FORBIDDEN_HIGH_SEASON_START[seasonType].includes(option.label)
|
||||||
);
|
);
|
||||||
|
|
||||||
$calculation.element('selectHighSeasonStart').setOptions(highSeasonStartOptions);
|
$calculation.element('selectHighSeasonStart').setOptions(highSeasonStartOptions);
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
function generateSeasonPaymentsRows(seasonType: number, shiftNumber: number, payments: number[]) {
|
|
||||||
const shiftedPeriods = new Set(
|
|
||||||
seasonsConstants.SEASONS_PERIODS[seasonType].map(
|
|
||||||
(position) => (position + shiftNumber) % seasonsConstants.SEASONS_PERIOD_NUMBER
|
|
||||||
)
|
|
||||||
);
|
|
||||||
const rows: Row[] = payments.map((value, i) => ({
|
|
||||||
value,
|
|
||||||
status: shiftedPeriods.has(i) ? 'Default' : 'Disabled',
|
|
||||||
}));
|
|
||||||
|
|
||||||
return rows;
|
|
||||||
}
|
|
||||||
|
|
||||||
reaction(
|
reaction(
|
||||||
() => {
|
() => {
|
||||||
const seasonType = $calculation.element('selectSeasonType').getValue();
|
const seasonType = $calculation.element('selectSeasonType').getValue();
|
||||||
@ -466,15 +467,9 @@ export default function paymentsReactions({ store }: ReactionsContext) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const seasons = seasonsTools.generateSeasons(
|
const seasons = generateSeasons(seasonType, DEFAULT_SEASONS_VALUES);
|
||||||
seasonType,
|
|
||||||
seasonsConstants.DEFAULT_SEASONS_VALUES
|
|
||||||
);
|
|
||||||
const shiftNumber = Number.parseInt(highSeasonStartOption.label, 10) - 2;
|
const shiftNumber = Number.parseInt(highSeasonStartOption.label, 10) - 2;
|
||||||
const payments = seasonsTools.generateSeasonsPayments(
|
const payments = generateSeasonsPayments(leasingPeriod, shift(seasons, shiftNumber));
|
||||||
leasingPeriod,
|
|
||||||
shift(seasons, shiftNumber)
|
|
||||||
);
|
|
||||||
const middlePayments: Row[] = generateSeasonPaymentsRows(seasonType, shiftNumber, payments);
|
const middlePayments: Row[] = generateSeasonPaymentsRows(seasonType, shiftNumber, payments);
|
||||||
const firstPaymentPerc = $calculation.element('tbxFirstPaymentPerc').getValue();
|
const firstPaymentPerc = $calculation.element('tbxFirstPaymentPerc').getValue();
|
||||||
const lastPaymentPerc = $calculation.element('tbxLastPaymentPerc').getValue();
|
const lastPaymentPerc = $calculation.element('tbxLastPaymentPerc').getValue();
|
||||||
@ -504,7 +499,7 @@ export default function paymentsReactions({ store }: ReactionsContext) {
|
|||||||
reaction(
|
reaction(
|
||||||
() => {
|
() => {
|
||||||
const payments = toJS($tables.payments.values);
|
const payments = toJS($tables.payments.values);
|
||||||
const seasons = payments.slice(1, seasonsConstants.SEASONS_PERIOD_NUMBER + 1);
|
const seasons = payments.slice(1, SEASONS_PERIOD_NUMBER + 1);
|
||||||
|
|
||||||
return seasons;
|
return seasons;
|
||||||
},
|
},
|
||||||
@ -524,17 +519,14 @@ export default function paymentsReactions({ store }: ReactionsContext) {
|
|||||||
if (changes === null || changes.length > 1) return;
|
if (changes === null || changes.length > 1) return;
|
||||||
|
|
||||||
const [changeIndex] = changes;
|
const [changeIndex] = changes;
|
||||||
const positionIndex = seasonsTools.getPositionIndex(seasonType, changeIndex);
|
const positionIndex = getPositionIndex(seasonType, changeIndex);
|
||||||
|
|
||||||
const values = seasonsTools.getSeasonsValues(seasonType, unshiftedNextSeasons);
|
const values = getSeasonsValues(seasonType, unshiftedNextSeasons);
|
||||||
values[positionIndex] = unshiftedNextSeasons[changeIndex];
|
values[positionIndex] = unshiftedNextSeasons[changeIndex];
|
||||||
|
|
||||||
const seasons = seasonsTools.generateSeasons(seasonType, values);
|
const seasons = generateSeasons(seasonType, values);
|
||||||
const leasingPeriod = $calculation.element('tbxLeasingPeriod').getValue();
|
const leasingPeriod = $calculation.element('tbxLeasingPeriod').getValue();
|
||||||
const payments = seasonsTools.generateSeasonsPayments(
|
const payments = generateSeasonsPayments(leasingPeriod, shift(seasons, shiftNumber));
|
||||||
leasingPeriod,
|
|
||||||
shift(seasons, shiftNumber)
|
|
||||||
);
|
|
||||||
const rows: Row[] = generateSeasonPaymentsRows(seasonType, shiftNumber, payments);
|
const rows: Row[] = generateSeasonPaymentsRows(seasonType, shiftNumber, payments);
|
||||||
const firstPaymentPerc = $calculation.element('tbxFirstPaymentPerc').getValue();
|
const firstPaymentPerc = $calculation.element('tbxFirstPaymentPerc').getValue();
|
||||||
const lastPaymentPerc = $calculation.element('tbxLastPaymentPerc').getValue();
|
const lastPaymentPerc = $calculation.element('tbxLastPaymentPerc').getValue();
|
||||||
|
|||||||
61
apps/web/process/price/get-kp-data.ts
Normal file
61
apps/web/process/price/get-kp-data.ts
Normal file
@ -0,0 +1,61 @@
|
|||||||
|
/* 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';
|
||||||
|
|
||||||
|
const QUERY_GET_PRICE_DATA_FROM_QUOTE = gql`
|
||||||
|
query GetPriceDataFromQuote($quoteId: Uuid!) {
|
||||||
|
quote(quoteId: $quoteId) {
|
||||||
|
evo_supplier_currency_price
|
||||||
|
evo_price_without_nds_supplier_currency
|
||||||
|
evo_nds_in_price_supplier_currency
|
||||||
|
evo_last_payment_rub
|
||||||
|
evo_last_payment_calc
|
||||||
|
evo_transactioncurrencyid
|
||||||
|
evo_discount_supplier_currency
|
||||||
|
evo_discount_perc
|
||||||
|
evo_comission_perc
|
||||||
|
evo_comission_rub
|
||||||
|
evo_sale_bonus
|
||||||
|
}
|
||||||
|
}
|
||||||
|
`;
|
||||||
|
|
||||||
|
type QuotePaymentsProcessData = {
|
||||||
|
values: Partial<GetQuoteDataOutput['values']>;
|
||||||
|
};
|
||||||
|
|
||||||
|
export default async function getPriceDataFromKP({
|
||||||
|
values: { quote: quoteId },
|
||||||
|
}: GetQuoteDataInput): Promise<QuotePaymentsProcessData> {
|
||||||
|
const apolloClient = initializeApollo();
|
||||||
|
|
||||||
|
const {
|
||||||
|
data: { quote },
|
||||||
|
} = await apolloClient.query<
|
||||||
|
CRMTypes.GetPriceDataFromQuoteQuery,
|
||||||
|
CRMTypes.GetPriceDataFromQuoteQueryVariables
|
||||||
|
>({
|
||||||
|
query: QUERY_GET_PRICE_DATA_FROM_QUOTE,
|
||||||
|
variables: {
|
||||||
|
quoteId,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
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,
|
||||||
|
saleBonus: quote?.evo_sale_bonus || 0,
|
||||||
|
},
|
||||||
|
};
|
||||||
|
}
|
||||||
50
apps/web/process/price/reactions/common.ts
Normal file
50
apps/web/process/price/reactions/common.ts
Normal file
@ -0,0 +1,50 @@
|
|||||||
|
import { MIN_LASTPAYMENT_NSIB } from 'constants/values';
|
||||||
|
import { reaction } from 'mobx';
|
||||||
|
import type { ReactionsContext } from 'process/types';
|
||||||
|
|
||||||
|
export default function commonReactions({ store, apolloClient }: ReactionsContext) {
|
||||||
|
const { $calculation } = store;
|
||||||
|
|
||||||
|
reaction(
|
||||||
|
() => $calculation.element('radioLastPaymentRule').getValue(),
|
||||||
|
(lastPaymentRule) => {
|
||||||
|
switch (lastPaymentRule) {
|
||||||
|
case 100_000_000: {
|
||||||
|
$calculation.element('tbxLastPaymentPerc').block();
|
||||||
|
$calculation.element('tbxLastPaymentRub').unblock();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case 100_000_001: {
|
||||||
|
$calculation.element('tbxLastPaymentPerc').unblock();
|
||||||
|
$calculation.element('tbxLastPaymentRub').block();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
default: {
|
||||||
|
$calculation.element('tbxLastPaymentPerc').block();
|
||||||
|
$calculation.element('tbxLastPaymentRub').block();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
fireImmediately: true,
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
|
reaction(
|
||||||
|
() => {
|
||||||
|
const lastPaymentRub = $calculation.element('tbxLastPaymentRub').getValue();
|
||||||
|
const insNSIB = $calculation.element('selectInsNSIB').getValue();
|
||||||
|
|
||||||
|
return {
|
||||||
|
lastPaymentRub,
|
||||||
|
insNSIB,
|
||||||
|
};
|
||||||
|
},
|
||||||
|
({ lastPaymentRub, insNSIB }) => {
|
||||||
|
$calculation.element('tbxLastPaymentRub').validate({
|
||||||
|
invalid: !!insNSIB && lastPaymentRub < MIN_LASTPAYMENT_NSIB,
|
||||||
|
message: `Последний платеж меньше ${MIN_LASTPAYMENT_NSIB} руб. не может быть при наличии НСИБ, укажите большее значение`,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
);
|
||||||
|
}
|
||||||
@ -1,31 +1,13 @@
|
|||||||
/* eslint-disable @typescript-eslint/naming-convention */
|
/* eslint-disable @typescript-eslint/naming-convention */
|
||||||
import { gql } from '@apollo/client';
|
|
||||||
import dayjs from 'dayjs';
|
import dayjs from 'dayjs';
|
||||||
import utc from 'dayjs/plugin/utc';
|
import utc from 'dayjs/plugin/utc';
|
||||||
import type * as CRMTypes from 'graphql/crm.types';
|
import * as CRMTypes from 'graphql/crm.types';
|
||||||
import { autorun } from 'mobx';
|
import { autorun } from 'mobx';
|
||||||
import type { ReactionsContext } from 'process/types';
|
import type { ReactionsContext } from 'process/types';
|
||||||
|
|
||||||
dayjs.extend(utc);
|
dayjs.extend(utc);
|
||||||
|
|
||||||
export default function computedReactions({ store, apolloClient }: ReactionsContext) {
|
export default function computedReactions({ store, apolloClient }: ReactionsContext) {
|
||||||
const QUERY_GET_EVO_CURRENCY_CHANGES = gql`
|
|
||||||
query GetCurrencyChanges($currentDate: DateTime) {
|
|
||||||
evo_currencychanges(statecode: 0, evo_coursedate_param: { eq: $currentDate }) {
|
|
||||||
evo_currencychange
|
|
||||||
evo_ref_transactioncurrency
|
|
||||||
}
|
|
||||||
}
|
|
||||||
`;
|
|
||||||
|
|
||||||
const QUERY_GET_CURRENCY_ISOCODE = gql`
|
|
||||||
query GetCurrencyISOCode($id: Uuid!) {
|
|
||||||
transactioncurrency(transactioncurrencyid: $id) {
|
|
||||||
isocurrencycode
|
|
||||||
}
|
|
||||||
}
|
|
||||||
`;
|
|
||||||
|
|
||||||
const { $calculation } = store;
|
const { $calculation } = store;
|
||||||
|
|
||||||
autorun(
|
autorun(
|
||||||
@ -43,13 +25,10 @@ export default function computedReactions({ store, apolloClient }: ReactionsCont
|
|||||||
|
|
||||||
const {
|
const {
|
||||||
data: { transactioncurrency },
|
data: { transactioncurrency },
|
||||||
} = await apolloClient.query<
|
} = await apolloClient.query({
|
||||||
CRMTypes.GetCurrencyIsoCodeQuery,
|
query: CRMTypes.GetTransactionCurrencyDocument,
|
||||||
CRMTypes.GetCurrencyIsoCodeQueryVariables
|
|
||||||
>({
|
|
||||||
query: QUERY_GET_CURRENCY_ISOCODE,
|
|
||||||
variables: {
|
variables: {
|
||||||
id: supplierCurrencyId,
|
currencyid: supplierCurrencyId,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -62,11 +41,8 @@ export default function computedReactions({ store, apolloClient }: ReactionsCont
|
|||||||
|
|
||||||
const {
|
const {
|
||||||
data: { evo_currencychanges },
|
data: { evo_currencychanges },
|
||||||
} = await apolloClient.query<
|
} = await apolloClient.query({
|
||||||
CRMTypes.GetCurrencyChangesQuery,
|
query: CRMTypes.GetCurrencyChangesDocument,
|
||||||
CRMTypes.GetCurrencyChangesQueryVariables
|
|
||||||
>({
|
|
||||||
query: QUERY_GET_EVO_CURRENCY_CHANGES,
|
|
||||||
variables: {
|
variables: {
|
||||||
currentDate: dayjs().utc(false).format('YYYY-MM-DD'),
|
currentDate: dayjs().utc(false).format('YYYY-MM-DD'),
|
||||||
},
|
},
|
||||||
|
|||||||
@ -1,2 +1,2 @@
|
|||||||
/* eslint-disable import/prefer-default-export */
|
export { default as common } from './common';
|
||||||
export { default as computed } from './computed';
|
export { default as computed } from './computed';
|
||||||
|
|||||||
60
apps/web/process/subsidy/reactions.ts
Normal file
60
apps/web/process/subsidy/reactions.ts
Normal file
@ -0,0 +1,60 @@
|
|||||||
|
/* eslint-disable @typescript-eslint/naming-convention */
|
||||||
|
import * as CRMTypes from 'graphql/crm.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
|
||||||
|
*/
|
||||||
|
/* eslint-enable */
|
||||||
|
|
||||||
|
export function computedReactions({ store, apolloClient, queryClient }: ReactionsContext) {
|
||||||
|
const { $calculation } = store;
|
||||||
|
|
||||||
|
autorun(async () => {
|
||||||
|
const importProgramId = $calculation.element('selectImportProgram').getValue();
|
||||||
|
const plPriceRub = $calculation.$values.getValue('plPriceRub');
|
||||||
|
const supplierDiscountRub = $calculation.element('tbxSupplierDiscountRub').getValue();
|
||||||
|
|
||||||
|
if (importProgramId) {
|
||||||
|
const {
|
||||||
|
data: { evo_subsidy: importProgram },
|
||||||
|
} = await apolloClient.query({
|
||||||
|
query: CRMTypes.GetSubsidyDocument,
|
||||||
|
variables: {
|
||||||
|
subsidyId: importProgramId,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
if (importProgram?.evo_subsidy_summ && importProgram?.evo_subsidy_summ > 0) {
|
||||||
|
$calculation.element('tbxImportProgramSum').setValue(importProgram?.evo_subsidy_summ);
|
||||||
|
} else {
|
||||||
|
const subsidyPercent = (importProgram?.evo_percent_subsidy || 0) / 100;
|
||||||
|
|
||||||
|
const sum = (plPriceRub - supplierDiscountRub) * subsidyPercent;
|
||||||
|
const maxSum = importProgram?.evo_max_subsidy_summ || 0;
|
||||||
|
|
||||||
|
$calculation.element('tbxImportProgramSum').setValue(Math.min(sum, maxSum));
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
$calculation.element('tbxImportProgramSum').setValue(0);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
export function commonReactions({ store, apolloClient, queryClient }: ReactionsContext) {
|
||||||
|
const { $calculation, $tables } = store;
|
||||||
|
}
|
||||||
@ -1,9 +1,8 @@
|
|||||||
/* eslint-disable @typescript-eslint/naming-convention */
|
/* eslint-disable @typescript-eslint/naming-convention */
|
||||||
import type { ApolloClient } from '@apollo/client';
|
import type { ApolloClient } from '@apollo/client';
|
||||||
import { gql } from '@apollo/client';
|
|
||||||
import dayjs from 'dayjs';
|
import dayjs from 'dayjs';
|
||||||
import utc from 'dayjs/plugin/utc';
|
import utc from 'dayjs/plugin/utc';
|
||||||
import type * as CRMTypes from 'graphql/crm.types';
|
import * as CRMTypes from 'graphql/crm.types';
|
||||||
import { autorun, reaction } from 'mobx';
|
import { autorun, reaction } from 'mobx';
|
||||||
import type RootStore from 'stores/root';
|
import type RootStore from 'stores/root';
|
||||||
import ValidationHelper from 'stores/validation/helper';
|
import ValidationHelper from 'stores/validation/helper';
|
||||||
@ -13,22 +12,6 @@ import type { AgentsFields, AgentsRewardConditionsFields, AgentsSumFields } from
|
|||||||
|
|
||||||
dayjs.extend(utc);
|
dayjs.extend(utc);
|
||||||
|
|
||||||
const QUERY_GET_REWARD_CONDITIONS = gql`
|
|
||||||
query GetRewardConditions($agentid: Uuid!, $currentDate: DateTime) {
|
|
||||||
evo_reward_conditions(
|
|
||||||
evo_agent_accountid: $agentid
|
|
||||||
evo_datefrom_param: { lte: $currentDate }
|
|
||||||
evo_dateto_param: { gte: $currentDate }
|
|
||||||
statecode: 0
|
|
||||||
evo_agency_agreementid_param: { has: true }
|
|
||||||
) {
|
|
||||||
label: evo_name
|
|
||||||
value: evo_reward_conditionid
|
|
||||||
evo_reward_summ
|
|
||||||
}
|
|
||||||
}
|
|
||||||
`;
|
|
||||||
|
|
||||||
export function fillAgentRewardReaction(
|
export function fillAgentRewardReaction(
|
||||||
store: RootStore,
|
store: RootStore,
|
||||||
apolloClient: ApolloClient<object>,
|
apolloClient: ApolloClient<object>,
|
||||||
@ -50,11 +33,8 @@ export function fillAgentRewardReaction(
|
|||||||
}
|
}
|
||||||
const {
|
const {
|
||||||
data: { evo_reward_conditions },
|
data: { evo_reward_conditions },
|
||||||
} = await apolloClient.query<
|
} = await apolloClient.query({
|
||||||
CRMTypes.GetRewardConditionsQuery,
|
query: CRMTypes.GetRewardConditionsDocument,
|
||||||
CRMTypes.GetRewardConditionsQueryVariables
|
|
||||||
>({
|
|
||||||
query: QUERY_GET_REWARD_CONDITIONS,
|
|
||||||
variables: {
|
variables: {
|
||||||
agentid,
|
agentid,
|
||||||
currentDate: dayjs().toISOString(),
|
currentDate: dayjs().toISOString(),
|
||||||
@ -72,14 +52,6 @@ export function fillAgentRewardReaction(
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
const QUERY_GET_REWARD_SUMM = gql`
|
|
||||||
query GetRewardSumm($conditionId: Uuid!) {
|
|
||||||
evo_reward_condition(evo_reward_conditionid: $conditionId) {
|
|
||||||
evo_reward_summ
|
|
||||||
}
|
|
||||||
}
|
|
||||||
`;
|
|
||||||
|
|
||||||
export function fillAgentRewardSummReaction(
|
export function fillAgentRewardSummReaction(
|
||||||
store: RootStore,
|
store: RootStore,
|
||||||
apolloClient: ApolloClient<object>,
|
apolloClient: ApolloClient<object>,
|
||||||
@ -104,11 +76,8 @@ export function fillAgentRewardSummReaction(
|
|||||||
|
|
||||||
const {
|
const {
|
||||||
data: { evo_reward_condition },
|
data: { evo_reward_condition },
|
||||||
} = await apolloClient.query<
|
} = await apolloClient.query({
|
||||||
CRMTypes.GetRewardSummQuery,
|
query: CRMTypes.GetRewardConditionDocument,
|
||||||
CRMTypes.GetRewardSummQueryVariables
|
|
||||||
>({
|
|
||||||
query: QUERY_GET_REWARD_SUMM,
|
|
||||||
variables: {
|
variables: {
|
||||||
conditionId: rewardConditionId,
|
conditionId: rewardConditionId,
|
||||||
},
|
},
|
||||||
@ -136,19 +105,6 @@ export function fillAgentRewardSummReaction(
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
const QUERY_GET_REWARD_CONDITION = gql`
|
|
||||||
query GetRewardCondition($conditionId: Uuid!) {
|
|
||||||
evo_reward_condition(evo_reward_conditionid: $conditionId) {
|
|
||||||
evo_reward_summ
|
|
||||||
evo_reduce_reward
|
|
||||||
evo_min_reward_summ
|
|
||||||
evo_agency_agreementidData {
|
|
||||||
evo_required_reward
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
`;
|
|
||||||
|
|
||||||
export function validateAgentRewardSumm(
|
export function validateAgentRewardSumm(
|
||||||
store: RootStore,
|
store: RootStore,
|
||||||
apolloClient: ApolloClient<object>,
|
apolloClient: ApolloClient<object>,
|
||||||
@ -178,7 +134,7 @@ export function validateAgentRewardSumm(
|
|||||||
CRMTypes.GetRewardConditionQuery,
|
CRMTypes.GetRewardConditionQuery,
|
||||||
CRMTypes.GetRewardConditionQueryVariables
|
CRMTypes.GetRewardConditionQueryVariables
|
||||||
>({
|
>({
|
||||||
query: QUERY_GET_REWARD_CONDITION,
|
query: CRMTypes.GetRewardConditionDocument,
|
||||||
variables: {
|
variables: {
|
||||||
conditionId,
|
conditionId,
|
||||||
},
|
},
|
||||||
@ -245,7 +201,7 @@ export function validateAgentRewardSumm(
|
|||||||
CRMTypes.GetRewardConditionQuery,
|
CRMTypes.GetRewardConditionQuery,
|
||||||
CRMTypes.GetRewardConditionQueryVariables
|
CRMTypes.GetRewardConditionQueryVariables
|
||||||
>({
|
>({
|
||||||
query: QUERY_GET_REWARD_CONDITION,
|
query: CRMTypes.GetRewardConditionDocument,
|
||||||
variables: {
|
variables: {
|
||||||
conditionId,
|
conditionId,
|
||||||
},
|
},
|
||||||
|
|||||||
@ -1,17 +1,19 @@
|
|||||||
/* eslint-disable import/prefer-default-export */
|
/* eslint-disable import/prefer-default-export */
|
||||||
import type { ApolloClient, DocumentNode } from '@apollo/client';
|
import type { ApolloClient } from '@apollo/client';
|
||||||
import { gql } from '@apollo/client';
|
|
||||||
import type { Elements } from 'Components/Calculation/config/map/values';
|
import type { Elements } from 'Components/Calculation/config/map/values';
|
||||||
import type { GetAgentQuery, GetAgentQueryVariables } from 'graphql/crm.types';
|
import * as CRMTypes from 'graphql/crm.types';
|
||||||
import type RootStore from 'stores/root';
|
import type RootStore from 'stores/root';
|
||||||
import { normalizeOptions } from 'tools/entity';
|
import { normalizeOptions } from 'tools/entity';
|
||||||
import { QUERY_GET_AGENT } from './query';
|
|
||||||
|
|
||||||
function makeFillAgentFromLead(
|
type AgentsLeadProp = keyof Pick<
|
||||||
elementName: Elements,
|
NonNullable<CRMTypes.GetLeadQuery['lead']>,
|
||||||
queryGetAgentId: DocumentNode,
|
| 'evo_agent_accountid'
|
||||||
queryGetAgent: DocumentNode
|
| 'evo_broker_accountid'
|
||||||
) {
|
| 'evo_double_agent_accountid'
|
||||||
|
| 'evo_fin_department_accountid'
|
||||||
|
>;
|
||||||
|
|
||||||
|
function makeFillAgentFromLead(elementName: Elements, leadProp: AgentsLeadProp) {
|
||||||
return async function fillAgentFromLead(
|
return async function fillAgentFromLead(
|
||||||
{ $calculation }: RootStore,
|
{ $calculation }: RootStore,
|
||||||
apolloClient: ApolloClient<object>,
|
apolloClient: ApolloClient<object>,
|
||||||
@ -26,19 +28,21 @@ function makeFillAgentFromLead(
|
|||||||
const {
|
const {
|
||||||
data: { lead },
|
data: { lead },
|
||||||
} = await apolloClient.query({
|
} = await apolloClient.query({
|
||||||
query: queryGetAgentId,
|
query: CRMTypes.GetLeadDocument,
|
||||||
variables: {
|
variables: {
|
||||||
leadid,
|
leadid,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
if (lead?.agentid) {
|
const agentid = lead?.[leadProp];
|
||||||
|
|
||||||
|
if (agentid) {
|
||||||
const {
|
const {
|
||||||
data: { agent },
|
data: { agent },
|
||||||
} = await apolloClient.query<GetAgentQuery, GetAgentQueryVariables>({
|
} = await apolloClient.query({
|
||||||
query: queryGetAgent,
|
query: CRMTypes.GetAgentDocument,
|
||||||
variables: {
|
variables: {
|
||||||
agentid: lead.agentid,
|
agentid,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -60,19 +64,8 @@ function makeFillAgentFromLead(
|
|||||||
* записанную в поле Интереса "Агент" (lead.evo_agent_accountid → account),
|
* записанную в поле Интереса "Агент" (lead.evo_agent_accountid → account),
|
||||||
* иначе очищать поле калькулятора indAgent
|
* иначе очищать поле калькулятора indAgent
|
||||||
*/
|
*/
|
||||||
const QUERY_GET_AGENT_ACCOUNTID_FROM_LEAD = gql`
|
|
||||||
query GetAgentAccountIdFromLead($leadid: Uuid!) {
|
|
||||||
lead(leadid: $leadid) {
|
|
||||||
agentid: evo_agent_accountid
|
|
||||||
}
|
|
||||||
}
|
|
||||||
`;
|
|
||||||
|
|
||||||
export const fillIndAgent = makeFillAgentFromLead(
|
export const fillIndAgent = makeFillAgentFromLead('selectIndAgent', 'evo_agent_accountid');
|
||||||
'selectIndAgent',
|
|
||||||
QUERY_GET_AGENT_ACCOUNTID_FROM_LEAD,
|
|
||||||
QUERY_GET_AGENT
|
|
||||||
);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Если lead содержит данные,
|
* Если lead содержит данные,
|
||||||
@ -81,18 +74,9 @@ export const fillIndAgent = makeFillAgentFromLead(
|
|||||||
* иначе очищать поле калькулятора calcDoubleAgent
|
* иначе очищать поле калькулятора calcDoubleAgent
|
||||||
*/
|
*/
|
||||||
|
|
||||||
const QUERY_GET_DOUBLE_AGENT_ACCOUNTID = gql`
|
|
||||||
query GetDoubleAgentAccountId($leadid: Uuid!) {
|
|
||||||
lead(leadid: $leadid) {
|
|
||||||
agentid: evo_double_agent_accountid
|
|
||||||
}
|
|
||||||
}
|
|
||||||
`;
|
|
||||||
|
|
||||||
export const fillCalcDoubleAgent = makeFillAgentFromLead(
|
export const fillCalcDoubleAgent = makeFillAgentFromLead(
|
||||||
'selectCalcDoubleAgent',
|
'selectCalcDoubleAgent',
|
||||||
QUERY_GET_DOUBLE_AGENT_ACCOUNTID,
|
'evo_double_agent_accountid'
|
||||||
QUERY_GET_AGENT
|
|
||||||
);
|
);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -101,19 +85,7 @@ export const fillCalcDoubleAgent = makeFillAgentFromLead(
|
|||||||
* иначе очищать поле калькулятора calcBroker
|
* иначе очищать поле калькулятора calcBroker
|
||||||
*/
|
*/
|
||||||
|
|
||||||
const QUERY_GET_BROKER_ACCOUNTID_FROM_LEAD = gql`
|
export const fillCalcBroker = makeFillAgentFromLead('selectCalcBroker', 'evo_broker_accountid');
|
||||||
query GetBrokerAccountId($leadid: Uuid!) {
|
|
||||||
lead(leadid: $leadid) {
|
|
||||||
agentid: evo_broker_accountid
|
|
||||||
}
|
|
||||||
}
|
|
||||||
`;
|
|
||||||
|
|
||||||
export const fillCalcBroker = makeFillAgentFromLead(
|
|
||||||
'selectCalcBroker',
|
|
||||||
QUERY_GET_BROKER_ACCOUNTID_FROM_LEAD,
|
|
||||||
QUERY_GET_AGENT
|
|
||||||
);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* если lead содержит данные, то calcFinDepartment заполняется ссылкой
|
* если lead содержит данные, то calcFinDepartment заполняется ссылкой
|
||||||
@ -122,16 +94,7 @@ export const fillCalcBroker = makeFillAgentFromLead(
|
|||||||
* иначе очищать поле калькулятора calcFinDepartment
|
* иначе очищать поле калькулятора calcFinDepartment
|
||||||
*/
|
*/
|
||||||
|
|
||||||
const QUERY_GET_FIN_DEPARTMENT_ACCOUNTID = gql`
|
|
||||||
query GetFinDepartmentAccountId($leadid: Uuid!) {
|
|
||||||
lead(leadid: $leadid) {
|
|
||||||
agentid: evo_fin_department_accountid
|
|
||||||
}
|
|
||||||
}
|
|
||||||
`;
|
|
||||||
|
|
||||||
export const fillFinDepartment = makeFillAgentFromLead(
|
export const fillFinDepartment = makeFillAgentFromLead(
|
||||||
'selectCalcFinDepartment',
|
'selectCalcFinDepartment',
|
||||||
QUERY_GET_FIN_DEPARTMENT_ACCOUNTID,
|
'evo_fin_department_accountid'
|
||||||
QUERY_GET_AGENT
|
|
||||||
);
|
);
|
||||||
|
|||||||
@ -1,18 +0,0 @@
|
|||||||
import { gql } from '@apollo/client';
|
|
||||||
|
|
||||||
export const QUERY_GET_AGENT = gql`
|
|
||||||
query GetAgent($agentid: Uuid!) {
|
|
||||||
agent: account(accountid: $agentid) {
|
|
||||||
label: name
|
|
||||||
value: accountid
|
|
||||||
}
|
|
||||||
}
|
|
||||||
`;
|
|
||||||
|
|
||||||
export const QUERY_GET_DEALER_RETURN_LEASING = gql`
|
|
||||||
query GetDealerReturnLeasing($dealerId: Uuid!) {
|
|
||||||
dealer: account(accountid: $dealerId) {
|
|
||||||
evo_return_leasing_dealer
|
|
||||||
}
|
|
||||||
}
|
|
||||||
`;
|
|
||||||
@ -1,14 +1,17 @@
|
|||||||
/* eslint-disable @typescript-eslint/naming-convention */
|
/* eslint-disable @typescript-eslint/naming-convention */
|
||||||
import { gql } from '@apollo/client';
|
|
||||||
import dayjs from 'dayjs';
|
import dayjs from 'dayjs';
|
||||||
import utc from 'dayjs/plugin/utc';
|
import utc from 'dayjs/plugin/utc';
|
||||||
import type * as CRMTypes from 'graphql/crm.types';
|
import * as CRMTypes from 'graphql/crm.types';
|
||||||
import { autorun, reaction } from 'mobx';
|
import { autorun, reaction } from 'mobx';
|
||||||
import type { ReactionsContext } from 'process/types';
|
import type { ReactionsContext } from 'process/types';
|
||||||
import { makeDisposable } from 'tools/mobx';
|
import { makeDisposable } from 'tools/mobx';
|
||||||
import * as createReactions from '../lib/create-reactions';
|
import * as createReactions from '../lib/create-reactions';
|
||||||
import * as fillAgentsFromLead from '../lib/fill-agents-from-lead';
|
import * as fillAgentsFromLead from '../lib/fill-agents-from-lead';
|
||||||
|
|
||||||
|
const { fillIndAgent, fillCalcBroker, fillCalcDoubleAgent, fillFinDepartment } = fillAgentsFromLead;
|
||||||
|
const { fillAgentRewardReaction, fillAgentRewardSummReaction, validateAgentRewardSumm } =
|
||||||
|
createReactions;
|
||||||
|
|
||||||
dayjs.extend(utc);
|
dayjs.extend(utc);
|
||||||
|
|
||||||
export function fillReactions({ store, apolloClient }: ReactionsContext) {
|
export function fillReactions({ store, apolloClient }: ReactionsContext) {
|
||||||
@ -22,10 +25,10 @@ export function fillReactions({ store, apolloClient }: ReactionsContext) {
|
|||||||
reaction(
|
reaction(
|
||||||
() => $calculation.element('selectLead').getValue(),
|
() => $calculation.element('selectLead').getValue(),
|
||||||
(leadid) => {
|
(leadid) => {
|
||||||
fillAgentsFromLead.fillIndAgent(store, apolloClient, leadid);
|
fillIndAgent(store, apolloClient, leadid);
|
||||||
fillAgentsFromLead.fillCalcDoubleAgent(store, apolloClient, leadid);
|
fillCalcDoubleAgent(store, apolloClient, leadid);
|
||||||
fillAgentsFromLead.fillCalcBroker(store, apolloClient, leadid);
|
fillCalcBroker(store, apolloClient, leadid);
|
||||||
fillAgentsFromLead.fillFinDepartment(store, apolloClient, leadid);
|
fillFinDepartment(store, apolloClient, leadid);
|
||||||
}
|
}
|
||||||
),
|
),
|
||||||
() => $process.has('LoadKP')
|
() => $process.has('LoadKP')
|
||||||
@ -35,13 +38,13 @@ export function fillReactions({ store, apolloClient }: ReactionsContext) {
|
|||||||
* IndAgent
|
* IndAgent
|
||||||
*/
|
*/
|
||||||
// Заполняем selectIndAgentRewardCondition
|
// Заполняем selectIndAgentRewardCondition
|
||||||
createReactions.fillAgentRewardReaction(store, apolloClient, {
|
fillAgentRewardReaction(store, apolloClient, {
|
||||||
agentField: 'selectIndAgent',
|
agentField: 'selectIndAgent',
|
||||||
rewardConditionField: 'selectIndAgentRewardCondition',
|
rewardConditionField: 'selectIndAgentRewardCondition',
|
||||||
});
|
});
|
||||||
|
|
||||||
// Заполняем tbxIndAgentRewardSumm
|
// Заполняем tbxIndAgentRewardSumm
|
||||||
createReactions.fillAgentRewardSummReaction(store, apolloClient, {
|
fillAgentRewardSummReaction(store, apolloClient, {
|
||||||
rewardConditionField: 'selectIndAgentRewardCondition',
|
rewardConditionField: 'selectIndAgentRewardCondition',
|
||||||
rewardSummField: 'tbxIndAgentRewardSumm',
|
rewardSummField: 'tbxIndAgentRewardSumm',
|
||||||
});
|
});
|
||||||
@ -50,13 +53,13 @@ export function fillReactions({ store, apolloClient }: ReactionsContext) {
|
|||||||
* CalcDoubleAgent
|
* CalcDoubleAgent
|
||||||
*/
|
*/
|
||||||
// Заполняем selectCalcDoubleAgentRewardCondition
|
// Заполняем selectCalcDoubleAgentRewardCondition
|
||||||
createReactions.fillAgentRewardReaction(store, apolloClient, {
|
fillAgentRewardReaction(store, apolloClient, {
|
||||||
agentField: 'selectCalcDoubleAgent',
|
agentField: 'selectCalcDoubleAgent',
|
||||||
rewardConditionField: 'selectCalcDoubleAgentRewardCondition',
|
rewardConditionField: 'selectCalcDoubleAgentRewardCondition',
|
||||||
});
|
});
|
||||||
|
|
||||||
// Заполняем tbxCalcDoubleAgentRewardSumm
|
// Заполняем tbxCalcDoubleAgentRewardSumm
|
||||||
createReactions.fillAgentRewardSummReaction(store, apolloClient, {
|
fillAgentRewardSummReaction(store, apolloClient, {
|
||||||
rewardConditionField: 'selectCalcDoubleAgentRewardCondition',
|
rewardConditionField: 'selectCalcDoubleAgentRewardCondition',
|
||||||
rewardSummField: 'tbxCalcDoubleAgentRewardSumm',
|
rewardSummField: 'tbxCalcDoubleAgentRewardSumm',
|
||||||
});
|
});
|
||||||
@ -65,13 +68,13 @@ export function fillReactions({ store, apolloClient }: ReactionsContext) {
|
|||||||
* CalcBroker
|
* CalcBroker
|
||||||
*/
|
*/
|
||||||
// Заполняем selectCalcBrokerRewardCondition
|
// Заполняем selectCalcBrokerRewardCondition
|
||||||
createReactions.fillAgentRewardReaction(store, apolloClient, {
|
fillAgentRewardReaction(store, apolloClient, {
|
||||||
agentField: 'selectCalcBroker',
|
agentField: 'selectCalcBroker',
|
||||||
rewardConditionField: 'selectCalcBrokerRewardCondition',
|
rewardConditionField: 'selectCalcBrokerRewardCondition',
|
||||||
});
|
});
|
||||||
|
|
||||||
// Заполняем tbxCalcBrokerRewardSum
|
// Заполняем tbxCalcBrokerRewardSum
|
||||||
createReactions.fillAgentRewardSummReaction(store, apolloClient, {
|
fillAgentRewardSummReaction(store, apolloClient, {
|
||||||
rewardConditionField: 'selectCalcBrokerRewardCondition',
|
rewardConditionField: 'selectCalcBrokerRewardCondition',
|
||||||
rewardSummField: 'tbxCalcBrokerRewardSum',
|
rewardSummField: 'tbxCalcBrokerRewardSum',
|
||||||
});
|
});
|
||||||
@ -80,13 +83,13 @@ export function fillReactions({ store, apolloClient }: ReactionsContext) {
|
|||||||
* CalcFinDepartment
|
* CalcFinDepartment
|
||||||
*/
|
*/
|
||||||
// Заполняем selectFinDepartmentRewardCondtion
|
// Заполняем selectFinDepartmentRewardCondtion
|
||||||
createReactions.fillAgentRewardReaction(store, apolloClient, {
|
fillAgentRewardReaction(store, apolloClient, {
|
||||||
agentField: 'selectCalcFinDepartment',
|
agentField: 'selectCalcFinDepartment',
|
||||||
rewardConditionField: 'selectFinDepartmentRewardCondtion',
|
rewardConditionField: 'selectFinDepartmentRewardCondtion',
|
||||||
});
|
});
|
||||||
|
|
||||||
// Заполняем tbxCalcBrokerRewardSum
|
// Заполняем tbxCalcBrokerRewardSum
|
||||||
createReactions.fillAgentRewardSummReaction(store, apolloClient, {
|
fillAgentRewardSummReaction(store, apolloClient, {
|
||||||
rewardConditionField: 'selectFinDepartmentRewardCondtion',
|
rewardConditionField: 'selectFinDepartmentRewardCondtion',
|
||||||
rewardSummField: 'tbxFinDepartmentRewardSumm',
|
rewardSummField: 'tbxFinDepartmentRewardSumm',
|
||||||
});
|
});
|
||||||
@ -109,16 +112,6 @@ class Helper {
|
|||||||
export function commonReactions({ store, apolloClient }: ReactionsContext) {
|
export function commonReactions({ store, apolloClient }: ReactionsContext) {
|
||||||
const { $calculation } = store;
|
const { $calculation } = store;
|
||||||
|
|
||||||
const QUERY_GET_REWARD_WITHOUT_OTHER_AGENT = gql`
|
|
||||||
query GetRewardWithoutOtherAgent($conditionId: Uuid!) {
|
|
||||||
evo_reward_condition(evo_reward_conditionid: $conditionId) {
|
|
||||||
evo_agency_agreementidData {
|
|
||||||
evo_reward_without_other_agent
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
`;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Добавить реакцию на изменение списка в поле selectDealerRewardCondition :
|
* Добавить реакцию на изменение списка в поле selectDealerRewardCondition :
|
||||||
Если в списке selectDealerRewardCondition есть запись,
|
Если в списке selectDealerRewardCondition есть запись,
|
||||||
@ -140,10 +133,10 @@ export function commonReactions({ store, apolloClient }: ReactionsContext) {
|
|||||||
async (rewardConditionId) => {
|
async (rewardConditionId) => {
|
||||||
function fillAgents() {
|
function fillAgents() {
|
||||||
const leadid = $calculation.element('selectLead').getValue();
|
const leadid = $calculation.element('selectLead').getValue();
|
||||||
fillAgentsFromLead.fillIndAgent(store, apolloClient, leadid);
|
fillIndAgent(store, apolloClient, leadid);
|
||||||
fillAgentsFromLead.fillCalcDoubleAgent(store, apolloClient, leadid);
|
fillCalcDoubleAgent(store, apolloClient, leadid);
|
||||||
fillAgentsFromLead.fillCalcBroker(store, apolloClient, leadid);
|
fillCalcBroker(store, apolloClient, leadid);
|
||||||
fillAgentsFromLead.fillFinDepartment(store, apolloClient, leadid);
|
fillFinDepartment(store, apolloClient, leadid);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!rewardConditionId) {
|
if (!rewardConditionId) {
|
||||||
@ -157,11 +150,8 @@ export function commonReactions({ store, apolloClient }: ReactionsContext) {
|
|||||||
|
|
||||||
const {
|
const {
|
||||||
data: { evo_reward_condition },
|
data: { evo_reward_condition },
|
||||||
} = await apolloClient.query<
|
} = await apolloClient.query({
|
||||||
CRMTypes.GetRewardWithoutOtherAgentQuery,
|
query: CRMTypes.GetRewardConditionDocument,
|
||||||
CRMTypes.GetRewardWithoutOtherAgentQueryVariables
|
|
||||||
>({
|
|
||||||
query: QUERY_GET_REWARD_WITHOUT_OTHER_AGENT,
|
|
||||||
variables: {
|
variables: {
|
||||||
conditionId: rewardConditionId,
|
conditionId: rewardConditionId,
|
||||||
},
|
},
|
||||||
@ -212,10 +202,10 @@ export function commonReactions({ store, apolloClient }: ReactionsContext) {
|
|||||||
async (rewardConditionId) => {
|
async (rewardConditionId) => {
|
||||||
function fillAgents() {
|
function fillAgents() {
|
||||||
const leadid = $calculation.element('selectLead').getValue();
|
const leadid = $calculation.element('selectLead').getValue();
|
||||||
fillAgentsFromLead.fillIndAgent(store, apolloClient, leadid);
|
fillIndAgent(store, apolloClient, leadid);
|
||||||
fillAgentsFromLead.fillCalcDoubleAgent(store, apolloClient, leadid);
|
fillCalcDoubleAgent(store, apolloClient, leadid);
|
||||||
fillAgentsFromLead.fillCalcBroker(store, apolloClient, leadid);
|
fillCalcBroker(store, apolloClient, leadid);
|
||||||
fillAgentsFromLead.fillFinDepartment(store, apolloClient, leadid);
|
fillFinDepartment(store, apolloClient, leadid);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!rewardConditionId) {
|
if (!rewardConditionId) {
|
||||||
@ -229,11 +219,8 @@ export function commonReactions({ store, apolloClient }: ReactionsContext) {
|
|||||||
|
|
||||||
const {
|
const {
|
||||||
data: { evo_reward_condition },
|
data: { evo_reward_condition },
|
||||||
} = await apolloClient.query<
|
} = await apolloClient.query({
|
||||||
CRMTypes.GetRewardWithoutOtherAgentQuery,
|
query: CRMTypes.GetRewardConditionDocument,
|
||||||
CRMTypes.GetRewardWithoutOtherAgentQueryVariables
|
|
||||||
>({
|
|
||||||
query: QUERY_GET_REWARD_WITHOUT_OTHER_AGENT,
|
|
||||||
variables: {
|
variables: {
|
||||||
conditionId: rewardConditionId,
|
conditionId: rewardConditionId,
|
||||||
},
|
},
|
||||||
@ -285,9 +272,9 @@ export function commonReactions({ store, apolloClient }: ReactionsContext) {
|
|||||||
async (rewardConditionId) => {
|
async (rewardConditionId) => {
|
||||||
function fillAgents() {
|
function fillAgents() {
|
||||||
const leadid = $calculation.element('selectLead').getValue();
|
const leadid = $calculation.element('selectLead').getValue();
|
||||||
fillAgentsFromLead.fillCalcDoubleAgent(store, apolloClient, leadid);
|
fillCalcDoubleAgent(store, apolloClient, leadid);
|
||||||
fillAgentsFromLead.fillCalcBroker(store, apolloClient, leadid);
|
fillCalcBroker(store, apolloClient, leadid);
|
||||||
fillAgentsFromLead.fillFinDepartment(store, apolloClient, leadid);
|
fillFinDepartment(store, apolloClient, leadid);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!rewardConditionId) {
|
if (!rewardConditionId) {
|
||||||
@ -301,11 +288,8 @@ export function commonReactions({ store, apolloClient }: ReactionsContext) {
|
|||||||
|
|
||||||
const {
|
const {
|
||||||
data: { evo_reward_condition },
|
data: { evo_reward_condition },
|
||||||
} = await apolloClient.query<
|
} = await apolloClient.query({
|
||||||
CRMTypes.GetRewardWithoutOtherAgentQuery,
|
query: CRMTypes.GetRewardConditionDocument,
|
||||||
CRMTypes.GetRewardWithoutOtherAgentQueryVariables
|
|
||||||
>({
|
|
||||||
query: QUERY_GET_REWARD_WITHOUT_OTHER_AGENT,
|
|
||||||
variables: {
|
variables: {
|
||||||
conditionId: rewardConditionId,
|
conditionId: rewardConditionId,
|
||||||
},
|
},
|
||||||
@ -358,9 +342,9 @@ export function commonReactions({ store, apolloClient }: ReactionsContext) {
|
|||||||
async (rewardConditionId) => {
|
async (rewardConditionId) => {
|
||||||
function fillAgents() {
|
function fillAgents() {
|
||||||
const leadid = $calculation.element('selectLead').getValue();
|
const leadid = $calculation.element('selectLead').getValue();
|
||||||
fillAgentsFromLead.fillIndAgent(store, apolloClient, leadid);
|
fillIndAgent(store, apolloClient, leadid);
|
||||||
fillAgentsFromLead.fillCalcBroker(store, apolloClient, leadid);
|
fillCalcBroker(store, apolloClient, leadid);
|
||||||
fillAgentsFromLead.fillFinDepartment(store, apolloClient, leadid);
|
fillFinDepartment(store, apolloClient, leadid);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!rewardConditionId) {
|
if (!rewardConditionId) {
|
||||||
@ -374,11 +358,8 @@ export function commonReactions({ store, apolloClient }: ReactionsContext) {
|
|||||||
|
|
||||||
const {
|
const {
|
||||||
data: { evo_reward_condition },
|
data: { evo_reward_condition },
|
||||||
} = await apolloClient.query<
|
} = await apolloClient.query({
|
||||||
CRMTypes.GetRewardWithoutOtherAgentQuery,
|
query: CRMTypes.GetRewardConditionDocument,
|
||||||
CRMTypes.GetRewardWithoutOtherAgentQueryVariables
|
|
||||||
>({
|
|
||||||
query: QUERY_GET_REWARD_WITHOUT_OTHER_AGENT,
|
|
||||||
variables: {
|
variables: {
|
||||||
conditionId: rewardConditionId,
|
conditionId: rewardConditionId,
|
||||||
},
|
},
|
||||||
@ -431,9 +412,9 @@ export function commonReactions({ store, apolloClient }: ReactionsContext) {
|
|||||||
async (rewardConditionId) => {
|
async (rewardConditionId) => {
|
||||||
function fillAgents() {
|
function fillAgents() {
|
||||||
const leadid = $calculation.element('selectLead').getValue();
|
const leadid = $calculation.element('selectLead').getValue();
|
||||||
fillAgentsFromLead.fillIndAgent(store, apolloClient, leadid);
|
fillIndAgent(store, apolloClient, leadid);
|
||||||
fillAgentsFromLead.fillCalcDoubleAgent(store, apolloClient, leadid);
|
fillCalcDoubleAgent(store, apolloClient, leadid);
|
||||||
fillAgentsFromLead.fillFinDepartment(store, apolloClient, leadid);
|
fillFinDepartment(store, apolloClient, leadid);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!rewardConditionId) {
|
if (!rewardConditionId) {
|
||||||
@ -447,11 +428,8 @@ export function commonReactions({ store, apolloClient }: ReactionsContext) {
|
|||||||
|
|
||||||
const {
|
const {
|
||||||
data: { evo_reward_condition },
|
data: { evo_reward_condition },
|
||||||
} = await apolloClient.query<
|
} = await apolloClient.query({
|
||||||
CRMTypes.GetRewardWithoutOtherAgentQuery,
|
query: CRMTypes.GetRewardConditionDocument,
|
||||||
CRMTypes.GetRewardWithoutOtherAgentQueryVariables
|
|
||||||
>({
|
|
||||||
query: QUERY_GET_REWARD_WITHOUT_OTHER_AGENT,
|
|
||||||
variables: {
|
variables: {
|
||||||
conditionId: rewardConditionId,
|
conditionId: rewardConditionId,
|
||||||
},
|
},
|
||||||
@ -505,9 +483,9 @@ export function commonReactions({ store, apolloClient }: ReactionsContext) {
|
|||||||
async (rewardConditionId) => {
|
async (rewardConditionId) => {
|
||||||
function fillAgents() {
|
function fillAgents() {
|
||||||
const leadid = $calculation.element('selectLead').getValue();
|
const leadid = $calculation.element('selectLead').getValue();
|
||||||
fillAgentsFromLead.fillIndAgent(store, apolloClient, leadid);
|
fillIndAgent(store, apolloClient, leadid);
|
||||||
fillAgentsFromLead.fillCalcDoubleAgent(store, apolloClient, leadid);
|
fillCalcDoubleAgent(store, apolloClient, leadid);
|
||||||
fillAgentsFromLead.fillFinDepartment(store, apolloClient, leadid);
|
fillFinDepartment(store, apolloClient, leadid);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!rewardConditionId) {
|
if (!rewardConditionId) {
|
||||||
@ -520,11 +498,8 @@ export function commonReactions({ store, apolloClient }: ReactionsContext) {
|
|||||||
}
|
}
|
||||||
const {
|
const {
|
||||||
data: { evo_reward_condition },
|
data: { evo_reward_condition },
|
||||||
} = await apolloClient.query<
|
} = await apolloClient.query({
|
||||||
CRMTypes.GetRewardWithoutOtherAgentQuery,
|
query: CRMTypes.GetRewardConditionDocument,
|
||||||
CRMTypes.GetRewardWithoutOtherAgentQueryVariables
|
|
||||||
>({
|
|
||||||
query: QUERY_GET_REWARD_WITHOUT_OTHER_AGENT,
|
|
||||||
variables: {
|
variables: {
|
||||||
conditionId: rewardConditionId,
|
conditionId: rewardConditionId,
|
||||||
},
|
},
|
||||||
@ -553,22 +528,22 @@ export function commonReactions({ store, apolloClient }: ReactionsContext) {
|
|||||||
export function validationReactions({ store, apolloClient }: ReactionsContext) {
|
export function validationReactions({ store, apolloClient }: ReactionsContext) {
|
||||||
const { $calculation } = store;
|
const { $calculation } = store;
|
||||||
|
|
||||||
createReactions.validateAgentRewardSumm(store, apolloClient, {
|
validateAgentRewardSumm(store, apolloClient, {
|
||||||
rewardConditionField: 'selectIndAgentRewardCondition',
|
rewardConditionField: 'selectIndAgentRewardCondition',
|
||||||
rewardSummField: 'tbxIndAgentRewardSumm',
|
rewardSummField: 'tbxIndAgentRewardSumm',
|
||||||
});
|
});
|
||||||
|
|
||||||
createReactions.validateAgentRewardSumm(store, apolloClient, {
|
validateAgentRewardSumm(store, apolloClient, {
|
||||||
rewardConditionField: 'selectCalcDoubleAgentRewardCondition',
|
rewardConditionField: 'selectCalcDoubleAgentRewardCondition',
|
||||||
rewardSummField: 'tbxCalcDoubleAgentRewardSumm',
|
rewardSummField: 'tbxCalcDoubleAgentRewardSumm',
|
||||||
});
|
});
|
||||||
|
|
||||||
createReactions.validateAgentRewardSumm(store, apolloClient, {
|
validateAgentRewardSumm(store, apolloClient, {
|
||||||
rewardConditionField: 'selectCalcBrokerRewardCondition',
|
rewardConditionField: 'selectCalcBrokerRewardCondition',
|
||||||
rewardSummField: 'tbxCalcBrokerRewardSum',
|
rewardSummField: 'tbxCalcBrokerRewardSum',
|
||||||
});
|
});
|
||||||
|
|
||||||
createReactions.validateAgentRewardSumm(store, apolloClient, {
|
validateAgentRewardSumm(store, apolloClient, {
|
||||||
rewardConditionField: 'selectFinDepartmentRewardCondtion',
|
rewardConditionField: 'selectFinDepartmentRewardCondtion',
|
||||||
rewardSummField: 'tbxFinDepartmentRewardSumm',
|
rewardSummField: 'tbxFinDepartmentRewardSumm',
|
||||||
});
|
});
|
||||||
|
|||||||
@ -1,7 +1,6 @@
|
|||||||
import type * as CRMTypes from 'graphql/crm.types';
|
import * as CRMTypes from 'graphql/crm.types';
|
||||||
import { autorun, reaction } from 'mobx';
|
import { autorun, reaction } from 'mobx';
|
||||||
import type { ReactionsContext } from 'process/types';
|
import type { ReactionsContext } from 'process/types';
|
||||||
import * as query from '../lib/query';
|
|
||||||
|
|
||||||
export default function leasebackReactions({ store, apolloClient }: ReactionsContext) {
|
export default function leasebackReactions({ store, apolloClient }: ReactionsContext) {
|
||||||
const { $calculation, $tables } = store;
|
const { $calculation, $tables } = store;
|
||||||
@ -27,11 +26,8 @@ export default function leasebackReactions({ store, apolloClient }: ReactionsCon
|
|||||||
|
|
||||||
const {
|
const {
|
||||||
data: { dealer },
|
data: { dealer },
|
||||||
} = await apolloClient.query<
|
} = await apolloClient.query({
|
||||||
CRMTypes.GetDealerReturnLeasingQuery,
|
query: CRMTypes.GetDealerDocument,
|
||||||
CRMTypes.GetDealerReturnLeasingQueryVariables
|
|
||||||
>({
|
|
||||||
query: query.QUERY_GET_DEALER_RETURN_LEASING,
|
|
||||||
variables: {
|
variables: {
|
||||||
dealerId,
|
dealerId,
|
||||||
},
|
},
|
||||||
@ -61,11 +57,8 @@ export default function leasebackReactions({ store, apolloClient }: ReactionsCon
|
|||||||
if (dealerId) {
|
if (dealerId) {
|
||||||
const {
|
const {
|
||||||
data: { dealer },
|
data: { dealer },
|
||||||
} = await apolloClient.query<
|
} = await apolloClient.query({
|
||||||
CRMTypes.GetDealerReturnLeasingQuery,
|
query: CRMTypes.GetDealerDocument,
|
||||||
CRMTypes.GetDealerReturnLeasingQueryVariables
|
|
||||||
>({
|
|
||||||
query: query.QUERY_GET_DEALER_RETURN_LEASING,
|
|
||||||
variables: {
|
variables: {
|
||||||
dealerId,
|
dealerId,
|
||||||
},
|
},
|
||||||
@ -101,11 +94,8 @@ export default function leasebackReactions({ store, apolloClient }: ReactionsCon
|
|||||||
if (dealerId) {
|
if (dealerId) {
|
||||||
const {
|
const {
|
||||||
data: { dealer },
|
data: { dealer },
|
||||||
} = await apolloClient.query<
|
} = await apolloClient.query({
|
||||||
CRMTypes.GetDealerReturnLeasingQuery,
|
query: CRMTypes.GetDealerDocument,
|
||||||
CRMTypes.GetDealerReturnLeasingQueryVariables
|
|
||||||
>({
|
|
||||||
query: query.QUERY_GET_DEALER_RETURN_LEASING,
|
|
||||||
variables: {
|
variables: {
|
||||||
dealerId,
|
dealerId,
|
||||||
},
|
},
|
||||||
|
|||||||
@ -1,14 +1,12 @@
|
|||||||
/* eslint-disable @typescript-eslint/naming-convention */
|
/* eslint-disable @typescript-eslint/naming-convention */
|
||||||
import { gql } from '@apollo/client';
|
|
||||||
import dayjs from 'dayjs';
|
import dayjs from 'dayjs';
|
||||||
import utc from 'dayjs/plugin/utc';
|
import utc from 'dayjs/plugin/utc';
|
||||||
import type * as CRMTypes from 'graphql/crm.types';
|
import * as CRMTypes from 'graphql/crm.types';
|
||||||
import { reaction } from 'mobx';
|
import { reaction } from 'mobx';
|
||||||
import type { ReactionsContext } from 'process/types';
|
import type { ReactionsContext } from 'process/types';
|
||||||
import { sift } from 'radash';
|
import { sift } from 'radash';
|
||||||
import { normalizeOptions } from 'tools/entity';
|
import { normalizeOptions } from 'tools/entity';
|
||||||
import * as createReactions from '../lib/create-reactions';
|
import * as createReactions from '../lib/create-reactions';
|
||||||
import * as query from '../lib/query';
|
|
||||||
|
|
||||||
dayjs.extend(utc);
|
dayjs.extend(utc);
|
||||||
|
|
||||||
@ -22,17 +20,6 @@ export function commonReactions({ store, apolloClient }: ReactionsContext) {
|
|||||||
* И связаны с карточкой Контрагент из поля "Салон приобретения" по связи Салон-ЮЛ
|
* И связаны с карточкой Контрагент из поля "Салон приобретения" по связи Салон-ЮЛ
|
||||||
*/
|
*/
|
||||||
|
|
||||||
const QUERY_GET_DEALER_PERSON = gql`
|
|
||||||
query GetDealerPerson($dealerId: Uuid!) {
|
|
||||||
salon_providers(statecode: 0, salonaccountid: $dealerId) {
|
|
||||||
label: name
|
|
||||||
value: accountid
|
|
||||||
evo_inn
|
|
||||||
evo_kpp
|
|
||||||
}
|
|
||||||
}
|
|
||||||
`;
|
|
||||||
|
|
||||||
reaction(
|
reaction(
|
||||||
() => $calculation.element('selectDealer').getValue(),
|
() => $calculation.element('selectDealer').getValue(),
|
||||||
async (dealerId) => {
|
async (dealerId) => {
|
||||||
@ -44,11 +31,8 @@ export function commonReactions({ store, apolloClient }: ReactionsContext) {
|
|||||||
|
|
||||||
const {
|
const {
|
||||||
data: { dealer },
|
data: { dealer },
|
||||||
} = await apolloClient.query<
|
} = await apolloClient.query({
|
||||||
CRMTypes.GetDealerReturnLeasingQuery,
|
query: CRMTypes.GetDealerDocument,
|
||||||
CRMTypes.GetDealerReturnLeasingQueryVariables
|
|
||||||
>({
|
|
||||||
query: query.QUERY_GET_DEALER_RETURN_LEASING,
|
|
||||||
variables: {
|
variables: {
|
||||||
dealerId,
|
dealerId,
|
||||||
},
|
},
|
||||||
@ -59,28 +43,25 @@ export function commonReactions({ store, apolloClient }: ReactionsContext) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const {
|
const {
|
||||||
data: { salon_providers },
|
data: { dealerPersons },
|
||||||
} = await apolloClient.query<
|
} = await apolloClient.query({
|
||||||
CRMTypes.GetDealerPersonQuery,
|
query: CRMTypes.GetDealerPersonsDocument,
|
||||||
CRMTypes.GetDealerPersonQueryVariables
|
|
||||||
>({
|
|
||||||
query: QUERY_GET_DEALER_PERSON,
|
|
||||||
variables: {
|
variables: {
|
||||||
dealerId,
|
dealerId,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
if (salon_providers && salon_providers.length > 0) {
|
if (dealerPersons && dealerPersons.length > 0) {
|
||||||
$calculation.element('selectDealerPerson').setOptions(
|
$calculation.element('selectDealerPerson').setOptions(
|
||||||
normalizeOptions(
|
normalizeOptions(
|
||||||
salon_providers.map((dp) => ({
|
dealerPersons.map((dp) => ({
|
||||||
...dp,
|
...dp,
|
||||||
label: `${dp?.label} ${sift([dp?.evo_inn, dp?.evo_kpp]).join(' | ')}`,
|
label: `${dp?.label} ${sift([dp?.evo_inn, dp?.evo_kpp]).join(' | ')}`,
|
||||||
}))
|
}))
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
const value = salon_providers.at(0)?.value;
|
const value = dealerPersons.at(0)?.value;
|
||||||
if (!$process.has('LoadKP') && value) {
|
if (!$process.has('LoadKP') && value) {
|
||||||
$calculation.element('selectDealerPerson').setValue(value);
|
$calculation.element('selectDealerPerson').setValue(value);
|
||||||
}
|
}
|
||||||
@ -94,14 +75,6 @@ export function commonReactions({ store, apolloClient }: ReactionsContext) {
|
|||||||
* Заполняем selectDealerBroker
|
* Заполняем selectDealerBroker
|
||||||
*/
|
*/
|
||||||
|
|
||||||
const QUERY_GET_BROKER_ACCOUNTID_FROM_DEALER = gql`
|
|
||||||
query GetBrokerAccountIdFromDealer($dealerId: Uuid!) {
|
|
||||||
dealer: account(accountid: $dealerId) {
|
|
||||||
evo_broker_accountid
|
|
||||||
}
|
|
||||||
}
|
|
||||||
`;
|
|
||||||
|
|
||||||
reaction(
|
reaction(
|
||||||
() => $calculation.element('selectDealerPerson').getValue(),
|
() => $calculation.element('selectDealerPerson').getValue(),
|
||||||
async (dealerPersonId) => {
|
async (dealerPersonId) => {
|
||||||
@ -113,11 +86,8 @@ export function commonReactions({ store, apolloClient }: ReactionsContext) {
|
|||||||
|
|
||||||
const {
|
const {
|
||||||
data: { dealer },
|
data: { dealer },
|
||||||
} = await apolloClient.query<
|
} = await apolloClient.query({
|
||||||
CRMTypes.GetBrokerAccountIdFromDealerQuery,
|
query: CRMTypes.GetDealerDocument,
|
||||||
CRMTypes.GetBrokerAccountIdFromDealerQueryVariables
|
|
||||||
>({
|
|
||||||
query: QUERY_GET_BROKER_ACCOUNTID_FROM_DEALER,
|
|
||||||
variables: {
|
variables: {
|
||||||
dealerId: dealerPersonId,
|
dealerId: dealerPersonId,
|
||||||
},
|
},
|
||||||
@ -127,7 +97,7 @@ export function commonReactions({ store, apolloClient }: ReactionsContext) {
|
|||||||
const {
|
const {
|
||||||
data: { agent: dealerBroker },
|
data: { agent: dealerBroker },
|
||||||
} = await apolloClient.query<CRMTypes.GetAgentQuery, CRMTypes.GetAgentQueryVariables>({
|
} = await apolloClient.query<CRMTypes.GetAgentQuery, CRMTypes.GetAgentQueryVariables>({
|
||||||
query: query.QUERY_GET_AGENT,
|
query: CRMTypes.GetAgentDocument,
|
||||||
variables: {
|
variables: {
|
||||||
agentid: dealer?.evo_broker_accountid,
|
agentid: dealer?.evo_broker_accountid,
|
||||||
},
|
},
|
||||||
|
|||||||
@ -82,6 +82,8 @@ export default class CalculationStore {
|
|||||||
return this.$options.getOptions(elementName)?.find((x) => x.value === value);
|
return this.$options.getOptions(elementName)?.find((x) => x.value === value);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
getOptions: () => this.$options.getOptions(elementName),
|
||||||
|
|
||||||
setOptions: (options: BaseOption<Values.ElementsTypes[E]>[]) => {
|
setOptions: (options: BaseOption<Values.ElementsTypes[E]>[]) => {
|
||||||
this.$options.setOptions(elementName, options);
|
this.$options.setOptions(elementName, options);
|
||||||
|
|
||||||
@ -94,12 +96,12 @@ export default class CalculationStore {
|
|||||||
return this.element(elementName);
|
return this.element(elementName);
|
||||||
},
|
},
|
||||||
|
|
||||||
validate: ({ invalid, message }: ValidationParams) => {
|
validate: ({ invalid, message, silent }: ValidationParams) => {
|
||||||
if (!this.$validation[elementName]) this.createElementValidation(elementName);
|
if (!this.$validation[elementName]) this.createElementValidation(elementName);
|
||||||
|
|
||||||
let removeError: RemoveError | undefined;
|
let removeError: RemoveError | undefined;
|
||||||
if (invalid) {
|
if (invalid) {
|
||||||
removeError = this.$validation[elementName]?.addError(message);
|
removeError = this.$validation[elementName]?.addError(message, silent);
|
||||||
} else {
|
} else {
|
||||||
this.$validation[elementName]?.removeError(message);
|
this.$validation[elementName]?.removeError(message);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -26,19 +26,6 @@ export default class OptionsStore {
|
|||||||
return options;
|
return options;
|
||||||
}
|
}
|
||||||
|
|
||||||
private checkValueInOptions = (elementName: Elements) => {
|
|
||||||
/**
|
|
||||||
* Проверяем, что значение есть в новом списке, иначе сбрасываем значение
|
|
||||||
*/
|
|
||||||
const value = this.root.$calculation.element(elementName).getValue();
|
|
||||||
if (
|
|
||||||
!this.options[elementName]?.length ||
|
|
||||||
!this.options[elementName].some((x) => x.value === value)
|
|
||||||
) {
|
|
||||||
this.root.$calculation.element(elementName).resetValue();
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
setOptions = <T extends Elements>(elementName: T, options: BaseOption<ElementsTypes[T]>[]) => {
|
setOptions = <T extends Elements>(elementName: T, options: BaseOption<ElementsTypes[T]>[]) => {
|
||||||
/**
|
/**
|
||||||
* TODO: use T instead of any in BaseOption type
|
* TODO: use T instead of any in BaseOption type
|
||||||
@ -46,8 +33,6 @@ export default class OptionsStore {
|
|||||||
* but infer works just perfect
|
* but infer works just perfect
|
||||||
*/
|
*/
|
||||||
this.options[elementName] = options as BaseOption<any>[];
|
this.options[elementName] = options as BaseOption<any>[];
|
||||||
|
|
||||||
this.checkValueInOptions(elementName);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
resetOptions = <T extends Elements>(elementName: T) => {
|
resetOptions = <T extends Elements>(elementName: T) => {
|
||||||
|
|||||||
@ -1,7 +1,6 @@
|
|||||||
/* eslint-disable object-curly-newline */
|
/* eslint-disable object-curly-newline */
|
||||||
import defaultValues from 'config/default-values';
|
import defaultValues from 'config/default-values';
|
||||||
import { makeAutoObservable } from 'mobx';
|
import { makeAutoObservable } from 'mobx';
|
||||||
import { pick } from 'radash';
|
|
||||||
import type RootStore from '../../root';
|
import type RootStore from '../../root';
|
||||||
import type { CalculationValues, Values } from './types';
|
import type { CalculationValues, Values } from './types';
|
||||||
|
|
||||||
@ -18,11 +17,10 @@ export default class ValuesStore {
|
|||||||
this.values = initialValues;
|
this.values = initialValues;
|
||||||
};
|
};
|
||||||
|
|
||||||
setValues = (params: { values: CalculationValues; exclude: Values[] }) => {
|
setValues = (params: { values: CalculationValues }) => {
|
||||||
const { values, exclude } = params;
|
const { values } = params;
|
||||||
|
|
||||||
const savedValues = pick(this.values, exclude);
|
this.values = values;
|
||||||
this.values = { ...values, ...savedValues };
|
|
||||||
};
|
};
|
||||||
|
|
||||||
getValue<V extends Values>(valueName: V) {
|
getValue<V extends Values>(valueName: V) {
|
||||||
|
|||||||
@ -63,7 +63,7 @@ export default class InsuranceTable {
|
|||||||
|
|
||||||
getStatus: (valueName: Insurance.Values) => this.statuses[key][valueName],
|
getStatus: (valueName: Insurance.Values) => this.statuses[key][valueName],
|
||||||
|
|
||||||
getOptions: (valueName: Insurance.Values) => this.options[key][valueName],
|
getOptions: <V extends Insurance.Values>(valueName: V) => this.options[key][valueName],
|
||||||
|
|
||||||
setValue: <V extends Insurance.Values>(valueName: V, value: Insurance.RowValues[V]) => {
|
setValue: <V extends Insurance.Values>(valueName: V, value: Insurance.RowValues[V]) => {
|
||||||
const rowIndex = this.values.findIndex((x) => x.key === key);
|
const rowIndex = this.values.findIndex((x) => x.key === key);
|
||||||
|
|||||||
@ -25,14 +25,16 @@ export default class Validation {
|
|||||||
if (this.messages.size === 0) notification.close(this.params.err_key);
|
if (this.messages.size === 0) notification.close(this.params.err_key);
|
||||||
};
|
};
|
||||||
|
|
||||||
addError = (message: string) => {
|
addError = (message: string, silent?: boolean) => {
|
||||||
this.messages.add(message);
|
this.messages.add(message);
|
||||||
|
|
||||||
notification.error({
|
if (!silent) {
|
||||||
key: this.params.err_key,
|
notification.error({
|
||||||
message: this.params.err_title,
|
key: this.params.err_key,
|
||||||
description: message,
|
message: this.params.err_title,
|
||||||
});
|
description: message,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
return () => this.removeError(message);
|
return () => this.removeError(message);
|
||||||
};
|
};
|
||||||
|
|||||||
@ -6,6 +6,7 @@ export type ValidationConfig = {
|
|||||||
export type ValidationParams = {
|
export type ValidationParams = {
|
||||||
invalid: boolean;
|
invalid: boolean;
|
||||||
message: string;
|
message: string;
|
||||||
|
silent?: boolean;
|
||||||
};
|
};
|
||||||
|
|
||||||
export type RemoveError = () => void;
|
export type RemoveError = () => void;
|
||||||
|
|||||||
@ -1,8 +1,11 @@
|
|||||||
import defaultValues from 'config/default-values';
|
import defaultValues from 'config/default-values';
|
||||||
import { defaultValues as defaultInsuranceValues } from 'config/tables/insurance-table';
|
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 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 { GetQuoteDataInputSchema, GetQuoteDataOutputSchema } from 'process/load-kp/types';
|
||||||
import getPaymentsDataFromKP from 'process/payments/get-kp-data';
|
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';
|
import getSupplierAgentsDataFromKP from 'process/supplier-agent/get-kp-values';
|
||||||
import { t } from '../server';
|
import { t } from '../server';
|
||||||
|
|
||||||
@ -14,15 +17,21 @@ const quoteRouter = t.router({
|
|||||||
.input(GetQuoteDataInputSchema)
|
.input(GetQuoteDataInputSchema)
|
||||||
.output(GetQuoteDataOutputSchema)
|
.output(GetQuoteDataOutputSchema)
|
||||||
.query(async ({ input }) => {
|
.query(async ({ input }) => {
|
||||||
|
const { values: configuratorValues } = await getConfiguratorDataFromKP(input);
|
||||||
const { values: supplierAgentsValues } = await getSupplierAgentsDataFromKP(input);
|
const { values: supplierAgentsValues } = await getSupplierAgentsDataFromKP(input);
|
||||||
const { values: paymentsValues, payments } = await getPaymentsDataFromKP(input);
|
const { values: paymentsValues, payments } = await getPaymentsDataFromKP(input);
|
||||||
|
const { values: priceValues } = await getPriceDataFromKP(input);
|
||||||
|
const { values: leasingObjectValues } = await getLeasingObjectDataFromKP(input);
|
||||||
const { fingap, insurance: fingapInsurance } = await getFingapDataFromKP(input);
|
const { fingap, insurance: fingapInsurance } = await getFingapDataFromKP(input);
|
||||||
|
|
||||||
return {
|
return {
|
||||||
values: {
|
values: {
|
||||||
...defaultValues,
|
...defaultValues,
|
||||||
|
...configuratorValues,
|
||||||
...supplierAgentsValues,
|
...supplierAgentsValues,
|
||||||
...paymentsValues,
|
...paymentsValues,
|
||||||
|
...priceValues,
|
||||||
|
...leasingObjectValues,
|
||||||
},
|
},
|
||||||
payments,
|
payments,
|
||||||
insurance: {
|
insurance: {
|
||||||
|
|||||||
@ -9,7 +9,7 @@
|
|||||||
"scripts": {
|
"scripts": {
|
||||||
"build": "dotenv -e .env turbo run build",
|
"build": "dotenv -e .env turbo run build",
|
||||||
"clean": "turbo run clean",
|
"clean": "turbo run clean",
|
||||||
"dev": "dotenv -e .env.local turbo run dev --parallel",
|
"dev": "dotenv -e .env.local turbo run dev",
|
||||||
"format": "prettier --write \"**/*.{js,jsx,ts,tsx}\"",
|
"format": "prettier --write \"**/*.{js,jsx,ts,tsx}\"",
|
||||||
"lint": "dotenv -e .env.local turbo run lint",
|
"lint": "dotenv -e .env.local turbo run lint",
|
||||||
"lint:fix": "dotenv -e .env.local turbo run lint:fix",
|
"lint:fix": "dotenv -e .env.local turbo run lint:fix",
|
||||||
@ -25,7 +25,7 @@
|
|||||||
"husky": "^8.0.3",
|
"husky": "^8.0.3",
|
||||||
"prettier": "^2.8.2",
|
"prettier": "^2.8.2",
|
||||||
"tools": "*",
|
"tools": "*",
|
||||||
"turbo": "latest"
|
"turbo": "^1.7.1"
|
||||||
},
|
},
|
||||||
"packageManager": "yarn@1.22.17",
|
"packageManager": "yarn@1.22.17",
|
||||||
"engines": {
|
"engines": {
|
||||||
|
|||||||
@ -3,5 +3,12 @@ import { isEmpty } from 'radash';
|
|||||||
import type { BaseOption } from 'ui/elements/types';
|
import type { BaseOption } from 'ui/elements/types';
|
||||||
|
|
||||||
export function normalizeOptions(options: any[] | null | undefined) {
|
export function normalizeOptions(options: any[] | null | undefined) {
|
||||||
return (isEmpty(options) ? [] : options) as BaseOption[];
|
if (isEmpty(options)) {
|
||||||
|
return [];
|
||||||
|
}
|
||||||
|
|
||||||
|
return options?.map(({ label, value }) => ({
|
||||||
|
label,
|
||||||
|
value,
|
||||||
|
})) as BaseOption[];
|
||||||
}
|
}
|
||||||
|
|||||||
@ -3,8 +3,7 @@
|
|||||||
"pipeline": {
|
"pipeline": {
|
||||||
"build": {
|
"build": {
|
||||||
"outputs": ["dist/**", ".next/**", "public/dist/**"],
|
"outputs": ["dist/**", ".next/**", "public/dist/**"],
|
||||||
"dependsOn": ["^build"],
|
"dependsOn": ["^build"]
|
||||||
"cache": false
|
|
||||||
},
|
},
|
||||||
"test": {
|
"test": {
|
||||||
"cache": false
|
"cache": false
|
||||||
@ -18,7 +17,8 @@
|
|||||||
"outputs": []
|
"outputs": []
|
||||||
},
|
},
|
||||||
"dev": {
|
"dev": {
|
||||||
"cache": false
|
"cache": false,
|
||||||
|
"persistent": true
|
||||||
},
|
},
|
||||||
"clean": {
|
"clean": {
|
||||||
"cache": false
|
"cache": false
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user