<?php

namespace App\Classes\Modules\ControllersLogic\Warehouses;


use App\Classes\Modules\Warehouses\DataTransferObjects\WarehouseObject;
use App\Classes\Modules\Warehouses\Services\CreatesWarehouse;
use Illuminate\Http\Request;

class CreateWarehouseLogic
{
    /** @var  CreatesWarehouse */
    private $CreatesWarehouse;

    /**
     * CreateWarehouseLogic constructor.
     * @param CreatesWarehouse $CreatesWarehouse
     */
    public function __construct(CreatesWarehouse $CreatesWarehouse)
    {
        $this->CreatesWarehouse = $CreatesWarehouse;
    }


    public function execute(Request $request){

        $object = new WarehouseObject($request->input('name'), $request->input('email'),$request->input('street_one'), $request->input('street_two'), $request->input('city'), $request->input('state'), $request->input('post_code'), $request->input('country'));

        return $this->CreatesWarehouse->execute($object);

    }

}