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

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

    Hierarchy (View Summary)

    Index
    db: B2bDatabase
    rewardEventNamesCache: ServiceCache<string[]>
    instance: (...args: []) => RewardEventConfigQueryService = ...

    The process default: built from each dependency's own instance().

    • 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.

    • Display only: whether the customer has a reward_program row, cached with negatives. Credits and config writes call rewardProgramGate.ts fresh.

      Parameters

      • __namedParameters: { customerId: string }

      Returns Promise<boolean>

    • Parameters

      • __namedParameters: {
            customerId: string;
            events?: string[];
            page?: number;
            pageSize?: number;
            statuses?: ("ACTIVE" | "DISABLED")[];
        }

      Returns Promise<
          {
              ok: true;
              value: { hasNext: boolean; items: RewardEventConfig[]; total: number };
          },
      >