mirror of
https://github.com/complexcaresolutions/dak.c2s.git
synced 2026-03-17 23:03:41 +00:00
Add audit_service for compliance logging, admin endpoints (user CRUD, invitation management, audit log), notification endpoints (list, mark read), and interactive create_admin script. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
28 lines
681 B
Python
28 lines
681 B
Python
"""Pydantic v2 schemas for Notification responses."""
|
|
|
|
from datetime import datetime
|
|
from typing import Optional
|
|
|
|
from pydantic import BaseModel
|
|
|
|
|
|
class NotificationResponse(BaseModel):
|
|
"""Single notification returned to the client."""
|
|
|
|
id: int
|
|
notification_type: str
|
|
title: str
|
|
message: Optional[str] = None
|
|
related_entity_type: Optional[str] = None
|
|
related_entity_id: Optional[int] = None
|
|
is_read: bool
|
|
created_at: datetime
|
|
|
|
model_config = {"from_attributes": True}
|
|
|
|
|
|
class NotificationList(BaseModel):
|
|
"""Wrapper that includes an unread counter alongside the item list."""
|
|
|
|
items: list[NotificationResponse]
|
|
unread_count: int
|