1
All checks were successful
Docker Build & Deploy / Build Docker Image (push) Successful in 32s
Docker Build & Deploy / Deploy to Production (push) Successful in 13s
Docker Build & Deploy / Cleanup Dangling Images (push) Successful in 1s
Docker Build & Deploy / WeChat Notification (push) Successful in 2s
All checks were successful
Docker Build & Deploy / Build Docker Image (push) Successful in 32s
Docker Build & Deploy / Deploy to Production (push) Successful in 13s
Docker Build & Deploy / Cleanup Dangling Images (push) Successful in 1s
Docker Build & Deploy / WeChat Notification (push) Successful in 2s
This commit is contained in:
@@ -273,7 +273,13 @@ public class TransactionRecordController(
|
||||
try
|
||||
{
|
||||
var statistics = await transactionRepository.GetDailyStatisticsAsync(year, month);
|
||||
var result = statistics.Select(s => new DailyStatisticsDto(s.Key, s.Value.count, s.Value.amount)).ToList();
|
||||
var result = statistics.Select(s => new DailyStatisticsDto(
|
||||
s.Key,
|
||||
s.Value.count,
|
||||
s.Value.expense,
|
||||
s.Value.income,
|
||||
s.Value.income - s.Value.expense // Balance = Income - Expense
|
||||
)).ToList();
|
||||
|
||||
return result.Ok();
|
||||
}
|
||||
@@ -300,7 +306,13 @@ public class TransactionRecordController(
|
||||
var effectiveStartDate = startDate.Date;
|
||||
|
||||
var statistics = await transactionRepository.GetDailyStatisticsByRangeAsync(effectiveStartDate, effectiveEndDate);
|
||||
var result = statistics.Select(s => new DailyStatisticsDto(s.Key, s.Value.count, s.Value.amount)).ToList();
|
||||
var result = statistics.Select(s => new DailyStatisticsDto(
|
||||
s.Key,
|
||||
s.Value.count,
|
||||
s.Value.expense,
|
||||
s.Value.income,
|
||||
s.Value.income - s.Value.expense
|
||||
)).ToList();
|
||||
|
||||
return result.Ok();
|
||||
}
|
||||
@@ -755,7 +767,9 @@ public record UpdateTransactionDto(
|
||||
public record DailyStatisticsDto(
|
||||
string Date,
|
||||
int Count,
|
||||
decimal Amount
|
||||
decimal Expense,
|
||||
decimal Income,
|
||||
decimal Balance
|
||||
);
|
||||
|
||||
/// <summary>
|
||||
|
||||
Reference in New Issue
Block a user