@unchainedshop/core-delivery 2.7.1 → 2.7.3
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.
|
@@ -33,15 +33,10 @@ export const DeliveryPricingSheet = (params) => {
|
|
|
33
33
|
rate,
|
|
34
34
|
});
|
|
35
35
|
},
|
|
36
|
-
taxSum() {
|
|
36
|
+
taxSum(filter) {
|
|
37
37
|
return basePricingSheet.sum({
|
|
38
38
|
category: DeliveryPricingRowCategory.Tax,
|
|
39
|
-
|
|
40
|
-
},
|
|
41
|
-
discountSum(discountId) {
|
|
42
|
-
return basePricingSheet.sum({
|
|
43
|
-
category: DeliveryPricingRowCategory.Discount,
|
|
44
|
-
discountId,
|
|
39
|
+
...(filter || {}),
|
|
45
40
|
});
|
|
46
41
|
},
|
|
47
42
|
discountPrices(explicitDiscountId) {
|
|
@@ -53,7 +48,7 @@ export const DeliveryPricingSheet = (params) => {
|
|
|
53
48
|
.map(({ discountId }) => discountId);
|
|
54
49
|
return [...new Set(discountIds)]
|
|
55
50
|
.map((discountId) => {
|
|
56
|
-
const amount = basePricingSheet.
|
|
51
|
+
const { currency, amount } = basePricingSheet.total({
|
|
57
52
|
category: DeliveryPricingRowCategory.Discount,
|
|
58
53
|
discountId,
|
|
59
54
|
});
|
|
@@ -63,7 +58,7 @@ export const DeliveryPricingSheet = (params) => {
|
|
|
63
58
|
return {
|
|
64
59
|
discountId,
|
|
65
60
|
amount: Math.round(amount),
|
|
66
|
-
currency
|
|
61
|
+
currency,
|
|
67
62
|
};
|
|
68
63
|
})
|
|
69
64
|
.filter(Boolean);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DeliveryPricingSheet.js","sourceRoot":"","sources":["../../src/director/DeliveryPricingSheet.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AACxD,OAAO,EAEL,0BAA0B,GAE3B,MAAM,0CAA0C,CAAC;AAG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EAAE,EAAE,CAAC,UAAU,CAAC,CAAC;YAEvC,OAAO,CAAC,GAAG,IAAI,GAAG,CAAC,WAAW,CAAC,CAAC;iBAC7B,GAAG,CAAC,CAAC,UAAU,EAAE,EAAE;gBAClB,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,GAAG,gBAAgB,CAAC,KAAK,CAAC;oBAClD,QAAQ,EAAE,0BAA0B,CAAC,QAAQ;oBAC7C,UAAU;iBACX,CAAC,CAAC;gBACH,IAAI,CAAC,MAAM,EAAE,CAAC;oBACZ,OAAO,IAAI,CAAC;gBACd,CAAC;gBACD,OAAO;oBACL,UAAU;oBACV,MAAM,EAAE,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC;oBAC1B,QAAQ;iBACT,CAAC;YACJ,CAAC,CAAC;iBACD,MAAM,CAAC,OAAO,CAAC,CAAC;QACrB,CAAC;KACF,CAAC;IAEF,OAAO,YAAY,CAAC;AACtB,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@unchainedshop/core-delivery",
|
|
3
|
-
"version": "2.7.
|
|
3
|
+
"version": "2.7.3",
|
|
4
4
|
"main": "lib/delivery-index.js",
|
|
5
5
|
"exports": {
|
|
6
6
|
".": "./lib/delivery-index.js",
|
|
@@ -31,14 +31,14 @@
|
|
|
31
31
|
},
|
|
32
32
|
"homepage": "https://github.com/unchainedshop/unchained#readme",
|
|
33
33
|
"dependencies": {
|
|
34
|
-
"@unchainedshop/events": "^2.7.
|
|
35
|
-
"@unchainedshop/logger": "^2.7.
|
|
36
|
-
"@unchainedshop/utils": "^2.7.
|
|
34
|
+
"@unchainedshop/events": "^2.7.3",
|
|
35
|
+
"@unchainedshop/logger": "^2.7.3",
|
|
36
|
+
"@unchainedshop/utils": "^2.7.3",
|
|
37
37
|
"simpl-schema": "=3.2.0"
|
|
38
38
|
},
|
|
39
39
|
"devDependencies": {
|
|
40
40
|
"@types/node": "^20.11.17",
|
|
41
|
-
"@unchainedshop/types": "^2.7.
|
|
41
|
+
"@unchainedshop/types": "^2.7.3",
|
|
42
42
|
"jest": "^29.7.0",
|
|
43
43
|
"ts-jest": "^29.1.2",
|
|
44
44
|
"typescript": "^5.3.3"
|
|
@@ -46,16 +46,10 @@ export const DeliveryPricingSheet = (
|
|
|
46
46
|
});
|
|
47
47
|
},
|
|
48
48
|
|
|
49
|
-
taxSum() {
|
|
49
|
+
taxSum(filter) {
|
|
50
50
|
return basePricingSheet.sum({
|
|
51
51
|
category: DeliveryPricingRowCategory.Tax,
|
|
52
|
-
|
|
53
|
-
},
|
|
54
|
-
|
|
55
|
-
discountSum(discountId) {
|
|
56
|
-
return basePricingSheet.sum({
|
|
57
|
-
category: DeliveryPricingRowCategory.Discount,
|
|
58
|
-
discountId,
|
|
52
|
+
...(filter || {}),
|
|
59
53
|
});
|
|
60
54
|
},
|
|
61
55
|
|
|
@@ -69,7 +63,7 @@ export const DeliveryPricingSheet = (
|
|
|
69
63
|
|
|
70
64
|
return [...new Set(discountIds)]
|
|
71
65
|
.map((discountId) => {
|
|
72
|
-
const amount = basePricingSheet.
|
|
66
|
+
const { currency, amount } = basePricingSheet.total({
|
|
73
67
|
category: DeliveryPricingRowCategory.Discount,
|
|
74
68
|
discountId,
|
|
75
69
|
});
|
|
@@ -79,7 +73,7 @@ export const DeliveryPricingSheet = (
|
|
|
79
73
|
return {
|
|
80
74
|
discountId,
|
|
81
75
|
amount: Math.round(amount),
|
|
82
|
-
currency
|
|
76
|
+
currency,
|
|
83
77
|
};
|
|
84
78
|
})
|
|
85
79
|
.filter(Boolean);
|