Skip to content

[codex] fix default preparation copy on schedule edit#572

Merged
jjoonleo merged 1 commit into
mainfrom
feature/fix-default-preparation-copy
Jun 28, 2026
Merged

[codex] fix default preparation copy on schedule edit#572
jjoonleo merged 1 commit into
mainfrom
feature/fix-default-preparation-copy

Conversation

@jjoonleo

Copy link
Copy Markdown
Contributor

Summary

  • Preserve the schedule's original preparation mode when opening the edit form.
  • When a DEFAULT schedule's preparation is edited, copy the steps with fresh UUIDs before calling PUT /schedules/{scheduleId}/preparations.
  • Keep existing step IDs unchanged for CUSTOM schedules.

Root Cause

DEFAULT schedules render user default preparation rows from /users/preparations. The edit flow was sending those default preparationId values back to the schedule-specific update endpoint, which creates schedule-owned preparation rows. Reusing user-default IDs can conflict with existing preparation_user rows and trigger PREPARATION_STEP_ID_CONFLICT.

Validation

  • flutter test test/presentation/schedule_create/bloc/schedule_form_bloc_test.dart
  • flutter analyze
  • git diff --check

@jjoonleo jjoonleo marked this pull request as ready for review June 28, 2026 06:21
@jjoonleo jjoonleo merged commit ce72e1c into main Jun 28, 2026
3 of 5 checks passed
@jjoonleo jjoonleo deleted the feature/fix-default-preparation-copy branch June 28, 2026 06:21
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