Skip to content

Commit

Permalink
Added Trigger Manager - Rewritten existing hermes registrations/handl…
Browse files Browse the repository at this point in the history
…ers to use new `TriggerManager`

Reason: We needed an official way to register trigger within Scenarios to later validate if an trigger is compatible with the chosen condition. Second, we needed to specify a place where should be triggers registered instead of deriving those from registered public events.

- Added `registerScenariosTriggers` method to `ApplicationModuleInterface`
  • Loading branch information
burithetech committed Apr 29, 2024
1 parent 7775344 commit 3d5df3f
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/Tests/BaseTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

use Contributte\Translation\Translator;
use Crm\ApplicationModule\Models\Event\EventsStorage;
use Crm\ApplicationModule\Models\Scenario\TriggerManager;
use Crm\ApplicationModule\Tests\DatabaseTestCase;
use Crm\PaymentsModule\Events\RecurrentPaymentRenewedEvent;
use Crm\RempCampaignModule\RempCampaignModule;
Expand Down Expand Up @@ -78,6 +79,7 @@ protected function setUp(): void
$eventsStorage->register('subscription_ends', SubscriptionEndsEvent::class, true);
$eventsStorage->register('recurrent_payment_renewed', RecurrentPaymentRenewedEvent::class, true);
$this->scenariosModule->registerHermesHandlers($this->dispatcher);
$this->scenariosModule->registerScenariosTriggers($this->inject(TriggerManager::class));
$this->rempCampaignModule->registerLazyEventHandlers($this->emitter);

$this->engine = $this->inject(Engine::class);
Expand Down

0 comments on commit 3d5df3f

Please sign in to comment.