feat(savings): Add savings module with categories, transactions, recurring plans

- Categories: regular, deposits, credits, recurring, multi-user, accounts
- Transactions: deposits and withdrawals with user tracking
- Recurring plans: monthly payment obligations per user
- Stats: overdues calculation with allocation algorithm
- Excludes is_account categories from total sums
- Documentation: docs/SAVINGS.md
This commit is contained in:
Cosmo
2026-02-16 06:48:09 +00:00
parent 9e90aa6d95
commit 2a50e50771
18 changed files with 2910 additions and 162 deletions

View File

@@ -146,6 +146,14 @@ func (h *HabitHandler) Log(w http.ResponseWriter, r *http.Request) {
writeError(w, "habit not found", http.StatusNotFound)
return
}
if errors.Is(err, service.ErrFutureDate) {
writeError(w, "cannot log habit for future date", http.StatusBadRequest)
return
}
if errors.Is(err, service.ErrAlreadyLogged) {
writeError(w, "habit already logged for this date", http.StatusConflict)
return
}
writeError(w, "failed to log habit", http.StatusInternalServerError)
return
}