@nuskin/react-loyalty-elements 1.0.8 → 1.0.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,13 @@
1
1
  import { CalculateMonthCompletionParams } from '../types';
2
- export declare const calculateMonthCompletionValues: ({ data, minAmount, maxAmount, minVoucher, maxVoucher, initialVoucherValue, initialMonthCompletionValue, maxMonths, today, }: CalculateMonthCompletionParams) => {
2
+ export type Tier = {
3
+ consecutive_months: number;
4
+ min_spend: number;
5
+ max_spend?: number;
6
+ promo_code: string;
7
+ };
8
+ export declare const findTierForAmount: (amount: number, tiers?: Tier[]) => Tier;
9
+ export declare const extractVoucherFromPromoCode: (promoCode: string) => number;
10
+ export declare const calculateMonthCompletionValues: ({ data, minAmount, tiers, initialVoucherValue, initialMonthCompletionValue, maxMonths, today, }: CalculateMonthCompletionParams) => {
3
11
  monthCompletionValue: number;
4
12
  voucherValue: number;
5
13
  };
@@ -1,7 +1,3 @@
1
- export type ApproximateMonthlyTotal = {
2
- currentMonthTotal: number;
3
- nextMonthTotal?: number;
4
- };
5
1
  export type StoreMonthlySubsOrder = {
6
2
  accountId?: number;
7
3
  userId?: number;
@@ -16,9 +12,9 @@ export type StoreMonthlySubsOrder = {
16
12
  };
17
13
  export type MonthlyData = {
18
14
  approximateMonthlyTotalResponse?: {
19
- currentMonthTotal?: string;
15
+ currentMonthTotal?: number | string;
16
+ nextMonthTotal?: number | string;
20
17
  };
21
- approximateMonthlyTotal?: ApproximateMonthlyTotal;
22
18
  csmMonthlySubsOrderTotal?: StoreMonthlySubsOrder[];
23
19
  };
24
20
  export type OrderRecord = {
@@ -105,9 +101,12 @@ export type RewardSubscriptionMonthDescriptionProps = {
105
101
  export type CalculateMonthCompletionParams = {
106
102
  data: MonthlyData | null | undefined;
107
103
  minAmount: number;
108
- maxAmount: number;
109
- minVoucher: number;
110
- maxVoucher: number;
104
+ tiers: {
105
+ consecutive_months: number;
106
+ min_spend: number;
107
+ max_spend?: number;
108
+ promo_code: string;
109
+ }[];
111
110
  initialVoucherValue: number;
112
111
  initialMonthCompletionValue: number;
113
112
  maxMonths: number;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nuskin/react-loyalty-elements",
3
- "version": "1.0.8",
3
+ "version": "1.0.9",
4
4
  "description": "A React based component library for reusable Nextgen Loyalty component",
5
5
  "types": "dist/index.d.ts",
6
6
  "main": "dist/index.js",