<?php

namespace Modules\Review\Services;

use Illuminate\Http\Request;
use Modules\Review\Interfaces\ReviewRepositoryInterface;
use Modules\Review\Models\Review;

class ReviewService
{
    private ReviewRepositoryInterface $reviewRepository ;

    public function __construct(ReviewRepositoryInterface $reviewRepository)
    {
        $this->reviewRepository = $reviewRepository;
    }

    public function get(Request $request)
    {
        $reviews= $this->reviewRepository->get($request);
        return $reviews;
    }
    public function getItem(Review $review)
    {
        $review = $this->reviewRepository->getItem($review);
        return $review;
    }
    public function save(Request $request, ?Review $review): Review
    {
        $review = $this->reviewRepository->save($request,$review);
        return $review;
    }
    public function destroy(Request $request, int $id): array
    {
        $response = $this->reviewRepository->destroy($request,$id);
        return $response;
    }
    public function destroyAll(Request $request): array
    {
        $response = $this->reviewRepository->destroyAll($request);
        return $response;
    }
    public function restore(Request $request, int $id): array
    {
        $response = $this->reviewRepository->restore($request,$id);
        return $response;
    }
    public function restoreAll(Request $request): array
    {
        $response = $this->reviewRepository->restoreAll($request);
        return $response;
    }
}
