<?php
/**
 * BookiFlex NotificationLog Extension
 *
 * @package    BookiFlex
 * @subpackage NotificationLog
 * @author     BookiFlex
 * @copyright  Copyright (c) 2025 BookiFlex
 * @license    GPL-2.0-or-later
 *
 * @link       https://bookiflex.com
 */

declare(strict_types=1);

namespace BookiFlex\Extensions\NotificationLog;

use BookiFlex\Core\Repository\ReservationRepository;
use BookiFlex\Extensions\Notification\Repository\NotificationRepository;
use BookiFlex\Extensions\Notification\Service\NotificationRenderer;
use BookiFlex\Extensions\NotificationLog\Api\Controller\NotificationLogController;
use BookiFlex\Extensions\NotificationLog\Service\NotificationLogService;
use Cycle\ORM\EntityManagerInterface;
use Pimple\Container;
use Pimple\ServiceProviderInterface;

defined('ABSPATH') || exit;

class ServiceProvider implements ServiceProviderInterface
{
    public function register(Container $pimple): void
    {
        $pimple[NotificationLogService::class] = function ($c) {
            return new NotificationLogService(
                $c->get(NotificationRepository::class),
                $c->get(ReservationRepository::class),
            );
        };

        $pimple[NotificationLogController::class] = function ($c) {
            return new NotificationLogController(
                $c->get(NotificationRepository::class),
                $c->get(EntityManagerInterface::class),
                $c->get(NotificationRenderer::class),
            );
        };
    }
}
