feature/cierres (#25)

Varios cambios

Co-authored-by: Juan Pablo Vial <jpvialb@incoviba.cl>
Reviewed-on: #25
This commit is contained in:
2025-07-22 13:18:00 +00:00
parent ba57cad514
commit 307f2ac7d7
418 changed files with 20045 additions and 984 deletions

View File

@ -2,6 +2,16 @@
use Incoviba\Controller\Proyectos;
$app->group('/proyectos', function($app) {
$folder = implode(DIRECTORY_SEPARATOR, [__DIR__, 'proyectos']);
if (file_exists($folder)) {
$files = new FilesystemIterator($folder);
foreach ($files as $file) {
if ($file->isDir()) {
continue;
}
include_once $file->getRealPath();
}
}
$app->get('/unidades[/]', [Proyectos::class, 'unidades']);
$app->get('[/]', Proyectos::class);
})->add($app->getContainer()->get(Incoviba\Middleware\Authentication::class));

View File

@ -23,6 +23,7 @@ $app->group('/venta/{venta_id:[0-9]+}', function($app) {
$app->get('[/]', [Ventas::class, 'propiedad']);
});
$app->group('/pie', function($app) {
$app->get('/add[/]', [Ventas\Pies::class, 'add']);
$app->group('/cuotas', function($app) {
$app->get('[/]', [Ventas::class, 'cuotas']);
});

View File

@ -7,4 +7,4 @@ $app->group('/contabilidad', function($app) {
}
include_once $file->getRealPath();
}
});
})->add($app->getContainer()->get(Incoviba\Middleware\Authentication::class));

View File

@ -7,4 +7,4 @@ $app->group('/admin', function($app) {
}
include_once $file->getRealPath();
}
});
})->add($app->getContainer()->get(Incoviba\Middleware\Authentication::class));

View File

@ -2,5 +2,9 @@
use Incoviba\Controller\API\Admin\Users;
$app->group('/users', function($app) {
$app->post('/add[/]', Users::class . ':add');
$app->post('/add[/]', [Users::class, 'add']);
});
$app->group('/user/{user_id}', function($app) {
$app->post('/edit[/]', [Users::class, 'edit']);
$app->delete('[/]', [Users::class, 'delete']);
});

View File

@ -0,0 +1,16 @@
<?php
use Incoviba\Controller\API\External;
$app->group('/external', function($app) {
$files = new FilesystemIterator(implode(DIRECTORY_SEPARATOR, [__DIR__, 'external']));
foreach ($files as $file) {
if ($file->isDir()) {
continue;
}
include_once $file->getRealPath();
}
$app->group('/services', function($app) {
$app->get('/check[/]', [External::class, 'check']);
$app->get('/update[/]', [External::class, 'update']);
});
});

View File

@ -0,0 +1,11 @@
<?php
use Incoviba\Controller\API\Ventas\MediosPago\Toku;
$app->group('/toku', function($app) {
$app->post('/cuotas/{venta_id}[/]', [Toku::class, 'cuotas']);
$app->post('/success[/]', [Toku::class, 'success']);
$app->get('/test[/]', [Toku::class, 'test']);
$app->delete('/reset[/]', [Toku::class, 'reset']);
$app->post('/enqueue[/]', [Toku::class, 'enqueue']);
$app->post('/update[/{type}[/]]', [Toku::class, 'update']);
});

View File

@ -3,6 +3,13 @@ use Incoviba\Controller\API\Proyectos;
$app->group('/proyectos', function($app) {
$app->get('/escriturando[/]', [Proyectos::class, 'escriturando']);
$files = new FilesystemIterator(implode(DIRECTORY_SEPARATOR, [__DIR__, 'proyectos']));
foreach ($files as $file) {
if ($file->isDir()) {
continue;
}
include_once $file->getRealPath();
}
$app->get('[/]', [Proyectos::class, 'list']);
});
$app->group('/proyecto/{proyecto_id}', function($app) {
@ -14,10 +21,13 @@ $app->group('/proyecto/{proyecto_id}', function($app) {
$app->get('/vendible[/]', [Proyectos::class, 'superficies']);
});
$app->group('/unidades', function($app) {
$app->post('/precios[/]', [Proyectos\Unidades::class, 'precios']);
$app->post('/estados[/]', [Proyectos\Unidades::class, 'estados']);
$app->get('/disponibles[/]', [Proyectos::class, 'disponibles']);
$app->get('[/]', [Proyectos::class, 'unidades']);
});
$app->group('/terreno', function($app) {
$app->post('/edit[/]', [Proyectos::class, 'terreno']);
});
$app->get('/brokers', [Proyectos::class, 'brokers']);
});

