"""Pydantic schemas for Account endpoints.""" from __future__ import annotations from datetime import datetime from typing import Any from pydantic import BaseModel, ConfigDict, Field from app.models.account import AccountSize, Industry class AccountBase(BaseModel): """Shared fields for create/update.""" name: str = Field(..., min_length=1, max_length=255) website: str | None = Field(None, max_length=512) industry: Industry | None = None size: AccountSize | None = None address: dict[str, Any] | None = None class AccountCreate(AccountBase): """Request body for POST /api/v1/accounts/.""" pass class AccountUpdate(BaseModel): """Request body for PATCH /api/v1/accounts/{id}. All optional.""" name: str | None = Field(None, min_length=1, max_length=255) website: str | None = Field(None, max_length=512) industry: Industry | None = None size: AccountSize | None = None address: dict[str, Any] | None = None class AccountOut(AccountBase): """Response schema for an account.""" model_config = ConfigDict(from_attributes=True) id: int org_id: int owner_id: int created_at: datetime updated_at: datetime deleted_at: datetime | None = None class AccountListItem(AccountOut): """Slim schema for list responses.""" pass __all__ = ["AccountCreate", "AccountListItem", "AccountOut", "AccountUpdate"]