# This file was auto-generated by Fern from our API Definition.

from ..core.unchecked_base_model import UncheckedBaseModel
from .money import Money
import pydantic
import typing
from .loyalty_program_accrual_rule_tax_mode import LoyaltyProgramAccrualRuleTaxMode
from ..core.pydantic_utilities import IS_PYDANTIC_V2


class LoyaltyProgramAccrualRuleSpendData(UncheckedBaseModel):
    """
    Represents additional data for rules with the `SPEND` accrual type.
    """

    amount_money: Money = pydantic.Field()
    """
    The amount that buyers must spend to earn points. 
    For example, given an "Earn 1 point for every $10 spent" accrual rule, a buyer who spends $105 earns 10 points.
    """

    excluded_category_ids: typing.Optional[typing.List[str]] = pydantic.Field(default=None)
    """
    The IDs of any `CATEGORY` catalog objects that are excluded from points accrual.
    
    You can use the [BatchRetrieveCatalogObjects](api-endpoint:Catalog-BatchRetrieveCatalogObjects)
    endpoint to retrieve information about the excluded categories.
    """

    excluded_item_variation_ids: typing.Optional[typing.List[str]] = pydantic.Field(default=None)
    """
    The IDs of any `ITEM_VARIATION` catalog objects that are excluded from points accrual.
    
    You can use the [BatchRetrieveCatalogObjects](api-endpoint:Catalog-BatchRetrieveCatalogObjects)
    endpoint to retrieve information about the excluded item variations.
    """

    tax_mode: LoyaltyProgramAccrualRuleTaxMode = pydantic.Field()
    """
    Indicates how taxes should be treated when calculating the purchase amount used for points accrual.
    See [LoyaltyProgramAccrualRuleTaxMode](#type-loyaltyprogramaccrualruletaxmode) for possible values
    """

    if IS_PYDANTIC_V2:
        model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True)  # type: ignore # Pydantic v2
    else:

        class Config:
            frozen = True
            smart_union = True
            extra = pydantic.Extra.allow
