feat(phase-18): add in-app notification system (T-128, T-129)
This commit is contained in:
28
backend/app/schemas/notification.py
Normal file
28
backend/app/schemas/notification.py
Normal file
@@ -0,0 +1,28 @@
|
||||
"""Pydantic schemas for Notification endpoints."""
|
||||
|
||||
import uuid
|
||||
from datetime import datetime
|
||||
|
||||
from pydantic import BaseModel, ConfigDict
|
||||
|
||||
|
||||
class NotificationOut(BaseModel):
|
||||
"""Notification returned by the API."""
|
||||
|
||||
id: uuid.UUID
|
||||
user_id: uuid.UUID
|
||||
type: str
|
||||
title: str
|
||||
message: str | None = None
|
||||
entity_type: str | None = None
|
||||
entity_id: uuid.UUID | None = None
|
||||
read: bool = False
|
||||
created_at: datetime | None = None
|
||||
|
||||
model_config = ConfigDict(from_attributes=True)
|
||||
|
||||
|
||||
class UnreadCountOut(BaseModel):
|
||||
"""Simple counter response."""
|
||||
|
||||
unread_count: int
|
||||
Reference in New Issue
Block a user