infuranceOPF value reaction
This commit is contained in:
parent
248809e8e9
commit
dccbce9adb
@ -1,4 +1,6 @@
|
||||
import { IReactionEffect } from 'core/types/Calculation/Store/effect';
|
||||
import { Process } from 'core/types/Calculation/Store/process';
|
||||
import { get } from 'lodash';
|
||||
|
||||
const mapObjectCategoryToUseFor = {
|
||||
100000000: [100000000, 100000002],
|
||||
@ -55,6 +57,30 @@ const insuranceReactions: IReactionEffect[] = [
|
||||
}
|
||||
},
|
||||
}),
|
||||
|
||||
(calculationStore, calculationProcess) => ({
|
||||
expression: () => {
|
||||
return calculationStore.getValue('INNForCalc');
|
||||
},
|
||||
effect: INNForCalc => {
|
||||
if (calculationProcess.hasProcess(Process.LoadKp)) {
|
||||
return;
|
||||
}
|
||||
|
||||
const mapINNForCalcToInfuranceOPF = {
|
||||
10: 100000000,
|
||||
12: 100000001,
|
||||
};
|
||||
|
||||
const OPFValue = get(
|
||||
mapINNForCalcToInfuranceOPF,
|
||||
INNForCalc ? INNForCalc.toString().length : 0,
|
||||
null,
|
||||
);
|
||||
|
||||
calculationStore.setValue('infuranceOPF', OPFValue);
|
||||
},
|
||||
}),
|
||||
];
|
||||
|
||||
export default insuranceReactions;
|
||||
|
||||
@ -63,6 +63,7 @@ const loadKpReaction: IReactionEffect = calculationStore => ({
|
||||
INNForCalc,
|
||||
regionRegistration,
|
||||
creditRate,
|
||||
infuranceOPF,
|
||||
} = calculationStore.values;
|
||||
|
||||
calculationStore.setStatus('selectQuote', ElementStatus.Disabled);
|
||||
@ -305,6 +306,7 @@ const loadKpReaction: IReactionEffect = calculationStore => ({
|
||||
INNForCalc,
|
||||
regionRegistration,
|
||||
creditRate,
|
||||
infuranceOPF,
|
||||
});
|
||||
|
||||
message.success({
|
||||
|
||||
Reference in New Issue
Block a user