"""Auth-related request / response schemas.""" from __future__ import annotations from typing import Any, Dict from pydantic import BaseModel, EmailStr, Field # ── Requests ────────────────────────────────────────────── class RegisterRequest(BaseModel): email: EmailStr password: str = Field(..., min_length=8, max_length=128) name: str = Field(..., min_length=1, max_length=255) role: str = Field(default="visitor", pattern="^(visitor|agency)$") class LoginRequest(BaseModel): email: EmailStr password: str class RefreshTokenRequest(BaseModel): refresh_token: str class PasswordResetRequest(BaseModel): email: EmailStr class PasswordResetConfirm(BaseModel): new_password: str = Field(..., min_length=8, max_length=128) class ChangePasswordRequest(BaseModel): current_password: str new_password: str = Field(..., min_length=8, max_length=128) # ── Responses ───────────────────────────────────────────── class TokenResponse(BaseModel): access_token: str refresh_token: str token_type: str = "bearer" class RegisterResponse(BaseModel): message: str user: Dict[str, Any] class MessageResponse(BaseModel): message: str