This commit is contained in:
2023-08-03 08:58:53 +03:00
parent c82f8e3537
commit ad31d3ffce
30 changed files with 697 additions and 24 deletions
@@ -1,9 +1,9 @@
namespace MyOffice.Web.Controllers;
using Core.Extensions;
using Infrastructure.Attributes;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using MyOffice.Services.Account;
using MyOffice.Services.Item;
using Services.Dashboard;
[Authorize]
@@ -31,4 +31,21 @@ public class DashboardController : BaseApiController
return data;
}
[HttpGet("~/api/dashboard/income")]
public object Income(DateTime from, DateTime to, [AsGuid(true)] string? category)
{
var data = _dashboardService.GetDashboardIncomeData(UserId, from.StartOfDay(), to.EndOfDay(), category?.AsGuidNull());
return data;
}
[HttpGet("~/api/dashboard/outcome")]
public object Outcome(DateTime from, DateTime to, [AsGuid(true)] string? category)
{
var data = _dashboardService.GetDashboardOutcomeData(UserId, from.StartOfDay(), to.EndOfDay(), category?.AsGuidNull());
return data;
}
}