@wtree/payload-ecommerce-coupon 3.78.8 → 3.78.10
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/collections/createReferralProgramsCollection.d.ts.map +1 -1
- package/dist/index.js +199 -172
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +199 -172
- package/dist/index.mjs.map +1 -1
- package/dist/utilities/calculateValues.d.ts +18 -1
- package/dist/utilities/calculateValues.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -1,11 +1,28 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Calculate the discount amount for a coupon.
|
|
3
|
+
*
|
|
4
|
+
* @param coupon - Coupon document from DB (values in normal currency).
|
|
5
|
+
* @param cartTotal - Cart subtotal in normal currency.
|
|
6
|
+
* @returns Discount amount in normal currency (2 dp).
|
|
7
|
+
*/
|
|
8
|
+
export declare function calculateCouponDiscount({ coupon, cartTotal, }: {
|
|
2
9
|
coupon: any;
|
|
3
10
|
cartTotal: number;
|
|
4
11
|
}): number;
|
|
12
|
+
/**
|
|
13
|
+
* Returns the effective minimum order amount for a program in NORMAL CURRENCY.
|
|
14
|
+
* Returns null if there is no minimum.
|
|
15
|
+
*/
|
|
5
16
|
export declare function getProgramMinimumOrderAmount({ program, allowedTotalCommissionTypes, }: {
|
|
6
17
|
program: any;
|
|
7
18
|
allowedTotalCommissionTypes?: Array<'fixed' | 'percentage'>;
|
|
8
19
|
}): number | null;
|
|
20
|
+
/**
|
|
21
|
+
* Calculate total partner commission and customer discount for a cart.
|
|
22
|
+
*
|
|
23
|
+
* All monetary inputs are in NORMAL CURRENCY.
|
|
24
|
+
* Returns results in NORMAL CURRENCY (2 dp).
|
|
25
|
+
*/
|
|
9
26
|
export declare function calculateCommissionAndDiscount({ cartItems, program, currencyCode, cartTotal, allowedTotalCommissionTypes, }: {
|
|
10
27
|
cartItems: any[];
|
|
11
28
|
program: any;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"calculateValues.d.ts","sourceRoot":"","sources":["../../src/utilities/calculateValues.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"calculateValues.d.ts","sourceRoot":"","sources":["../../src/utilities/calculateValues.ts"],"names":[],"mappings":"AA8BA;;;;;;GAMG;AACH,wBAAgB,uBAAuB,CAAC,EACtC,MAAM,EACN,SAAS,GACV,EAAE;IACD,MAAM,EAAE,GAAG,CAAA;IACX,SAAS,EAAE,MAAM,CAAA;CAClB,GAAG,MAAM,CAiBT;AA+UD;;;GAGG;AACH,wBAAgB,4BAA4B,CAAC,EAC3C,OAAO,EACP,2BAA2B,GAC5B,EAAE;IACD,OAAO,EAAE,GAAG,CAAA;IACZ,2BAA2B,CAAC,EAAE,KAAK,CAAC,OAAO,GAAG,YAAY,CAAC,CAAA;CAC5D,GAAG,MAAM,GAAG,IAAI,CAsBhB;AAMD;;;;;GAKG;AACH,wBAAgB,8BAA8B,CAAC,EAC7C,SAAS,EACT,OAAO,EACP,YAAoB,EACpB,SAAa,EACb,2BAA2B,GAC5B,EAAE;IACD,SAAS,EAAE,GAAG,EAAE,CAAA;IAChB,OAAO,EAAE,GAAG,CAAA;IACZ,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,2BAA2B,CAAC,EAAE,KAAK,CAAC,OAAO,GAAG,YAAY,CAAC,CAAA;CAC5D,GAAG;IAAE,iBAAiB,EAAE,MAAM,CAAC;IAAC,gBAAgB,EAAE,MAAM,CAAA;CAAE,CA2E1D"}
|