feat: add finance module with yearly income/expense tracking

- FinanceEntry model (income/expense x fixed/extra)
- CRUD API endpoints for finance entries
- FinancePage with summary cards and drill-down
- Updated navigation with Finance tab
- Updated todos default filter to active
This commit is contained in:
2026-07-29 00:15:41 +08:00
parent acb1291137
commit acd70d319f
9 changed files with 505 additions and 16 deletions
+24
View File
@@ -97,3 +97,27 @@ func (s *DailyLogService) Save(date, morning, afternoon, evening string) (*model
err := s.repo.Upsert(log)
return log, err
}
type FinanceService struct {
repo *repository.FinanceRepository
}
func NewFinanceService(repo *repository.FinanceRepository) *FinanceService {
return &FinanceService{repo: repo}
}
func (s *FinanceService) GetByYear(year int) ([]model.FinanceEntry, error) {
return s.repo.GetByYear(year)
}
func (s *FinanceService) Create(entry *model.FinanceEntry) error {
return s.repo.Create(entry)
}
func (s *FinanceService) Update(entry *model.FinanceEntry) error {
return s.repo.Update(entry)
}
func (s *FinanceService) Delete(id uint64) error {
return s.repo.Delete(id)
}