<?php

namespace Modules\Shipping\Services;

use Illuminate\Http\Request;
use Modules\Shipping\Interfaces\ShippingRepositoryInterface;
use Modules\Shipping\Models\Shipping;

class ShippingService
{
    private ShippingRepositoryInterface $shippingRepository ;

    public function __construct(ShippingRepositoryInterface $shippingRepository)
    {
        $this->shippingRepository = $shippingRepository;
    }

    public function get(Request $request)
    {
        $shippings = $this->shippingRepository->get($request);
        return $shippings;
    }
    public function getItem(Shipping $shipping)
    {
        $shipping = $this->shippingRepository->getItem($shipping);
        return $shipping;
    }
    public function cities(Shipping $shipping)
    {
        $cities = $this->shippingRepository->cities($shipping);
        return $cities;
    }
    public function save(Request $request, ?Shipping $shipping): Shipping
    {
        $shipping = $this->shippingRepository->save($request,$shipping);
        return $shipping;
    }
    public function destroy(Request $request, int $id): array
    {
        $response = $this->shippingRepository->destroy($request,$id);
        return $response;
    }
    public function destroyAll(Request $request): array
    {
        $response = $this->shippingRepository->destroyAll($request);
        return $response;
    }
    public function restore(Request $request, int $id): array
    {
        $response = $this->shippingRepository->restore($request,$id);
        return $response;
    }
    public function restoreAll(Request $request): array
    {
        $response = $this->shippingRepository->restoreAll($request);
        return $response;
    }
    public function getCity($shipping_city)
    {
        $shipping_city = $this->shippingRepository->getCity($shipping_city);
        return $shipping_city;
    }
}
