20 lines
378 B
Python
20 lines
378 B
Python
import uuid
|
|
from pydantic import BaseModel
|
|
from domains.users.models import UserRole
|
|
|
|
class UserCreate(BaseModel):
|
|
username: str
|
|
role: UserRole
|
|
|
|
class UserResponse(BaseModel):
|
|
id: uuid.UUID
|
|
username: str
|
|
role: str
|
|
is_active: bool
|
|
|
|
class Config:
|
|
from_attributes = True
|
|
|
|
class UserCreateResult(BaseModel):
|
|
user: UserResponse
|
|
secret: str |