feat(notifications): extension point to modify user resolving

this change adds a new extension point method that can be used to
pass a custom function that can modify how individual user
entity references are resolved inside the notifications backend.

Signed-off-by: Hellgren Heikki <heikki.hellgren@op.fi>
This commit is contained in:
Hellgren Heikki
2025-08-05 13:24:21 +03:00
parent a59be35d43
commit 7e7ed57de2
6 changed files with 163 additions and 5 deletions
@@ -100,6 +100,19 @@ export interface NotificationProcessor {
getNotificationFilters?(): NotificationProcessorFilters;
}
/**
* NotificationRecipientResolver is a function that resolves the individual users to receive the notification
* based on the entity reference(s) and the excluded entity reference(s).
*
* The function should return a list of user entity references that should receive the notification.
*
* @public
*/
export type NotificationRecipientResolver = (
entityRef: string | string[] | null,
excludeEntityRefs: string | string[],
) => Promise<string[]>;
/**
* @public
*/
@@ -107,6 +120,9 @@ export interface NotificationsProcessingExtensionPoint {
addProcessor(
...processors: Array<NotificationProcessor | Array<NotificationProcessor>>
): void;
setNotificationRecipientResolver(
resolver: NotificationRecipientResolver,
): void;
}
/**