<?php

declare(strict_types=1);

namespace ImovelZapAi\Authentication\Infrastructure\Providers;

use Illuminate\Support\Facades\Route;
use Illuminate\Support\ServiceProvider;

class AuthenticationServiceProvider extends ServiceProvider
{
    public function register(): void
    {
        $this->app->singleton(
            \ImovelZapAi\Authentication\Infrastructure\Persistence\PasswordResetTokenRepository::class,
        );

        $this->app->singleton(
            \ImovelZapAi\Authentication\Application\Services\RoleProvisioner::class,
        );

        $this->app->singleton(
            \ImovelZapAi\Authentication\Application\Actions\AssignUserRoleAction::class,
        );
        $this->app->singleton(
            \ImovelZapAi\Authentication\Application\Actions\RegisterAccountAction::class,
        );
    }

    public function boot(): void
    {
        Route::prefix('api')
            ->group(__DIR__.'/../Routes/api.php');

        Route::middleware('web')
            ->group(__DIR__.'/../Routes/web.php');
    }
}
