Skip to content

Add native chore creation from Master data - #1005

Open
exquisiteskink wants to merge 2 commits into
patzly:masterfrom
exquisiteskink:feature/native-chore-creation
Open

exquisiteskink wants to merge 2 commits into
patzly:masterfrom
exquisiteskink:feature/native-chore-creation

Conversation

@exquisiteskink

@exquisiteskink exquisiteskink commented Oct 5, 2026 •

Copy link
Copy Markdown

Master data → Chores currently displays a not-implemented message. This change opens a native creation form and saves the chore through the existing Grocy API.

Changes

  • Follow the existing Java Fragment/ViewModel, view binding, Material form, navigation, and DownloadHelper patterns.
  • Create chores with a name, description, start date, and manual/daily/weekly/monthly/yearly recurrence. Validate intervals, month days, and required weekdays before sending.
  • Preserve form values with SavedStateHandle, including across rotation and process recreation.
  • POST to objects/chores, then calculate assignments using the returned ID, following the web editor's save sequence.
  • Block repeated Save taps and automatic retries of the create POST. If assignment setup fails after creation, retry setup with the saved ID. An uncertain create outcome directs the user to check the server and blocks resubmission from that form.
  • Reuse existing server storage and Android chore synchronization; no database migration or tracking rewrite.

Scope

Requires Grocy 4.0 or newer. New chores are active, date-only, and unassigned. Keep the server-interface action for existing chore management and advanced settings. Editing, assignment configuration, hourly/adaptive schedules, time-of-day tracking, stock consumption, and userfields remain outside this creation-only change.

Validation

  • :app:testDebugUnitTest :app:assembleDebug :app:lintDebug completed successfully using the project's Gradle 9.4.1 wrapper and JDK 21. All six JUnit tests passed, covering payload defaults, supported recurrences, leap-day dates, month-day boundaries, and invalid input.
  • Compared lint against upstream 8921b9f8b: no new findings. The existing 34 fatal findings, 28 errors, and 599 warnings are unchanged; upstream configures abortOnError = false.
  • Tested the debug APK on a physical Samsung Galaxy Z Fold6 running Android 16 against an isolated official Grocy 4.7.1 instance. Created all five supported recurrence types and verified their persisted payloads, visibility in the existing Android tracking screen, and visibility in the server web UI.
  • Checked empty-name, zero-interval, missing-weekday, and invalid-month-day validation; form restoration across rotation and process recreation; and date-picker restoration after rotation.
  • Used a local fault-injection proxy to verify a 403 rejection can be retried, repeated Save taps and rotation during a delayed create produce one record, assignment setup failure can be retried after process recreation using the original ID, and a lost create response blocks resubmission even after process recreation. Request logs and the server database confirmed no duplicate records.
  • git diff --check passed. The debug app used separate storage; no household server data was used for testing.

@exquisiteskink
exquisiteskink marked this pull request as ready for review October 6, 2026 00:49
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