- Profile settings, account transfer, delete/leave account flows - Email verification with JWT tokens and Resend integration - AI assistant/copilot fixes: markdown rendering, shared RAG helpers, token tracking, input refocus, model_validate usage - User guides hub + detail pages with 13 topic guides - Sidebar and top bar navigation for guides Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
45 lines
1.0 KiB
Python
45 lines
1.0 KiB
Python
from datetime import datetime
|
|
from typing import Optional
|
|
from uuid import UUID
|
|
from pydantic import BaseModel, Field
|
|
|
|
|
|
class AccountResponse(BaseModel):
|
|
id: UUID
|
|
name: str
|
|
display_code: str
|
|
owner_id: UUID
|
|
stripe_customer_id: Optional[str] = None
|
|
created_at: datetime
|
|
updated_at: datetime
|
|
|
|
model_config = {"from_attributes": True}
|
|
|
|
|
|
class AccountUpdate(BaseModel):
|
|
name: Optional[str] = Field(None, min_length=1, max_length=255)
|
|
|
|
|
|
class TransferOwnershipRequest(BaseModel):
|
|
current_password: str
|
|
target_user_id: UUID
|
|
|
|
|
|
class AccountInviteCreate(BaseModel):
|
|
email: str = Field(..., max_length=255)
|
|
role: str = Field("engineer", pattern="^(engineer|viewer)$")
|
|
expires_in_days: Optional[int] = Field(None, ge=1, le=30)
|
|
|
|
|
|
class AccountInviteResponse(BaseModel):
|
|
id: UUID
|
|
account_id: UUID
|
|
email: str
|
|
code: str
|
|
role: str
|
|
expires_at: Optional[datetime] = None
|
|
created_at: datetime
|
|
used_at: Optional[datetime] = None
|
|
|
|
model_config = {"from_attributes": True}
|