feat: 데일리 루틴 (반복 할 일) 지원#68
Open
sjin4861 wants to merge 7 commits into
Open
Conversation
Introduces RecurrenceRule with daily/weekly/monthly/yearly frequency, interval, weekday selection, and a sealed RecurrenceEnd type (never/onDate/afterCount). Todo gains nullable recurrence, seriesId, and occurrenceDate so a single entity can represent both a series template and a materialized occurrence. Adds four usecases (create/update/delete/expand) and extends the TodoRepository contract with series + occurrence lookups. Repository impl uses stubs that throw UnimplementedError; full persistence lands in step 2/3. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
RecurrenceRuleModel (typeId 8), RecurrenceEndModel (7), RecurrenceEndKind (6), and RecurrenceFrequencyModel (5) provide Hive-backed persistence for the new domain types. TodoModel adds three nullable fields (recurrence/seriesId/occurrenceDate) at HiveField 10-12, so existing boxes remain readable without migration. Adapters are registered in main.dart, and a round-trip test confirms non-recurring todos persist with null recurrence, weekly rules with EndAfterCount survive the round-trip, materialized occurrences keep their seriesId, and EndOnDate/EndNever both deserialize correctly. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
TodoLocalDatasource gains getRecurringSeries (filters non-occurrence todos with a recurrence rule), findOccurrence (matches seriesId + day-normalized occurrenceDate), and deleteSeriesAndUnfinishedOccurrences (drops the series and any unfinished materialized occurrences, preserving completed history). TodoRepositoryImpl delegates the four new contract methods to the datasource. materializeOccurrence persists the entity as-is so the virtual id assigned by ExpandRecurringTodosForDate becomes the stable Hive key for that day's instance. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
TodoInputViewModel now carries a nullable RecurrenceRule, populates
it from the editing todo, and routes save through the recurring
usecases when a rule is set. describeRecurrence() formats the rule for
display ("매주 월, 수, 금", "매 2달 15일", etc.).
A new RecurrenceBottomSheet lets users choose frequency
(none/daily/weekly/monthly/yearly), interval, weekdays (multi-select
chips when weekly), month day (when monthly), and end condition
(never / on date / after N times). Defaults seed the start weekday for
weekly and the start day-of-month for monthly so common cases are
one-tap.
The input body surfaces a "반복" row beneath the existing options;
it is shown only for daily todos since a date-range todo already
defines a single span.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
HomeViewModel.loadTodos now drops series templates from the raw list, asks ExpandRecurringTodosForDate for today's occurrences, and merges them by id so an already-materialized instance wins over the virtual copy. The home row shows a small repeat icon for any todo that carries a recurrence rule (series or occurrence). TodoManageViewModel applies the same drop+expand+merge for the currently selected date; updateSelectedDate is now async so the expansion refresh completes before filter/categorize. The status update path in TodoRepositoryImpl preserves recurrence/seriesId/ occurrenceDate so toggling a virtual occurrence materializes it as a proper occurrence record rather than wiping the recurrence metadata. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
TodoManageViewModel gains deleteRecurringSeries (delegates to DeleteRecurringTodoUseCase) and deleteTodoById now falls back to the day's expanded occurrences so virtual instances can also be targeted. todo_list_section routes onDelete through a shared handler: a non-recurring todo deletes immediately as before, while a recurring one (series or any occurrence) raises a confirmation dialog explaining that future occurrences will be removed and completed history is preserved. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Drives a real TodoLocalDatasource (Hive) via a thin in-process TodoRepository so create → expand → materialize-on-complete → delete runs through the actual persistence layer, not mocks. Confirms a weekly Mon/Wed/Fri series surfaces on Mon and Wed but not Tue, that checking the Mon occurrence materializes a status=1.0 record, and that deleting the series drops future occurrences while preserving the completed Mon record. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
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.
Summary
RecurrenceRule(daily/weekly/monthly/yearly + interval + 요일/일자 + 종료조건) 추가TodoModelHiveField 10–12 (nullable) → 기존 박스 호환 (마이그레이션 불필요)Commits (단계별 리뷰 권장)
feat(domain): 엔티티 + UseCase + expand 알고리즘feat(data): Hive 모델/어댑터/매퍼/등록 + 라운드트립 테스트feat(data): Repository/Datasource 구현 + 단위 테스트feat(presentation): TodoInputView 반복 BottomSheetfeat(presentation): 홈/관리 화면 lazy expansion + 아이콘feat(presentation): 시리즈 삭제 확인 다이얼로그test(data): 통합 테스트 (생성→expand→완료→삭제)Test plan