<?php

namespace App\Providers;

use App\Core\Billing\BillingInterface;
use App\Core\Billing\BillingManager;
use App\Core\Email\EmailManager;
use App\Core\Payment\PaymentManager;
use App\Services\InvoicePdfService;
use Illuminate\Support\ServiceProvider;

class BillingServiceProvider extends ServiceProvider
{
    public function register(): void
    {
        $this->app->singleton(BillingInterface::class, function ($app) {
            return new BillingManager(
                $app->make(PaymentManager::class),
                $app->make(EmailManager::class),
                $app->make(InvoicePdfService::class)
            );
        });

        $this->app->alias(BillingInterface::class, 'billing');
    }

    public function boot(): void
    {
        //
    }
}
