The Notifications module provides an in-app notification inbox with multi-channel delivery abstraction, preference management, and template-based notifications.
Endpoints
| Endpoint | Method | Description |
|---|---|---|
/api/notifications | GET | Paginated inbox listing |
/api/notifications/{id}/read | POST | Mark as read |
/api/notifications/read-all | POST | Mark all as read |
/api/notifications/preferences | GET/PUT | User notification preferences |
Architecture
NotificationEndpoints │ ▼NotificationService │ ├── INotificationRepository → SqlSugarNotificationRepository ├── INotificationPreferenceStore → AllowAllNotificationPreferenceStore ├── INotificationDeliveryAdapter → NullNotificationDeliveryAdapter └── INotificationTemplateStore → (configuration-based)Key components
NotificationService
Central service for creating and delivering notifications:
public class NotificationService{ // Create notification → persist to inbox + trigger delivery public Task CreateAsync(string userId, NotificationTemplate template, CancellationToken ct);
// Mark individual notification as read public Task MarkReadAsync(Guid notificationId, CancellationToken ct);
// Query user's inbox public Task<NotificationInboxPage> GetInboxAsync(string userId, int page, int pageSize, CancellationToken ct);}NotificationTemplate
public class NotificationTemplate{ public string Title { get; } public string Body { get; } public string Category { get; } // system, chat, ticket, billing, etc. public Dictionary<string, string> Variables { get; }}NotificationPreference
public class NotificationPreference{ public string Category { get; } public bool InApp { get; } public bool Email { get; } public bool Sms { get; } public bool Push { get; }}Notification entity
public class NotificationEntity : TenantSoftDeleteEntityBase{ public string UserId { get; set; } public string Title { get; set; } public string Body { get; set; } public string Category { get; set; } public bool IsRead { get; set; } public DateTimeOffset? ReadAt { get; set; }}Delivery channels
| Channel | Implementation | Status |
|---|---|---|
| In-app inbox | SqlSugarNotificationRepository | ✅ Implemented |
NullNotificationDeliveryAdapter | 📋 Planned | |
| SMS | N/A | 📋 Planned |
| Push | N/A | 📋 Planned |
Event integration
Notifications are triggered by integration events from other modules:
Ticket created → ticket.created event → NotificationServiceChat mention → chat.mention event → NotificationServiceBilling alert → billing.overdue event → NotificationServiceSee also
- Mailing building block — Email delivery roadmap
- Eventing — CAP event infrastructure