Repository navigation
Conversation
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 59 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
Open
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Overview
Adds chores: rotations, the week view, marking turns done, swapping turns and the "Done this month" stats. This is the third MVP PR after login and houses, and is taken from
mvp-features, which is what the dev server runs.Changes Made
New
src/chores/moduleschedule.ts: date math for each frequency (DAILY,EVERY_OTHER_DAY,WEEKLY,BIWEEKLY,MONTHLY, with monthly clamped to the end of short months) and who's up next in the rotationchoreService.ts: creates, edits and deletes chores and generates their turns. Swaps and completions are saved on the turn, so editing a chore later never undoes them, and finished or overdue turns never changechoreController.ts,choreRouter.ts,chores.schema.ts: routes and request validationEndpoints (all under
/houses/:houseId, members only)GET /chores,POST /chores,GET /chores/:choreId,PATCH /chores/:choreId,DELETE /chores/:choreIdGET /chores/stats?month=YYYY-MM: turns each person finished that monthGET /chore-assignments?from&to&assignee&includeOverdue: turns in a date range (max 62 days), used by Home and the week viewPOST/DELETE /chore-assignments/:assignmentId/complete: mark done or undo. Anyone in the house can do it, and it counts for whoever didPOST /chore-assignments/:assignmentId/swap: trade two upcoming turns of the same choreHouses
houseRouter.tsNo schema changes. The chore tables were already in the initial migration.
Test Coverage
test/schedule.test.ts: frequency stepping, end-of-month clamping, listing turns in a range, rotation order, and "today" in the house's time zonetest/chores.test.ts(15 tests): creating chores and the "Coming up" preview, rotation members must live in the house, the week view with status and the "me" filter, overdue turns, bad date ranges, complete/undo and monthly stats, swaps and "Allow swaps" off, reordering the rotation, rescheduling that keeps finished turns, no rescheduling into the past, deleting a chore, leaving the house mid-rotation, and hiding other houses' choresNext Steps
reminderHouris saved but nothing sends reminders yet