<?php

namespace Modules\Faq\Services;

use Illuminate\Http\Request;
use Modules\Faq\Interfaces\FaqRepositoryInterface;
use Modules\Faq\Models\Faq;

class FaqService
{
    private FaqRepositoryInterface $faqRepository ;

    public function __construct(FaqRepositoryInterface $faqRepository)
    {
        $this->faqRepository = $faqRepository;
    }

    public function get(Request $request)
    {
        $faqs= $this->faqRepository->get($request);
        return $faqs;
    }
    public function getItem(Faq $faq)
    {
        $faq = $this->faqRepository->getItem($faq);
        return $faq;
    }
    public function save(Request $request, ?Faq $faq): Faq
    {
        $faq = $this->faqRepository->save($request,$faq);
        return $faq;
    }
    public function destroy(Request $request, int $id): array
    {
        $response = $this->faqRepository->destroy($request,$id);
        return $response;
    }
    public function destroyAll(Request $request): array
    {
        $response = $this->faqRepository->destroyAll($request);
        return $response;
    }
    public function restore(Request $request, int $id): array
    {
        $response = $this->faqRepository->restore($request,$id);
        return $response;
    }
    public function restoreAll(Request $request): array
    {
        $response = $this->faqRepository->restoreAll($request);
        return $response;
    }
}
