feat: allow editing frequency and target_value on habits

- Add frequency to UpdateHabitRequest (was immutable, now editable)
- Validate frequency + specific_days/dates coherence on update
- Keep type and is_negative immutable (they change entry semantics)
- Remove completion_rate references from swagger and README
This commit is contained in:
2026-03-08 00:02:37 +01:00
parent 2b059ec334
commit 94c5c30d09
11 changed files with 125 additions and 36 deletions
@@ -313,10 +313,11 @@ func (h *HabitHandlers) UpdateHabit(w http.ResponseWriter, r *http.Request) {
UserID: userID,
Name: req.Name,
Description: req.Description,
CarryOver: req.CarryOver,
TargetValue: req.TargetValue,
Frequency: req.Frequency,
SpecificDays: req.SpecificDays,
SpecificDates: req.SpecificDates,
CarryOver: req.CarryOver,
TargetValue: req.TargetValue,
}
if err := h.updateHandler.Handle(r.Context(), cmd); err != nil {