"""
Depreciation Catalog Model
"""

from sqlalchemy import Column, Integer, String, Numeric, ForeignKey, PrimaryKeyConstraint
from sqlalchemy.orm import Mapped, mapped_column, relationship
from api.v1.common.base_models import TenantScopedMixin, TimestampMixin
from core.database import Base


class DepreciationCatalog(Base, TenantScopedMixin, TimestampMixin):
    """Depreciation Catalog Model"""
    
    __tablename__ = 'depreciation_catalog'
    __table_args__ = (
        PrimaryKeyConstraint("id", name="depreciation_catalog_pkey"),
        {'schema': 'a76'}
    )

    id: Mapped[int] = mapped_column(Integer, primary_key=True)
    
    # Fields
    fraction: Mapped[str] = mapped_column(String(10), nullable=False, index=True)
    description: Mapped[str] = mapped_column(String(500), nullable=False, index=True)
    depreciation_rate: Mapped[float] = mapped_column(Numeric(5, 2), nullable=False)
