<?php

namespace Modules\Region\Services;

use Illuminate\Http\Request;
use Modules\Region\Interfaces\RegionRepositoryInterface;
use Modules\Region\Models\Region;

class RegionService
{
    private RegionRepositoryInterface $regionRepository ;

    public function __construct(RegionRepositoryInterface $regionRepository)
    {
        $this->regionRepository = $regionRepository;
    }

    public function get(Request $request)
    {
        $regions= $this->regionRepository->get($request);
        return $regions;
    }
    public function getItem(Region $region)
    {
        $region = $this->regionRepository->getItem($region);
        return $region;
    }
    public function save(Request $request, ?Region $region): Region
    {
        $region = $this->regionRepository->save($request,$region);
        return $region;
    }
    public function destroy(Request $request, int $id): array
    {
        $response = $this->regionRepository->destroy($request,$id);
        return $response;
    }
    public function destroyAll(Request $request): array
    {
        $response = $this->regionRepository->destroyAll($request);
        return $response;
    }
    public function restore(Request $request, int $id): array
    {
        $response = $this->regionRepository->restore($request,$id);
        return $response;
    }
    public function restoreAll(Request $request): array
    {
        $response = $this->regionRepository->restoreAll($request);
        return $response;
    }
}