View File

@ -0,0 +1,30 @@
<?php
use Incoviba\Controller\API\Proyectos\Brokers;
use Incoviba\Controller\API\Proyectos\Brokers\Contracts;
$app->group('/brokers', function($app) {
$app->group('/contracts', function($app) {
$app->post('/add[/]', [Contracts::class, 'add']);
$app->get('[/]', Contracts::class);
});
$app->group('/contract/{contract_id}', function($app) {
$app->post('/edit[/]', [Contracts::class, 'edit']);
$app->post('/inactive[/]', [Contracts::class, 'inactive']);
$app->delete('[/]', [Contracts::class, 'delete']);
$app->get('[/]', [Contracts::class, 'get']);
});
$app->post('/add[/]', [Brokers::class, 'add']);
$app->post('/edit[/]', [Brokers::class, 'edit']);
$app->get('[/]', Brokers::class);
});
$app->group('/broker/{broker_rut}', function($app) {
$app->group('/contracts', function($app) {
$app->post('/add[/]', [Contracts::class, 'add']);
$app->get('[/]', [Contracts::class, 'getByBroker']);
});
$app->group('/contract/{contract_id}', function($app) {
$app->post('/promotions[/]', [Contracts::class, 'promotions']);
});
$app->delete('[/]', [Brokers::class, 'delete']);
$app->get('[/]', [Brokers::class, 'get']);
});

View File

@ -0,0 +1,10 @@
<?php
use Incoviba\Controller\API\Queues;
$app->group('/queue', function($app) {
#$app->get('/jobs[/]', [Queues::class, 'jobs']);
$app->group('/run', function($app) {
#$app->get('/{job_id:[0-9]+}[/]', [Queues::class, 'run']);
$app->get('[/]', Queues::class);
});
});

View File

@ -21,6 +21,7 @@ $app->group('/ventas', function($app) {
});
$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']);
@ -55,6 +56,9 @@ $app->group('/venta/{venta_id}', function($app) {
$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']);
});

View File

@ -0,0 +1,28 @@
<?php
use Incoviba\Controller\API\Ventas\Promotions;
$app->group('/promotions', function($app) {
$app->post('/add[/]', [Promotions::class, 'add']);
$app->post('/edit[/]', [Promotions::class, 'edit']);
});
$app->group('/promotion/{promotion_id}', function($app) {
$app->delete('/remove[/]', [Promotions::class, 'remove']);
$app->group('/connections', function($app) {
$app->post('/add[/]', [Promotions::class, 'addConnections']);
$app->group('/project/{project_id}', function($app) {
$app->delete('[/]', [Promotions::class, 'removeProject']);
$app->group('/unit-type/{unit_type_id}', function($app) {
$app->delete('[/]', [Promotions::class, 'removeUnitType']);
});
});
$app->group('/broker/{broker_rut}', function($app) {
$app->delete('[/]', [Promotions::class, 'removeBroker']);
});
$app->group('/unit-line/{unit_line_id}', function($app) {
$app->delete('[/]', [Promotions::class, 'removeUnitLine']);
});
$app->group('/unit/{unit_id}', function($app) {
$app->delete('[/]', [Promotions::class, 'removeUnit']);
});
});
});

View File

@ -0,0 +1,12 @@
<?php
use Incoviba\Controller\API\Ventas\Reservations;
$app->group('/reservations', function($app) {
$app->post('/add[/]', [Reservations::class, 'add']);
$app->get('[/]', Reservations::class);
});
$app->group('/reservation/{reservation_id}', function($app) {
$app->post('/edit[/]', [Reservations::class, 'edit']);
$app->delete('[/]', [Reservations::class, 'delete']);
$app->get('[/]', [Reservations::class, 'get']);
});

View File

@ -0,0 +1,12 @@
<?php
use Incoviba\Controller\Proyectos\Brokers;
$app->group('/brokers', function($app) {
$app->get('[/]', Brokers::class);
});
$app->group('/broker/{broker_rut}', function($app) {
$app->group('/contract/{contract_id}', function($app) {
$app->get('[/]', [Brokers\Contracts::class, 'show']);
});
$app->get('[/]', [Brokers::class, 'show']);
});

View File

@ -0,0 +1,9 @@
<?php
use Incoviba\Controller\Ventas\Promotions;
$app->group('/promotions', function($app) {
$app->get('[/]', Promotions::class);
});
$app->group('/promotion/{promotion_id}', function($app) {
$app->get('[/]', [Promotions::class, 'show']);
});