2026-03-19 22:09:44 +01:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
namespace MintyPHP\Module\Notifications;
|
|
|
|
|
|
|
|
|
|
use MintyPHP\App\AppContainer;
|
|
|
|
|
use MintyPHP\App\Container\ContainerRegistrar;
|
|
|
|
|
use MintyPHP\Module\Notifications\Handler\NotificationCleanupJobHandler;
|
2026-03-20 00:05:03 +01:00
|
|
|
use MintyPHP\Module\Notifications\Listeners\UserActivatedNotificationListener;
|
|
|
|
|
use MintyPHP\Module\Notifications\Listeners\UserAssignmentChangedNotificationListener;
|
2026-03-19 22:09:44 +01:00
|
|
|
use MintyPHP\Module\Notifications\Listeners\UserCreatedNotificationListener;
|
2026-03-20 00:05:03 +01:00
|
|
|
use MintyPHP\Module\Notifications\Listeners\UserDeactivatedNotificationListener;
|
2026-03-19 22:09:44 +01:00
|
|
|
use MintyPHP\Module\Notifications\Listeners\UserDeletedNotificationListener;
|
2026-03-26 12:01:11 +01:00
|
|
|
use MintyPHP\Module\Notifications\Repository\NotificationRepository;
|
2026-03-19 22:09:44 +01:00
|
|
|
use MintyPHP\Module\Notifications\Service\NotificationService;
|
2026-03-20 00:05:03 +01:00
|
|
|
use MintyPHP\Repository\Tenant\UserTenantRepository;
|
|
|
|
|
use MintyPHP\Repository\User\UserReadRepository;
|
2026-03-25 19:39:02 +01:00
|
|
|
use MintyPHP\Service\Access\PermissionService;
|
2026-03-19 22:09:44 +01:00
|
|
|
|
|
|
|
|
final class NotificationsContainerRegistrar implements ContainerRegistrar
|
|
|
|
|
{
|
|
|
|
|
public function register(AppContainer $container): void
|
|
|
|
|
{
|
2026-03-25 19:39:02 +01:00
|
|
|
$container->set(NotificationsAuthorizationPolicy::class, static fn (AppContainer $c): NotificationsAuthorizationPolicy => new NotificationsAuthorizationPolicy(
|
|
|
|
|
$c->get(PermissionService::class)
|
|
|
|
|
));
|
2026-03-19 22:09:44 +01:00
|
|
|
|
2026-03-26 12:01:11 +01:00
|
|
|
$container->set(NotificationRepository::class, static fn (): NotificationRepository => new NotificationRepository());
|
2026-03-19 22:09:44 +01:00
|
|
|
|
2026-03-26 12:01:11 +01:00
|
|
|
$container->set(NotificationService::class, static fn (AppContainer $c): NotificationService => new NotificationService(
|
|
|
|
|
$c->get(NotificationRepository::class),
|
2026-03-20 00:05:03 +01:00
|
|
|
$c->get(UserTenantRepository::class)
|
|
|
|
|
));
|
2026-03-19 22:09:44 +01:00
|
|
|
|
|
|
|
|
$container->set(NotificationCleanupJobHandler::class, static fn (AppContainer $c): NotificationCleanupJobHandler => new NotificationCleanupJobHandler(
|
|
|
|
|
$c->get(NotificationService::class)
|
|
|
|
|
));
|
|
|
|
|
|
|
|
|
|
$container->set(UserCreatedNotificationListener::class, static fn (AppContainer $c): UserCreatedNotificationListener => new UserCreatedNotificationListener(
|
|
|
|
|
$c->get(NotificationService::class),
|
2026-03-20 00:05:03 +01:00
|
|
|
$c->get(UserReadRepository::class),
|
|
|
|
|
$c->get(UserTenantRepository::class)
|
2026-03-19 22:09:44 +01:00
|
|
|
));
|
|
|
|
|
|
|
|
|
|
$container->set(UserDeletedNotificationListener::class, static fn (AppContainer $c): UserDeletedNotificationListener => new UserDeletedNotificationListener(
|
|
|
|
|
$c->get(NotificationService::class),
|
2026-03-20 00:05:03 +01:00
|
|
|
$c->get(UserReadRepository::class)
|
|
|
|
|
));
|
|
|
|
|
|
|
|
|
|
$container->set(UserActivatedNotificationListener::class, static fn (AppContainer $c): UserActivatedNotificationListener => new UserActivatedNotificationListener(
|
|
|
|
|
$c->get(NotificationService::class),
|
|
|
|
|
$c->get(UserReadRepository::class),
|
|
|
|
|
$c->get(UserTenantRepository::class)
|
|
|
|
|
));
|
|
|
|
|
|
|
|
|
|
$container->set(UserDeactivatedNotificationListener::class, static fn (AppContainer $c): UserDeactivatedNotificationListener => new UserDeactivatedNotificationListener(
|
|
|
|
|
$c->get(NotificationService::class),
|
|
|
|
|
$c->get(UserReadRepository::class),
|
|
|
|
|
$c->get(UserTenantRepository::class)
|
|
|
|
|
));
|
|
|
|
|
|
|
|
|
|
$container->set(UserAssignmentChangedNotificationListener::class, static fn (AppContainer $c): UserAssignmentChangedNotificationListener => new UserAssignmentChangedNotificationListener(
|
|
|
|
|
$c->get(NotificationService::class),
|
|
|
|
|
$c->get(UserReadRepository::class)
|
2026-03-19 22:09:44 +01:00
|
|
|
));
|
|
|
|
|
}
|
|
|
|
|
}
|