Notification
Data Entity
Description
Stores notification records delivered to users via push, email, or SMS channels, tracking delivery status, read state, and scenario-driven triggers across the Meander platform.
Data Structure
| Name | Type | Description | Constraints |
|---|---|---|---|
id |
uuid |
Primary key | PKrequiredunique |
user_id |
uuid |
Recipient user reference | required |
organization_id |
uuid |
Organization context for tenant isolation | required |
channel |
enum |
Delivery channel used for this notification | required |
type |
enum |
Notification category/scenario type | required |
title |
string |
Short notification headline shown in inbox or push banner | required |
body |
text |
Full notification message body | required |
data |
json |
Arbitrary payload for deep-link routing (entity type, entity id, action) | - |
scenario_id |
uuid |
FK to notification_scenarios if this was triggered by a scenario engine rule; null for direct notifications | - |
status |
enum |
Current delivery status | required |
is_read |
boolean |
Whether the recipient has opened/acknowledged the notification | required |
read_at |
datetime |
Timestamp when user marked as read | - |
sent_at |
datetime |
Timestamp when notification was dispatched to provider | - |
delivered_at |
datetime |
Timestamp of confirmed delivery from provider | - |
failed_at |
datetime |
Timestamp of delivery failure | - |
failure_reason |
string |
Provider error message if delivery failed | - |
retry_count |
integer |
Number of delivery attempts made | required |
provider_message_id |
string |
External provider reference ID (FCM message id, email provider id, etc.) | - |
expires_at |
datetime |
When this notification should no longer be shown/delivered (for time-sensitive alerts) | - |
created_at |
datetime |
Record creation timestamp | required |
updated_at |
datetime |
Last modification timestamp | required |
Database Indexes
idx_notifications_user_id
Columns: user_id
idx_notifications_user_is_read
Columns: user_id, is_read
idx_notifications_user_created
Columns: user_id, created_at
idx_notifications_status
Columns: status
idx_notifications_organization_id
Columns: organization_id
idx_notifications_scenario_id
Columns: scenario_id
idx_notifications_created_at
Columns: created_at
Validation Rules
valid_channel
error
Validation failed
title_not_empty
error
Validation failed
body_not_empty
error
Validation failed
valid_user_reference
error
Validation failed
read_at_only_when_read
error
Validation failed
expires_at_future
warning
Validation failed
data_valid_json
warning
Validation failed
Business Rules
respect_user_preferences
A notification must not be sent via a channel the user has disabled in their notification_preferences. Check preferences before dispatch.
tenant_isolation
Users may only read notifications belonging to their own organization. organization_id must match the requesting user's org context.
scenario_triggered_deduplication
For a given scenario_id + user_id combination, do not create a duplicate notification within the scenario's cooldown window.
expiry_enforcement
Notifications past their expires_at timestamp must not be delivered and should be auto-cancelled if still pending.
max_retry_limit
Failed delivery must not be retried more than 3 times. After 3 failures set status to 'failed'.
read_timestamp_on_mark_read
When is_read is set to true, read_at must be populated with the current timestamp.