Skip to content

Update to handle nullable clock times#41

Merged
jeyongsong merged 4 commits intomainfrom
upsert-none
Mar 21, 2026
Merged

Update to handle nullable clock times#41
jeyongsong merged 4 commits intomainfrom
upsert-none

Conversation

@jeyongsong
Copy link
Copy Markdown
Member

This pull request introduces several important changes to how work schedules and notifications are managed, especially around handling special schedule types like VACATION and NONE. 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

  • Made clockInTime and clockOutTime nullable in the DailyWorkSchedule entity to better represent days without set work times, such as NONE or VACATION types.
  • Updated logic in WorkdayService so that a NONE work schedule type now results in null times instead of throwing an exception, and prevents clock-out edits for both VACATION and NONE types. [1] [2]

Notification Logic and Synchronization

  • Changed notification suppression logic to treat both VACATION and NONE work schedule types as suppressing notifications, updating method names and checks accordingly. [1] [2]
  • Enhanced notification synchronization in NotificationSyncService:
    • Now considers both the current and following day when syncing notifications, to handle overnight shifts and date boundaries.
    • Cancels pending notifications for both VACATION and NONE days, and ensures upcoming work notifications are present when appropriate. [1] [2] [3]
    • Prevents duplicate notifications by checking existing logs before creating new ones.
    • Adjusts the scheduled date for clock-in notifications to always match the current date.
  • Added a constant list of work notification types to simplify repository queries for notification logs.

Repository Methods

  • Added and updated repository methods in NotificationLogRepository to support querying by multiple dates and notification types, enabling more flexible and efficient notification management.

…le clock times and improve vacation notification logic
…rt multiple scheduled dates and ensure upcoming work notifications
Copilot AI review requested due to automatic review settings March 21, 2026 08:11
@github-actions
Copy link
Copy Markdown

github-actions bot commented Mar 21, 2026

Test Results

46 tests   46 ✅  0s ⏱️
 6 suites   0 💤
 6 files     0 ❌

Results for commit f3046fc.

♻️ This comment has been updated with latest results.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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/clockOutTime nullable and update WorkdayService to persist NONE schedules with null times and block clock-out edits for NONE/VACATION.
  • Update notification generation suppression to treat both VACATION and NONE as 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.

…ve pending work notification retrieval logic
@jeyongsong jeyongsong merged commit 392c66b into main Mar 21, 2026
3 checks passed
@jeyongsong jeyongsong deleted the upsert-none branch March 21, 2026 08:25
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