- FastAPI backend mit Domain-Check, TLD-Pricing, User-Management - Next.js frontend mit modernem UI - Sortierbare TLD-Tabelle mit Mini-Charts - Domain availability monitoring - Subscription tiers (Starter, Professional, Enterprise) - Authentication & Authorization - Scheduler für automatische Domain-Checks
42 lines
964 B
Python
42 lines
964 B
Python
"""Subscription schemas."""
|
|
from datetime import datetime
|
|
from typing import Optional, Dict, List
|
|
|
|
from pydantic import BaseModel
|
|
|
|
|
|
class SubscriptionResponse(BaseModel):
|
|
"""Schema for subscription response."""
|
|
id: int
|
|
tier: str
|
|
tier_name: str
|
|
status: str
|
|
domain_limit: int
|
|
domains_used: int = 0
|
|
check_frequency: str
|
|
history_days: int
|
|
features: Dict[str, bool]
|
|
started_at: datetime
|
|
expires_at: Optional[datetime]
|
|
|
|
class Config:
|
|
from_attributes = True
|
|
|
|
|
|
class SubscriptionTierInfo(BaseModel):
|
|
"""Schema for subscription tier information."""
|
|
id: str
|
|
name: str
|
|
domain_limit: int
|
|
price: float
|
|
check_frequency: str
|
|
features: List[str]
|
|
feature_flags: Dict[str, bool]
|
|
|
|
|
|
class SubscriptionUpdate(BaseModel):
|
|
"""Schema for updating subscription (admin/payment webhook)."""
|
|
tier: str
|
|
expires_at: Optional[datetime] = None
|
|
payment_reference: Optional[str] = None
|