@cfxlabsinc/b2b-services
    Preparing search index...

    Rules that are configured per customer to trigger rewards on certain events

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    rewardEventNamesCache: Keyv<string[]>

    Methods

    • Match event and event data to the rules defined for the given customer

      If multiple rules match, the first one is returned

      Parameters

      • __namedParameters: { customerId: string; data: object; event: string }
        • customerId: string
        • data: object

          Data associated with the event, compared against rule matchers

        • event: string

      Returns Promise<RewardAmount | null>

      Reward amount that this event qualifies for. null if no active rules match.