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

import typing_extensions
from ..types.loyalty_program_accrual_rule_type import LoyaltyProgramAccrualRuleType
import typing_extensions
import typing
from .loyalty_program_accrual_rule_visit_data import LoyaltyProgramAccrualRuleVisitDataParams
from .loyalty_program_accrual_rule_spend_data import LoyaltyProgramAccrualRuleSpendDataParams
from .loyalty_program_accrual_rule_item_variation_data import LoyaltyProgramAccrualRuleItemVariationDataParams
from .loyalty_program_accrual_rule_category_data import LoyaltyProgramAccrualRuleCategoryDataParams


class LoyaltyProgramAccrualRuleParams(typing_extensions.TypedDict):
    """
    Represents an accrual rule, which defines how buyers can earn points from the base [loyalty program](entity:LoyaltyProgram).
    """

    accrual_type: LoyaltyProgramAccrualRuleType
    """
    The type of the accrual rule that defines how buyers can earn points.
    See [LoyaltyProgramAccrualRuleType](#type-loyaltyprogramaccrualruletype) for possible values
    """

    points: typing_extensions.NotRequired[typing.Optional[int]]
    """
    The number of points that 
    buyers earn based on the `accrual_type`.
    """

    visit_data: typing_extensions.NotRequired[LoyaltyProgramAccrualRuleVisitDataParams]
    """
    Additional data for rules with the `VISIT` accrual type.
    """

    spend_data: typing_extensions.NotRequired[LoyaltyProgramAccrualRuleSpendDataParams]
    """
    Additional data for rules with the `SPEND` accrual type.
    """

    item_variation_data: typing_extensions.NotRequired[LoyaltyProgramAccrualRuleItemVariationDataParams]
    """
    Additional data for rules with the `ITEM_VARIATION` accrual type.
    """

    category_data: typing_extensions.NotRequired[LoyaltyProgramAccrualRuleCategoryDataParams]
    """
    Additional data for rules with the `CATEGORY` accrual type.
    """
