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