@nuskin/react-loyalty-elements 1.0.8-nge2-2767.1 → 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.
- package/dist/CircularProgressBar/index.js +1 -1
- package/dist/CircularProgressBar/index.js.map +1 -1
- package/dist/CircularProgressBar/index.mjs +1 -1
- package/dist/CircularProgressBar/index.mjs.map +1 -1
- package/dist/CircularProgressBar/logic/calculateMonthCompletionValues.d.ts +9 -1
- package/dist/CircularProgressBar/types.d.ts +8 -9
- package/package.json +1 -1
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
import { CalculateMonthCompletionParams } from '../types';
|
|
2
|
-
export
|
|
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
|
-
|
|
109
|
-
|
|
110
|
-
|
|
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