Skip to content

Conversation

@jjoonleo
Copy link
Contributor

@jjoonleo jjoonleo commented Nov 24, 2025

Describe your changes

  • 스케줄 겹침 경고 기능 제작

Issue ticket number and link

#328

Checklist before requesting a review

  • I have performed a self-review of my code
  • If it is a core feature, I have added thorough tests.

Screenshots (if appropriate):


Note

Adds schedule overlap detection/warnings in the create flow and finish-schedule handling, with supporting use-cases, data updates, and UI integration.

  • Schedule Creation UX:
    • Show overlap warning/error messages when selected date/time, move time, or spare time conflict with the next schedule via new MessageBubble.
    • Compute next schedule’s preparation window and validate in ScheduleDateTimeCubit, SchedulePlaceMovingTimeCubit, and ScheduleFormSpareTimeCubit.
  • Finish Flow:
    • Add ScheduleFinished event and handling in ScheduleBloc; AlarmScreen triggers finish API then navigates to early/late screen.
    • Disable edit action for completed/past schedules in calendar item.
  • Domain/Use-cases:
    • Introduce loading/querying of next schedule and preparations: LoadNextScheduleWithPreparationUseCase, GetNextScheduleWithPreparationUseCase, LoadPreparationByScheduleIdUseCase, LoadSchedulesByDateUseCase.
    • Refactor weekly/monthly loaders to use date-range loader.
  • Data/Repository/API:
    • PreparationRepository now streams preparations; push updates on create/update/load.
    • ScheduleRepository adds finishSchedule; ScheduleRemoteDataSource supports PUT /schedules/{id}/finish.
    • Extend models: ScheduleEntity + ScheduleDoneStatus, GetScheduleResponseModel maps doneStatus.
  • Infra/Logging/i18n:
    • Add request LoggingTransformer and set JSON content type.
    • Add localized overlap messages (ko/en).
    • New endpoint Endpoint.finishSchedule().

Written by Cursor Bugbot for commit 194acf0. This will update automatically on new commits. Configure here.

- Introduced LoggingTransformer to log serialized request payloads for better debugging and monitoring.
- Updated AppDio to utilize LoggingTransformer, enhancing the request transformation process.
- This addition improves visibility into the data being sent over the network.
- Introduced finishSchedule method in ScheduleRemoteDataSource and its implementation in ScheduleRepositoryImpl to handle finishing schedules with a lateness time.
- Added FinishScheduleUseCase to encapsulate the logic for finishing a schedule, enhancing the architecture and separation of concerns.
- Updated Endpoint class to include a new endpoint for finishing schedules.
- Added ScheduleFinished event to trigger the completion of a schedule with a lateness time.
- Updated ScheduleBloc to process the ScheduleFinished event, integrating the new FinishScheduleUseCase for managing schedule finalization.
- Enhanced AlarmScreen to calculate and dispatch lateness minutes upon preparation completion, improving user feedback on schedule adherence.
- Introduced doneStatus property in GetScheduleResponseModel and ScheduleEntity to track the completion status of schedules.
- Implemented _mapDoneStatus function to map server values to ScheduleDoneStatus enum, enhancing status management.
- Default value for doneStatus is set to 'NOT_ENDED' in GetScheduleResponseModel and ScheduleEntity, improving initial state handling.
…Entity

- Eliminated the assignment of elapsedTime from the current preparation step, streamlining the state management logic.
- This change enhances the clarity and efficiency of the preparation handling within the entity.
…pletion

- Changed the HTTP method from POST to PUT in the finishSchedule implementation to align with RESTful conventions for updating resources.
- This adjustment ensures proper handling of schedule completion requests, enhancing the API interaction.
…tion completion

- Introduced navigation logic in AlarmScreen to handle transitions after preparation completion, improving user experience.
- Added state variables to manage pending early/late status and reset navigation state effectively.
- Refactored the build method to utilize BlocListener for handling schedule state changes, ensuring timely navigation to the early/late screen.
- Improved the preparation completion dialog handling to provide better feedback upon finishing preparation steps.
…tatus

- Added logic to determine if the edit action should be displayed based on the schedule's doneStatus and scheduleTime.
- This enhancement improves user interaction by preventing edits on completed schedules or those that are past their scheduled time.
- Introduced a copyWith method in ScheduleEntity to facilitate the creation of modified instances while maintaining immutability.
- This enhancement allows for easier updates to the doneStatus property without altering the original instance, improving state management.
- Updated finishSchedule method to include logic for updating the doneStatus based on lateness time, improving state management.
- Added functionality to emit updated schedule instances through the stream controller, ensuring real-time updates for schedule completion status.
- Refactored getNearestUpcomingScheduleUseCase to handle exceptions more gracefully and ensure proper fetching of schedules based on their doneStatus.
…ing logic

