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

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


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

    minimum_amount_money: typing.Optional[Money] = pydantic.Field(default=None)
    """
    The minimum purchase required during the visit to quality for points.
    """

    tax_mode: LoyaltyProgramAccrualRuleTaxMode = pydantic.Field()
    """
    Indicates how taxes should be treated when calculating the purchase amount to determine whether the visit qualifies for points. 
    This setting applies only if `minimum_amount_money` is specified.
    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
