feat(backend): migrate auth and notifications off email
This commit is contained in:
52
apps/notifications/api/schemas.py
Normal file
52
apps/notifications/api/schemas.py
Normal file
@@ -0,0 +1,52 @@
|
||||
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
|
||||
Reference in New Issue
Block a user