reviewed
This commit is contained in:
parent
a56a4c076a
commit
a31bd8246c
10 changed files with 15 additions and 71 deletions
|
|
@ -5,10 +5,6 @@ from typing import Generic, TypeVar
|
|||
from pydantic import BaseModel, EmailStr
|
||||
|
||||
|
||||
# =============================================================================
|
||||
# Auth Schemas
|
||||
# =============================================================================
|
||||
|
||||
class UserCredentials(BaseModel):
|
||||
"""Base model for user email/password."""
|
||||
email: EmailStr
|
||||
|
|
@ -27,13 +23,6 @@ class UserResponse(BaseModel):
|
|||
permissions: list[str]
|
||||
|
||||
|
||||
class TokenResponse(BaseModel):
|
||||
"""Response model for token-based auth (unused but kept for API completeness)."""
|
||||
access_token: str
|
||||
token_type: str
|
||||
user: UserResponse
|
||||
|
||||
|
||||
class RegisterWithInvite(BaseModel):
|
||||
"""Request model for registration with invite."""
|
||||
email: EmailStr
|
||||
|
|
@ -41,19 +30,6 @@ class RegisterWithInvite(BaseModel):
|
|||
invite_identifier: str
|
||||
|
||||
|
||||
# =============================================================================
|
||||
# Counter Schemas
|
||||
# =============================================================================
|
||||
|
||||
class CounterValue(BaseModel):
|
||||
"""Response model for counter value."""
|
||||
value: int
|
||||
|
||||
|
||||
# =============================================================================
|
||||
# Sum Schemas
|
||||
# =============================================================================
|
||||
|
||||
class SumRequest(BaseModel):
|
||||
"""Request model for sum calculation."""
|
||||
a: float
|
||||
|
|
@ -67,10 +43,6 @@ class SumResponse(BaseModel):
|
|||
result: float
|
||||
|
||||
|
||||
# =============================================================================
|
||||
# Audit Schemas
|
||||
# =============================================================================
|
||||
|
||||
class CounterRecordResponse(BaseModel):
|
||||
"""Response model for a counter audit record."""
|
||||
id: int
|
||||
|
|
@ -90,10 +62,6 @@ class SumRecordResponse(BaseModel):
|
|||
created_at: datetime
|
||||
|
||||
|
||||
# =============================================================================
|
||||
# Pagination (Generic)
|
||||
# =============================================================================
|
||||
|
||||
RecordT = TypeVar("RecordT", bound=BaseModel)
|
||||
|
||||
|
||||
|
|
@ -110,10 +78,6 @@ PaginatedCounterRecords = PaginatedResponse[CounterRecordResponse]
|
|||
PaginatedSumRecords = PaginatedResponse[SumRecordResponse]
|
||||
|
||||
|
||||
# =============================================================================
|
||||
# Profile Schemas
|
||||
# =============================================================================
|
||||
|
||||
class ProfileResponse(BaseModel):
|
||||
"""Response model for profile data."""
|
||||
contact_email: str | None
|
||||
|
|
@ -131,10 +95,6 @@ class ProfileUpdate(BaseModel):
|
|||
nostr_npub: str | None = None
|
||||
|
||||
|
||||
# =============================================================================
|
||||
# Invite Schemas
|
||||
# =============================================================================
|
||||
|
||||
class InviteCheckResponse(BaseModel):
|
||||
"""Response for invite check endpoint."""
|
||||
valid: bool
|
||||
|
|
@ -174,12 +134,7 @@ class UserInviteResponse(BaseModel):
|
|||
PaginatedInviteRecords = PaginatedResponse[InviteResponse]
|
||||
|
||||
|
||||
# =============================================================================
|
||||
# Admin Schemas
|
||||
# =============================================================================
|
||||
|
||||
class AdminUserResponse(BaseModel):
|
||||
"""Minimal user info for admin dropdowns."""
|
||||
id: int
|
||||
email: str
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue