from datetime import datetime
from typing import Optional

from pydantic import BaseModel


class LoginRequest(BaseModel):
    username: str
    password: str


class TokenResponse(BaseModel):
    access_token: str
    token_type: str = "bearer"
    expires_in: int


class AdminInfo(BaseModel):
    id_usuario: int
    username: str
    email: str
    nombre: Optional[str]
    rol: str
    activo: bool
    ultimo_login: Optional[datetime]
    fecha_creacion: datetime
