<?php

namespace Modules\Complaint\Services;

use Illuminate\Http\Request;
use Modules\Complaint\Interfaces\ComplaintRepositoryInterface;
use Modules\Complaint\Models\Complaint;

class ComplaintService
{
    private ComplaintRepositoryInterface $complaintRepository ;

    public function __construct(ComplaintRepositoryInterface $complaintRepository)
    {
        $this->complaintRepository = $complaintRepository;
    }

    public function get(Request $request)
    {
        $complaints= $this->complaintRepository->get($request);
        return $complaints;
    }
    public function getItem(Complaint $complaint)
    {
        $complaint = $this->complaintRepository->getItem($complaint);
        return $complaint;
    }
    public function save(Request $request, ?Complaint $complaint): Complaint
    {
        $complaint = $this->complaintRepository->save($request,$complaint);
        return $complaint;
    }
    public function destroy(Request $request, int $id): array
    {
        $response = $this->complaintRepository->destroy($request,$id);
        return $response;
    }
    public function destroyAll(Request $request): array
    {
        $response = $this->complaintRepository->destroyAll($request);
        return $response;
    }
    public function restore(Request $request, int $id): array
    {
        $response = $this->complaintRepository->restore($request,$id);
        return $response;
    }
    public function restoreAll(Request $request): array
    {
        $response = $this->complaintRepository->restoreAll($request);
        return $response;
    }
}
