rate values changes

This commit is contained in:
vchikalkin 2021-06-21 11:39:30 +03:00
parent 1822213ad5
commit 9147c0fdc8
5 changed files with 22 additions and 8 deletions

View File

@ -250,8 +250,10 @@ const query = gql`
}
}
selectRate: evo_rates(
statecode: $statecode # evo_datefrom_param: { lte: $currentDate } # evo_dateto_param: { gte: $currentDate }
) {
statecode: $statecode
) # evo_datefrom_param: { lte: $currentDate }
# evo_dateto_param: { gte: $currentDate }
{
evo_id
evo_rateid
evo_name

View File

@ -63,6 +63,7 @@ const loadKpReaction: IReactionEffect = calculationStore => ({
INNForCalc,
regionRegistration,
creditRate,
rate,
infuranceOPF,
} = calculationStore.values;
@ -237,10 +238,6 @@ const loadKpReaction: IReactionEffect = calculationStore => ({
}),
);
const rate = calculationStore.getOption('selectRate', {
evo_rateid: quote.evo_rateid,
});
let clientRisk = quote.evo_client_riskid;
if (opportunity) {
const current_opportunity = calculationStore.getOption(
@ -291,7 +288,7 @@ const loadKpReaction: IReactionEffect = calculationStore => ({
...newValues,
product: base_product?.evo_id,
...addProducts,
rate: rate?.evo_id,
rate,
lead,
opportunity,
quote: quoteId,

View File

@ -1,4 +1,5 @@
import { openNotification } from 'client/Elements/Notification';
import valuesConstants from 'core/constants/values';
import { pipe } from 'core/tools/func';
import { IReactionEffect } from 'core/types/Calculation/Store/effect';
import { Process } from 'core/types/Calculation/Store/process';
@ -1754,6 +1755,18 @@ const reactionEffects: IReactionEffect[] = [
calculationStore.setValue('INNForCalc', inn);
},
}),
calculationStore => ({
expression: () => {
return calculationStore.getOption('selectRate');
},
effect: ({ evo_base_rate }) => {
calculationStore.setValue(
'creditRate',
evo_base_rate || valuesConstants.RATE,
);
},
}),
];
export default reactionEffects;

View File

@ -1,3 +1,4 @@
import valuesConstants from 'core/constants/values';
import { currentYear } from 'core/tools/date';
import { TValue, TValues } from 'core/types/Calculation/Store/values';
@ -71,7 +72,7 @@ const initialValues: TValues<TValue> = {
NSIB: true,
quoteContactGender: 100000000,
quoteRedemptionGraph: true,
creditRate: 7.75,
creditRate: valuesConstants.RATE,
requirementTelematic: 100000000,
maxPriceChange: 0,
importerRewardPerc: 0,

View File

@ -8,4 +8,5 @@ export default {
MAX_VEHICLE_MASS: 3500,
MAX_VEHICLE_SEATS: 20,
PERIODS_NUMBER: 12,
RATE: 7.75,
};