refactors
This commit is contained in:
parent
139a5fbef3
commit
f46d2ae8b3
12 changed files with 734 additions and 536 deletions
|
|
@ -277,3 +277,64 @@ class ConstantsResponse(BaseModel):
|
|||
roles: list[str]
|
||||
invite_statuses: list[InviteStatus]
|
||||
bitcoin_transfer_methods: list[BitcoinTransferMethod]
|
||||
|
||||
|
||||
# =============================================================================
|
||||
# Exchange Price/Config Schemas
|
||||
# =============================================================================
|
||||
|
||||
|
||||
class ExchangeConfigResponse(BaseModel):
|
||||
"""Exchange configuration for the frontend."""
|
||||
|
||||
eur_min: int
|
||||
eur_max: int
|
||||
eur_increment: int
|
||||
premium_percentage: int
|
||||
|
||||
|
||||
class PriceResponse(BaseModel):
|
||||
"""Current BTC/EUR price for trading.
|
||||
|
||||
Note: The actual agreed price depends on trade direction (buy/sell)
|
||||
and is calculated by the frontend using market_price and premium_percentage.
|
||||
"""
|
||||
|
||||
market_price: float # Raw price from exchange
|
||||
premium_percentage: int
|
||||
timestamp: datetime
|
||||
is_stale: bool
|
||||
|
||||
|
||||
class ExchangePriceResponse(BaseModel):
|
||||
"""Combined price and configuration response."""
|
||||
|
||||
price: PriceResponse | None # None if price fetch failed
|
||||
config: ExchangeConfigResponse
|
||||
error: str | None = None
|
||||
|
||||
|
||||
class BookableSlot(BaseModel):
|
||||
"""A single bookable time slot."""
|
||||
|
||||
start_time: datetime
|
||||
end_time: datetime
|
||||
|
||||
|
||||
class AvailableSlotsResponse(BaseModel):
|
||||
"""Response containing available slots for a date."""
|
||||
|
||||
date: date
|
||||
slots: list[BookableSlot]
|
||||
|
||||
|
||||
# =============================================================================
|
||||
# Admin User Search Schemas
|
||||
# =============================================================================
|
||||
|
||||
|
||||
class UserSearchResult(BaseModel):
|
||||
"""Result item for user search."""
|
||||
|
||||
id: int
|
||||
email: str
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue