Fix issue in rule engine.

This commit is contained in:
James Cole
2021-02-12 20:15:23 +01:00
parent 95966cdcd4
commit 1ecc454f70
7 changed files with 63 additions and 41 deletions

View File

@@ -62,14 +62,12 @@ class StoredGroupEventHandler
Log::debug(sprintf('Add local operator for journal(s): %s', $journalIds));
// collect rules:
$ruleRepository = app(RuleRepositoryInterface::class);
$ruleGroupRepository = app(RuleGroupRepositoryInterface::class);
$ruleRepository->setUser($storedGroupEvent->transactionGroup->user);
$ruleGroupRepository->setUser($storedGroupEvent->transactionGroup->user);
// add the groups to the rule engine.
// it should run the rules in the group and cancel the group if necessary.
$groups = $ruleGroupRepository->getRuleGroupsWithRules();
$groups = $ruleGroupRepository->getRuleGroupsWithRules('store-journal');
// create and fire rule engine.
$newRuleEngine = app(RuleEngineInterface::class);