@pisell/pisellos 0.10.43 → 0.10.44
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/model/strategy/adapter/itemRule/adapter.d.ts +4 -1
- package/dist/model/strategy/adapter/itemRule/adapter.js +135 -35
- package/dist/model/strategy/adapter/itemRule/evaluator.d.ts +8 -1
- package/dist/model/strategy/adapter/itemRule/evaluator.js +25 -1
- package/dist/model/strategy/adapter/itemRule/type.d.ts +44 -0
- package/dist/model/strategy/adapter/itemRule/type.js +19 -1
- package/dist/modules/Order/index.d.ts +41 -9
- package/dist/modules/Order/index.js +1438 -878
- package/dist/modules/Order/salesNotes.d.ts +31 -0
- package/dist/modules/Order/salesNotes.js +492 -0
- package/dist/modules/Order/types.d.ts +105 -8
- package/dist/modules/Order/types.js +6 -1
- package/dist/modules/Order/utils.d.ts +3 -1
- package/dist/modules/Order/utils.js +191 -71
- package/dist/modules/Payment/cashRecommendationAlgorithm.d.ts +4 -5
- package/dist/modules/Payment/cashRecommendationAlgorithm.js +17 -367
- package/dist/modules/ProductList/index.d.ts +2 -1
- package/dist/modules/ProductList/index.js +100 -20
- package/dist/modules/ProductList/types.d.ts +10 -0
- package/dist/server/index.d.ts +7 -0
- package/dist/server/index.js +45 -3
- package/dist/server/modules/order/index.js +6 -0
- package/dist/server/modules/order/types.d.ts +9 -0
- package/dist/server/utils/small-ticket.d.ts +1 -0
- package/dist/server/utils/small-ticket.js +142 -14
- package/dist/solution/BaseSales/index.d.ts +15 -1
- package/dist/solution/BaseSales/index.js +1240 -877
- package/dist/solution/BookingByStep/index.d.ts +1 -1
- package/dist/solution/BookingTicket/index.d.ts +1 -0
- package/dist/solution/BookingTicket/index.js +37 -16
- package/dist/solution/BookingTicket/utils/orderCustomer.js +3 -2
- package/dist/solution/RegisterAndLogin/config.d.ts +9 -3
- package/dist/solution/RegisterAndLogin/config.js +95 -40
- package/dist/solution/RegisterAndLogin/index.js +4 -1
- package/dist/solution/ScanOrder/index.d.ts +1 -0
- package/dist/solution/ScanOrder/index.js +31 -27
- package/dist/solution/ScanOrder/utils.d.ts +1 -0
- package/dist/solution/ScanOrder/utils.js +2 -0
- package/dist/solution/UnifiedBookingSales/index.d.ts +15 -2
- package/dist/solution/UnifiedBookingSales/index.js +777 -510
- package/dist/solution/UnifiedBookingSales/types.d.ts +14 -1
- package/dist/solution/VenueBooking/index.d.ts +1 -0
- package/dist/solution/VenueBooking/index.js +8 -4
- package/lib/model/strategy/adapter/itemRule/adapter.d.ts +4 -1
- package/lib/model/strategy/adapter/itemRule/adapter.js +73 -4
- package/lib/model/strategy/adapter/itemRule/evaluator.d.ts +8 -1
- package/lib/model/strategy/adapter/itemRule/evaluator.js +23 -1
- package/lib/model/strategy/adapter/itemRule/type.d.ts +44 -0
- package/lib/model/strategy/adapter/itemRule/type.js +19 -1
- package/lib/modules/Order/index.d.ts +41 -9
- package/lib/modules/Order/index.js +434 -61
- package/lib/modules/Order/salesNotes.d.ts +31 -0
- package/lib/modules/Order/salesNotes.js +382 -0
- package/lib/modules/Order/types.d.ts +105 -8
- package/lib/modules/Order/types.js +5 -1
- package/lib/modules/Order/utils.d.ts +3 -1
- package/lib/modules/Order/utils.js +114 -1
- package/lib/modules/Payment/cashRecommendationAlgorithm.d.ts +4 -5
- package/lib/modules/Payment/cashRecommendationAlgorithm.js +9 -354
- package/lib/modules/ProductList/index.d.ts +2 -1
- package/lib/modules/ProductList/index.js +47 -2
- package/lib/modules/ProductList/types.d.ts +10 -0
- package/lib/server/index.d.ts +7 -0
- package/lib/server/index.js +39 -3
- package/lib/server/modules/order/index.js +6 -0
- package/lib/server/modules/order/types.d.ts +9 -0
- package/lib/server/utils/small-ticket.d.ts +1 -0
- package/lib/server/utils/small-ticket.js +136 -12
- package/lib/solution/BaseSales/index.d.ts +15 -1
- package/lib/solution/BaseSales/index.js +192 -22
- package/lib/solution/BookingByStep/index.d.ts +1 -1
- package/lib/solution/BookingTicket/index.d.ts +1 -0
- package/lib/solution/BookingTicket/index.js +23 -5
- package/lib/solution/BookingTicket/utils/orderCustomer.js +2 -1
- package/lib/solution/RegisterAndLogin/config.d.ts +9 -3
- package/lib/solution/RegisterAndLogin/config.js +49 -8
- package/lib/solution/RegisterAndLogin/index.js +4 -1
- package/lib/solution/ScanOrder/index.d.ts +1 -0
- package/lib/solution/ScanOrder/index.js +5 -1
- package/lib/solution/ScanOrder/utils.d.ts +1 -0
- package/lib/solution/ScanOrder/utils.js +1 -0
- package/lib/solution/UnifiedBookingSales/index.d.ts +15 -2
- package/lib/solution/UnifiedBookingSales/index.js +125 -1
- package/lib/solution/UnifiedBookingSales/types.d.ts +14 -1
- package/lib/solution/VenueBooking/index.d.ts +1 -0
- package/lib/solution/VenueBooking/index.js +5 -1
- package/package.json +1 -1
|
@@ -2023,7 +2023,11 @@ export var ScanOrderImpl = /*#__PURE__*/function (_BaseSalesImpl) {
|
|
|
2023
2023
|
}, {
|
|
2024
2024
|
key: "getItemRuleRuntimeConfig",
|
|
2025
2025
|
value: function getItemRuleRuntimeConfig() {
|
|
2026
|
-
|
|
2026
|
+
var _ref7, _runtimeConfig$channe, _runtimeConfig$custom, _this$otherParams13;
|
|
2027
|
+
var runtimeConfig = this.itemRuleRuntimeConfig || {};
|
|
2028
|
+
return _objectSpread(_objectSpread({}, runtimeConfig), {}, {
|
|
2029
|
+
channel: (_ref7 = (_runtimeConfig$channe = runtimeConfig.channel) !== null && _runtimeConfig$channe !== void 0 ? _runtimeConfig$channe : (_runtimeConfig$custom = runtimeConfig.custom) === null || _runtimeConfig$custom === void 0 ? void 0 : _runtimeConfig$custom.channel) !== null && _ref7 !== void 0 ? _ref7 : (_this$otherParams13 = this.otherParams) === null || _this$otherParams13 === void 0 ? void 0 : _this$otherParams13.channel
|
|
2030
|
+
});
|
|
2027
2031
|
}
|
|
2028
2032
|
}, {
|
|
2029
2033
|
key: "ensureItemRuleConfigsLoaded",
|
|
@@ -2510,14 +2514,14 @@ export var ScanOrderImpl = /*#__PURE__*/function (_BaseSalesImpl) {
|
|
|
2510
2514
|
}, {
|
|
2511
2515
|
key: "normalizeResourceState",
|
|
2512
2516
|
value: function normalizeResourceState(detail, resourceSelectType, hasOrderId) {
|
|
2513
|
-
var _detail$form_record, _this$
|
|
2517
|
+
var _detail$form_record, _this$otherParams14, _detail$resource_capa, _detail$resource_capa2;
|
|
2514
2518
|
var currentOrderId = toPositiveString(detail === null || detail === void 0 ? void 0 : detail.order_id);
|
|
2515
2519
|
var lastOrderId = toPositiveString(detail === null || detail === void 0 ? void 0 : detail.last_order_id);
|
|
2516
2520
|
var relationId = toPositiveString(detail === null || detail === void 0 ? void 0 : detail.form_record_id);
|
|
2517
2521
|
var tableFormId = toPositiveString(detail === null || detail === void 0 ? void 0 : detail.form_id);
|
|
2518
2522
|
var formRecord = (_detail$form_record = detail === null || detail === void 0 ? void 0 : detail.form_record) !== null && _detail$form_record !== void 0 ? _detail$form_record : null;
|
|
2519
2523
|
// 是否允许加餐
|
|
2520
|
-
var allowSnack = ((_this$
|
|
2524
|
+
var allowSnack = ((_this$otherParams14 = this.otherParams) === null || _this$otherParams14 === void 0 || (_this$otherParams14 = _this$otherParams14.dineInConfig) === null || _this$otherParams14 === void 0 ? void 0 : _this$otherParams14['sale.allow_add_items']) || false;
|
|
2521
2525
|
// 开启同桌验证 - 本期没有这个配置,默认关掉
|
|
2522
2526
|
var deskmateValid = false;
|
|
2523
2527
|
var isExclusive = resourceSelectType === 'single';
|
|
@@ -2600,7 +2604,7 @@ export var ScanOrderImpl = /*#__PURE__*/function (_BaseSalesImpl) {
|
|
|
2600
2604
|
key: "fetchResourceOccupyDetailsByResourceId",
|
|
2601
2605
|
value: function () {
|
|
2602
2606
|
var _fetchResourceOccupyDetailsByResourceId = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee36(resourceId) {
|
|
2603
|
-
var _this$
|
|
2607
|
+
var _this$otherParams15, _this$otherParams15$g, _response$data$occupy, _response$data;
|
|
2604
2608
|
var formRecordId, shopId, response;
|
|
2605
2609
|
return _regeneratorRuntime().wrap(function _callee36$(_context36) {
|
|
2606
2610
|
while (1) switch (_context36.prev = _context36.next) {
|
|
@@ -2612,7 +2616,7 @@ export var ScanOrderImpl = /*#__PURE__*/function (_BaseSalesImpl) {
|
|
|
2612
2616
|
}
|
|
2613
2617
|
throw new Error("[ScanOrder] \u975E\u6CD5\u684C\u53F0 resourceId: ".concat(resourceId));
|
|
2614
2618
|
case 3:
|
|
2615
|
-
shopId = (_this$
|
|
2619
|
+
shopId = (_this$otherParams15 = this.otherParams) === null || _this$otherParams15 === void 0 || (_this$otherParams15$g = _this$otherParams15.getStateData) === null || _this$otherParams15$g === void 0 ? void 0 : _this$otherParams15$g.call(_this$otherParams15, 'shop_id');
|
|
2616
2620
|
if (shopId) {
|
|
2617
2621
|
_context36.next = 6;
|
|
2618
2622
|
break;
|
|
@@ -2706,18 +2710,18 @@ export var ScanOrderImpl = /*#__PURE__*/function (_BaseSalesImpl) {
|
|
|
2706
2710
|
var hasOrderId,
|
|
2707
2711
|
normalizedResourceId,
|
|
2708
2712
|
_this$otherParams$bus,
|
|
2709
|
-
_this$otherParams15,
|
|
2710
|
-
_this$otherParams$cha,
|
|
2711
2713
|
_this$otherParams16,
|
|
2714
|
+
_this$otherParams$cha,
|
|
2712
2715
|
_this$otherParams17,
|
|
2713
|
-
_this$
|
|
2716
|
+
_this$otherParams18,
|
|
2717
|
+
_this$otherParams18$g,
|
|
2714
2718
|
_occupyDetails$,
|
|
2715
2719
|
_occupyDetail$form_re,
|
|
2716
2720
|
_occupyDetail$form_re2,
|
|
2717
2721
|
_this$store$order6,
|
|
2718
2722
|
_this$store$order7,
|
|
2719
2723
|
_this$store$order7$ge,
|
|
2720
|
-
_this$
|
|
2724
|
+
_this$otherParams19,
|
|
2721
2725
|
_this$store$resource3,
|
|
2722
2726
|
_this$store$resource4,
|
|
2723
2727
|
businessCode,
|
|
@@ -2771,11 +2775,11 @@ export var ScanOrderImpl = /*#__PURE__*/function (_BaseSalesImpl) {
|
|
|
2771
2775
|
resourceId: normalizedResourceId
|
|
2772
2776
|
});
|
|
2773
2777
|
_context37.prev = 3;
|
|
2774
|
-
businessCode = String((_this$otherParams$bus = (_this$
|
|
2775
|
-
channel = String((_this$otherParams$cha = (_this$
|
|
2778
|
+
businessCode = String((_this$otherParams$bus = (_this$otherParams16 = this.otherParams) === null || _this$otherParams16 === void 0 ? void 0 : _this$otherParams16.businessCode) !== null && _this$otherParams$bus !== void 0 ? _this$otherParams$bus : '').trim();
|
|
2779
|
+
channel = String((_this$otherParams$cha = (_this$otherParams17 = this.otherParams) === null || _this$otherParams17 === void 0 ? void 0 : _this$otherParams17.channel) !== null && _this$otherParams$cha !== void 0 ? _this$otherParams$cha : '').trim();
|
|
2776
2780
|
openDataTarget = businessCode && channel ? "".concat(businessCode, "+").concat(channel) : 'dine_in+scan_to_order';
|
|
2777
2781
|
_context37.next = 9;
|
|
2778
|
-
return (_this$
|
|
2782
|
+
return (_this$otherParams18 = this.otherParams) === null || _this$otherParams18 === void 0 || (_this$otherParams18$g = _this$otherParams18.getOpenData) === null || _this$otherParams18$g === void 0 ? void 0 : _this$otherParams18$g.call(_this$otherParams18, {
|
|
2779
2783
|
scope: 'board',
|
|
2780
2784
|
target: openDataTarget,
|
|
2781
2785
|
section_code: ['basic', 'fulfillment', 'reservation', 'sale', 'menu', 'availability', 'workflow']
|
|
@@ -3004,7 +3008,7 @@ export var ScanOrderImpl = /*#__PURE__*/function (_BaseSalesImpl) {
|
|
|
3004
3008
|
}, []) : []; // pax 由 setEntryPaxNumber 负责写入 itemRuleRuntimeConfig.pax
|
|
3005
3009
|
_context37.next = 84;
|
|
3006
3010
|
return this.setItemRuleRuntimeConfig({
|
|
3007
|
-
serviceType: (_this$
|
|
3011
|
+
serviceType: (_this$otherParams19 = this.otherParams) === null || _this$otherParams19 === void 0 ? void 0 : _this$otherParams19.businessCode,
|
|
3008
3012
|
submissionIndex: isAdditionalOrderMode ? 1 : 0,
|
|
3009
3013
|
historicalItems: historicalItems
|
|
3010
3014
|
});
|
|
@@ -3130,14 +3134,14 @@ export var ScanOrderImpl = /*#__PURE__*/function (_BaseSalesImpl) {
|
|
|
3130
3134
|
key: "getProductList",
|
|
3131
3135
|
value: function () {
|
|
3132
3136
|
var _getProductList = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee40() {
|
|
3133
|
-
var _this$
|
|
3137
|
+
var _this$otherParams20;
|
|
3134
3138
|
var associatedMenus, menu_list_ids, res, productList, formattedRes;
|
|
3135
3139
|
return _regeneratorRuntime().wrap(function _callee40$(_context40) {
|
|
3136
3140
|
while (1) switch (_context40.prev = _context40.next) {
|
|
3137
3141
|
case 0:
|
|
3138
3142
|
this.logMethodStart('getProductList');
|
|
3139
3143
|
// 可以直接通过配置里的 menu 读取
|
|
3140
|
-
associatedMenus = (_this$
|
|
3144
|
+
associatedMenus = (_this$otherParams20 = this.otherParams) === null || _this$otherParams20 === void 0 || (_this$otherParams20 = _this$otherParams20.dineInConfig) === null || _this$otherParams20 === void 0 ? void 0 : _this$otherParams20['menu.associated_menus'];
|
|
3141
3145
|
menu_list_ids = associatedMenus.map(function (n) {
|
|
3142
3146
|
return Number(n.value);
|
|
3143
3147
|
}) || [];
|
|
@@ -3196,14 +3200,14 @@ export var ScanOrderImpl = /*#__PURE__*/function (_BaseSalesImpl) {
|
|
|
3196
3200
|
key: "setOtherParams",
|
|
3197
3201
|
value: function () {
|
|
3198
3202
|
var _setOtherParams = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee41(params) {
|
|
3199
|
-
var
|
|
3200
|
-
|
|
3203
|
+
var _ref9,
|
|
3204
|
+
_ref9$cover,
|
|
3201
3205
|
cover,
|
|
3202
3206
|
_args41 = arguments;
|
|
3203
3207
|
return _regeneratorRuntime().wrap(function _callee41$(_context41) {
|
|
3204
3208
|
while (1) switch (_context41.prev = _context41.next) {
|
|
3205
3209
|
case 0:
|
|
3206
|
-
|
|
3210
|
+
_ref9 = _args41.length > 1 && _args41[1] !== undefined ? _args41[1] : {}, _ref9$cover = _ref9.cover, cover = _ref9$cover === void 0 ? false : _ref9$cover;
|
|
3207
3211
|
if (cover) {
|
|
3208
3212
|
this.otherParams = params;
|
|
3209
3213
|
} else {
|
|
@@ -3354,7 +3358,7 @@ export var ScanOrderImpl = /*#__PURE__*/function (_BaseSalesImpl) {
|
|
|
3354
3358
|
key: "syncAdditionalOrderFromResource",
|
|
3355
3359
|
value: function () {
|
|
3356
3360
|
var _syncAdditionalOrderFromResource = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee43(resourceId) {
|
|
3357
|
-
var
|
|
3361
|
+
var _ref10, _ref11, _ref12, _this$store$resource5, _this$store$resource6, _occupyDetails$2, _this$store$resource7, _this$otherParams21, _this$store$order8;
|
|
3358
3362
|
var tempOrder, normalizedResourceId, _result, occupyDetails, occupyDetail, resourceSelectType, allowAddItems, result;
|
|
3359
3363
|
return _regeneratorRuntime().wrap(function _callee43$(_context43) {
|
|
3360
3364
|
while (1) switch (_context43.prev = _context43.next) {
|
|
@@ -3366,7 +3370,7 @@ export var ScanOrderImpl = /*#__PURE__*/function (_BaseSalesImpl) {
|
|
|
3366
3370
|
throw new Error('order 模块未初始化');
|
|
3367
3371
|
case 2:
|
|
3368
3372
|
tempOrder = this.store.order.ensureTempOrder();
|
|
3369
|
-
normalizedResourceId = String((
|
|
3373
|
+
normalizedResourceId = String((_ref10 = (_ref11 = (_ref12 = resourceId !== null && resourceId !== void 0 ? resourceId : tempOrder.resource_id) !== null && _ref12 !== void 0 ? _ref12 : (_this$store$resource5 = this.store.resource) === null || _this$store$resource5 === void 0 ? void 0 : _this$store$resource5.relationId) !== null && _ref11 !== void 0 ? _ref11 : (_this$store$resource6 = this.store.resource) === null || _this$store$resource6 === void 0 ? void 0 : _this$store$resource6.relation_id) !== null && _ref10 !== void 0 ? _ref10 : '').trim();
|
|
3370
3374
|
this.logMethodStart('syncAdditionalOrderFromResource', {
|
|
3371
3375
|
resourceId: normalizedResourceId
|
|
3372
3376
|
});
|
|
@@ -3387,7 +3391,7 @@ export var ScanOrderImpl = /*#__PURE__*/function (_BaseSalesImpl) {
|
|
|
3387
3391
|
occupyDetails = _context43.sent;
|
|
3388
3392
|
occupyDetail = (_occupyDetails$2 = occupyDetails[0]) !== null && _occupyDetails$2 !== void 0 ? _occupyDetails$2 : null;
|
|
3389
3393
|
resourceSelectType = ((_this$store$resource7 = this.store.resource) === null || _this$store$resource7 === void 0 ? void 0 : _this$store$resource7.resourceSelectType) || this.resolveResourceSelectType(toPositiveString(occupyDetail === null || occupyDetail === void 0 ? void 0 : occupyDetail.form_id));
|
|
3390
|
-
allowAddItems = toBoolean((_this$
|
|
3394
|
+
allowAddItems = toBoolean((_this$otherParams21 = this.otherParams) === null || _this$otherParams21 === void 0 || (_this$otherParams21 = _this$otherParams21.dineInConfig) === null || _this$otherParams21 === void 0 ? void 0 : _this$otherParams21['sale.allow_add_items']);
|
|
3391
3395
|
result = this.resolveAdditionalOrderFromOccupyDetail(occupyDetail, resourceSelectType, allowAddItems);
|
|
3392
3396
|
if (!(!result.matched || !result.order_id)) {
|
|
3393
3397
|
_context43.next = 19;
|
|
@@ -3445,9 +3449,9 @@ export var ScanOrderImpl = /*#__PURE__*/function (_BaseSalesImpl) {
|
|
|
3445
3449
|
}, {
|
|
3446
3450
|
key: "checkAllowAddItems",
|
|
3447
3451
|
value: function checkAllowAddItems() {
|
|
3448
|
-
var _this$
|
|
3452
|
+
var _this$otherParams22;
|
|
3449
3453
|
this.logMethodStart('checkAllowAddItems');
|
|
3450
|
-
var dineInConfig = ((_this$
|
|
3454
|
+
var dineInConfig = ((_this$otherParams22 = this.otherParams) === null || _this$otherParams22 === void 0 ? void 0 : _this$otherParams22.dineInConfig) || {};
|
|
3451
3455
|
var result = {
|
|
3452
3456
|
enabled: toBoolean(dineInConfig['sale.allow_add_items'])
|
|
3453
3457
|
};
|
|
@@ -3460,9 +3464,9 @@ export var ScanOrderImpl = /*#__PURE__*/function (_BaseSalesImpl) {
|
|
|
3460
3464
|
}, {
|
|
3461
3465
|
key: "getFulfillmentModes",
|
|
3462
3466
|
value: function getFulfillmentModes() {
|
|
3463
|
-
var _this$
|
|
3467
|
+
var _this$otherParams23;
|
|
3464
3468
|
this.logMethodStart('getFulfillmentModes');
|
|
3465
|
-
var dineInConfig = ((_this$
|
|
3469
|
+
var dineInConfig = ((_this$otherParams23 = this.otherParams) === null || _this$otherParams23 === void 0 ? void 0 : _this$otherParams23.dineInConfig) || {};
|
|
3466
3470
|
var result = {
|
|
3467
3471
|
enablePickup: Boolean(dineInConfig['fulfillment.enable_pickup']),
|
|
3468
3472
|
enableTableService: Boolean(dineInConfig['fulfillment.enable_table_service'])
|
|
@@ -3476,9 +3480,9 @@ export var ScanOrderImpl = /*#__PURE__*/function (_BaseSalesImpl) {
|
|
|
3476
3480
|
}, {
|
|
3477
3481
|
key: "checkManualPickupRef",
|
|
3478
3482
|
value: function checkManualPickupRef() {
|
|
3479
|
-
var _this$
|
|
3483
|
+
var _this$otherParams24;
|
|
3480
3484
|
this.logMethodStart('checkManualPickupRef');
|
|
3481
|
-
var dineInConfig = ((_this$
|
|
3485
|
+
var dineInConfig = ((_this$otherParams24 = this.otherParams) === null || _this$otherParams24 === void 0 ? void 0 : _this$otherParams24.dineInConfig) || {};
|
|
3482
3486
|
var refMode = dineInConfig['fulfillment.fulfillment_ref_mode'];
|
|
3483
3487
|
var manualInputType = dineInConfig['fulfillment.manual_input_type'];
|
|
3484
3488
|
var enabled = refMode === 'manual_input';
|
|
@@ -309,6 +309,7 @@ export function aggregateItemRuleLimit(matchedLimits) {
|
|
|
309
309
|
};
|
|
310
310
|
}
|
|
311
311
|
export function buildItemRuleBusinessData(params) {
|
|
312
|
+
var _runtimeConfig$channe, _runtimeConfig$custom;
|
|
312
313
|
var tempOrder = params.tempOrder,
|
|
313
314
|
runtimeConfig = params.runtimeConfig,
|
|
314
315
|
itemRuleConfigs = params.itemRuleConfigs;
|
|
@@ -345,6 +346,7 @@ export function buildItemRuleBusinessData(params) {
|
|
|
345
346
|
cartItems: cartItems,
|
|
346
347
|
historicalItems: historicalItems,
|
|
347
348
|
serviceType: runtimeConfig.serviceType || 'dine-in',
|
|
349
|
+
channel: (_runtimeConfig$channe = runtimeConfig.channel) !== null && _runtimeConfig$channe !== void 0 ? _runtimeConfig$channe : (_runtimeConfig$custom = runtimeConfig.custom) === null || _runtimeConfig$custom === void 0 ? void 0 : _runtimeConfig$custom.channel,
|
|
348
350
|
submissionIndex: typeof runtimeConfig.submissionIndex === 'number' ? toNonNegativeInt(runtimeConfig.submissionIndex) : tempOrder.order_id ? 1 : 0,
|
|
349
351
|
custom: runtimeConfig.custom || {},
|
|
350
352
|
strategyConfigs: itemRuleConfigs
|
|
@@ -2,10 +2,11 @@ import type { Module, ModuleOptions, PisellCore } from '../../types';
|
|
|
2
2
|
import type { ProductData } from '../../modules';
|
|
3
3
|
import { type InvoiceLayoutConfig, type InvoiceTemplateSettings, type OpenDataConfig } from '../../modules/OpenData';
|
|
4
4
|
import type { LoadScheduleAvailableDateParams, ScheduleItem } from '../../modules/Schedule/types';
|
|
5
|
-
import type { ProductListLoadProductsParams } from '../../modules/ProductList';
|
|
5
|
+
import type { ProductListLoadProductsParams, ProductListStoreQueryParams } from '../../modules/ProductList';
|
|
6
6
|
import type { AvailabilityDateRange, AvailabilityOccupancy, AvailabilityProduct, AvailabilityResource, GetProductTimeRangesRequest } from '../../modules/ResourcePlanner';
|
|
7
|
-
import type { AvailabilityContextRef, ContextualAvailabilityQuery, ContextualAvailabilityQueryResult, ContextualCommitAvailabilitySelectionParams, ContextualProductTimeRangeGroup, UnifiedBookingSalesAddRetailProductParams, UnifiedBookingSalesApplyPlannerDiscountsParams, UnifiedBookingSalesCommitAvailabilitySelectionResult, UnifiedBookingSalesDiscountResult, UnifiedBookingSalesLoadProductsByScheduleDateParams, UnifiedBookingSalesLoadOpenDataParams, UnifiedBookingSalesPrepareAvailabilityProjectionParams, UnifiedBookingSalesPolicyResponse, UnifiedBookingSalesStageRetailProductsParams, UnifiedBookingSalesState } from './types';
|
|
7
|
+
import type { AvailabilityContextRef, ContextualAvailabilityQuery, ContextualAvailabilityQueryResult, ContextualCommitAvailabilitySelectionParams, ContextualProductTimeRangeGroup, UnifiedBookingSalesAddRetailProductParams, UnifiedBookingSalesApplyPlannerDiscountsParams, UnifiedBookingSalesCommitAvailabilitySelectionResult, UnifiedBookingSalesDiscountResult, UnifiedBookingSalesLoadProductsByScheduleDateParams, UnifiedBookingSalesLoadOpenDataParams, UnifiedBookingSalesPrepareAvailabilityProjectionParams, UnifiedBookingSalesPolicyResponse, UnifiedBookingSalesResolveProductAllergyRequirementParams, UnifiedBookingSalesStageRetailProductsParams, UnifiedBookingSalesState } from './types';
|
|
8
8
|
import { BookingTicket } from '../BookingTicket';
|
|
9
|
+
import type { AllergyRequirement } from '../../model/strategy/adapter/itemRule';
|
|
9
10
|
export * from './types';
|
|
10
11
|
export { AvailabilityError } from '../../modules/ResourcePlanner';
|
|
11
12
|
/**
|
|
@@ -73,6 +74,9 @@ export declare class UnifiedBookingSalesImpl extends BookingTicket {
|
|
|
73
74
|
private availabilityRemoteResourceQuerySequence;
|
|
74
75
|
private availabilityRemoteResourceEpoch;
|
|
75
76
|
private availabilityCommitLocks;
|
|
77
|
+
private allergyItemRuleEvaluator;
|
|
78
|
+
private allergyItemRuleConfigs;
|
|
79
|
+
private allergyItemRuleConfigsPromise;
|
|
76
80
|
initialize(core: PisellCore, options?: ModuleOptions): Promise<void>;
|
|
77
81
|
protected getSubmitOrderSalesChannel(): string;
|
|
78
82
|
private createAvailabilityFacadeError;
|
|
@@ -144,6 +148,14 @@ export declare class UnifiedBookingSalesImpl extends BookingTicket {
|
|
|
144
148
|
*/
|
|
145
149
|
loadOpenData(params: UnifiedBookingSalesLoadOpenDataParams): Promise<OpenDataConfig>;
|
|
146
150
|
getOpenData(): Promise<OpenDataConfig | null>;
|
|
151
|
+
private resetAllergyItemRuleState;
|
|
152
|
+
private fetchAllergyItemRuleConfigs;
|
|
153
|
+
private ensureAllergyItemRuleConfigsLoaded;
|
|
154
|
+
/**
|
|
155
|
+
* 评估当前渠道与商品是否命中 ALLERGY_CHECK。
|
|
156
|
+
* 只返回优先级最高 Action 中当前商品 Target 的 dataSource,不跨商品或 Action 合并。
|
|
157
|
+
*/
|
|
158
|
+
resolveProductAllergyRequirement(params: UnifiedBookingSalesResolveProductAllergyRequirementParams): Promise<AllergyRequirement | null>;
|
|
147
159
|
clearOpenDataCache(): void;
|
|
148
160
|
getInvoiceLayoutConfig(): Promise<InvoiceLayoutConfig>;
|
|
149
161
|
getInvoiceTemplateSettings(): Promise<InvoiceTemplateSettings>;
|
|
@@ -160,6 +172,7 @@ export declare class UnifiedBookingSalesImpl extends BookingTicket {
|
|
|
160
172
|
callback?: (result: any) => void;
|
|
161
173
|
subscriberId?: string;
|
|
162
174
|
}): Promise<ProductData[]>;
|
|
175
|
+
queryProducts(params?: ProductListStoreQueryParams): Promise<ProductData[]>;
|
|
163
176
|
/** Date-first entry point. It delegates protocol details and cache ownership to ScheduleModule. */
|
|
164
177
|
loadScheduleAvailableDate(params: LoadScheduleAvailableDateParams): Promise<import("../../modules/Date/types").ITime[]>;
|
|
165
178
|
/**
|