<?php

namespace App\Providers;

use Illuminate\Support\ServiceProvider;
use App\Domain\Empresa\Repositories\EmpresaRepositoryInterface;
use App\Infra\Empresa\Repositories\EmpresaRepositoryEloquent;
use App\Domains\Clientes\Repositories\ClienteRepository;
use App\Domains\Clientes\Models\Cliente;
use App\Domains\Clientes\Services\ClienteService;

class AppServiceProvider extends ServiceProvider
{
    /**
     * Register any application services.
     */
    public function register(): void
    {
        $this->app->bind(EmpresaRepositoryInterface::class, EmpresaRepositoryEloquent::class);
        
        $this->app->bind(ClienteRepository::class, function ($app) {
            return new ClienteRepository($app->make(Cliente::class));
        });

        $this->app->bind(ClienteService::class, function ($app) {
            return new ClienteService($app->make(ClienteRepository::class));
        });
    }

    /**
     * Bootstrap any application services.
     */
    public function boot(): void
    {
        //
    }
}
