Remove unnecessary comments from codebase

Clean up obvious and redundant comments that don't add value:
- Remove step-by-step comments in command handlers
- Remove obvious test setup comments
- Keep only meaningful comments that explain why, not what
This commit is contained in:
2025-11-27 00:48:50 +01:00
parent ca2533d4df
commit 358f844073
7 changed files with 0 additions and 19 deletions
@@ -30,28 +30,23 @@ func NewUpdateHabitHandler(habitRepo repositories.HabitRepository) *UpdateHabitH
}
func (h *UpdateHabitHandler) Handle(ctx context.Context, cmd UpdateHabitCommand) error {
// Validate input
if strings.TrimSpace(cmd.Name) == "" {
return errors.ErrInvalidInput
}
// Find existing habit
habit, err := h.habitRepo.FindByID(ctx, cmd.HabitID)
if err != nil {
return err
}
// Check ownership
if habit.UserID != cmd.UserID {
return errors.ErrUnauthorized
}
// Cannot update archived habits
if !habit.IsActive() {
return errors.ErrInvalidInput
}
// Update fields
habit.Name = cmd.Name
habit.Description = cmd.Description
habit.CarryOver = cmd.CarryOver
@@ -59,6 +54,5 @@ func (h *UpdateHabitHandler) Handle(ctx context.Context, cmd UpdateHabitCommand)
habit.SpecificDays = cmd.SpecificDays
habit.SpecificDates = cmd.SpecificDates
// Save changes
return h.habitRepo.Update(ctx, habit)
}