Repository navigation
fix: expose persisted habit recurrence origins - #820
Merged
Merged
Conversation
|
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes: Reviewed the persisted recurrence-origin fields across both detail-query producers, both API contracts, regression tests, and the current shared client schemas.
- Detail responses: Append optional nullable
scheduledStartDateandoriginalDayOfMonth, projecting stored values in both standalone and full-detail responses without inferring missing legacy values. - API compatibility: Update v1 and v2 OpenAPI schemas additively without changing existing fields or required lists; client adoption remains the separate follow-up described in the PR.
- Regression coverage: Verified 29 focused application tests and 2 contract tests pass, including short-month, leap-day, daily, and legacy-null cases; OpenAPI regeneration left the worktree clean. Full suites were not rerun during this review.
gpt-6.1-sol | 𝕏
This was referenced Oct 20, 2026
thomasluizon
added a commit
that referenced
this pull request
Oct 20, 2026
… and bulk reparenting (#746) (#827) * fix: expose persisted habit recurrence origins (#820) (cherry picked from commit 6e4a3a5) * feat: support bounded habit log date ranges (#822) (cherry picked from commit 906f9e4) * Add bulk habit reparenting (#821) * refactor: share habit hierarchy validation helpers * feat: move selected habits under a parent atomically * fix: register bulk parent action in the capability catalog (cherry picked from commit f67708f)
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.




Closes thomasluizon/orbit-tickets#394
Habit detail responses now expose the persisted
scheduledStartDateandoriginalDayOfMonth, so clients can retain the recurrence origin after a completion clamps the next due date to a short month. Missing stored values serialize as null.HabitDetailResponseand its projection insrc/Orbit.Application/Habits/Queries/GetHabitByIdQuery.csappend nullable fields with null defaults.GetHabitFullDetailQuery.cspopulates the same fields in its embedded detail response. Both generated contracts,src/Orbit.Api/openapi.jsonandopenapi_v2.json, include the optional additions. Existing fields and request contracts are unchanged.The entity fields already exist at
src/Orbit.Domain/Entities/Habit.cs:81and:88; historical scheduling already uses the persisted anchor atsrc/Orbit.Application/Habits/Services/HabitScheduleService.cs:206-207and:238. This change projects those stored values directly. It needs no migration, backfill, new input validator, or domain mutation. Client reconstruction remains in #395.Assumptions
HabitDetailResponse, including the full-detail query, rather than leaving that endpoint to return the new constructor defaults for populated entity fields.Test evidence
dotnet test tests/Orbit.Application.Tests --filter FullyQualifiedName~GetHabitByIdQueryHandlerTestspassed all 10 existing tests with the omission present, includingHandle_HabitFound_MapsAllDetailFields.GetHabitRecurrenceOriginTestswhile the implementation still lacked both fields.dotnet test tests/Orbit.Application.Tests --filter FullyQualifiedName~GetHabitRecurrenceOriginTestsfailed all 8 cases withKeyNotFoundExceptionon the missing serialized fields. The cases use realHabit.CreateandHabit.Logto advance Jan 31 to Feb 28 and Feb 29 into a non-leap year, exercise both detail producers, and cover daily and legacy null values. Reflection represents legacy nullable persisted properties because the current factory always initializes the origin.dotnet test tests/Orbit.Application.Tests --no-build --filter 'FullyQualifiedName~GetHabitRecurrenceOriginTests|FullyQualifiedName~GetHabitByIdQueryHandlerTests|FullyQualifiedName~GetHabitFullDetailQueryHandlerTests'passed all 29 tests, including all 8 regression cases.dotnet test tests/Orbit.Infrastructure.Tests --no-build --filter FullyQualifiedName~HabitRecurrenceOriginContractTestspassed both contract tests, proving optional nullable fields in v1 and v2.dotnet build Orbit.slnxpassed with 0 errors. Both generated documents were compared with the original committed JSON: removing only the two added detail properties makes each document identical to its original. Their required lists are unchanged. CI remains responsible for the OpenAPI breaking-change gate; this worker does not wait on CI.dotnet test tests/Orbit.Domain.Tests: 767 passed, exit 0.dotnet test tests/Orbit.Application.Tests: 5,232 passed, exit 0.dotnet test tests/Orbit.Infrastructure.Tests: 3,773 passed, exit 0.dotnet test tests/Orbit.Analyzers.Tests --no-build: 40 passed, exit 0.