phase 3.1

This commit is contained in:
Danilo Reyes
2025-11-01 23:33:52 -06:00
parent da4892cc30
commit a95a4c091a
25 changed files with 1214 additions and 27 deletions

View File

@@ -0,0 +1,45 @@
"""Authentication schemas for request/response validation."""
from datetime import datetime
from typing import Optional
from uuid import UUID
from pydantic import BaseModel, EmailStr, Field
class UserBase(BaseModel):
"""Base user schema."""
email: EmailStr
class UserCreate(UserBase):
"""Schema for user registration."""
password: str = Field(..., min_length=8, max_length=100)
class UserLogin(BaseModel):
"""Schema for user login."""
email: EmailStr
password: str
class UserResponse(UserBase):
"""Schema for user response."""
id: UUID
created_at: datetime
is_active: bool
class Config:
from_attributes = True
class TokenResponse(BaseModel):
"""Schema for JWT token response."""
access_token: str
token_type: str = "bearer"
user: UserResponse