mirror of
https://github.com/blackboxprogramming/BlackRoad-Operating-System.git
synced 2026-03-17 04:57:15 -05:00
24 lines
807 B
Python
24 lines
807 B
Python
"""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}>"
|