Skip to content

feat: store sent notifications to DB - #52

Open
busehalis-sap wants to merge 8 commits into
mainfrom
feat/store-notifications-db
Open

feat: store sent notifications to DB#52
busehalis-sap wants to merge 8 commits into
mainfrom
feat/store-notifications-db

Conversation

@busehalis-sap

Copy link
Copy Markdown
Contributor

Summary

Some applications need the notifications stored to DB to do further processing with them. This PR adds optional DB storage for sent notifications in production mode.

When cds.requires.notifications.storeNotifications: true is set, each notification is stored to the database after successful delivery to ANS. The ANS-assigned notification ID is used directly, no new ID is generated. Since a single notification can be sent to multiple recipients, one row per recipient is created.

Changes

  • NotificationStorage.cds: CDS model with @PersonalData annotations for Notifications, NotificationProperties and NotificationTargetParameters entities
  • StoreNotificationsHandler: @After handler on NotificationProviderService that stores notifications to DB after ANS delivery
  • NotificationServiceConfiguration: reads storeNotifications flag and conditionally registers the handler
  • Integration tests: 4 new tests covering DB storage, properties, target parameters and multiple recipients
  • Sample app: demonstrates the feature with StoredNotifications projection and key bookId field

@busehalis-sap
busehalis-sap requested a review from lisajulia July 27, 2026 13:27
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