Skip to content

Commit

Permalink
[Hotfix][Duy] Return users count in dashboard
Browse files Browse the repository at this point in the history
  • Loading branch information
duykasama committed Mar 19, 2024
1 parent ce54759 commit 5b7c77b
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion Domus.Service/Implementations/AdminService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,13 @@ public class AdminService : IAdminService
{
private readonly IContractRepository _contractRepository;
private readonly IQuotationRevisionRepository _quotationRevisionRepository;
private readonly IUserRepository _userRepository;

public AdminService(IContractRepository contractRepository, IQuotationRevisionRepository quotationRevisionRepository)
public AdminService(IContractRepository contractRepository, IQuotationRevisionRepository quotationRevisionRepository, IUserRepository userRepository)
{
_contractRepository = contractRepository;
_quotationRevisionRepository = quotationRevisionRepository;
_userRepository = userRepository;
}

public async Task<ServiceActionResult> GetDashboardInfo(GetDashboardInfoRequest request)
Expand Down Expand Up @@ -47,6 +49,7 @@ public async Task<ServiceActionResult> GetDashboardInfo(GetDashboardInfoRequest
});
}

dashboardResponse.NewUsersCount = await (await _userRepository.FindAsync(u => !u.IsDeleted && u.EmailConfirmed)).CountAsync();
dashboardResponse.TotalRevenue = dashboardResponse.RevenueByMonths.Select(rbm => rbm.Revenue).Sum();

return new ServiceActionResult(true) { Data = dashboardResponse };
Expand Down

0 comments on commit 5b7c77b

Please sign in to comment.