Make sure webhooks are generated in a generic way for future expansion.

This commit is contained in:
James Cole
2020-12-05 06:47:16 +01:00
parent 4a7e185c44
commit deb829dfdb
5 changed files with 70 additions and 39 deletions

View File

@@ -85,8 +85,12 @@ class StoredGroupEventHandler
/** @var MessageGeneratorInterface $engine */
$engine = app(MessageGeneratorInterface::class);
$engine->setUser($user);
$engine->setTransactionGroups(new Collection([$group]));
// tell the generator which trigger it should look for
$engine->setTrigger(Webhook::TRIGGER_STORE_TRANSACTION);
// tell the generator which objects to process
$engine->setObjects(new Collection([$group]));
// tell the generator to generate the messages
$engine->generateMessages();
}