añadido tercera estadistica

This commit is contained in:
fede committed 2025-05-31 01:06:59 -03:00
1 parent 616c9503bc
commit e5d17c3a38
5 files changed
+135 -20

No files matched your search

@@ -7,6 +7,21 @@ namespace AlquilaFacil.Controllers;
[ApiController]
public class EstadisticaController : ControllerBase
{
[HttpGet("/api/stats/Pagos")]
public IActionResult EstadisticasPagos([FromHeader(Name ="Auth")] string Auth, int year){
if (String.IsNullOrWhiteSpace(Auth)) return BadRequest("");
var validacion1 = RepositorioPermisos.Singleton.CheckPermisos(Auth, 6);
if (validacion1 == false) return Unauthorized();
ChartData stats;
List<InformePagos> tabla;
(stats, tabla) = RepositorioEstadisticas.Singleton.InformePagos(year);
return Ok(new { chart = stats, tabla = tabla});
}
[HttpGet("api/stats/alquileresIniciados")]
public IActionResult alquileresIniciadosEsteAño([FromHeader(Name = "Auth")] string Auth, int year)
{