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:
@@ -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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user