32 lines
597 B
Python
32 lines
597 B
Python
from pydantic import BaseModel
|
|
from datetime import datetime
|
|
from uuid import UUID
|
|
from typing import Optional, List
|
|
|
|
class UserRegister(BaseModel):
|
|
email: str
|
|
password: str
|
|
name: str
|
|
|
|
class UserLogin(BaseModel):
|
|
email: str
|
|
password: str
|
|
|
|
class TokenRefresh(BaseModel):
|
|
refresh_token: str
|
|
|
|
class TokenResponse(BaseModel):
|
|
access_token: str
|
|
refresh_token: str
|
|
token_type: str = "bearer"
|
|
|
|
class UserResponse(BaseModel):
|
|
id: UUID
|
|
email: str
|
|
name: str
|
|
roles: List[str] = []
|
|
created_at: datetime
|
|
|
|
class Config:
|
|
from_attributes = True
|