Merged
Conversation
…le clock times and improve vacation notification logic
…pression logic for vacation and none types
…rt multiple scheduled dates and ensure upcoming work notifications
Test Results46 tests 46 ✅ 0s ⏱️ Results for commit f3046fc. ♻️ This comment has been updated with latest results. |
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates schedule and notification handling to correctly support days with no work times (e.g., NONE, VACATION) by making clock-in/out times nullable and expanding notification suppression/sync behavior around those schedule types.
Changes:
- Make
DailyWorkSchedule.clockInTime/clockOutTimenullable and updateWorkdayServiceto persistNONEschedules withnulltimes and block clock-out edits forNONE/VACATION. - Update notification generation suppression to treat both
VACATIONandNONEas suppressing work notifications. - Rework notification syncing to consider cross-midnight shifts, add repository queries for multi-date/type lookups, and prevent duplicate upcoming work notifications.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| src/main/kotlin/com/moa/service/notification/NotificationSyncService.kt | Sync/cancel/reschedule logic updated for nullable times and cross-day handling; adds “ensure upcoming” logic and de-dupe checks. |
| src/main/kotlin/com/moa/service/notification/NotificationBatchService.kt | Suppresses work notifications for both VACATION and NONE overrides. |
| src/main/kotlin/com/moa/service/WorkdayService.kt | Persists NONE with null times; blocks clock-out edits for NONE and syncs notifications with nullable times. |
| src/main/kotlin/com/moa/repository/NotificationLogRepository.kt | Adds multi-date and multi-type query methods used by sync logic. |
| src/main/kotlin/com/moa/entity/DailyWorkSchedule.kt | Makes clock times nullable at the Kotlin type level to match DB nullability. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
src/main/kotlin/com/moa/service/notification/NotificationSyncService.kt
Outdated
Show resolved
Hide resolved
…ve pending work notification retrieval logic
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.
This pull request introduces several important changes to how work schedules and notifications are managed, especially around handling special schedule types like
VACATIONandNONE. The updates improve the handling of nullable clock-in/out times, notification suppression, and synchronization of work notifications across date boundaries.Key changes:
Work Schedule Handling
clockInTimeandclockOutTimenullable in theDailyWorkScheduleentity to better represent days without set work times, such asNONEorVACATIONtypes.WorkdayServiceso that aNONEwork schedule type now results innulltimes instead of throwing an exception, and prevents clock-out edits for bothVACATIONandNONEtypes. [1] [2]Notification Logic and Synchronization
VACATIONandNONEwork schedule types as suppressing notifications, updating method names and checks accordingly. [1] [2]NotificationSyncService:VACATIONandNONEdays, and ensures upcoming work notifications are present when appropriate. [1] [2] [3]Repository Methods
NotificationLogRepositoryto support querying by multiple dates and notification types, enabling more flexible and efficient notification management.