Files
Amirhossein Khalili b7b21a6cc6
Some checks failed
Backend CI/CD / test (push) Has been cancelled
Backend CI/CD / deploy (push) Has been cancelled
feat(backend): migrate auth and notifications off email
2026-05-21 10:28:04 +03:30

53 lines
1.1 KiB
Python

from datetime import datetime
from typing import Any
from ninja import Schema
class NotificationSchema(Schema):
id: str
type: str
title: str
message: str
level: str
created_at: datetime | str
is_seen: bool
delete_on_seen: bool
action_url: str | None = None
entity_type: str | None = None
entity_id: int | str | None = None
meta: dict[str, Any] = {}
class NotificationListSchema(Schema):
count: int
unread_count: int
notifications: list[NotificationSchema]
class NotificationSeenIn(Schema):
id: str
class NotificationSeenResponseSchema(Schema):
marked_read: bool
notification_id: str | None = None
deleted: bool = False
notification: NotificationSchema | None = None
unread_count: int | None = None
class NotificationDeleteResponseSchema(Schema):
deleted: bool
notification_id: str | None = None
unread_count: int | None = None
class NotificationMarkAllReadResponseSchema(Schema):
marked_read: int
class NotificationStreamTokenResponseSchema(Schema):
token: str
expires_in: int