<?php

namespace Modules\User\Services;

use Illuminate\Http\Request;
use Modules\User\Models\Address;
use Modules\User\Interfaces\AddressRepositoryInterface;

class AddressService
{
    private AddressRepositoryInterface $addressRepository ;

    public function __construct(AddressRepositoryInterface $addressRepository)
    {
        $this->addressRepository = $addressRepository;
    }

    public function get(Request $request)
    {
        $addresss= $this->addressRepository->get($request);
        return $addresss;
    }
    public function getItem(Address $address)
    {
        $address = $this->addressRepository->getItem($address);
        return $address;
    }
    public function save(Request $request, ?Address $address): Address
    {
        $address = $this->addressRepository->save($request,$address);
        return $address;
    }
    public function destroy(Request $request, int $id): array
    {
        $response = $this->addressRepository->destroy($request,$id);
        return $response;
    }

    public function destroyAll(Request $request): array
    {
        $response = $this->addressRepository->destroyAll($request);
        return $response;
    }
    public function restore(Request $request, int $id): array
    {
        $response = $this->addressRepository->restore($request,$id);
        return $response;
    }
    public function restoreAll(Request $request): array
    {
        $response = $this->addressRepository->restoreAll($request);
        return $response;
    }

}
