<?php


namespace App\Http\Controllers\Admin;


use App\Http\logic\admin\StockLogic;
use Illuminate\Http\Request;

class StockController
{
    public function index(Request $request)
    {
        $date = $request->date ?: '';
        $start_time = $request->start_time ?: '';
        $end_time = $request->end_time ?: '';

        $type = $request->type ?: 0;
        $roomID = $request->roomID ?: '';
        $excel = $request->excel ?: '';

        $list = (new StockLogic())->index($date, $start_time, $end_time, $type, $roomID, $excel);

        return view('admin.stock.index', $list);
    }

    public function roomList(Request $request)
    {
        $type = $request->type ?: '';

        $list = (new StockLogic())->roomList($type);

        return apiReturnSuc($list);

    }
}
