<?php

namespace Modules\Product\Http\Controllers;

use Illuminate\Contracts\Support\Renderable;
use Illuminate\Http\Request;
use Illuminate\Routing\Controller;
use Modules\Product\Http\Requests\AddProductRequest;
use Modules\Product\Services\ProductService;

class ProductController extends Controller
{
    protected  $service;

    public function __construct(ProductService $productService)
    {
        $this->service=$productService;

        $this->middleware('auth:sanctum');
    }

    public function productsList()
    {
        return $this->service->list();
    }

    public function addProduct(AddProductRequest $request)
    {
        return $this->service->add($request);
    }

    public function showProduct($id)
    {
        return $this->service->show($id);
    }

    public function deleteProduct($id)
    {
        return $this->service ->delete($id);
    }

    public function changeCapacityProduct(Request $request,$id)
    {
        return $this->service ->changeCapacity($request,$id);
    }
}
