feat(notifications): Phase B backend — per-user channel preferences

This commit is contained in:
Александр Зимин
2026-05-15 14:56:25 +00:00
parent 300fd12d6c
commit 9452adaf55
4 changed files with 230 additions and 0 deletions
@@ -75,6 +75,14 @@ class NotificationsDispatcherTest {
notificationLogRepository = new StubNotificationLogRepository();
idempotencyGuard = new StubIdempotencyGuard(notificationLogRepository);
// Phase B: UserPreferencesGate — stub all-allow для existing tests (no
// prefs row → defaults apply, email ON). Per-channel skip tested separately.
UserPreferencesGate allAllowGate = new UserPreferencesGate(null) {
@Override
public boolean allows(String userId, cloud.nstart.terravault.ordinis.notifications.channel.ChannelKind channel) {
return true;
}
};
dispatcher = new NotificationsDispatcher(
outboxRepository,
notificationLogRepository,
@@ -82,6 +90,7 @@ class NotificationsDispatcherTest {
messageRenderer,
List.of(emailChannel),
recipientResolver,
allAllowGate,
new SimpleMeterRegistry()
);