"""Pydantic schemas for account-related API operations.""" from pydantic import BaseModel, Field from datetime import datetime from typing import Optional from app.models.account import AccountType class AccountBase(BaseModel): """Base schema for account data.""" account_number: str = Field(..., description="Unique account identifier") account_name: str = Field(..., description="Human-readable account name") account_type: AccountType = Field(default=AccountType.CASH, description="Account type") class AccountCreate(AccountBase): """Schema for creating a new account.""" pass class AccountUpdate(BaseModel): """Schema for updating an existing account.""" account_name: Optional[str] = Field(None, description="Updated account name") account_type: Optional[AccountType] = Field(None, description="Updated account type") class AccountResponse(AccountBase): """Schema for account API responses.""" id: int created_at: datetime updated_at: datetime class Config: from_attributes = True