<?php

namespace Modules\Quotation\Services;

use Illuminate\Http\Request;
use Modules\Quotation\Interfaces\QuotationRepositoryInterface;
use Modules\Quotation\Models\Quotation;

class QuotationService
{
    private QuotationRepositoryInterface $quotationRepository ;

    public function __construct(QuotationRepositoryInterface $quotationRepository)
    {
        $this->quotationRepository = $quotationRepository;
    }

    public function get(Request $request)
    {
        $quotations= $this->quotationRepository->get($request);
        return $quotations;
    }
    public function getItem(Quotation $quotation)
    {
        $quotation = $this->quotationRepository->getItem($quotation);
        return $quotation;
    }
    public function save(Request $request, ?Quotation $quotation): Quotation
    {
        $quotation = $this->quotationRepository->save($request,$quotation);
        return $quotation;
    }
    public function destroy(Request $request, int $id): array
    {
        $response = $this->quotationRepository->destroy($request,$id);
        return $response;
    }
    public function destroyAll(Request $request): array
    {
        $response = $this->quotationRepository->destroyAll($request);
        return $response;
    }
    public function restore(Request $request, int $id): array
    {
        $response = $this->quotationRepository->restore($request,$id);
        return $response;
    }
    public function restoreAll(Request $request): array
    {
        $response = $this->quotationRepository->restoreAll($request);
        return $response;
    }
}
