@pisell/pisellos 2.3.172 → 2.3.174
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/index.d.ts +0 -1
- package/dist/index.js +0 -1
- package/dist/model/strategy/adapter/promotion/evaluator.d.ts +2 -1
- package/dist/model/strategy/adapter/promotion/evaluator.js +14 -8
- package/dist/modules/BookingContext/utils/productExtend.d.ts +5 -0
- package/dist/modules/BookingContext/utils/productExtend.js +61 -23
- package/dist/modules/Discount/index.js +0 -1
- package/dist/modules/OpenData/index.d.ts +1 -0
- package/dist/modules/OpenData/index.js +1 -0
- package/dist/modules/OpenData/salesSettings.d.ts +32 -0
- package/dist/modules/OpenData/salesSettings.js +80 -0
- package/dist/modules/OpenData/types.d.ts +13 -0
- package/dist/modules/Order/index.d.ts +3 -25
- package/dist/modules/Order/index.js +1313 -1772
- package/dist/modules/Order/types.d.ts +0 -7
- package/dist/modules/Order/utils/discountProductLineIdentity.js +2 -2
- package/dist/modules/ProductList/index.js +12 -33
- package/dist/modules/Rules/index.d.ts +0 -2
- package/dist/modules/Rules/index.js +21 -29
- package/dist/solution/BaseSales/index.d.ts +1 -16
- package/dist/solution/BaseSales/index.js +1325 -1511
- package/dist/solution/BookingTicket/index.d.ts +2 -2
- package/dist/solution/BookingTicket/index.js +108 -200
- package/dist/solution/BookingTicket/types.d.ts +2 -14
- package/dist/solution/BookingTicket/utils/addProductDecision.d.ts +1 -1
- package/dist/solution/BookingTicket/utils/addProductDecision.js +3 -4
- package/dist/solution/BookingTicket/utils/scan/applyGlobalScan.js +58 -94
- package/dist/solution/BookingTicket/utils/scan/cloudSearch.js +0 -1
- package/dist/solution/BookingTicket/utils/scan/handleScan.js +1 -2
- package/dist/solution/UnifiedBookingSales/index.d.ts +23 -2
- package/dist/solution/UnifiedBookingSales/index.js +923 -683
- package/dist/solution/UnifiedBookingSales/salesSettings.d.ts +16 -0
- package/dist/solution/UnifiedBookingSales/salesSettings.js +81 -0
- package/dist/utils/platform.d.ts +0 -2
- package/dist/utils/platform.js +0 -6
- package/lib/index.d.ts +0 -1
- package/lib/index.js +0 -12
- package/lib/model/strategy/adapter/promotion/evaluator.d.ts +2 -1
- package/lib/model/strategy/adapter/promotion/evaluator.js +13 -7
- package/lib/modules/BookingContext/utils/productExtend.d.ts +5 -0
- package/lib/modules/BookingContext/utils/productExtend.js +36 -3
- package/lib/modules/Discount/index.js +0 -1
- package/lib/modules/OpenData/index.d.ts +1 -0
- package/lib/modules/OpenData/index.js +12 -0
- package/lib/modules/OpenData/salesSettings.d.ts +32 -0
- package/lib/modules/OpenData/salesSettings.js +70 -0
- package/lib/modules/OpenData/types.d.ts +13 -0
- package/lib/modules/Order/index.d.ts +3 -25
- package/lib/modules/Order/index.js +38 -192
- package/lib/modules/Order/types.d.ts +0 -7
- package/lib/modules/Order/utils/discountProductLineIdentity.js +1 -1
- package/lib/modules/ProductList/index.js +0 -15
- package/lib/modules/Rules/index.d.ts +0 -2
- package/lib/modules/Rules/index.js +0 -6
- package/lib/solution/BaseSales/index.d.ts +1 -16
- package/lib/solution/BaseSales/index.js +9 -89
- package/lib/solution/BookingTicket/index.d.ts +2 -2
- package/lib/solution/BookingTicket/index.js +2 -38
- package/lib/solution/BookingTicket/types.d.ts +2 -14
- package/lib/solution/BookingTicket/utils/addProductDecision.d.ts +1 -1
- package/lib/solution/BookingTicket/utils/addProductDecision.js +3 -4
- package/lib/solution/BookingTicket/utils/scan/applyGlobalScan.js +2 -14
- package/lib/solution/BookingTicket/utils/scan/cloudSearch.js +0 -1
- package/lib/solution/BookingTicket/utils/scan/handleScan.js +1 -2
- package/lib/solution/UnifiedBookingSales/index.d.ts +23 -2
- package/lib/solution/UnifiedBookingSales/index.js +131 -15
- package/lib/solution/UnifiedBookingSales/salesSettings.d.ts +16 -0
- package/lib/solution/UnifiedBookingSales/salesSettings.js +72 -0
- package/lib/utils/platform.d.ts +0 -2
- package/lib/utils/platform.js +0 -7
- package/package.json +1 -1
- package/dist/inventory/index.d.ts +0 -92
- package/dist/inventory/index.js +0 -509
- package/dist/modules/Order/utils/productVoucherGroups.d.ts +0 -15
- package/dist/modules/Order/utils/productVoucherGroups.js +0 -115
- package/dist/solution/BookingTicket/utils/scan/applyProductVoucherCollectionScan.d.ts +0 -10
- package/dist/solution/BookingTicket/utils/scan/applyProductVoucherCollectionScan.js +0 -117
- package/lib/inventory/index.d.ts +0 -92
- package/lib/inventory/index.js +0 -287
- package/lib/modules/Order/utils/productVoucherGroups.d.ts +0 -15
- package/lib/modules/Order/utils/productVoucherGroups.js +0 -64
- package/lib/solution/BookingTicket/utils/scan/applyProductVoucherCollectionScan.d.ts +0 -10
- package/lib/solution/BookingTicket/utils/scan/applyProductVoucherCollectionScan.js +0 -71
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.applyProductVoucherCollectionScan = applyProductVoucherCollectionScan;
|
|
7
|
-
var _applyGlobalScan = require("./applyGlobalScan");
|
|
8
|
-
/** Collect voucher candidates after customer binding and coupon loading finish.
|
|
9
|
-
* Never expand a wristband's result to other orders of the same customer. */
|
|
10
|
-
async function applyProductVoucherCollectionScan(host, formatted, bridge) {
|
|
11
|
-
const assertCurrent = () => {
|
|
12
|
-
if (bridge.isCurrent?.() === false) {
|
|
13
|
-
throw new DOMException('Scan session ended', 'AbortError');
|
|
14
|
-
}
|
|
15
|
-
};
|
|
16
|
-
let vouchers = [];
|
|
17
|
-
assertCurrent();
|
|
18
|
-
const result = await (0, _applyGlobalScan.applyGlobalScan)({
|
|
19
|
-
...host,
|
|
20
|
-
setOrderCustomer: customer => {
|
|
21
|
-
assertCurrent();
|
|
22
|
-
host.setOrderCustomer(customer);
|
|
23
|
-
},
|
|
24
|
-
addProductToOrder: (product, booking) => {
|
|
25
|
-
assertCurrent();
|
|
26
|
-
return host.addProductToOrder(product, booking);
|
|
27
|
-
}
|
|
28
|
-
}, formatted, {
|
|
29
|
-
...bridge,
|
|
30
|
-
applyPromotionCode: bridge.applyPromotionCode && (async (code, customerId, options) => {
|
|
31
|
-
// Customer binding starts prepare/config in the background. Let it finish
|
|
32
|
-
// before adding scanned coupons so its response cannot overwrite them.
|
|
33
|
-
await host.waitForCustomerDiscounts();
|
|
34
|
-
assertCurrent();
|
|
35
|
-
const promotion = await bridge.applyPromotionCode(code, customerId, {
|
|
36
|
-
...options,
|
|
37
|
-
productVouchersOnly: true,
|
|
38
|
-
suppressFailureNotification: true
|
|
39
|
-
});
|
|
40
|
-
assertCurrent();
|
|
41
|
-
// An empty successful search is different from a swallowed request error.
|
|
42
|
-
if (!Array.isArray(promotion.scannedDiscountList)) {
|
|
43
|
-
throw new Error('Could not resolve scanned vouchers');
|
|
44
|
-
}
|
|
45
|
-
vouchers = promotion.scannedDiscountList;
|
|
46
|
-
return promotion;
|
|
47
|
-
})
|
|
48
|
-
});
|
|
49
|
-
assertCurrent();
|
|
50
|
-
if (formatted.searchType === 'wallet' && result.status === 'success') {
|
|
51
|
-
vouchers = await host.loadCustomerDiscounts();
|
|
52
|
-
assertCurrent();
|
|
53
|
-
return {
|
|
54
|
-
...result,
|
|
55
|
-
redemption: {
|
|
56
|
-
source: 'wallet',
|
|
57
|
-
vouchers
|
|
58
|
-
}
|
|
59
|
-
};
|
|
60
|
-
}
|
|
61
|
-
if (formatted.searchType === 'walletPass') {
|
|
62
|
-
return {
|
|
63
|
-
...result,
|
|
64
|
-
redemption: {
|
|
65
|
-
source: 'scan',
|
|
66
|
-
vouchers
|
|
67
|
-
}
|
|
68
|
-
};
|
|
69
|
-
}
|
|
70
|
-
return result;
|
|
71
|
-
}
|