diff --git a/src/DependencyInjection/StreakExtension.php b/src/DependencyInjection/StreakExtension.php index 3ba7859..458e088 100644 --- a/src/DependencyInjection/StreakExtension.php +++ b/src/DependencyInjection/StreakExtension.php @@ -29,6 +29,7 @@ public function load(array $configs, ContainerBuilder $container) $loader->load('services.yaml'); $loader->load('command_handlers.yaml'); $loader->load('query_handlers.yaml'); + $loader->load('projectors.yaml'); } public function getNamespace() diff --git a/src/Resources/config/projectors.yaml b/src/Resources/config/projectors.yaml new file mode 100644 index 0000000..f098e99 --- /dev/null +++ b/src/Resources/config/projectors.yaml @@ -0,0 +1,8 @@ +services: + streak.listener.subscriptions_projector.factory: + class: Streak\Application\Listener\Subscriptions\Projector\Factory + arguments: + - '@streak.dbal.postgres.event_store.connection' + - '@streak.clock' + tags: + - 'streak.listener_factory' diff --git a/src/Resources/config/services.yaml b/src/Resources/config/services.yaml index f913408..f860bbd 100644 --- a/src/Resources/config/services.yaml +++ b/src/Resources/config/services.yaml @@ -67,7 +67,13 @@ services: - '@streak.event_store' - '@streak.unit_of_work' - streak.subscription_repository: '@streak.event_sourced.subscription_repository' + streak.subscriptions_projection.subscription_repository: + class: Streak\Infrastructure\Event\Subscription\ProjectionRepository + arguments: + - '@streak.event_sourced.subscription_repository' + - '@streak.query_bus' + + streak.subscription_repository: '@streak.subscriptions_projection.subscription_repository' streak.null.event_bus: class: Streak\Infrastructure\EventBus\NullEventBus @@ -237,6 +243,7 @@ services: Streak\Domain\EventBus: '@streak.event_bus' Streak\Application\CommandHandler: '@streak.command_handler' Streak\Application\CommandBus: '@streak.command_bus' + Streak\Application\QueryBus: '@streak.query_bus' Streak\Domain\EventStore: '@streak.event_store' Streak\Domain\AggregateRoot\Factory: '@streak.aggregate_factory' Streak\Infrastructure\AggregateRoot\Snapshotter: '@streak.snapshotter'