Skip to content

Feat/cooldown mechanism - #64

Open
busehalis-sap wants to merge 7 commits into
mainfrom
feat/cooldown-mechanism
Open

Feat/cooldown mechanism#64
busehalis-sap wants to merge 7 commits into
mainfrom
feat/cooldown-mechanism

Conversation

@busehalis-sap

Copy link
Copy Markdown
Contributor

Summary

Adds an optional cooldown mechanism to prevent sending the same notification type to the same recipient with the same target parameters too frequently.

When cooldown: <days> is set on a @notification-annotated event, the plugin checks the notification history before sending. If a notification of the same type was already sent to the same recipient with the same target parameters within the cooldown window, the notification is skipped. If only some recipients are in cooldown, the notification is still sent to the remaining recipients.

Requires cds.notifications.storeNotifications: true.

Changes

  • CooldownChecker — new class that queries the notification history and filters out recipients within the cooldown window
  • ProductionHandler / LocalHandler — cooldown check applied before sending/logging each notification
  • NotificationServiceConfigurationCooldownChecker is instantiated and passed to handlers when storeNotifications is enabled
  • notificationtypes-data.cds — added ReminderNotification event for integration tests
  • CooldownCheckerTest — unit tests for cooldown logic
  • CooldownIntegrationTest — integration tests covering all cooldown scenarios
  • sample-app/notifications.cds — cooldown example on LowStockAlert
  • README.md / CHANGELOG.md — cooldown mechanism documented

@busehalis-sap
busehalis-sap requested a review from lisajulia August 5, 2026 09:56
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