Data Layer low complexity mobile
0
Dependencies
0
Dependents
1
Entities
0
Integrations

Description

Typed Dart data class representing a single notification record from the Supabase notifications table. Encapsulates all fields (user_id, type enum, JSONB payload, read_at nullable, created_at) with factory constructors for database row parsing and JSON serialization. Provides computed properties such as isRead and relativeTimestamp.

Feature: In-app Notification Centre

notification-model

Responsibilities

  • Represent a single notification with all database fields
  • Parse from Supabase database row map
  • Expose typed payload sub-models per notification type
  • Provide computed isRead property from read_at nullability
  • Provide relative timestamp formatting

Interfaces

Notification.fromMap(Map<String, dynamic>)
toMap()
copyWith({...})
get isRead: bool
get relativeTimestamp: String
get payload: NotificationPayload
get typeIcon: IconData

Related Data Entities (1)

Data entities managed by this component

API Contract

View full contract →
REST /api/v1/notification-models 5 endpoints
GET /api/v1/notification-models List all notification model definitions (types and their schema)
GET /api/v1/notification-models/:id Get schema and metadata for a specific notification model type
POST /api/v1/notification-models Register a new notification model type
PUT /api/v1/notification-models/:id Update an existing notification model definition
DELETE /api/v1/notification-models/:id Remove a notification model type definition