36 lines
857 B
Python
36 lines
857 B
Python
from pydantic import BaseModel, Field
|
|
|
|
from app.schemas.common import NaiveDatetime
|
|
|
|
|
|
class SetManagerRequest(BaseModel):
|
|
user_id: str = Field(..., min_length=1, max_length=32, description="新团队队长的前台用户ID")
|
|
|
|
|
|
class TeamMemberOut(BaseModel):
|
|
id: str
|
|
username: str
|
|
phone: str | None = None
|
|
credits: float
|
|
personal_credits: float = 0
|
|
team_available_credits: float = 0
|
|
team_frozen_credits: float = 0
|
|
is_active: bool = True
|
|
joined_at: NaiveDatetime
|
|
|
|
model_config = {"from_attributes": True}
|
|
|
|
|
|
class ManagedTeamOut(BaseModel):
|
|
id: str
|
|
name: str
|
|
code: str | None = None
|
|
description: str | None = None
|
|
status: str
|
|
status_label: str = ""
|
|
member_count: int = 0
|
|
manager_id: str | None = None
|
|
manager_name: str | None = None
|
|
|
|
model_config = {"from_attributes": True}
|