@pisell/pisellos 2.2.278 → 2.2.280
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/modules/BaseModule.d.ts +1 -0
- package/dist/modules/BaseModule.js +24 -28
- package/dist/modules/BookingContext/utils/buildCacheItemFromOrderLine.js +7 -3
- package/dist/modules/BookingContext/utils/productExtend.js +5 -9
- package/dist/modules/BookingContext/utils/timeSlices.js +24 -3
- package/dist/modules/Customer/index.d.ts +4 -0
- package/dist/modules/Customer/index.js +91 -59
- package/dist/modules/Customer/types.d.ts +2 -0
- package/dist/modules/Discount/index.d.ts +1 -0
- package/dist/modules/Discount/index.js +40 -11
- package/dist/modules/Discount/types.d.ts +1 -0
- package/dist/modules/Holder/index.d.ts +48 -0
- package/dist/modules/Holder/index.js +640 -0
- package/dist/modules/Holder/types.d.ts +123 -0
- package/dist/modules/Holder/types.js +1 -0
- package/dist/modules/Holder/utils.d.ts +13 -0
- package/dist/modules/Holder/utils.js +34 -0
- package/dist/modules/OpenData/index.js +2 -2
- package/dist/modules/Order/index.d.ts +32 -4
- package/dist/modules/Order/index.js +868 -675
- package/dist/modules/Order/types.d.ts +22 -1
- package/dist/modules/Order/utils/discountProductLineIdentity.d.ts +45 -0
- package/dist/modules/Order/utils/discountProductLineIdentity.js +227 -0
- package/dist/modules/Order/utils/orderCollectionIdentity.d.ts +15 -0
- package/dist/modules/Order/utils/orderCollectionIdentity.js +75 -0
- package/dist/modules/Order/utils.d.ts +10 -0
- package/dist/modules/Order/utils.js +71 -34
- package/dist/modules/Payment/index.d.ts +4 -0
- package/dist/modules/Payment/index.js +14 -4
- package/dist/modules/Payment/walletpass.js +21 -7
- package/dist/modules/Product/types.d.ts +1 -0
- package/dist/modules/ProductList/index.js +33 -13
- package/dist/modules/Quotation/index.d.ts +1 -1
- package/dist/modules/Quotation/index.js +2 -2
- package/dist/modules/ResourcePlanner/index.d.ts +24 -0
- package/dist/modules/ResourcePlanner/index.js +181 -0
- package/dist/modules/ResourcePlanner/planner.d.ts +14 -0
- package/dist/modules/ResourcePlanner/planner.js +1069 -0
- package/dist/modules/ResourcePlanner/types.d.ts +227 -0
- package/dist/modules/ResourcePlanner/types.js +1 -0
- package/dist/modules/Rules/index.js +153 -56
- package/dist/modules/SalesSummary/index.js +12 -13
- package/dist/modules/ScanOrderLogger/index.d.ts +2 -0
- package/dist/modules/ScanOrderLogger/index.js +15 -2
- package/dist/modules/ScanOrderLogger/providers/feishu.js +45 -27
- package/dist/modules/ScanOrderLogger/types.d.ts +1 -0
- package/dist/modules/Schedule/index.d.ts +3 -1
- package/dist/modules/Schedule/index.js +21 -16
- package/dist/modules/Summary/utils.js +38 -13
- package/dist/modules/index.d.ts +2 -0
- package/dist/modules/index.js +3 -1
- package/dist/plugins/window.d.ts +1 -0
- package/dist/server/index.d.ts +20 -0
- package/dist/server/index.js +1101 -909
- package/dist/server/modules/order/index.d.ts +2 -0
- package/dist/server/modules/order/index.js +261 -96
- package/dist/server/modules/order/types.d.ts +1 -1
- package/dist/solution/BaseSales/index.d.ts +20 -1
- package/dist/solution/BaseSales/index.js +989 -881
- package/dist/solution/BaseSales/utils/cartPromotion.js +19 -1
- package/dist/solution/BaseSales/utils/transformBaseProductToOrderProduct.js +6 -3
- package/dist/solution/BaseSales/utils.js +31 -20
- package/dist/solution/BookingByStep/index.d.ts +17 -2
- package/dist/solution/BookingByStep/index.js +294 -215
- package/dist/solution/BookingByStep/types.d.ts +2 -1
- package/dist/solution/BookingByStep/types.js +3 -1
- package/dist/solution/BookingByStep/utils/capacity.js +17 -1
- package/dist/solution/BookingByStep/utils/timeslots.d.ts +3 -1
- package/dist/solution/BookingByStep/utils/timeslots.js +19 -12
- package/dist/solution/BookingTicket/index.d.ts +21 -3
- package/dist/solution/BookingTicket/index.js +312 -226
- package/dist/solution/BookingTicket/utils/scan/handleScan.d.ts +3 -1
- package/dist/solution/BookingTicket/utils/scan/handleScan.js +10 -2
- package/dist/solution/ScanOrder/index.d.ts +26 -14
- package/dist/solution/ScanOrder/index.js +1142 -739
- package/dist/solution/ScanOrder/types.d.ts +21 -1
- package/dist/solution/ScanOrder/utils.d.ts +8 -0
- package/dist/solution/ScanOrder/utils.js +97 -45
- package/dist/solution/ShopDiscount/index.d.ts +1 -0
- package/dist/solution/ShopDiscount/index.js +125 -87
- package/dist/solution/UnifiedBookingSales/index.d.ts +204 -0
- package/dist/solution/UnifiedBookingSales/index.js +2211 -0
- package/dist/solution/UnifiedBookingSales/types.d.ts +150 -0
- package/dist/solution/UnifiedBookingSales/types.js +11 -0
- package/dist/solution/VenueBooking/index.d.ts +39 -11
- package/dist/solution/VenueBooking/index.js +1167 -841
- package/dist/solution/VenueBooking/types.d.ts +3 -0
- package/dist/solution/VenueBooking/utils/resource.js +1 -0
- package/dist/solution/VenueBooking/utils/slotMerge.d.ts +4 -4
- package/dist/solution/VenueBooking/utils/slotMerge.js +10 -5
- package/dist/solution/index.d.ts +1 -0
- package/dist/solution/index.js +2 -1
- package/dist/types/index.d.ts +1 -0
- package/lib/model/strategy/adapter/promotion/index.js +0 -51
- package/lib/modules/BaseModule.d.ts +1 -0
- package/lib/modules/BaseModule.js +24 -37
- package/lib/modules/BookingContext/utils/buildCacheItemFromOrderLine.js +3 -0
- package/lib/modules/BookingContext/utils/productExtend.js +4 -3
- package/lib/modules/BookingContext/utils/timeSlices.js +18 -3
- package/lib/modules/Customer/index.d.ts +4 -0
- package/lib/modules/Customer/index.js +11 -0
- package/lib/modules/Customer/types.d.ts +2 -0
- package/lib/modules/Discount/index.d.ts +1 -0
- package/lib/modules/Discount/index.js +9 -0
- package/lib/modules/Discount/types.d.ts +1 -0
- package/lib/modules/Holder/index.d.ts +48 -0
- package/lib/modules/Holder/index.js +402 -0
- package/lib/modules/Holder/types.d.ts +123 -0
- package/lib/modules/Holder/types.js +17 -0
- package/lib/modules/Holder/utils.d.ts +13 -0
- package/lib/modules/Holder/utils.js +71 -0
- package/lib/modules/OpenData/index.js +1 -1
- package/lib/modules/Order/index.d.ts +32 -4
- package/lib/modules/Order/index.js +372 -156
- package/lib/modules/Order/types.d.ts +22 -1
- package/lib/modules/Order/utils/discountProductLineIdentity.d.ts +45 -0
- package/lib/modules/Order/utils/discountProductLineIdentity.js +170 -0
- package/lib/modules/Order/utils/orderCollectionIdentity.d.ts +15 -0
- package/lib/modules/Order/utils/orderCollectionIdentity.js +70 -0
- package/lib/modules/Order/utils.d.ts +10 -0
- package/lib/modules/Order/utils.js +39 -6
- package/lib/modules/Payment/index.d.ts +4 -0
- package/lib/modules/Payment/index.js +7 -0
- package/lib/modules/Payment/walletpass.js +12 -0
- package/lib/modules/Product/types.d.ts +1 -0
- package/lib/modules/ProductList/index.js +49 -31
- package/lib/modules/Quotation/index.d.ts +1 -1
- package/lib/modules/Quotation/index.js +2 -2
- package/lib/modules/ResourcePlanner/index.d.ts +24 -0
- package/lib/modules/ResourcePlanner/index.js +148 -0
- package/lib/modules/ResourcePlanner/planner.d.ts +14 -0
- package/lib/modules/ResourcePlanner/planner.js +933 -0
- package/lib/modules/ResourcePlanner/types.d.ts +227 -0
- package/lib/modules/ResourcePlanner/types.js +17 -0
- package/lib/modules/Rules/index.js +117 -25
- package/lib/modules/SalesSummary/index.js +6 -7
- package/lib/modules/ScanOrderLogger/index.d.ts +2 -0
- package/lib/modules/ScanOrderLogger/index.js +13 -1
- package/lib/modules/ScanOrderLogger/providers/feishu.js +15 -6
- package/lib/modules/ScanOrderLogger/types.d.ts +1 -0
- package/lib/modules/Schedule/index.d.ts +3 -1
- package/lib/modules/Schedule/index.js +10 -8
- package/lib/modules/Summary/utils.js +21 -1
- package/lib/modules/index.d.ts +2 -0
- package/lib/modules/index.js +5 -1
- package/lib/plugins/window.d.ts +1 -0
- package/lib/server/index.d.ts +20 -0
- package/lib/server/index.js +124 -19
- package/lib/server/modules/order/index.d.ts +2 -0
- package/lib/server/modules/order/index.js +75 -5
- package/lib/server/modules/order/types.d.ts +1 -1
- package/lib/solution/BaseSales/index.d.ts +20 -1
- package/lib/solution/BaseSales/index.js +105 -31
- package/lib/solution/BaseSales/utils/cartPromotion.js +18 -0
- package/lib/solution/BaseSales/utils/transformBaseProductToOrderProduct.js +1 -0
- package/lib/solution/BaseSales/utils.js +29 -18
- package/lib/solution/BookingByStep/index.d.ts +17 -2
- package/lib/solution/BookingByStep/index.js +60 -18
- package/lib/solution/BookingByStep/types.d.ts +2 -1
- package/lib/solution/BookingByStep/types.js +5 -0
- package/lib/solution/BookingByStep/utils/capacity.js +20 -1
- package/lib/solution/BookingByStep/utils/timeslots.d.ts +3 -1
- package/lib/solution/BookingByStep/utils/timeslots.js +19 -11
- package/lib/solution/BookingTicket/index.d.ts +21 -3
- package/lib/solution/BookingTicket/index.js +75 -16
- package/lib/solution/BookingTicket/utils/scan/handleScan.d.ts +3 -1
- package/lib/solution/BookingTicket/utils/scan/handleScan.js +2 -2
- package/lib/solution/ScanOrder/index.d.ts +26 -14
- package/lib/solution/ScanOrder/index.js +449 -182
- package/lib/solution/ScanOrder/types.d.ts +21 -1
- package/lib/solution/ScanOrder/utils.d.ts +8 -0
- package/lib/solution/ScanOrder/utils.js +60 -18
- package/lib/solution/ShopDiscount/index.d.ts +1 -0
- package/lib/solution/ShopDiscount/index.js +14 -0
- package/lib/solution/UnifiedBookingSales/index.d.ts +204 -0
- package/lib/solution/UnifiedBookingSales/index.js +1273 -0
- package/lib/solution/UnifiedBookingSales/types.d.ts +150 -0
- package/lib/solution/UnifiedBookingSales/types.js +33 -0
- package/lib/solution/VenueBooking/index.d.ts +39 -11
- package/lib/solution/VenueBooking/index.js +322 -110
- package/lib/solution/VenueBooking/types.d.ts +3 -0
- package/lib/solution/VenueBooking/utils/resource.js +1 -0
- package/lib/solution/VenueBooking/utils/slotMerge.d.ts +4 -4
- package/lib/solution/VenueBooking/utils/slotMerge.js +6 -4
- package/lib/solution/index.d.ts +1 -0
- package/lib/solution/index.js +3 -1
- package/lib/types/index.d.ts +1 -0
- package/package.json +1 -1
|
@@ -20,6 +20,7 @@ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o =
|
|
|
20
20
|
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
21
21
|
import dayjs from "dayjs";
|
|
22
22
|
import Decimal from 'decimal.js';
|
|
23
|
+
import { getProductHolderConfig } from "../Holder/utils";
|
|
23
24
|
import { buildProductLineFingerprint, createEmptySummary } from "../../solution/ScanOrder/utils";
|
|
24
25
|
import { createUuidV4 } from "./utils/orderCollectionIdentity";
|
|
25
26
|
/**
|
|
@@ -744,10 +745,41 @@ export var mergeRelationForms = function mergeRelationForms(relationForms) {
|
|
|
744
745
|
return item.form_record_ids.length > 0;
|
|
745
746
|
}); // 过滤掉没有有效记录的表单
|
|
746
747
|
};
|
|
748
|
+
function getCustomerIdFromStorage(window) {
|
|
749
|
+
try {
|
|
750
|
+
var _window$getLocalStora;
|
|
751
|
+
var customer = JSON.parse((window === null || window === void 0 || (_window$getLocalStora = window.getLocalStorage) === null || _window$getLocalStora === void 0 ? void 0 : _window$getLocalStora.call(window, 'customer')) || '{}');
|
|
752
|
+
var customerId = Number(customer === null || customer === void 0 ? void 0 : customer.id);
|
|
753
|
+
return Number.isFinite(customerId) && customerId > 0 ? customerId : undefined;
|
|
754
|
+
} catch (_unused) {
|
|
755
|
+
return undefined;
|
|
756
|
+
}
|
|
757
|
+
}
|
|
758
|
+
|
|
759
|
+
/**
|
|
760
|
+
* 为购物车行补齐订单所需的 holder 信息(与 cartAccount 结构保持一致)
|
|
761
|
+
*/
|
|
762
|
+
export function ensureCartItemOriginHolder(cartItem, window) {
|
|
763
|
+
var _cartItem$_origin, _cartItem$_productIni;
|
|
764
|
+
if (cartItem !== null && cartItem !== void 0 && (_cartItem$_origin = cartItem._origin) !== null && _cartItem$_origin !== void 0 && _cartItem$_origin.holder) {
|
|
765
|
+
return;
|
|
766
|
+
}
|
|
767
|
+
var holderConfig = getProductHolderConfig((_cartItem$_productIni = cartItem === null || cartItem === void 0 ? void 0 : cartItem._productInit) !== null && _cartItem$_productIni !== void 0 ? _cartItem$_productIni : cartItem === null || cartItem === void 0 ? void 0 : cartItem._productOrigin);
|
|
768
|
+
var formRecordId = cartItem === null || cartItem === void 0 ? void 0 : cartItem.holder_id;
|
|
769
|
+
if (!(holderConfig !== null && holderConfig !== void 0 && holderConfig.resource_id) || formRecordId == null) {
|
|
770
|
+
return;
|
|
771
|
+
}
|
|
772
|
+
cartItem._origin.holder = {
|
|
773
|
+
customer_id: getCustomerIdFromStorage(window),
|
|
774
|
+
form_id: holderConfig.resource_id,
|
|
775
|
+
form_record: [formRecordId]
|
|
776
|
+
};
|
|
777
|
+
}
|
|
778
|
+
;
|
|
747
779
|
export var getAllDiscountList = function getAllDiscountList(cartItem) {
|
|
748
|
-
var _cartItem$
|
|
749
|
-
var discountList = (cartItem === null || cartItem === void 0 || (_cartItem$
|
|
750
|
-
((cartItem === null || cartItem === void 0 || (_cartItem$
|
|
780
|
+
var _cartItem$_origin2, _cartItem$_origin3;
|
|
781
|
+
var discountList = (cartItem === null || cartItem === void 0 || (_cartItem$_origin2 = cartItem._origin) === null || _cartItem$_origin2 === void 0 || (_cartItem$_origin2 = _cartItem$_origin2.product) === null || _cartItem$_origin2 === void 0 ? void 0 : _cartItem$_origin2.discount_list) || [];
|
|
782
|
+
((cartItem === null || cartItem === void 0 || (_cartItem$_origin3 = cartItem._origin) === null || _cartItem$_origin3 === void 0 || (_cartItem$_origin3 = _cartItem$_origin3.product) === null || _cartItem$_origin3 === void 0 ? void 0 : _cartItem$_origin3.product_bundle) || []).forEach(function (item) {
|
|
751
783
|
discountList = [].concat(_toConsumableArray(discountList), _toConsumableArray((item === null || item === void 0 ? void 0 : item.discount_list) || []));
|
|
752
784
|
item.discount_list = undefined;
|
|
753
785
|
});
|
|
@@ -878,7 +910,7 @@ function formatSubmitBundleItems(bundle) {
|
|
|
878
910
|
* 本函数不再改造价格字段形状,仅做字段/metadata 裁剪。
|
|
879
911
|
*/
|
|
880
912
|
function normalizeSubmitProduct(product) {
|
|
881
|
-
var _rawMetadata$product_, _submitProduct$produc, _submitProduct$paymen;
|
|
913
|
+
var _ref29, _submitProduct$bundle, _rawMetadata$product_, _submitProduct$produc, _submitProduct$paymen;
|
|
882
914
|
var _ref28 = product,
|
|
883
915
|
_runtimeUid = _ref28.unique_identification_number,
|
|
884
916
|
submitProduct = _objectWithoutProperties(_ref28, _excluded2);
|
|
@@ -893,6 +925,10 @@ function normalizeSubmitProduct(product) {
|
|
|
893
925
|
delete productRest["product_".concat('option', "_item")];
|
|
894
926
|
var rawMetadata = submitProduct.metadata || {};
|
|
895
927
|
var bookingUid = rawMetadata.booking_uid;
|
|
928
|
+
// 兼容历史 BigSale 编辑链路:bundle_edit 曾被写入 metadata,
|
|
929
|
+
// 出站时需提升到商品顶层;套餐未编辑时也必须显式提交 0。
|
|
930
|
+
var hasProductBundle = Array.isArray(submitProduct.product_bundle) && submitProduct.product_bundle.length > 0;
|
|
931
|
+
var bundleEdit = (_ref29 = (_submitProduct$bundle = submitProduct.bundle_edit) !== null && _submitProduct$bundle !== void 0 ? _submitProduct$bundle : rawMetadata.bundle_edit) !== null && _ref29 !== void 0 ? _ref29 : hasProductBundle ? 0 : undefined;
|
|
896
932
|
var cleanMetadata = {};
|
|
897
933
|
if (rawMetadata.unique_identification_number) {
|
|
898
934
|
cleanMetadata.unique_identification_number = rawMetadata.unique_identification_number;
|
|
@@ -917,8 +953,10 @@ function normalizeSubmitProduct(product) {
|
|
|
917
953
|
var productSku = _objectSpread(_objectSpread({}, submitProduct.product_sku && _typeof(submitProduct.product_sku) === 'object' ? submitProduct.product_sku : {}), {}, {
|
|
918
954
|
option: formatSubmitOptionItems((_submitProduct$produc = submitProduct.product_sku) === null || _submitProduct$produc === void 0 ? void 0 : _submitProduct$produc.option)
|
|
919
955
|
});
|
|
920
|
-
return _objectSpread(_objectSpread(_objectSpread({}, productRest), bookingUid ? {
|
|
956
|
+
return _objectSpread(_objectSpread(_objectSpread(_objectSpread({}, productRest), bookingUid ? {
|
|
921
957
|
booking_uid: bookingUid
|
|
958
|
+
} : {}), bundleEdit !== undefined ? {
|
|
959
|
+
bundle_edit: bundleEdit
|
|
922
960
|
} : {}), {}, {
|
|
923
961
|
product_quantity: toBundleNumber(num !== null && num !== void 0 ? num : submitProduct.product_quantity, 1),
|
|
924
962
|
product_sku: productSku,
|
|
@@ -1048,7 +1086,7 @@ export function createDefaultTempOrder(params) {
|
|
|
1048
1086
|
};
|
|
1049
1087
|
}
|
|
1050
1088
|
export function buildSubmitPayload(params) {
|
|
1051
|
-
var _tempOrder$customer_i, _tempOrder$country_ca, _tempOrder$phone, _tempOrder$email, _tempOrder$order_numb, _tempOrder$shop_order, _tempOrder$shop_full_,
|
|
1089
|
+
var _tempOrder$customer_i, _tempOrder$country_ca, _tempOrder$phone, _tempOrder$email, _tempOrder$order_numb, _tempOrder$shop_order, _tempOrder$shop_full_, _ref31, _tempOrder$is_price_i, _tempOrder$is_deposit, _enhancedPayload$summ;
|
|
1052
1090
|
var tempOrder = params.tempOrder,
|
|
1053
1091
|
cacheId = params.cacheId,
|
|
1054
1092
|
_params$now = params.now,
|
|
@@ -1061,26 +1099,26 @@ export function buildSubmitPayload(params) {
|
|
|
1061
1099
|
enhance = params.enhance;
|
|
1062
1100
|
var scheduleDate = tempOrder.schedule_date || tempOrder.created_at || formatDateTime(now);
|
|
1063
1101
|
var bookingUuid = createUuidV4();
|
|
1064
|
-
var
|
|
1065
|
-
_extend =
|
|
1066
|
-
_relationId =
|
|
1067
|
-
_tableFormId =
|
|
1068
|
-
_resourceId =
|
|
1069
|
-
_summary =
|
|
1070
|
-
_lastOrderInfo =
|
|
1071
|
-
_paidAmount =
|
|
1072
|
-
_shopId =
|
|
1073
|
-
_shopNote =
|
|
1074
|
-
_shopServiceType =
|
|
1075
|
-
_startTime =
|
|
1076
|
-
_customer =
|
|
1077
|
-
_discountList =
|
|
1078
|
-
_rootTaxFee =
|
|
1079
|
-
_totalAmount =
|
|
1080
|
-
_totalRefundAmount =
|
|
1081
|
-
_createDate =
|
|
1082
|
-
_holderId =
|
|
1083
|
-
tempOrderRest = _objectWithoutProperties(
|
|
1102
|
+
var _ref30 = tempOrder,
|
|
1103
|
+
_extend = _ref30._extend,
|
|
1104
|
+
_relationId = _ref30.relation_id,
|
|
1105
|
+
_tableFormId = _ref30.table_form_id,
|
|
1106
|
+
_resourceId = _ref30.resource_id,
|
|
1107
|
+
_summary = _ref30.summary,
|
|
1108
|
+
_lastOrderInfo = _ref30.lastOrderInfo,
|
|
1109
|
+
_paidAmount = _ref30.paid_amount,
|
|
1110
|
+
_shopId = _ref30.shop_id,
|
|
1111
|
+
_shopNote = _ref30.shop_note,
|
|
1112
|
+
_shopServiceType = _ref30.shop_service_type,
|
|
1113
|
+
_startTime = _ref30.start_time,
|
|
1114
|
+
_customer = _ref30.customer,
|
|
1115
|
+
_discountList = _ref30.discount_list,
|
|
1116
|
+
_rootTaxFee = _ref30.tax_fee,
|
|
1117
|
+
_totalAmount = _ref30.total_amount,
|
|
1118
|
+
_totalRefundAmount = _ref30.total_refund_amount,
|
|
1119
|
+
_createDate = _ref30.create_date,
|
|
1120
|
+
_holderId = _ref30.holder_id,
|
|
1121
|
+
tempOrderRest = _objectWithoutProperties(_ref30, _excluded4);
|
|
1084
1122
|
var submitType = type !== null && type !== void 0 ? type : tempOrder.type;
|
|
1085
1123
|
if (!submitType) {
|
|
1086
1124
|
var _tempOrder$bookings;
|
|
@@ -1105,7 +1143,7 @@ export function buildSubmitPayload(params) {
|
|
|
1105
1143
|
type: submitType,
|
|
1106
1144
|
business_code: businessCode !== null && businessCode !== void 0 ? businessCode : tempOrder.business_code,
|
|
1107
1145
|
sales_channel: tempOrder.sales_channel || 'my_pisel',
|
|
1108
|
-
order_sales_channel: (
|
|
1146
|
+
order_sales_channel: (_ref31 = channel !== null && channel !== void 0 ? channel : tempOrder.order_sales_channel) !== null && _ref31 !== void 0 ? _ref31 : 'online_store',
|
|
1109
1147
|
status: tempOrder.status || 'normal',
|
|
1110
1148
|
payment_status: tempOrder.payment_status || 'payment_processing',
|
|
1111
1149
|
// shipping_status: tempOrder.shipping_status || 'unfulfilled',
|
|
@@ -1131,10 +1169,10 @@ export function buildSubmitPayload(params) {
|
|
|
1131
1169
|
// holder: tempOrder.holder || null,
|
|
1132
1170
|
summary: summary || tempOrder.summary || createEmptySummary(),
|
|
1133
1171
|
metadata: function () {
|
|
1134
|
-
var
|
|
1135
|
-
_collectPax =
|
|
1136
|
-
_tableOccupancyDuration =
|
|
1137
|
-
rest = _objectWithoutProperties(
|
|
1172
|
+
var _ref32 = tempOrder.metadata || {},
|
|
1173
|
+
_collectPax = _ref32.collect_pax,
|
|
1174
|
+
_tableOccupancyDuration = _ref32.table_occupancy_duration,
|
|
1175
|
+
rest = _objectWithoutProperties(_ref32, _excluded5);
|
|
1138
1176
|
return _objectSpread({}, rest);
|
|
1139
1177
|
}(),
|
|
1140
1178
|
products: (tempOrder.products || []).map(function (product) {
|
|
@@ -1342,8 +1380,8 @@ export function getRuntimeProductOrigin(tempOrder, product) {
|
|
|
1342
1380
|
return tempOrder._extend.productsByUid[uid].origin;
|
|
1343
1381
|
}
|
|
1344
1382
|
var matchedProduct = ((tempOrder === null || tempOrder === void 0 ? void 0 : tempOrder.products) || []).find(function (item) {
|
|
1345
|
-
var
|
|
1346
|
-
return item === product || getOrderProductLineUid(item) === uid || String((
|
|
1383
|
+
var _ref33, _item$product_id, _ref34, _product$product_id;
|
|
1384
|
+
return item === product || getOrderProductLineUid(item) === uid || String((_ref33 = (_item$product_id = item === null || item === void 0 ? void 0 : item.product_id) !== null && _item$product_id !== void 0 ? _item$product_id : item === null || item === void 0 ? void 0 : item.id) !== null && _ref33 !== void 0 ? _ref33 : '') === String((_ref34 = (_product$product_id = product === null || product === void 0 ? void 0 : product.product_id) !== null && _product$product_id !== void 0 ? _product$product_id : product === null || product === void 0 ? void 0 : product.id) !== null && _ref34 !== void 0 ? _ref34 : '');
|
|
1347
1385
|
});
|
|
1348
1386
|
var matchedUid = matchedProduct ? getOrderProductLineUid(matchedProduct) : '';
|
|
1349
1387
|
return matchedUid ? (tempOrder === null || tempOrder === void 0 || (_tempOrder$_extend3 = tempOrder._extend) === null || _tempOrder$_extend3 === void 0 || (_tempOrder$_extend3 = _tempOrder$_extend3.productsByUid) === null || _tempOrder$_extend3 === void 0 || (_tempOrder$_extend3 = _tempOrder$_extend3[matchedUid]) === null || _tempOrder$_extend3 === void 0 ? void 0 : _tempOrder$_extend3.origin) || null : null;
|
|
@@ -1363,7 +1401,6 @@ export function productRequiresFormSubject(tempOrder, product) {
|
|
|
1363
1401
|
}
|
|
1364
1402
|
export function resolveIsFormSubject(tempOrder, product) {
|
|
1365
1403
|
var _tempOrder$holder;
|
|
1366
|
-
debugger;
|
|
1367
1404
|
// 旧版预约维度的 holder 类型仍然生效;新版则从当前商品 holder_config 判断。
|
|
1368
1405
|
if ((tempOrder === null || tempOrder === void 0 || (_tempOrder$holder = tempOrder.holder) === null || _tempOrder$holder === void 0 ? void 0 : _tempOrder$holder.type) === 'form') return true;
|
|
1369
1406
|
if (product) return productRequiresFormSubject(tempOrder, product);
|
|
@@ -41,6 +41,10 @@ export declare class PaymentModule extends BaseModule implements Module, Payment
|
|
|
41
41
|
* paymentModule.updateOtherParams({ fatherModule: 'bookingTicket' });
|
|
42
42
|
*/
|
|
43
43
|
updateOtherParams(params: Record<string, any>): void;
|
|
44
|
+
/**
|
|
45
|
+
* 获取标准化后的宿主平台标识,供支付子能力做平台边界判断。
|
|
46
|
+
*/
|
|
47
|
+
getPlatform(): string;
|
|
44
48
|
private getPaymentNumberAppData;
|
|
45
49
|
/**
|
|
46
50
|
* 记录信息日志
|
|
@@ -231,6 +231,16 @@ export var PaymentModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
231
231
|
value: function updateOtherParams(params) {
|
|
232
232
|
this.otherParams = params || {};
|
|
233
233
|
}
|
|
234
|
+
|
|
235
|
+
/**
|
|
236
|
+
* 获取标准化后的宿主平台标识,供支付子能力做平台边界判断。
|
|
237
|
+
*/
|
|
238
|
+
}, {
|
|
239
|
+
key: "getPlatform",
|
|
240
|
+
value: function getPlatform() {
|
|
241
|
+
var _this$otherParams;
|
|
242
|
+
return String(((_this$otherParams = this.otherParams) === null || _this$otherParams === void 0 ? void 0 : _this$otherParams.platform) || '').trim().toLowerCase();
|
|
243
|
+
}
|
|
234
244
|
}, {
|
|
235
245
|
key: "getPaymentNumberAppData",
|
|
236
246
|
value: function getPaymentNumberAppData(key) {
|
|
@@ -247,10 +257,10 @@ export var PaymentModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
247
257
|
}, {
|
|
248
258
|
key: "logInfo",
|
|
249
259
|
value: function logInfo(title, metadata) {
|
|
250
|
-
var _this$
|
|
251
|
-
if ((_this$
|
|
252
|
-
var _this$
|
|
253
|
-
var fatherModule = this.core.getModule((_this$
|
|
260
|
+
var _this$otherParams2;
|
|
261
|
+
if ((_this$otherParams2 = this.otherParams) !== null && _this$otherParams2 !== void 0 && _this$otherParams2.fatherModule) {
|
|
262
|
+
var _this$otherParams3;
|
|
263
|
+
var fatherModule = this.core.getModule((_this$otherParams3 = this.otherParams) === null || _this$otherParams3 === void 0 ? void 0 : _this$otherParams3.fatherModule);
|
|
254
264
|
if (fatherModule) {
|
|
255
265
|
fatherModule.logInfo("".concat(title), metadata);
|
|
256
266
|
return;
|
|
@@ -851,7 +851,7 @@ export var WalletPassPaymentImpl = /*#__PURE__*/function () {
|
|
|
851
851
|
key: "getUserIdentificationCodeListAsync",
|
|
852
852
|
value: function () {
|
|
853
853
|
var _getUserIdentificationCodeListAsync = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6(params) {
|
|
854
|
-
var _newParams$products, _newParams$prepare_pa, _this$walletParams4, newParams, response, sortedData;
|
|
854
|
+
var _newParams$products, _newParams$prepare_pa, _this$walletParams4, newParams, platform, response, sortedData;
|
|
855
855
|
return _regeneratorRuntime().wrap(function _callee6$(_context6) {
|
|
856
856
|
while (1) switch (_context6.prev = _context6.next) {
|
|
857
857
|
case 0:
|
|
@@ -864,6 +864,20 @@ export var WalletPassPaymentImpl = /*#__PURE__*/function () {
|
|
|
864
864
|
this.paymentModule.logInfo('[WalletPass] 商品列表为空,跳过获取用户识别码列表');
|
|
865
865
|
return _context6.abrupt("return", []);
|
|
866
866
|
case 5:
|
|
867
|
+
platform = this.paymentModule.getPlatform();
|
|
868
|
+
if (!(platform === 'pc' || platform === 'h5')) {
|
|
869
|
+
_context6.next = 11;
|
|
870
|
+
break;
|
|
871
|
+
}
|
|
872
|
+
this.userIdentificationCodes = [];
|
|
873
|
+
this.emitEvent(WalletPassHooks.OnUserIdentificationCodesUpdated, {
|
|
874
|
+
userIdentificationCodes: []
|
|
875
|
+
});
|
|
876
|
+
this.paymentModule.logInfo('[WalletPass] 用户端平台跳过获取用户识别码列表', {
|
|
877
|
+
platform: platform
|
|
878
|
+
});
|
|
879
|
+
return _context6.abrupt("return", []);
|
|
880
|
+
case 11:
|
|
867
881
|
if (typeof newParams.payment_order_id === 'string' && newParams.payment_order_id.startsWith('LOCAL_')) {
|
|
868
882
|
newParams.payment_order_id = undefined;
|
|
869
883
|
}
|
|
@@ -874,9 +888,9 @@ export var WalletPassPaymentImpl = /*#__PURE__*/function () {
|
|
|
874
888
|
filter_prepare_wallet_pass: newParams.filter_prepare_wallet_pass,
|
|
875
889
|
payment_order_id: (_this$walletParams4 = this.walletParams) === null || _this$walletParams4 === void 0 ? void 0 : _this$walletParams4.payment_order_id
|
|
876
890
|
});
|
|
877
|
-
_context6.next =
|
|
891
|
+
_context6.next = 15;
|
|
878
892
|
return this.paymentModule.request.post('/machinecode/prepare/deduction', newParams);
|
|
879
|
-
case
|
|
893
|
+
case 15:
|
|
880
894
|
response = _context6.sent;
|
|
881
895
|
// 对获取到的数据进行排序,将错误码为 500100、500200、500300 的项目排到最后
|
|
882
896
|
sortedData = sortUserIdentificationCodeList((response === null || response === void 0 ? void 0 : response.data) || []);
|
|
@@ -897,19 +911,19 @@ export var WalletPassPaymentImpl = /*#__PURE__*/function () {
|
|
|
897
911
|
})
|
|
898
912
|
});
|
|
899
913
|
return _context6.abrupt("return", this.userIdentificationCodes);
|
|
900
|
-
case
|
|
901
|
-
_context6.prev =
|
|
914
|
+
case 23:
|
|
915
|
+
_context6.prev = 23;
|
|
902
916
|
_context6.t0 = _context6["catch"](0);
|
|
903
917
|
this.paymentModule.logError('[WalletPass] 获取用户识别码列表失败', _context6.t0, {
|
|
904
918
|
customer_id: params.customer_id,
|
|
905
919
|
available: params.available
|
|
906
920
|
});
|
|
907
921
|
return _context6.abrupt("return", []);
|
|
908
|
-
case
|
|
922
|
+
case 27:
|
|
909
923
|
case "end":
|
|
910
924
|
return _context6.stop();
|
|
911
925
|
}
|
|
912
|
-
}, _callee6, this, [[0,
|
|
926
|
+
}, _callee6, this, [[0, 23]]);
|
|
913
927
|
}));
|
|
914
928
|
function getUserIdentificationCodeListAsync(_x7) {
|
|
915
929
|
return _getUserIdentificationCodeListAsync.apply(this, arguments);
|
|
@@ -157,6 +157,10 @@ export var ProductList = /*#__PURE__*/function (_BaseModule) {
|
|
|
157
157
|
userPlugin,
|
|
158
158
|
customer_id,
|
|
159
159
|
_userPlugin$get,
|
|
160
|
+
channelMap,
|
|
161
|
+
rawApplicationCode,
|
|
162
|
+
mappedApplicationCode,
|
|
163
|
+
queryPayload,
|
|
160
164
|
productsData,
|
|
161
165
|
sortedList,
|
|
162
166
|
_args4 = arguments;
|
|
@@ -185,37 +189,53 @@ export var ProductList = /*#__PURE__*/function (_BaseModule) {
|
|
|
185
189
|
console.error(error);
|
|
186
190
|
}
|
|
187
191
|
// 如果没传schedule_date,则从
|
|
188
|
-
|
|
189
|
-
|
|
192
|
+
channelMap = {
|
|
193
|
+
online_store: 'online-store',
|
|
194
|
+
scan_to_order: 'online-store',
|
|
195
|
+
'scan-to-order': 'online-store',
|
|
196
|
+
scan_to_order_2: 'mobile_order',
|
|
197
|
+
scan_to_order_3: 'scantoorder3'
|
|
198
|
+
};
|
|
199
|
+
rawApplicationCode = (_this$otherParams = this.otherParams) === null || _this$otherParams === void 0 ? void 0 : _this$otherParams.channel;
|
|
200
|
+
mappedApplicationCode = typeof rawApplicationCode === 'string' ? channelMap[rawApplicationCode] || rawApplicationCode : rawApplicationCode;
|
|
201
|
+
queryPayload = _objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread({
|
|
190
202
|
open_quotation: 1,
|
|
191
203
|
open_bundle: 0,
|
|
192
204
|
exclude_extension_type: ['product_party', 'product_event', 'product_series_event', 'product_package_ticket', 'ticket', 'event_item'],
|
|
193
|
-
with: ['category', 'collection', 'resourceRelation'],
|
|
205
|
+
with: ['category', 'collection', 'resourceRelation', 'bundleGroup.bundleItem', 'optionGroup.optionItem', 'variantGroup.variantItem', 'dataVariants'],
|
|
194
206
|
status: status,
|
|
195
207
|
num: 500,
|
|
196
208
|
skip: 1,
|
|
197
|
-
customer_id: customer_id
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
209
|
+
customer_id: customer_id
|
|
210
|
+
}, Array.isArray(category_ids) && category_ids.length ? {
|
|
211
|
+
category_ids: category_ids
|
|
212
|
+
} : {}), Array.isArray(product_ids) && product_ids.length ? {
|
|
213
|
+
ids: product_ids
|
|
214
|
+
} : {}), Array.isArray(collection) && collection.length ? {
|
|
215
|
+
collection: collection
|
|
216
|
+
} : {}), {}, {
|
|
217
|
+
front_end_cache_id: cacheId
|
|
218
|
+
}, Array.isArray(menu_list_ids) && menu_list_ids.length ? {
|
|
219
|
+
menu_list_ids: menu_list_ids
|
|
220
|
+
} : {}), {}, {
|
|
203
221
|
with_count: with_count,
|
|
204
222
|
// client_schedule_ids: schedule_ids,
|
|
205
223
|
schedule_date: schedule_date,
|
|
206
|
-
application_code:
|
|
224
|
+
application_code: mappedApplicationCode,
|
|
207
225
|
is_eject: 1,
|
|
208
226
|
with_schedule: with_schedule,
|
|
209
227
|
schedule_datetime: schedule_datetime,
|
|
210
228
|
extension_type: extension_type,
|
|
211
229
|
strategy_context: strategy_context
|
|
212
|
-
}
|
|
230
|
+
});
|
|
231
|
+
_context4.next = 11;
|
|
232
|
+
return this.request.post("/product/query", queryPayload, {
|
|
213
233
|
osServer: true,
|
|
214
234
|
callback: options === null || options === void 0 ? void 0 : options.callback,
|
|
215
235
|
subscriberId: options === null || options === void 0 ? void 0 : options.subscriberId,
|
|
216
236
|
customToast: function customToast() {}
|
|
217
237
|
});
|
|
218
|
-
case
|
|
238
|
+
case 11:
|
|
219
239
|
productsData = _context4.sent;
|
|
220
240
|
sortedList = (productsData.data.list || []).slice().sort(function (a, b) {
|
|
221
241
|
return Number(b.sort) - Number(a.sort);
|
|
@@ -228,7 +248,7 @@ export var ProductList = /*#__PURE__*/function (_BaseModule) {
|
|
|
228
248
|
// }
|
|
229
249
|
this.addProduct(sortedList);
|
|
230
250
|
return _context4.abrupt("return", sortedList);
|
|
231
|
-
case
|
|
251
|
+
case 15:
|
|
232
252
|
case "end":
|
|
233
253
|
return _context4.stop();
|
|
234
254
|
}
|
|
@@ -21,7 +21,7 @@ export declare class QuotationModule extends BaseModule implements Module {
|
|
|
21
21
|
* Look up the quotation price for a specific product (+ optional variant) at a given datetime.
|
|
22
22
|
* Returns the price as a string (e.g. "300.00"), or null if no quotation applies.
|
|
23
23
|
*
|
|
24
|
-
* Priority: iterates quotations already sorted by `sort`
|
|
24
|
+
* Priority: iterates quotations already sorted by `sort` descending (highest = highest priority).
|
|
25
25
|
* First matching quotation whose schedule covers `datetime` and whose product_data contains
|
|
26
26
|
* the requested productId wins.
|
|
27
27
|
*/
|
|
@@ -90,7 +90,7 @@ export var QuotationModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
90
90
|
res = _context2.sent;
|
|
91
91
|
list = (res === null || res === void 0 || (_data = res.data) === null || _data === void 0 ? void 0 : _data.list) || (res === null || res === void 0 ? void 0 : res.list) || [];
|
|
92
92
|
list.sort(function (a, b) {
|
|
93
|
-
return
|
|
93
|
+
return b.sort - a.sort;
|
|
94
94
|
});
|
|
95
95
|
this.store.list = list;
|
|
96
96
|
case 9:
|
|
@@ -151,7 +151,7 @@ export var QuotationModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
151
151
|
* Look up the quotation price for a specific product (+ optional variant) at a given datetime.
|
|
152
152
|
* Returns the price as a string (e.g. "300.00"), or null if no quotation applies.
|
|
153
153
|
*
|
|
154
|
-
* Priority: iterates quotations already sorted by `sort`
|
|
154
|
+
* Priority: iterates quotations already sorted by `sort` descending (highest = highest priority).
|
|
155
155
|
* First matching quotation whose schedule covers `datetime` and whose product_data contains
|
|
156
156
|
* the requested productId wins.
|
|
157
157
|
*/
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { BaseModule } from '../BaseModule';
|
|
2
|
+
import type { Module, ModuleOptions, PisellCore } from '../../types';
|
|
3
|
+
import type { ResourcePlannerAssignmentResult, ResourcePlannerAssignableSlotResult, ResourcePlannerContextInput, ResourcePlannerProjection, ResourcePlannerQuery, ResourcePlannerSelectionPatch, ResourcePlannerSnapshot, ResourcePlannerValidationResult } from './types';
|
|
4
|
+
export * from './types';
|
|
5
|
+
export * from './planner';
|
|
6
|
+
export declare enum ResourcePlannerHooks {
|
|
7
|
+
onContextChanged = "resourcePlanner:onContextChanged",
|
|
8
|
+
onSelectionChanged = "resourcePlanner:onSelectionChanged",
|
|
9
|
+
onProjectionChanged = "resourcePlanner:onProjectionChanged"
|
|
10
|
+
}
|
|
11
|
+
export declare class ResourcePlannerModule extends BaseModule implements Module {
|
|
12
|
+
protected defaultName: string;
|
|
13
|
+
protected defaultVersion: string;
|
|
14
|
+
private store;
|
|
15
|
+
initialize(core: PisellCore, options: ModuleOptions): Promise<void>;
|
|
16
|
+
setContext(input: ResourcePlannerContextInput): ResourcePlannerSnapshot;
|
|
17
|
+
mergeContext(input: ResourcePlannerContextInput): ResourcePlannerSnapshot;
|
|
18
|
+
setSelectionPatch(patch: ResourcePlannerSelectionPatch): ResourcePlannerSnapshot;
|
|
19
|
+
queryAvailability(query?: ResourcePlannerQuery): ResourcePlannerProjection;
|
|
20
|
+
autoAssign(query?: ResourcePlannerQuery): ResourcePlannerAssignmentResult;
|
|
21
|
+
resolveAssignableSlots(query?: ResourcePlannerQuery): ResourcePlannerAssignableSlotResult;
|
|
22
|
+
validateSelection(): ResourcePlannerValidationResult;
|
|
23
|
+
getSnapshot(): ResourcePlannerSnapshot;
|
|
24
|
+
}
|