"""
Depreciation Catalog DTOs
"""

from pydantic import BaseModel, Field, ConfigDict
from datetime import datetime


class DepreciationCatalogCreate(BaseModel):
    """DTO for creating a depreciation catalog entry"""
    fraction: str = Field(..., max_length=10)
    description: str = Field(..., max_length=500)
    depreciation_rate: float = Field(..., ge=0, le=100)

    model_config = ConfigDict(from_attributes=True)


class DepreciationCatalogUpdate(BaseModel):
    """DTO for updating a depreciation catalog entry"""
    fraction: str | None = Field(None, max_length=10)
    description: str | None = Field(None, max_length=500)
    depreciation_rate: float | None = Field(None, ge=0, le=100)

    model_config = ConfigDict(from_attributes=True)


class DepreciationCatalogResponse(BaseModel):
    """DTO for depreciation catalog response"""
    id: int
    tenant_id: int
    company_id: int
    fraction: str
    description: str
    depreciation_rate: float
    created_at: datetime
    updated_at: datetime

    model_config = ConfigDict(from_attributes=True)
