mirror of
https://github.com/blackboxprogramming/BlackRoad-Operating-System.git
synced 2026-03-17 03:57:13 -05:00
Add v0.2 pillars: chaos inbox, identity center, command palette
This commit is contained in:
23
backend/app/models/notification.py
Normal file
23
backend/app/models/notification.py
Normal file
@@ -0,0 +1,23 @@
|
||||
"""Notification model for OS-level alerts"""
|
||||
from sqlalchemy import Column, Integer, String, DateTime, ForeignKey
|
||||
from sqlalchemy.sql import func
|
||||
from app.database import Base
|
||||
|
||||
|
||||
class Notification(Base):
|
||||
"""Stores notifications across apps"""
|
||||
|
||||
__tablename__ = "notifications"
|
||||
|
||||
id = Column(Integer, primary_key=True, index=True)
|
||||
type = Column(String(50), default="info")
|
||||
source_app_id = Column(String(100))
|
||||
title = Column(String(255))
|
||||
body = Column(String(1000))
|
||||
importance = Column(String(50), default="normal")
|
||||
delivery_mode = Column(String(50), default="immediate")
|
||||
read_at = Column(DateTime(timezone=True))
|
||||
created_at = Column(DateTime(timezone=True), server_default=func.now())
|
||||
|
||||
def __repr__(self):
|
||||
return f"<Notification {self.id}:{self.title}>"
|
||||
Reference in New Issue
Block a user