<?php

namespace Modules\Store\Services;

use Illuminate\Http\Request;
use Modules\Store\Interfaces\BranchRepositoryInterface;
use Modules\Store\Models\Branch;

class BranchService
{
    private BranchRepositoryInterface $branchRepository ;

    public function __construct(BranchRepositoryInterface $branchRepository)
    {
        $this->branchRepository = $branchRepository;
    }

    public function get(Request $request)
    {
        $branches = $this->branchRepository->get($request);
        return $branches;
    }
    public function getItem(Branch $branch)
    {
        $branch = $this->branchRepository->getItem($branch);
        return $branch;
    }
    public function save(Request $request, ?Branch $branch): Branch
    {
        $branch = $this->branchRepository->save($request,$branch);
        return $branch;
    }
    public function destroy(Request $request, int $id): array
    {
        $response = $this->branchRepository->destroy($request,$id);
        return $response;
    }
    public function destroyAll(Request $request): array
    {
        $response = $this->branchRepository->destroyAll($request);
        return $response;
    }
    public function restore(Request $request, int $id): array
    {
        $response = $this->branchRepository->restore($request,$id);
        return $response;
    }
    public function restoreAll(Request $request): array
    {
        $response = $this->branchRepository->restoreAll($request);
        return $response;
    }

}
