Group and Targeting for new V3 rule set.

This commit is contained in:
Patrick Fic
2024-08-09 12:02:09 -07:00
parent dc94fa0a49
commit 0b2b741123
17 changed files with 5112 additions and 219 deletions

View File

@@ -16,25 +16,6 @@ const RuleSets = [
},
];
function ChangeOfRuleSet({
prevDateMoment = moment(),
newDateMoment = moment(),
}) {
const prevRuleSet = RuleSets.find(
(r) =>
prevDateMoment.isSameOrAfter(r.range[0]) &&
prevDateMoment.isBefore(r.range[1])
);
const newRuleSet = RuleSets.find(
(r) =>
newDateMoment.isSameOrAfter(r.range[0]) &&
newDateMoment.isBefore(r.range[1])
);
return prevRuleSet?.title !== newRuleSet?.title;
}
function WhichRulesetToApply(close_date) {
const DateMoment = close_date ? moment(close_date) : moment();
const newRuleSet = RuleSets.find(