2026-06-29 00:10:10 +02:00
|
|
|
"""Common schemas for pagination, errors, etc."""
|
2026-06-04 00:06:21 +00:00
|
|
|
|
|
|
|
|
from __future__ import annotations
|
|
|
|
|
|
2026-06-29 00:10:10 +02:00
|
|
|
from pydantic import BaseModel
|
2026-06-04 00:06:21 +00:00
|
|
|
|
|
|
|
|
|
2026-06-29 00:10:10 +02:00
|
|
|
class ErrorResponse(BaseModel):
|
|
|
|
|
detail: str
|
|
|
|
|
code: str | None = None
|
|
|
|
|
fields: dict[str, str] | None = None
|
2026-06-04 00:06:21 +00:00
|
|
|
|
|
|
|
|
|
2026-06-29 00:10:10 +02:00
|
|
|
class HealthResponse(BaseModel):
|
|
|
|
|
status: str
|
|
|
|
|
version: str
|
2026-06-04 00:06:21 +00:00
|
|
|
|
|
|
|
|
|
2026-06-29 00:10:10 +02:00
|
|
|
class NotificationResponse(BaseModel):
|
|
|
|
|
id: str
|
|
|
|
|
type: str
|
|
|
|
|
title: str
|
|
|
|
|
body: str | None = None
|
|
|
|
|
read_at: str | None = None
|
|
|
|
|
created_at: str | None = None
|
2026-06-04 00:06:21 +00:00
|
|
|
|
|
|
|
|
|
2026-06-29 00:10:10 +02:00
|
|
|
class NotificationListResponse(BaseModel):
|
|
|
|
|
items: list[NotificationResponse]
|
2026-06-04 00:06:21 +00:00
|
|
|
total: int
|
2026-06-29 00:10:10 +02:00
|
|
|
page: int
|
|
|
|
|
page_size: int
|
2026-06-04 00:06:21 +00:00
|
|
|
|
|
|
|
|
|
2026-06-29 00:10:10 +02:00
|
|
|
class UnreadCountResponse(BaseModel):
|
|
|
|
|
count: int
|
2026-07-15 21:00:32 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
class NotificationPreferenceUpdate(BaseModel):
|
|
|
|
|
is_enabled: bool
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class NotificationTypeResponse(BaseModel):
|
|
|
|
|
type_key: str
|
|
|
|
|
plugin_name: str
|
|
|
|
|
category: str
|
|
|
|
|
label: str
|
|
|
|
|
description: str | None = None
|
|
|
|
|
is_enabled_by_default: bool
|
|
|
|
|
is_enabled: bool
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class NotificationPreferenceResponse(BaseModel):
|
|
|
|
|
type_key: str
|
|
|
|
|
is_enabled: bool
|