<?php

namespace Modules\Rate\Services;

use Illuminate\Http\Request;
use Modules\Rate\Interfaces\RateRepositoryInterface;
use Modules\Rate\Models\Rate;

class RateService
{
    private RateRepositoryInterface $rateRepository ;

    public function __construct(RateRepositoryInterface $rateRepository)
    {
        $this->rateRepository = $rateRepository;
    }

    public function get(Request $request)
    {
        $rates= $this->rateRepository->get($request);
        return $rates;
    }
    public function getItem(Rate $rate)
    {
        $rate = $this->rateRepository->getItem($rate);
        return $rate;
    }
    public function save(Request $request, ?Rate $rate): Rate
    {
        $rate = $this->rateRepository->save($request,$rate);
        return $rate;
    }
    public function destroy(Request $request, int $id): array
    {
        $response = $this->rateRepository->destroy($request,$id);
        return $response;
    }
    public function destroyAll(Request $request): array
    {
        $response = $this->rateRepository->destroyAll($request);
        return $response;
    }
    public function restore(Request $request, int $id): array
    {
        $response = $this->rateRepository->restore($request,$id);
        return $response;
    }
    public function restoreAll(Request $request): array
    {
        $response = $this->rateRepository->restoreAll($request);
        return $response;
    }
}
