añadido tercera estadistica
This commit is contained in:
@@ -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)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user