Skip to content

Conversation

@jjoonleo
Copy link
Contributor

@jjoonleo jjoonleo commented Nov 25, 2025

  • 일정(스케줄) 생성 시 겹치는 일정이 있을 경우 경고 메시지 표시
  • 관련 UI 및 로직 추가
  • 테스트 및 리팩토링 포함

Note

Adds schedule overlap detection (warnings/errors) in schedule creation, finish-schedule flow, preparation streaming, logging, and related UI/localization updates.

  • Core/Network:
    • Add request logging transformer LoggingTransformer and wire into AppDio.
    • Extend endpoint with finishSchedule and implement in ScheduleRemoteDataSource.
  • Domain/Repositories & Use-cases:
    • Introduce preparation streaming via PreparationRepository (BehaviorSubject); adapt getters to stream-based flow.
    • Add/Refactor use-cases: LoadSchedulesByDate, LoadPreparationByScheduleId, LoadAdjacentScheduleWithPreparation, GetAdjacentSchedulesWithPreparation, update weekly/monthly loaders to use new loader.
    • Enhance GetNearestUpcomingScheduleUseCase to ignore ended schedules and ensure preparation load.
    • Add FinishScheduleUseCase and repo method to update schedule done status.
    • Extend ScheduleEntity with doneStatus; map from API in GetScheduleResponseModel.
  • Presentation/UI:
    • Add MessageBubble component for inline warnings/errors.
    • Schedule creation flow now initializes steps and checks for overlaps:
      • Date/Time: loads adjacent schedules, computes next/previous overlaps, surfaces messages.
      • Place/Move Time & Spare/Preparation Time: recompute overlap impacts and show warnings/errors.
    • Wire spare time default from user, pass max available time across steps.
    • Disable edit swipe for ended/past schedules.
    • Alarm: send finish event (with lateness) and navigate post-finish.
  • Localization:
    • Add overlap warning/error strings (ko/en).
  • Misc:
    • Minor constant for warning threshold; small refactors and DI param wiring.

Written by Cursor Bugbot for commit d2eb115. 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.
- 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.
- Rename GetNextScheduleWithPreparationUseCase to GetAdjacentSchedulesWithPreparationUseCase to support fetching both previous and next schedules.

- Rename LoadNextScheduleWithPreparationUseCase to LoadAdjacentScheduleWithPreparationUseCase.

- Add AdjacentSchedulesWithPreparationEntity to hold previous and next schedule data.
- Update scheduleOverlapError to include start time.

- Add previousScheduleOverlapError for previous schedule conflicts.
- Update ScheduleDateTimeCubit to fetch and check both previous and next schedules.

- Implement logic to calculate available time from previous schedule and overlap with next schedule.

- Update ScheduleFormBloc to store maxAvailableTime and previousScheduleName.

- Update UI to show overlap warnings/errors.
… detection

- Update SchedulePlaceMovingTimeCubit to use maxAvailableTime for overlap checks.

- Update ScheduleFormSpareTimeCubit to use maxAvailableTime for overlap checks.

- Update UI to show overlap warnings/errors in these steps.
- Pass AuthBloc to ScheduleFormBloc in ScheduleCreateScreen and ScheduleEditScreen.

- This allows accessing user spare time settings.
…nd update spare time state with overlap checks
…DateTimeCubit and SchedulePlaceMovingTimeCubit
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 is the final PR Bugbot will review for you during this billing cycle

Your free Bugbot reviews will reset on December 7

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 HTML files accidentally committed

Generated coverage HTML files and reports have been committed to the repository. These are build artifacts that should be excluded from version control via .gitignore. Coverage reports are typically generated locally or in CI/CD pipelines and shouldn't be tracked in git as they change with every test run and bloat the repository.

Additional Locations (2)

Fix in Cursor Fix in Web

@github-actions
Copy link

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

https://ontime-c63f1--pr331-328-0q00mwh4.web.app

(expires Tue, 02 Dec 2025 15:14:43 GMT)

🔥 via Firebase Hosting GitHub Action 🌎

Sign: 7d60a2eae4c4a5839220ed6a57552a3b61cce5a3

@github-actions
Copy link

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

https://on-time-front-widgetbook--pr331-328-6ycqu0ld.web.app

(expires Tue, 02 Dec 2025 15:15:15 GMT)

🔥 via Firebase Hosting GitHub Action 🌎

Sign: e53128a376fed0209d449279de9c0d94c83cdd8b

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.

3 participants