Skip to content

Commit

Permalink
[5.1] MSPB-289: Fix issue where the wrong callflow is set for the hol…
Browse files Browse the repository at this point in the history
…iday (#442)
  • Loading branch information
pcandia authored Aug 12, 2022
1 parent 652db0a commit 5845674
Showing 1 changed file with 2 additions and 14 deletions.
16 changes: 2 additions & 14 deletions submodules/strategyHolidays/strategyHolidays.js
Original file line number Diff line number Diff line change
Expand Up @@ -1256,14 +1256,14 @@ define(function(require) {
var self = this,
reconcileTemporalRules = _.bind(self.strategyHolidaysReconcileTemporalRules, self, strategyData),
rebuildTemporalRulesInPlace = function(actionsByType, strategyData) {
var mainCallflowId = strategyData.callflows.MainCallflow.id;
var holidayCallflowId = _.get(strategyData.callflows, 'MainHolidays.id');

_.forEach(actionsByType.toAdd, function(rule) {
_.set(strategyData.temporalRules, ['holidays', rule.hasOwnProperty('temporal_rules') ? rule.name : rule.id], rule);
strategyData.callflows.MainCallflow.flow.children[rule.id] = {
children: {},
data: {
id: mainCallflowId
id: holidayCallflowId
},
module: 'callflow'
};
Expand All @@ -1278,17 +1278,6 @@ define(function(require) {
_.unset(strategyData.callflows.MainCallflow.flow.children, rule.id);
});
},
updateMainCallflowCatchAllInPlace = function(strategyData) {
var holidayCallflowId = _.get(strategyData.callflows, 'MainHolidays.id');

strategyData.callflows.MainCallflow.flow.children._ = {
children: {},
data: {
id: holidayCallflowId
},
module: 'callflow'
};
},
rebuildMainCallflowRulesInPlace = _.bind(self.strategyRebuildMainCallflowRuleArray, self),
shouldUpdateMainCallflow = function(current, strategyData) {
var currentRules = _.sortBy(current.rules),
Expand All @@ -1308,7 +1297,6 @@ define(function(require) {
};

rebuildTemporalRulesInPlace(actionsPerType, strategyData);
updateMainCallflowCatchAllInPlace(strategyData);
rebuildMainCallflowRulesInPlace(strategyData);

monster.waterfall([
Expand Down

0 comments on commit 5845674

Please sign in to comment.