Spaces:
Sleeping
Sleeping
File size: 664 Bytes
478dec6 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 | from uuid import UUID
from typing import Optional
from datetime import datetime
from pydantic import BaseModel, EmailStr
# ---------- REQUEST ----------
class UserCreate(BaseModel):
username: str
password: str
email: EmailStr
full_name: str
role: str
tenant_id: Optional[UUID] = None
notes: Optional[str] = None
# ---------- RESPONSE ----------
class UserResponse(BaseModel):
user_id: UUID
username: str
email: EmailStr
full_name: str
role: str
is_active: bool
tenant_id: Optional[UUID]
created_at: datetime
class Config:
from_attributes = True # ⬅️ WAJIB (SQLAlchemy → Pydantic)
|