from decimal import Decimal
from typing import Optional

from pydantic import Field


class CurrencyMixin:
    """Mixin for currency-related fields"""

    currency: Optional[str] = Field(None, max_length=3, description="Currency")
    currency_factor: Optional[Decimal] = Field(None, description="Currency factor")


class AffectValueMixin:
    """Mixin for value affect flags"""

    not_affect_usd_value: Optional[bool] = Field(
        None, description="Not affect USD value"
    )
    not_affect_customs_value: Optional[bool] = Field(
        None, description="Not affect customs value"
    )


class UpdateFlagsMixin:
    """Mixin for update flags"""

    update_vat: Optional[bool] = Field(None, description="Update VAT")
    update_advalorem: Optional[bool] = Field(None, description="Update advalorem")
    update_dta: Optional[bool] = Field(None, description="Update DTA")
    update_cc: Optional[bool] = Field(None, description="Update CC")
    update_ieps: Optional[bool] = Field(None, description="Update IEPS")
