<?php

namespace Modules\Product\Providers;

use Nwidart\Modules\Support\ModuleServiceProvider;

class ProductServiceProvider extends ModuleServiceProvider
{
    protected string $name = 'Product';

    protected string $nameLower = 'product';

    protected array $providers = [
        EventServiceProvider::class,
        RouteServiceProvider::class,
    ];

    public function boot(): void
    {
        parent::boot();

        if ($this->app->runningInConsole()) {
            $this->commands([
                \Modules\Product\Console\FetchProductImages::class,
            ]);
        }
    }

    public function register(): void
    {
        parent::register();
        $this->app->bind(
            \Modules\Product\Repositories\Interfaces\ProductRepositoryInterface::class,
            \Modules\Product\Repositories\ProductRepository::class
        );
    }
}
