<?php

namespace Modules\Partner\Services;

use Illuminate\Http\Request;
use Modules\Partner\Interfaces\PartnerRepositoryInterface;
use Modules\Partner\Models\Partner;

class PartnerService
{
    private PartnerRepositoryInterface $partnerRepository ;

    public function __construct(PartnerRepositoryInterface $partnerRepository)
    {
        $this->partnerRepository = $partnerRepository;
    }

    public function get(Request $request)
    {
        $partners= $this->partnerRepository->get($request);
        return $partners;
    }
    public function getItem(Partner $partner)
    {
        $partner = $this->partnerRepository->getItem($partner);
        return $partner;
    }
    public function save(Request $request, ?Partner $partner): Partner
    {
        $partner = $this->partnerRepository->save($request,$partner);
        return $partner;
    }
    public function destroy(Request $request, int $id): array
    {
        $response = $this->partnerRepository->destroy($request,$id);
        return $response;
    }
    public function destroyAll(Request $request): array
    {
        $response = $this->partnerRepository->destroyAll($request);
        return $response;
    }
    public function restore(Request $request, int $id): array
    {
        $response = $this->partnerRepository->restore($request,$id);
        return $response;
    }
    public function restoreAll(Request $request): array
    {
        $response = $this->partnerRepository->restoreAll($request);
        return $response;
    }
}
