from datetime import datetime from pydantic import BaseModel, EmailStr, Field class RegisterRequest(BaseModel): email: EmailStr username: str = Field(..., min_length=3, max_length=100) password: str = Field(..., min_length=8, max_length=128) class LoginRequest(BaseModel): email: EmailStr password: str class TokenResponse(BaseModel): access_token: str token_type: str = "bearer" class UserResponse(BaseModel): id: str email: str username: str created_at: datetime model_config = {"from_attributes": True}