- Added LoadSchedulesByDateUseCase to fetch schedules for a specified date range, improving modularity and reusability.
- Refactored LoadSchedulesForMonthUseCase and LoadSchedulesForWeekUseCase to utilize LoadSchedulesByDateUseCase, streamlining schedule retrieval logic.
- Introduced a BehaviorSubject to manage a stream of preparation entities, allowing real-time updates.
- Updated getPreparationByScheduleId and createDefaultPreparation methods to emit changes to the preparation stream.
- Refactored the PreparationRepository interface to include the preparationStream getter, enhancing data flow management.
…restUpcomingScheduleUseCase

- Added LoadPreparationByScheduleIdUseCase to facilitate loading preparation data from the remote source and updating local cache.
- Updated GetNearestUpcomingScheduleUseCase to utilize the new LoadPreparationByScheduleIdUseCase for fetching preparation data, improving data retrieval logic.
- Refactored getPreparationByScheduleId method to return preparation from a stream, enhancing real-time data handling.
…eduleWithPreparationUseCase

- Added GetNextScheduleWithPreparationUseCase to retrieve the next schedule along with its preparation data, enhancing scheduling functionality.
- Introduced LoadNextScheduleWithPreparationUseCase to load schedules and preparation data from the server, improving data synchronization.
- Enhanced localization with new messages for schedule overlap warnings and errors, providing better user feedback on scheduling conflicts.
- Updated ScheduleDateTimeCubit to check for schedule overlaps and display appropriate messages, improving user experience during schedule creation.
…tion for all schedules in date range

- Updated LoadNextScheduleWithPreparationUseCase to utilize GetSchedulesByDateUseCase for fetching schedules.
- Modified the call method to load preparation data for all schedules within the specified date range, improving data handling and synchronization.
- Updated localization files to include schedule overlap warnings and errors with specific schedule names for better user feedback.
- Refactored schedule overlap logic in ScheduleDateTimeCubit and related components to utilize new overlap duration calculations.
- Introduced MessageBubble component for consistent display of overlap messages across different forms.
- Enhanced state management in ScheduleFormSpareTimeCubit and SchedulePlaceMovingTimeCubit to track overlap status and duration, improving user experience during schedule creation.
Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR is being reviewed by Cursor Bugbot

Details

You are on the Bugbot Free tier. On this plan, Bugbot will review limited PRs each billing cycle.

To receive Bugbot reviews on all of your PRs, visit the Cursor dashboard to activate Pro and start your 14-day free trial.

@@ -0,0 +1 @@
genhtml coverage/lcov.info -o coverage/html
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: Coverage report files accidentally committed

Test coverage report files including HTML reports and command files were committed to the repository. These are generated artifacts that should be excluded via .gitignore as they bloat the repository, cause merge conflicts, and contain machine-specific paths like /Users/ejunpark/Development/Flutter/OnTime-front/lib/. Coverage reports should be generated locally or in CI/CD pipelines but not version controlled.

Additional Locations (2)

Fix in Cursor Fix in Web

- Introduced nextScheduleName to ScheduleFormEvent, ScheduleFormState, and related components to enhance schedule overlap handling.
- Updated localization messages in SchedulePlaceMovingTimeState and ScheduleFormSpareTimeState to include the next schedule name for better user feedback during scheduling conflicts.
@github-actions
Copy link

Visit the preview URL for this PR (updated for commit 194acf0):

https://ontime-c63f1--pr329-328-uh7kanav.web.app

(expires Mon, 01 Dec 2025 19:55:47 GMT)

🔥 via Firebase Hosting GitHub Action 🌎

Sign: 7d60a2eae4c4a5839220ed6a57552a3b61cce5a3

@github-actions
Copy link

Visit the preview URL for this PR (updated for commit 194acf0):

https://on-time-front-widgetbook--pr329-328-27f15gj4.web.app

(expires Mon, 01 Dec 2025 19:56:26 GMT)

🔥 via Firebase Hosting GitHub Action 🌎

Sign: e53128a376fed0209d449279de9c0d94c83cdd8b

@jjoonleo jjoonleo closed this Nov 25, 2025
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.

2 participants