82 lines
1.8 KiB
PHP
82 lines
1.8 KiB
PHP
<?php
|
|
|
|
namespace App\Http\Controllers\Almoxarifado;
|
|
|
|
use App\Http\Controllers\Controller;
|
|
use App\Services\Almoxarifado\TransferenciaService;
|
|
use Illuminate\Http\Response;
|
|
|
|
class TransferenciaController extends Controller
|
|
{
|
|
protected $modulo = 'almoxarifado';
|
|
protected $funcionalidade = 'transferencia';
|
|
|
|
public function datatableEnviadas()
|
|
{
|
|
return TransferenciaService::datatableEnviadas();
|
|
}
|
|
|
|
public function datatableRecebidas()
|
|
{
|
|
return TransferenciaService::datatableRecebidas();
|
|
}
|
|
|
|
public function create()
|
|
{
|
|
$this->auth(__FUNCTION__);
|
|
|
|
return response()->json(TransferenciaService::create(), Response::HTTP_OK);
|
|
}
|
|
|
|
public function store()
|
|
{
|
|
$this->auth(__FUNCTION__);
|
|
|
|
return response()->json(TransferenciaService::store(), Response::HTTP_CREATED);
|
|
}
|
|
|
|
public function edit($id)
|
|
{
|
|
$this->auth(__FUNCTION__);
|
|
|
|
return response()->json(TransferenciaService::edit($id), Response::HTTP_OK);
|
|
}
|
|
|
|
public function update($id)
|
|
{
|
|
$this->auth(__FUNCTION__);
|
|
|
|
return response()->json(TransferenciaService::update($id), Response::HTTP_OK);
|
|
}
|
|
|
|
public function destroy($id)
|
|
{
|
|
$this->auth(__FUNCTION__);
|
|
|
|
return response()->json(TransferenciaService::destroy($id), Response::HTTP_NO_CONTENT);
|
|
}
|
|
|
|
public function getTransferenciaRecebida($id)
|
|
{
|
|
return response()->json(TransferenciaService::getTransferenciaRecebida($id), Response::HTTP_OK);
|
|
}
|
|
|
|
public function accept($id)
|
|
{
|
|
$this->auth(__FUNCTION__);
|
|
|
|
TransferenciaService::accept($id);
|
|
|
|
return response()->noContent();
|
|
}
|
|
|
|
public function reject($id)
|
|
{
|
|
$this->auth(__FUNCTION__);
|
|
|
|
TransferenciaService::reject($id);
|
|
|
|
return response()->noContent();
|
|
}
|
|
}
|