65 lines
2.5 KiB
PHP
65 lines
2.5 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->group('/by', function($app) {
|
|
$app->get('/unidad/{unidad_id}', [Ventas::class, 'unidad']);
|
|
$app->post('/unidades[/]', [Ventas::class, 'byUnidades']);
|
|
});
|
|
$app->post('/get[/]', [Ventas::class, 'getMany']);
|
|
$app->post('[/]', [Ventas::class, 'proyecto']);
|
|
});
|
|
$app->group('/venta/{venta_id}', function($app) {
|
|
$app->get('/unidades[/]', [Ventas::class, 'unidades']);
|
|
$app->group('/comentarios', function($app) {
|
|
$app->post('/add[/]', [Ventas::class, 'addComentario']);
|
|
$app->get('[/]', [Ventas::class, 'comentarios']);
|
|
});
|
|
$app->group('/bono_pie', function($app) {
|
|
$app->post('/edit[/]', [Ventas\Bonos::class, 'edit']);
|
|
$app->post('/add[/]', [Ventas\Bonos::class, 'add']);
|
|
});
|
|
$app->group('/escritura', function($app) {
|
|
$app->group('/cuotas', function($app) {
|
|
$app->post('/add[/]', [Ventas\Abonos\Cuotas::class, 'add']);
|
|
});
|
|
$app->group('/cuota/{cuota_id:[0-9]+}', function($app) {
|
|
$app->post('/edit[/]', [Ventas\Abonos\Cuotas::class, 'edit']);
|
|
});
|
|
$app->post('/add[/]', [Ventas\Escrituras::class, 'add']);
|
|
});
|
|
$app->group('/credito', function($app) {
|
|
$app->post('[/]', [Ventas\Creditos::class, 'edit']);
|
|
});
|
|
$app->post('/escriturar[/]', [Ventas::class, 'escriturar']);
|
|
$app->group('/desistir', function($app) {
|
|
$app->get('/eliminar[/]', [Ventas::class, 'insistir']);
|
|
$app->post('[/]', [Ventas::class, 'desistir']);
|
|
});
|
|
$app->group('/propietario', function($app) {
|
|
$app->put('/edit[/]', [Ventas::class, 'propietario']);
|
|
});
|
|
$app->group('/pie', function($app) {
|
|
$app->post('/add[/]', [Ventas\Pies::class, 'add']);
|
|
});
|
|
$app->post('[/]', [Ventas::class, 'edit']);
|
|
$app->get('[/]', [Ventas::class, 'get']);
|
|
});
|