Skip to content

feat: add skip habit endpoint - #21

Merged
thomasluizon merged 1 commit into
mainfrom
feature/skip-habit
Mar 23, 2026
Merged

feat: add skip habit endpoint#21
thomasluizon merged 1 commit into
mainfrom
feature/skip-habit

Conversation

@thomasluizon

Copy link
Copy Markdown
Owner

Summary

  • New POST /api/habits/{id}/skip endpoint
  • Advances a recurring habit's due date to the next scheduled occurrence without creating a HabitLog
  • Reuses existing Habit.AdvanceDueDate(today) domain method

Changes

  • SkipHabitCommand - MediatR command + handler: validates habit is recurring, due/overdue, not completed, then advances due date
  • SkipHabitCommandValidator - FluentValidation: UserId/HabitId not empty
  • HabitsController - new POST {id}/skip action returning 204 No Content

Frontend dependency

Test plan

  • Skip a daily habit due today - verify DueDate advances to tomorrow
  • Skip an overdue habit (3 days late) - verify DueDate advances past today
  • Try to skip a one-time task - verify 400 error
  • Try to skip a future habit - verify 400 error
  • Try to skip a completed habit - verify 400 error

🤖 Generated with Claude Code

New POST /api/habits/{id}/skip endpoint that advances a recurring
habit's due date to the next scheduled occurrence without creating
a HabitLog entry. Reuses existing AdvanceDueDate domain method.

Validates: habit exists, owned by user, is recurring, due today or
overdue, not already completed.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@thomasluizon
thomasluizon merged commit f29d880 into main Mar 23, 2026
2 checks passed
@thomasluizon
thomasluizon deleted the feature/skip-habit branch March 23, 2026 00:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant