merge release/dyn-605_tarif-adds-for-main-product

This commit is contained in:
Chika 2021-12-07 19:57:22 +03:00
parent 3cc8cf3d3c
commit c00d31fa21
3 changed files with 8 additions and 5 deletions

View File

@ -250,6 +250,7 @@ const query = gql`
evo_id
evo_leasingobject_typeid
}
evo_delivery_time
}
selectRate: evo_rates(
statecode: $statecode

View File

@ -1374,11 +1374,11 @@ const reactionEffects: IReactionEffect[] = [
calculationStore => ({
expression: () => {
const { product, leasingPeriod } = calculationStore.values;
return { product_evo_id: product, leasingPeriod };
const { product, leasingPeriod, deliveryTime } = calculationStore.values;
return { product_evo_id: product, leasingPeriod, deliveryTime };
},
effect: ({ product_evo_id, leasingPeriod }) => {
if (product_evo_id && leasingPeriod) {
effect: ({ product_evo_id, leasingPeriod, deliveryTime }) => {
if (product_evo_id && leasingPeriod && deliveryTime) {
const product = calculationStore.getOption('selectProduct', {
evo_id: product_evo_id,
});
@ -1389,7 +1389,8 @@ const reactionEffects: IReactionEffect[] = [
x.evo_min_period &&
x.evo_min_period <= leasingPeriod &&
x.evo_max_period &&
x.evo_max_period >= leasingPeriod,
x.evo_max_period >= leasingPeriod &&
x.evo_delivery_time?.includes(deliveryTime),
);
calculationStore.setValue('tarif', tarif?.evo_tarifid);
}

View File

@ -372,6 +372,7 @@ export interface IEvoTarif {
evo_models?: IEvoModel[];
evo_model_exceptions?: IEvoModel[];
evo_rates?: IEvoRate[];
evo_delivery_time?: number[];
}
export interface IEvoRate {