This commit is contained in:
2023-07-21 23:01:56 +03:00
parent fa5a8a9001
commit d0cdaa85b6
18 changed files with 863 additions and 178 deletions
@@ -1,23 +1,25 @@
namespace MyOffice.Services.Dashboard.Domain;
using System.Collections.Generic;
using System.Text.Json.Serialization;
using Data.Models.Accounts;
public class DashboardData
{
public decimal IncomeLastWeek { get; set; }
public decimal IncomePreviousWeek { get; set; }
public decimal OutcomeLastWeek { get; set; }
public decimal OutcomePreviousWeek { get; set; }
public List<AccountSimple>? Rests { get; set; }
public decimal? RestTotal => Rests?.Sum(x => x.Rest);
public decimal? RestTotalPlus => Rests?.Where(x => x.Rest > 0).Sum(x => x.Rest);
public decimal? RestTotalMinus => Rests?.Where(x => x.Rest < 0).Sum(x => x.Rest);
public decimal IncomeLast { get; set; }
public decimal IncomePrevious { get; set; }
public decimal OutcomeLast { get; set; }
public decimal OutcomePrevious { get; set; }
public decimal? Balance { get; set; }
public decimal? BalanceDebit { get; set; }
public decimal? BalanceCredit { get; set; }
}
/*public class DashboardRestData
public class DashboardRestData
{
public string AccountId { get; set; }
public string AccountName { get; set; }
public decimal Rest { get; set; }
}*/
public AccountSimple AccountSimple { get; set; }
public decimal? Balance => AccountSimple.Balance;
public decimal? BalanceAtRate =>
AccountSimple.Balance * (AccountSimple.CurrencyRate * AccountSimple.CurrencyQuantity);
}