init commit
All checks were successful
build-api-image / build (push) Successful in 51s

This commit is contained in:
Antonio Lopes dos Santos
2026-08-04 16:52:02 -03:00
commit afec302c3e
11594 changed files with 1636728 additions and 0 deletions

View File

@@ -0,0 +1,50 @@
<?php
namespace App\Http\Controllers\Externo\Laboratorio\Cliente;
use App\Http\Controllers\Externo\Laboratorio\Controller;
use App\Services\WebService\Laboratorio\Cliente\ExameService;
use Illuminate\Http\Request;
use Illuminate\Http\Response;
class ExameController extends Controller
{
protected $controller = __CLASS__;
public function index($laboratorioId)
{
$this->auth(__FUNCTION__);
return response()->json(ExameService::index($laboratorioId), Response::HTTP_OK);
}
public function show($laboratorioId, $id)
{
$this->auth(__FUNCTION__);
return response()->json(ExameService::show($laboratorioId, $id), Response::HTTP_OK);
}
public function store(Request $request, $laboratorioId)
{
$this->auth(__FUNCTION__);
return response()->json(ExameService::store($request, $laboratorioId), Response::HTTP_CREATED);
}
public function update(Request $request, $laboratorioId, $id)
{
$this->auth(__FUNCTION__);
return response()->json(ExameService::update($request, $laboratorioId, $id), Response::HTTP_OK);
}
public function destroy($laboratorioId, $id)
{
$this->auth(__FUNCTION__);
ExameService::destroy($laboratorioId, $id);
return response()->noContent();
}
}

View File

@@ -0,0 +1,67 @@
<?php
namespace App\Http\Controllers\Externo\Laboratorio\Cliente;
use App\Exceptions\WebService\Laboratorio\Cliente\Pedido\CannotChangeStatusException;
use App\Http\Controllers\Externo\Laboratorio\Controller;
use App\Services\WebService\Laboratorio\Cliente\PedidoService;
use Illuminate\Http\Request;
use Illuminate\Http\Response;
class PedidoController extends Controller
{
protected $controller = __CLASS__;
public function index(Request $request, $laboratorioId)
{
$this->auth(__FUNCTION__);
return response()->json(PedidoService::index($request, $laboratorioId), Response::HTTP_OK);
}
public function show($laboratorioId, $id)
{
$this->auth(__FUNCTION__);
return response()->json(PedidoService::show($laboratorioId, $id), Response::HTTP_OK);
}
public function process($laboratorioId, $id)
{
$this->auth(__FUNCTION__);
try {
PedidoService::process($laboratorioId, $id);
return response()->noContent();
} catch (CannotChangeStatusException $e) {
return response()->json(['message' => $e->getMessage()], Response::HTTP_BAD_REQUEST);
}
}
public function cancel(Request $request, $laboratorioId, $id)
{
$this->auth(__FUNCTION__);
try {
PedidoService::cancel($request, $laboratorioId, $id);
return response()->noContent();
} catch (CannotChangeStatusException $e) {
return response()->json(['message' => $e->getMessage()], Response::HTTP_BAD_REQUEST);
}
}
public function storeResult(Request $request, $laboratorioId, $id)
{
$this->auth(__FUNCTION__);
try {
PedidoService::storeResult($request, $laboratorioId, $id);
return response()->noContent();
} catch (CannotChangeStatusException $e) {
return response()->json(['message' => $e->getMessage()], Response::HTTP_BAD_REQUEST);
}
}
}