Add transfer tracking and secure admin access
This commit is contained in:
@@ -56,7 +56,9 @@ public sealed class BudgetPushService(AppDbContext db)
|
||||
var spent = await db.Transactions
|
||||
.Where(transaction => transaction.UserId == userId &&
|
||||
transaction.LedgerId == group.Key.LedgerId &&
|
||||
transaction.Type == TransactionType.Expense &&
|
||||
(transaction.Type == TransactionType.Expense ||
|
||||
transaction.Type == TransactionType.Transfer &&
|
||||
transaction.TransferDirection == TransferDirection.Out) &&
|
||||
transaction.OccurredAt >= start && transaction.OccurredAt < end)
|
||||
.GroupBy(transaction => transaction.CategoryId)
|
||||
.Select(items => new { CategoryId = items.Key, Amount = items.Sum(item => item.Amount) })
|
||||
|
||||
Reference in New Issue
Block a user