<?php

namespace App\Providers;

use App\Models\Order;
use App\Models\Product;
use App\Models\ProductVariant;
use App\Models\PurchaseOrder;
use App\Observers\OrderObserver;
use App\Observers\ProductImageObserver;
use App\Observers\ProductVariantImageObserver;
use App\Observers\PurchaseOrderObserver;
use App\Services\CartService;
use App\Services\CheckoutService;
use App\Services\PointsService;
use App\Services\PricingService;
use App\Services\ShippingService;
use App\Services\SupplierSyncService;
use Illuminate\Support\ServiceProvider;

class AppServiceProvider extends ServiceProvider
{
    public function register(): void
    {
        $this->app->singleton(PricingService::class);
        $this->app->singleton(PointsService::class);
        $this->app->singleton(CartService::class);
        $this->app->singleton(SupplierSyncService::class);
        $this->app->singleton(CheckoutService::class);
        $this->app->singleton(ShippingService::class);
    }

    public function boot(): void
    {
        Order::observe(OrderObserver::class);
        PurchaseOrder::observe(PurchaseOrderObserver::class);
        Product::observe(ProductImageObserver::class);
        ProductVariant::observe(ProductVariantImageObserver::class);
    }
}
