<?php

namespace Modules\Country\Services;

use Illuminate\Http\Request;
use Modules\Country\Interfaces\CountryRepositoryInterface;
use Modules\Country\Models\Country;

class CountryService
{
    private CountryRepositoryInterface $countryRepository ;

    public function __construct(CountryRepositoryInterface $countryRepository)
    {
        $this->countryRepository = $countryRepository;
    }

    public function get(Request $request)
    {
        $countries = $this->countryRepository->get($request);
        return $countries;
    }
    public function getItem(Country $country)
    {
        $country = $this->countryRepository->getItem($country);
        return $country;
    }
    public function save(Request $request, ?Country $country): Country
    {
        $country = $this->countryRepository->save($request,$country);
        return $country;
    }
    public function destroy(Request $request, int $id): array
    {
        $response = $this->countryRepository->destroy($request,$id);
        return $response;
    }
    public function destroyAll(Request $request): array
    {
        $response = $this->countryRepository->destroyAll($request);
        return $response;
    }
    public function restore(Request $request, int $id): array
    {
        $response = $this->countryRepository->restore($request,$id);
        return $response;
    }
    public function restoreAll(Request $request): array
    {
        $response = $this->countryRepository->restoreAll($request);
        return $response;
    }
}
