Escriturar

This commit is contained in:
2023-12-20 08:44:49 -03:00
parent 1ba53c9e12
commit 379a33a4da
11 changed files with 430 additions and 16 deletions

View File

@ -230,4 +230,18 @@ class Ventas
}
return $this->withJson($response, $output);
}
public function escriturar(ServerRequestInterface $request, ResponseInterface $response, Service\Venta $ventaService, int $venta_id): ResponseInterface
{
$data = $request->getParsedBody();
$output = [
'input' => $data,
'venta_id' => $venta_id,
'status' => false
];
try {
$venta = $ventaService->getById($venta_id);
$output['status'] = $ventaService->escriturar($venta, $data);
} catch (EmptyResult) {}
return $this->withJson($response, $output);
}
}