Files
oficial/app/resources/routes/api/ventas.php
2023-12-21 18:45:47 -03:00

32 lines
1.1 KiB
PHP

<?php
use Incoviba\Controller\API\Ventas;
$app->group('/ventas', function($app) {
$folder = implode(DIRECTORY_SEPARATOR, [__DIR__, 'ventas']);
if (file_exists($folder)) {
$files = new FilesystemIterator($folder);
foreach ($files as $file) {
if ($file->isDir()) {
continue;
}
include_once $file->getRealPath();
}
}
$app->post('/add[/]', [Ventas::class, 'add']);
$app->group('/estados', function($app) {
$app->post('/firmar[/]', [Ventas::class, 'porFirmar']);
});
$app->group('/escrituras', function($app) {
$app->post('/estados[/]', [Ventas::class, 'escrituras']);
});
$app->post('[/]', [Ventas::class, 'proyecto']);
});
$app->group('/venta/{venta_id}', function($app) {
$app->get('/unidades[/]', [Ventas::class, 'unidades']);
$app->get('/comentarios[/]', [Ventas::class, 'comentarios']);
$app->post('/escriturar[/]', [Ventas::class, 'escriturar']);
$app->post('/desistir[/]', [Ventas::class, 'desistir']);
$app->post('[/]', [Ventas::class, 'edit']);
$app->get('[/]', [Ventas::class, 'get']);
});