feat: show report on payment method
All checks were successful
Deploy / build-and-deploy (push) Successful in 2m37s

This commit is contained in:
juancwu 2026-03-17 17:04:21 +00:00
commit 047e392ac3
4 changed files with 70 additions and 0 deletions

View file

@ -61,6 +61,11 @@ func (s *ReportService) GetSpendingReport(spaceID string, from, to time.Time) (*
}
}
byPaymentMethod, err := s.expenseRepo.GetExpensesByPaymentMethod(spaceID, from, to)
if err != nil {
return nil, err
}
totalIncome, totalExpenses, err := s.expenseRepo.GetIncomeVsExpenseSummary(spaceID, from, to)
if err != nil {
return nil, err
@ -68,6 +73,7 @@ func (s *ReportService) GetSpendingReport(spaceID string, from, to time.Time) (*
return &model.SpendingReport{
ByTag: byTag,
ByPaymentMethod: byPaymentMethod,
DailySpending: daily,
MonthlySpending: monthly,
TopExpenses: topWithTags,