@pisell/pisellos 2.2.314 → 2.2.316
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 +2 -0
- package/dist/index.js +3 -1
- package/dist/model/strategy/adapter/itemRule/adapter.d.ts +3 -1
- package/dist/model/strategy/adapter/itemRule/adapter.js +74 -7
- package/dist/model/strategy/adapter/itemRule/evaluator.d.ts +3 -1
- package/dist/model/strategy/adapter/itemRule/evaluator.js +13 -0
- package/dist/model/strategy/adapter/itemRule/type.d.ts +40 -1
- package/dist/model/strategy/adapter/itemRule/type.js +10 -0
- package/dist/model/strategy/adapter/promotion/evaluator.js +89 -104
- package/dist/modules/BookingContext/utils/buildNormalProductCacheItemFromOrderLine.d.ts +3 -1
- package/dist/modules/BookingContext/utils/buildNormalProductCacheItemFromOrderLine.js +28 -4
- package/dist/modules/BookingContext/utils/productExtend.d.ts +7 -0
- package/dist/modules/BookingContext/utils/productExtend.js +62 -18
- package/dist/modules/BookingContext/utils/resources.js +1 -1
- package/dist/modules/BusinessAvailability/index.d.ts +30 -0
- package/dist/modules/BusinessAvailability/index.js +204 -0
- package/dist/modules/Cart/index.js +4 -3
- package/dist/modules/Cart/types.d.ts +2 -0
- package/dist/modules/Cart/utils/cartProduct.d.ts +3 -1
- package/dist/modules/Cart/utils/cartProduct.js +59 -32
- package/dist/modules/FulfillmentTiming/index.d.ts +11 -0
- package/dist/modules/FulfillmentTiming/index.js +407 -0
- package/dist/modules/FulfillmentTiming/types.d.ts +67 -0
- package/dist/modules/FulfillmentTiming/types.js +1 -0
- package/dist/modules/Holder/utils.d.ts +2 -0
- package/dist/modules/Holder/utils.js +32 -2
- package/dist/modules/OpenData/contactInfo.d.ts +20 -0
- package/dist/modules/OpenData/contactInfo.js +70 -0
- package/dist/modules/OpenData/index.d.ts +1 -0
- package/dist/modules/OpenData/index.js +1 -0
- package/dist/modules/OpenData/types.d.ts +23 -0
- package/dist/modules/Order/holderRelations.d.ts +14 -0
- package/dist/modules/Order/holderRelations.js +154 -0
- package/dist/modules/Order/index.d.ts +16 -4
- package/dist/modules/Order/index.js +926 -511
- package/dist/modules/Order/localEftposState.d.ts +13 -0
- package/dist/modules/Order/localEftposState.js +39 -0
- package/dist/modules/Order/pickupTiming.d.ts +46 -0
- package/dist/modules/Order/pickupTiming.js +53 -0
- package/dist/modules/Order/types.d.ts +49 -3
- package/dist/modules/Order/types.js +2 -0
- package/dist/modules/Order/utils/discountProductLineIdentity.d.ts +1 -1
- package/dist/modules/Order/utils/discountProductLineIdentity.js +142 -7
- package/dist/modules/Order/utils/orderCollectionIdentity.js +24 -10
- package/dist/modules/Order/utils.d.ts +2 -1
- package/dist/modules/Order/utils.js +61 -17
- package/dist/modules/Payment/index.js +9 -10
- package/dist/modules/Product/types.d.ts +11 -0
- package/dist/modules/ProductList/index.js +1 -1
- package/dist/modules/ResourcePlanner/planner.d.ts +2 -0
- package/dist/modules/ResourcePlanner/planner.js +332 -23
- package/dist/modules/ResourcePlanner/types.d.ts +29 -0
- package/dist/modules/Rules/index.js +62 -61
- package/dist/modules/Schedule/index.d.ts +8 -0
- package/dist/modules/Schedule/index.js +141 -39
- package/dist/modules/index.d.ts +1 -0
- package/dist/modules/index.js +1 -0
- package/dist/plugins/request.d.ts +7 -0
- package/dist/server/index.d.ts +1 -0
- package/dist/server/index.js +1557 -1322
- package/dist/server/modules/form/index.d.ts +19 -0
- package/dist/server/modules/form/index.js +205 -0
- package/dist/server/modules/form/types.d.ts +13 -0
- package/dist/server/modules/form/types.js +3 -0
- package/dist/server/modules/index.d.ts +3 -0
- package/dist/server/modules/index.js +4 -0
- package/dist/server/modules/order/index.d.ts +19 -0
- package/dist/server/modules/order/index.js +1071 -774
- package/dist/server/modules/order/types.d.ts +4 -0
- package/dist/server/modules/products/index.d.ts +28 -7
- package/dist/server/modules/products/index.js +1297 -770
- package/dist/server/modules/products/replication.d.ts +8 -0
- package/dist/server/modules/products/replication.js +69 -0
- package/dist/server/modules/products/types.d.ts +12 -1
- package/dist/server/modules/products/types.js +4 -0
- package/dist/server/test.json +1 -1
- package/dist/server/utils/small-ticket.d.ts +1 -85
- package/dist/server/utils/small-ticket.js +2 -2542
- package/dist/shared/payment/loadPaymentMethods.d.ts +9 -0
- package/dist/shared/payment/loadPaymentMethods.js +66 -0
- package/dist/shared/receipt/customerInvoiceLanguages.d.ts +8 -0
- package/dist/shared/receipt/customerInvoiceLanguages.js +60 -0
- package/dist/shared/receipt/loadCustomerInvoiceLayout.d.ts +27 -0
- package/dist/shared/receipt/loadCustomerInvoiceLayout.js +184 -0
- package/dist/shared/receipt/small-ticket.d.ts +96 -0
- package/dist/shared/receipt/small-ticket.js +2763 -0
- package/dist/shared/receipt/templateVisibility.d.ts +26 -0
- package/dist/shared/receipt/templateVisibility.js +68 -0
- package/dist/shared/sales/loadSalesOrderSnapshot.d.ts +9 -0
- package/dist/shared/sales/loadSalesOrderSnapshot.js +21 -0
- package/dist/solution/BaseSales/fulfillmentItemRules.d.ts +27 -0
- package/dist/solution/BaseSales/fulfillmentItemRules.js +750 -0
- package/dist/solution/BaseSales/index.d.ts +43 -16
- package/dist/solution/BaseSales/index.js +2028 -1247
- package/dist/solution/BaseSales/pickupTiming.d.ts +47 -0
- package/dist/solution/BaseSales/pickupTiming.js +616 -0
- package/dist/solution/BaseSales/types.d.ts +12 -0
- package/dist/solution/BaseSales/utils/parseSalesResponse.d.ts +3 -1
- package/dist/solution/BaseSales/utils/parseSalesResponse.js +10 -3
- package/dist/solution/BaseSales/utils/transformBaseProductToOrderProduct.js +14 -4
- package/dist/solution/BookingByStep/index.d.ts +4 -2
- package/dist/solution/BookingByStep/index.js +8 -3
- package/dist/solution/BookingTicket/index.d.ts +23 -3
- package/dist/solution/BookingTicket/index.js +867 -507
- package/dist/solution/BookingTicket/utils/addProductDecision.d.ts +0 -1
- package/dist/solution/BookingTicket/utils/addProductDecision.js +1 -1
- package/dist/solution/BookingTicket/utils/cartView.js +3 -1
- package/dist/solution/OrderInvoicePreview/index.d.ts +66 -0
- package/dist/solution/OrderInvoicePreview/index.js +340 -0
- package/dist/solution/RegisterAndLogin/config.js +54 -11
- package/dist/solution/RegisterAndLogin/index.d.ts +2 -0
- package/dist/solution/RegisterAndLogin/index.js +1 -1
- package/dist/solution/RegisterAndLogin/utils.d.ts +12 -4
- package/dist/solution/RegisterAndLogin/utils.js +36 -16
- package/dist/solution/ScanOrder/index.js +65 -31
- package/dist/solution/ScanOrder/types.d.ts +3 -0
- package/dist/solution/UnifiedBookingSales/businessAvailability.d.ts +27 -0
- package/dist/solution/UnifiedBookingSales/businessAvailability.js +292 -0
- package/dist/solution/UnifiedBookingSales/index.d.ts +36 -4
- package/dist/solution/UnifiedBookingSales/index.js +1715 -906
- package/dist/solution/UnifiedBookingSales/types.d.ts +16 -2
- package/dist/solution/VenueBooking/index.d.ts +15 -2
- package/dist/solution/VenueBooking/index.js +1062 -785
- package/dist/solution/VenueBooking/types.d.ts +2 -1
- package/dist/solution/VenueBooking/types.js +1 -0
- package/dist/solution/VenueBooking/utils/dateSummary.d.ts +1 -0
- package/dist/solution/VenueBooking/utils/dateSummary.js +7 -4
- package/dist/solution/VenueBooking/utils/smartPricing.d.ts +71 -0
- package/dist/solution/VenueBooking/utils/smartPricing.js +273 -0
- package/dist/solution/VenueBooking/utils/timeSlot.d.ts +1 -0
- package/dist/solution/VenueBooking/utils/timeSlot.js +6 -3
- package/dist/solution/index.d.ts +1 -0
- package/dist/solution/index.js +2 -1
- package/lib/index.d.ts +2 -0
- package/lib/index.js +21 -1
- package/lib/model/strategy/adapter/itemRule/adapter.d.ts +3 -1
- package/lib/model/strategy/adapter/itemRule/adapter.js +54 -4
- package/lib/model/strategy/adapter/itemRule/evaluator.d.ts +3 -1
- package/lib/model/strategy/adapter/itemRule/evaluator.js +9 -0
- package/lib/model/strategy/adapter/itemRule/type.d.ts +40 -1
- package/lib/model/strategy/adapter/itemRule/type.js +10 -0
- package/lib/model/strategy/adapter/promotion/evaluator.js +9 -14
- package/lib/model/strategy/adapter/promotion/index.js +46 -1
- package/lib/modules/BookingContext/utils/buildNormalProductCacheItemFromOrderLine.d.ts +3 -1
- package/lib/modules/BookingContext/utils/buildNormalProductCacheItemFromOrderLine.js +17 -1
- package/lib/modules/BookingContext/utils/productExtend.d.ts +7 -0
- package/lib/modules/BookingContext/utils/productExtend.js +45 -2
- package/lib/modules/BookingContext/utils/resources.js +1 -1
- package/lib/modules/BusinessAvailability/index.d.ts +30 -0
- package/lib/modules/BusinessAvailability/index.js +146 -0
- package/lib/modules/Cart/index.js +4 -2
- package/lib/modules/Cart/types.d.ts +2 -0
- package/lib/modules/Cart/utils/cartProduct.d.ts +3 -1
- package/lib/modules/Cart/utils/cartProduct.js +39 -20
- package/lib/modules/FulfillmentTiming/index.d.ts +11 -0
- package/lib/modules/FulfillmentTiming/index.js +359 -0
- package/lib/modules/FulfillmentTiming/types.d.ts +67 -0
- package/lib/modules/FulfillmentTiming/types.js +5 -0
- package/lib/modules/Holder/utils.d.ts +2 -0
- package/lib/modules/Holder/utils.js +27 -1
- package/lib/modules/OpenData/contactInfo.d.ts +20 -0
- package/lib/modules/OpenData/contactInfo.js +56 -0
- package/lib/modules/OpenData/index.d.ts +1 -0
- package/lib/modules/OpenData/index.js +12 -0
- package/lib/modules/OpenData/types.d.ts +23 -0
- package/lib/modules/Order/holderRelations.d.ts +14 -0
- package/lib/modules/Order/holderRelations.js +98 -0
- package/lib/modules/Order/index.d.ts +16 -4
- package/lib/modules/Order/index.js +284 -50
- package/lib/modules/Order/localEftposState.d.ts +13 -0
- package/lib/modules/Order/localEftposState.js +44 -0
- package/lib/modules/Order/pickupTiming.d.ts +46 -0
- package/lib/modules/Order/pickupTiming.js +61 -0
- package/lib/modules/Order/types.d.ts +49 -3
- package/lib/modules/Order/types.js +1 -0
- package/lib/modules/Order/utils/discountProductLineIdentity.d.ts +1 -1
- package/lib/modules/Order/utils/discountProductLineIdentity.js +51 -2
- package/lib/modules/Order/utils/orderCollectionIdentity.js +5 -0
- package/lib/modules/Order/utils.d.ts +2 -1
- package/lib/modules/Order/utils.js +49 -11
- package/lib/modules/Payment/index.js +3 -4
- package/lib/modules/Product/types.d.ts +11 -0
- package/lib/modules/ProductList/index.js +1 -1
- package/lib/modules/ResourcePlanner/planner.d.ts +2 -0
- package/lib/modules/ResourcePlanner/planner.js +252 -8
- package/lib/modules/ResourcePlanner/types.d.ts +29 -0
- package/lib/modules/Rules/index.js +2 -1
- package/lib/modules/Schedule/index.d.ts +8 -0
- package/lib/modules/Schedule/index.js +68 -12
- package/lib/modules/index.d.ts +1 -0
- package/lib/modules/index.js +11 -0
- package/lib/plugins/request.d.ts +7 -0
- package/lib/server/index.d.ts +1 -0
- package/lib/server/index.js +166 -39
- package/lib/server/modules/form/index.d.ts +19 -0
- package/lib/server/modules/form/index.js +73 -0
- package/lib/server/modules/form/types.d.ts +13 -0
- package/lib/server/modules/form/types.js +9 -0
- package/lib/server/modules/index.d.ts +3 -0
- package/lib/server/modules/index.js +15 -1
- package/lib/server/modules/order/index.d.ts +19 -0
- package/lib/server/modules/order/index.js +160 -7
- package/lib/server/modules/order/types.d.ts +4 -0
- package/lib/server/modules/products/index.d.ts +28 -7
- package/lib/server/modules/products/index.js +226 -63
- package/lib/server/modules/products/replication.d.ts +8 -0
- package/lib/server/modules/products/replication.js +30 -0
- package/lib/server/modules/products/types.d.ts +12 -1
- package/lib/server/modules/products/types.js +3 -0
- package/lib/server/test.json +1 -1
- package/lib/server/utils/small-ticket.d.ts +1 -85
- package/lib/server/utils/small-ticket.js +9 -2305
- package/lib/shared/payment/loadPaymentMethods.d.ts +9 -0
- package/lib/shared/payment/loadPaymentMethods.js +40 -0
- package/lib/shared/receipt/customerInvoiceLanguages.d.ts +8 -0
- package/lib/shared/receipt/customerInvoiceLanguages.js +58 -0
- package/lib/shared/receipt/loadCustomerInvoiceLayout.d.ts +27 -0
- package/lib/shared/receipt/loadCustomerInvoiceLayout.js +124 -0
- package/lib/shared/receipt/small-ticket.d.ts +96 -0
- package/lib/shared/receipt/small-ticket.js +2555 -0
- package/lib/shared/receipt/templateVisibility.d.ts +26 -0
- package/lib/shared/receipt/templateVisibility.js +67 -0
- package/lib/shared/sales/loadSalesOrderSnapshot.d.ts +9 -0
- package/lib/shared/sales/loadSalesOrderSnapshot.js +22 -0
- package/lib/solution/BaseSales/fulfillmentItemRules.d.ts +27 -0
- package/lib/solution/BaseSales/fulfillmentItemRules.js +259 -0
- package/lib/solution/BaseSales/index.d.ts +43 -16
- package/lib/solution/BaseSales/index.js +401 -33
- package/lib/solution/BaseSales/pickupTiming.d.ts +47 -0
- package/lib/solution/BaseSales/pickupTiming.js +290 -0
- package/lib/solution/BaseSales/types.d.ts +12 -0
- package/lib/solution/BaseSales/utils/parseSalesResponse.d.ts +3 -1
- package/lib/solution/BaseSales/utils/parseSalesResponse.js +7 -0
- package/lib/solution/BaseSales/utils/transformBaseProductToOrderProduct.js +16 -8
- package/lib/solution/BookingByStep/index.d.ts +4 -2
- package/lib/solution/BookingByStep/index.js +7 -3
- package/lib/solution/BookingTicket/index.d.ts +23 -3
- package/lib/solution/BookingTicket/index.js +197 -9
- package/lib/solution/BookingTicket/utils/addProductDecision.d.ts +0 -1
- package/lib/solution/BookingTicket/utils/addProductDecision.js +1 -1
- package/lib/solution/BookingTicket/utils/cartView.js +3 -1
- package/lib/solution/OrderInvoicePreview/index.d.ts +66 -0
- package/lib/solution/OrderInvoicePreview/index.js +246 -0
- package/lib/solution/RegisterAndLogin/config.js +57 -11
- package/lib/solution/RegisterAndLogin/index.d.ts +2 -0
- package/lib/solution/RegisterAndLogin/index.js +9 -1
- package/lib/solution/RegisterAndLogin/utils.d.ts +12 -4
- package/lib/solution/RegisterAndLogin/utils.js +24 -17
- package/lib/solution/ScanOrder/index.js +59 -20
- package/lib/solution/ScanOrder/types.d.ts +3 -0
- package/lib/solution/UnifiedBookingSales/businessAvailability.d.ts +27 -0
- package/lib/solution/UnifiedBookingSales/businessAvailability.js +138 -0
- package/lib/solution/UnifiedBookingSales/index.d.ts +36 -4
- package/lib/solution/UnifiedBookingSales/index.js +562 -75
- package/lib/solution/UnifiedBookingSales/types.d.ts +16 -2
- package/lib/solution/VenueBooking/index.d.ts +15 -2
- package/lib/solution/VenueBooking/index.js +243 -96
- package/lib/solution/VenueBooking/types.d.ts +2 -1
- package/lib/solution/VenueBooking/types.js +1 -0
- package/lib/solution/VenueBooking/utils/dateSummary.d.ts +1 -0
- package/lib/solution/VenueBooking/utils/dateSummary.js +7 -4
- package/lib/solution/VenueBooking/utils/smartPricing.d.ts +71 -0
- package/lib/solution/VenueBooking/utils/smartPricing.js +224 -0
- package/lib/solution/VenueBooking/utils/timeSlot.d.ts +1 -0
- package/lib/solution/VenueBooking/utils/timeSlot.js +5 -2
- package/lib/solution/index.d.ts +1 -0
- package/lib/solution/index.js +11 -0
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
var _excluded = ["custom_product_bundle_map_id"],
|
|
2
2
|
_excluded2 = ["unique_identification_number"],
|
|
3
|
-
_excluded3 = ["num", "surcharge_fee", "discount_amount", "discount_type", "discountway", "product_discount_reason", "discount_per", "production_code"],
|
|
3
|
+
_excluded3 = ["num", "_extend", "surcharge_fee", "discount_amount", "discount_type", "discountway", "product_discount_reason", "discount_per", "production_code"],
|
|
4
4
|
_excluded4 = ["_extend", "relation_id", "table_form_id", "resource_id", "summary", "lastOrderInfo", "paid_amount", "shop_id", "shop_note", "shop_service_type", "start_time", "customer", "discount_list", "order_meta_list", "tax_fee", "total_amount", "total_refund_amount", "create_date", "holder_id", "payment_status", "notes"],
|
|
5
5
|
_excluded5 = ["collect_pax", "table_occupancy_duration", "cart_settlement_key", "cart_settlement_snapshot", "legal_currency_snapshot"];
|
|
6
6
|
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
@@ -22,6 +22,7 @@ function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symb
|
|
|
22
22
|
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
23
23
|
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; }
|
|
24
24
|
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
25
|
+
import { cloneDeep } from 'lodash-es';
|
|
25
26
|
import dayjs from "dayjs";
|
|
26
27
|
import customParseFormat from 'dayjs/plugin/customParseFormat';
|
|
27
28
|
import Decimal from 'decimal.js';
|
|
@@ -31,6 +32,8 @@ import { getProductHolderConfig } from "../Holder/utils";
|
|
|
31
32
|
import { buildProductLineFingerprint, createEmptySummary } from "../../solution/ScanOrder/utils";
|
|
32
33
|
import { createUuidV4 } from "./utils/orderCollectionIdentity";
|
|
33
34
|
import { encodeSalesNotes } from "./salesNotes";
|
|
35
|
+
import { isFulfillmentTimingBooking } from "./pickupTiming";
|
|
36
|
+
import { ensureHolderRelationUuids, getProductHolderRelations, hasProductBooking, removeProductHolderRelations } from "./holderRelations";
|
|
34
37
|
dayjs.extend(customParseFormat);
|
|
35
38
|
var POINT_CARD_SNAPSHOT_TAG = 'point_card';
|
|
36
39
|
var VIRTUAL_CURRENCY_SNAPSHOT_TAG = 'virtual_currency';
|
|
@@ -187,6 +190,10 @@ export function normalizeVirtualCurrencySnapshotItem(value) {
|
|
|
187
190
|
if (productId !== undefined) {
|
|
188
191
|
snapshot.product_id = productId;
|
|
189
192
|
}
|
|
193
|
+
var code = normalizeSnapshotScalar(value.code);
|
|
194
|
+
if (code !== undefined) {
|
|
195
|
+
snapshot.code = String(code).trim();
|
|
196
|
+
}
|
|
190
197
|
return snapshot;
|
|
191
198
|
}
|
|
192
199
|
function normalizeVirtualCurrencySnapshotList(value) {
|
|
@@ -218,6 +225,10 @@ export function buildVirtualCurrencySnapshotFromList(value) {
|
|
|
218
225
|
if (productId !== undefined) {
|
|
219
226
|
snapshot.product_id = productId;
|
|
220
227
|
}
|
|
228
|
+
var code = normalizeSnapshotScalar(item.code);
|
|
229
|
+
if (code !== undefined) {
|
|
230
|
+
snapshot.code = String(code).trim();
|
|
231
|
+
}
|
|
221
232
|
result.push(snapshot);
|
|
222
233
|
return result;
|
|
223
234
|
}, []);
|
|
@@ -787,7 +798,7 @@ export function resolveEffectivePerUnitDiscount(product) {
|
|
|
787
798
|
if (!Number.isFinite(originalPrice) || !Number.isFinite(finalPrice)) return fromList;
|
|
788
799
|
return fromList + (originalPrice - finalPrice);
|
|
789
800
|
}
|
|
790
|
-
export function createDefaultOrderRulesHooks(getBookings) {
|
|
801
|
+
export function createDefaultOrderRulesHooks(getBookings, getHolderRelations) {
|
|
791
802
|
var getProductStartDate = function getProductStartDate(product) {
|
|
792
803
|
var _ref17, _product$metadata$uni, _product$metadata2, _ref18, _product$booking_uid, _product$metadata3, _product$metadata4, _product$metadata5, _product$metadata6;
|
|
793
804
|
var productUid = String((_ref17 = (_product$metadata$uni = (_product$metadata2 = product.metadata) === null || _product$metadata2 === void 0 ? void 0 : _product$metadata2.unique_identification_number) !== null && _product$metadata$uni !== void 0 ? _product$metadata$uni : product.unique_identification_number) !== null && _ref17 !== void 0 ? _ref17 : '');
|
|
@@ -910,7 +921,13 @@ export function createDefaultOrderRulesHooks(getBookings) {
|
|
|
910
921
|
// 勿写死 false:否则 Rules 不会走 total≠origin_total 的手动价推断,
|
|
911
922
|
// 无券时会把 bundle 价还原成 original_price(手动改价套餐会从 20 回到 30)。
|
|
912
923
|
isManualDiscount: resolveRulesManualDiscountFlag(metadataAny),
|
|
913
|
-
holder_id: (_product$metadata9 = product.metadata) === null || _product$metadata9 === void 0 ? void 0 : _product$metadata9.holder_id
|
|
924
|
+
holder_id: hasProductBooking(product) || !getHolderRelations ? (_product$metadata9 = product.metadata) === null || _product$metadata9 === void 0 ? void 0 : _product$metadata9.holder_id : getProductHolderRelations({
|
|
925
|
+
holder_relations: getHolderRelations()
|
|
926
|
+
}, product).filter(function (relation) {
|
|
927
|
+
return relation.holder_type === 'form';
|
|
928
|
+
}).map(function (relation) {
|
|
929
|
+
return relation.holder_id;
|
|
930
|
+
}),
|
|
914
931
|
startDate: getProductStartDate(product),
|
|
915
932
|
main_product_selling_price: metadataAny.main_product_selling_price !== undefined ? new Decimal(Number(metadataAny.main_product_selling_price) || 0).minus(optionSellingSum).toDecimalPlaces(2).toString() : undefined,
|
|
916
933
|
inPromotion: ((_metadataAny$_promoti = metadataAny._promotion) === null || _metadataAny$_promoti === void 0 ? void 0 : _metadataAny$_promoti.inPromotion) === true,
|
|
@@ -1207,6 +1224,7 @@ function normalizeSubmitProduct(product) {
|
|
|
1207
1224
|
_runtimeUid = _ref37.unique_identification_number,
|
|
1208
1225
|
submitProduct = _objectWithoutProperties(_ref37, _excluded2);
|
|
1209
1226
|
var num = submitProduct.num,
|
|
1227
|
+
_productExtend = submitProduct._extend,
|
|
1210
1228
|
_productSurchargeFee = submitProduct.surcharge_fee,
|
|
1211
1229
|
_deprecatedDiscountAmount = submitProduct.discount_amount,
|
|
1212
1230
|
_deprecatedDiscountType = submitProduct.discount_type,
|
|
@@ -1287,7 +1305,7 @@ function normalizeSubmitProduct(product) {
|
|
|
1287
1305
|
payment_price: formatOptions.virtualSettlementMode ? virtualPrice : (_submitProduct$paymen = submitProduct.payment_price) !== null && _submitProduct$paymen !== void 0 ? _submitProduct$paymen : submitProduct.selling_price
|
|
1288
1306
|
});
|
|
1289
1307
|
}
|
|
1290
|
-
var SUBMIT_BOOKING_METADATA_WHITELIST = ['unique_identification_number', 'collect_pax', 'capacity', 'holder_id', 'resource_select_type', 'holder'];
|
|
1308
|
+
var SUBMIT_BOOKING_METADATA_WHITELIST = ['unique_identification_number', 'collect_pax', 'capacity', 'holder_id', 'resource_select_type', 'holder', 'is_fulfillment_timing', 'fulfillment_timing'];
|
|
1291
1309
|
export function normalizeBookingIsAll(booking) {
|
|
1292
1310
|
return booking.is_all === true || booking.is_all === 1 || booking.is_all === '1' || booking.is_all === 'true' ? 1 : 0;
|
|
1293
1311
|
}
|
|
@@ -1315,21 +1333,27 @@ export function normalizeSubmitBooking(booking) {
|
|
|
1315
1333
|
} finally {
|
|
1316
1334
|
_iterator7.f();
|
|
1317
1335
|
}
|
|
1318
|
-
if (cleanMetadata.holder_id === undefined
|
|
1336
|
+
if (cleanMetadata.holder_id === undefined && !isFulfillmentTimingBooking(booking)) {
|
|
1337
|
+
cleanMetadata.holder_id = null;
|
|
1338
|
+
}
|
|
1319
1339
|
var bookingRecord = booking;
|
|
1320
1340
|
var startDate = bookingRecord.start_date;
|
|
1321
1341
|
var shouldRestoreSelectDate = bookingRecord.select_date === undefined || bookingRecord.select_date === null || bookingRecord.select_date === '';
|
|
1322
1342
|
var selectDateFromStartDate = typeof startDate === 'string' ? startDate.split(/\s+/)[0] : startDate;
|
|
1323
|
-
return _objectSpread(_objectSpread(_objectSpread({}, booking), shouldRestoreSelectDate && selectDateFromStartDate ? {
|
|
1343
|
+
return _objectSpread(_objectSpread(_objectSpread(_objectSpread({}, booking), shouldRestoreSelectDate && selectDateFromStartDate ? {
|
|
1324
1344
|
select_date: selectDateFromStartDate
|
|
1325
1345
|
} : {}), {}, {
|
|
1326
1346
|
is_all: normalizeBookingIsAll(bookingRecord),
|
|
1327
|
-
sub_type: normalizeBookingSubType(bookingRecord)
|
|
1347
|
+
sub_type: normalizeBookingSubType(bookingRecord)
|
|
1348
|
+
}, isFulfillmentTimingBooking(booking) ? {
|
|
1349
|
+
like_status: bookingRecord.like_status || 'common',
|
|
1350
|
+
schedule_id: bookingRecord.schedule_id || 0
|
|
1351
|
+
} : {}), {}, {
|
|
1328
1352
|
metadata: cleanMetadata
|
|
1329
1353
|
});
|
|
1330
1354
|
}
|
|
1331
1355
|
var DEFAULT_TABLE_OCCUPANCY_DURATION = 20;
|
|
1332
|
-
function resolveTableOccupancyDuration(tempOrder) {
|
|
1356
|
+
export function resolveTableOccupancyDuration(tempOrder) {
|
|
1333
1357
|
var _metadata$table_confi, _metadata$tableConfig, _metadata$resource_co, _metadata$resourceCon;
|
|
1334
1358
|
var metadata = tempOrder.metadata || {};
|
|
1335
1359
|
var candidates = [metadata.table_occupancy_duration, metadata.booking_duration, metadata.table_duration, metadata.duration, (_metadata$table_confi = metadata.table_config) === null || _metadata$table_confi === void 0 ? void 0 : _metadata$table_confi.occupancy_duration, (_metadata$tableConfig = metadata.tableConfig) === null || _metadata$tableConfig === void 0 ? void 0 : _metadata$tableConfig.occupancy_duration, (_metadata$resource_co = metadata.resource_config) === null || _metadata$resource_co === void 0 ? void 0 : _metadata$resource_co.occupancy_duration, (_metadata$resourceCon = metadata.resourceConfig) === null || _metadata$resourceCon === void 0 ? void 0 : _metadata$resourceCon.occupancy_duration];
|
|
@@ -1391,6 +1415,7 @@ export function createDefaultTempOrder(params) {
|
|
|
1391
1415
|
request_unique_idempotency_token: '',
|
|
1392
1416
|
vouchers: [],
|
|
1393
1417
|
products: [],
|
|
1418
|
+
holder_relations: [],
|
|
1394
1419
|
notes: [],
|
|
1395
1420
|
bookings: [],
|
|
1396
1421
|
payments: [],
|
|
@@ -1413,6 +1438,7 @@ function hasBoundBookingResource(bookings) {
|
|
|
1413
1438
|
if (!Array.isArray(bookings)) return false;
|
|
1414
1439
|
return bookings.some(function (booking) {
|
|
1415
1440
|
if (!booking || _typeof(booking) !== 'object') return false;
|
|
1441
|
+
if (isFulfillmentTimingBooking(booking)) return false;
|
|
1416
1442
|
if (Number(booking.parent_id) === 0) return false;
|
|
1417
1443
|
var resources = booking.resources;
|
|
1418
1444
|
if (!Array.isArray(resources)) return false;
|
|
@@ -1447,7 +1473,9 @@ export function resolveSubmitOrderType(params) {
|
|
|
1447
1473
|
return 'table-order';
|
|
1448
1474
|
}
|
|
1449
1475
|
if (currentType) return currentType;
|
|
1450
|
-
if (Array.isArray(bookings) && bookings.
|
|
1476
|
+
if (Array.isArray(bookings) && bookings.some(function (booking) {
|
|
1477
|
+
return !isFulfillmentTimingBooking(booking);
|
|
1478
|
+
})) {
|
|
1451
1479
|
return businessCode === 'dine_in' ? 'table-order' : 'appointment_booking';
|
|
1452
1480
|
}
|
|
1453
1481
|
return 'virtual';
|
|
@@ -1464,6 +1492,7 @@ export function buildSubmitPayload(params) {
|
|
|
1464
1492
|
type = params.type,
|
|
1465
1493
|
summary = params.summary,
|
|
1466
1494
|
enhance = params.enhance;
|
|
1495
|
+
ensureHolderRelationUuids(tempOrder);
|
|
1467
1496
|
var scheduleDate = tempOrder.schedule_date || tempOrder.created_at || formatDateTime(now);
|
|
1468
1497
|
var bookingUuid = createUuidV4();
|
|
1469
1498
|
var virtualSettlementMode = ((_tempOrder$metadata2 = tempOrder.metadata) === null || _tempOrder$metadata2 === void 0 || (_tempOrder$metadata2 = _tempOrder$metadata2.currency_settlement_config) === null || _tempOrder$metadata2 === void 0 ? void 0 : _tempOrder$metadata2.settlement_type) === 'virtual_currency';
|
|
@@ -1500,7 +1529,9 @@ export function buildSubmitPayload(params) {
|
|
|
1500
1529
|
tempOrderBusinessCode: tempOrder.business_code,
|
|
1501
1530
|
bookings: tempOrder.bookings
|
|
1502
1531
|
});
|
|
1503
|
-
var payload = _objectSpread(_objectSpread(_objectSpread(_objectSpread({}, tempOrderRest),
|
|
1532
|
+
var payload = _objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread({}, tempOrderRest), tempOrder.holder_relations !== undefined ? {
|
|
1533
|
+
holder_relations: cloneDeep(tempOrder.holder_relations)
|
|
1534
|
+
} : {}), {}, {
|
|
1504
1535
|
customer_id: (_tempOrder$customer_i = tempOrder.customer_id) !== null && _tempOrder$customer_i !== void 0 ? _tempOrder$customer_i : 1,
|
|
1505
1536
|
customer_name: tempOrder.customer_name || 'Walk-In',
|
|
1506
1537
|
country_calling_code: String((_tempOrder$country_ca = tempOrder.country_calling_code) !== null && _tempOrder$country_ca !== void 0 ? _tempOrder$country_ca : ''),
|
|
@@ -1527,11 +1558,11 @@ export function buildSubmitPayload(params) {
|
|
|
1527
1558
|
shop_discount: tempOrder.shop_discount || '0.00',
|
|
1528
1559
|
surcharge_fee: tempOrder.surcharge_fee || '0.00',
|
|
1529
1560
|
note: tempOrder.note || '',
|
|
1530
|
-
delivery_type: tempOrder.delivery_type || '
|
|
1561
|
+
delivery_type: tempOrder.delivery_type || 'shop_service',
|
|
1531
1562
|
schedule_date: scheduleDate,
|
|
1532
1563
|
// created_at: tempOrder.created_at || formatDateTime(now), 和后端协定这个字段先不提交到接口
|
|
1533
1564
|
bookings: (tempOrder.bookings || []).filter(function (booking) {
|
|
1534
|
-
return Number(booking.parent_id) !== 0;
|
|
1565
|
+
return isFulfillmentTimingBooking(booking) || Number(booking.parent_id) !== 0;
|
|
1535
1566
|
}).map(function (booking) {
|
|
1536
1567
|
return normalizeSubmitBooking(booking);
|
|
1537
1568
|
}),
|
|
@@ -1687,21 +1718,32 @@ export function hasAssignedHolderId(value) {
|
|
|
1687
1718
|
* clearTempOrderHolderAssignments(tempOrder);
|
|
1688
1719
|
*/
|
|
1689
1720
|
export function clearTempOrderHolderAssignments(tempOrder) {
|
|
1690
|
-
var _tempOrder$_extend2;
|
|
1691
|
-
var
|
|
1721
|
+
var _tempOrder$holder_rel, _tempOrder$holder_rel2, _tempOrder$_extend2;
|
|
1722
|
+
var previousRelationCount = ((_tempOrder$holder_rel = tempOrder.holder_relations) === null || _tempOrder$holder_rel === void 0 ? void 0 : _tempOrder$holder_rel.length) || 0;
|
|
1723
|
+
removeProductHolderRelations(tempOrder, (tempOrder.products || []).filter(function (product) {
|
|
1724
|
+
return !hasProductBooking(product);
|
|
1725
|
+
}));
|
|
1726
|
+
var changed = previousRelationCount !== (((_tempOrder$holder_rel2 = tempOrder.holder_relations) === null || _tempOrder$holder_rel2 === void 0 ? void 0 : _tempOrder$holder_rel2.length) || 0);
|
|
1692
1727
|
var resetHolderField = function resetHolderField(target) {
|
|
1693
1728
|
var key = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'holder_id';
|
|
1694
1729
|
if (!hasAssignedHolderId(target[key])) return;
|
|
1695
1730
|
target[key] = null;
|
|
1696
1731
|
changed = true;
|
|
1697
1732
|
};
|
|
1733
|
+
var clearHolder = function clearHolder(target) {
|
|
1734
|
+
resetHolderField(target);
|
|
1735
|
+
if (target.holder !== undefined && target.holder !== null) {
|
|
1736
|
+
target.holder = null;
|
|
1737
|
+
changed = true;
|
|
1738
|
+
}
|
|
1739
|
+
};
|
|
1698
1740
|
var _iterator8 = _createForOfIteratorHelper(tempOrder.products || []),
|
|
1699
1741
|
_step8;
|
|
1700
1742
|
try {
|
|
1701
1743
|
for (_iterator8.s(); !(_step8 = _iterator8.n()).done;) {
|
|
1702
1744
|
var product = _step8.value;
|
|
1703
1745
|
if (product.metadata && _typeof(product.metadata) === 'object') {
|
|
1704
|
-
|
|
1746
|
+
clearHolder(product.metadata);
|
|
1705
1747
|
}
|
|
1706
1748
|
}
|
|
1707
1749
|
} catch (err) {
|
|
@@ -1734,11 +1776,13 @@ export function clearTempOrderHolderAssignments(tempOrder) {
|
|
|
1734
1776
|
var entry = _Object$values[_i4];
|
|
1735
1777
|
var origin = entry === null || entry === void 0 ? void 0 : entry.origin;
|
|
1736
1778
|
if (!origin || _typeof(origin) !== 'object') continue;
|
|
1779
|
+
clearHolder(origin);
|
|
1737
1780
|
if (origin.metadata && _typeof(origin.metadata) === 'object') {
|
|
1738
|
-
|
|
1781
|
+
clearHolder(origin.metadata);
|
|
1739
1782
|
}
|
|
1740
1783
|
if (origin._extend && _typeof(origin._extend) === 'object') {
|
|
1741
|
-
|
|
1784
|
+
clearHolder(origin._extend);
|
|
1785
|
+
delete origin._extend.holder_relations;
|
|
1742
1786
|
}
|
|
1743
1787
|
}
|
|
1744
1788
|
}
|
|
@@ -20,6 +20,7 @@ function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.g
|
|
|
20
20
|
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
21
21
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
22
22
|
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
23
|
+
import { loadPaymentMethods } from "../../shared/payment/loadPaymentMethods";
|
|
23
24
|
import { BaseModule } from "../BaseModule";
|
|
24
25
|
import { PaymentStatus, PaymentMethodType, RoundingRule } from "./types";
|
|
25
26
|
import { getUniqueId } from "../Cart/utils";
|
|
@@ -363,37 +364,35 @@ export var PaymentModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
363
364
|
key: "getPayMethodListAsync",
|
|
364
365
|
value: (function () {
|
|
365
366
|
var _getPayMethodListAsync = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {
|
|
366
|
-
var
|
|
367
|
+
var payMethods;
|
|
367
368
|
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
|
368
369
|
while (1) switch (_context3.prev = _context3.next) {
|
|
369
370
|
case 0:
|
|
370
371
|
this.logInfo('Starting getPayMethodListAsync');
|
|
371
372
|
_context3.prev = 1;
|
|
372
373
|
_context3.next = 4;
|
|
373
|
-
return this.request
|
|
374
|
+
return loadPaymentMethods(this.request, {
|
|
375
|
+
transport: 'os-server',
|
|
374
376
|
filterPaymentMethods: true
|
|
375
|
-
}, {
|
|
376
|
-
osServer: true
|
|
377
377
|
});
|
|
378
378
|
case 4:
|
|
379
|
-
|
|
380
|
-
payMethods = (response === null || response === void 0 ? void 0 : response.data) || response || [];
|
|
379
|
+
payMethods = _context3.sent;
|
|
381
380
|
this.logInfo('getPayMethodListAsync completed successfully', {
|
|
382
381
|
payMethods: payMethods
|
|
383
382
|
});
|
|
384
383
|
return _context3.abrupt("return", payMethods);
|
|
385
|
-
case
|
|
386
|
-
_context3.prev =
|
|
384
|
+
case 9:
|
|
385
|
+
_context3.prev = 9;
|
|
387
386
|
_context3.t0 = _context3["catch"](1);
|
|
388
387
|
console.error('[PaymentModule] 获取支付方式列表失败', _context3.t0);
|
|
389
388
|
this.logError('getPayMethodListAsync failed', _context3.t0);
|
|
390
389
|
// 如果所有操作都失败,返回空数组
|
|
391
390
|
return _context3.abrupt("return", []);
|
|
392
|
-
case
|
|
391
|
+
case 14:
|
|
393
392
|
case "end":
|
|
394
393
|
return _context3.stop();
|
|
395
394
|
}
|
|
396
|
-
}, _callee3, this, [[1,
|
|
395
|
+
}, _callee3, this, [[1, 9]]);
|
|
397
396
|
}));
|
|
398
397
|
function getPayMethodListAsync() {
|
|
399
398
|
return _getPayMethodListAsync.apply(this, arguments);
|
|
@@ -218,6 +218,17 @@ export interface ProductData {
|
|
|
218
218
|
bundle?: any[];
|
|
219
219
|
/** 商品选项组成 */
|
|
220
220
|
options?: any[];
|
|
221
|
+
/** 单规格组;用于由已选 option 反查规格项名称、价格等商品快照字段。 */
|
|
222
|
+
option_group?: Array<{
|
|
223
|
+
id: number | string;
|
|
224
|
+
option_item?: Array<{
|
|
225
|
+
id: number | string;
|
|
226
|
+
name?: string | Record<string, any>;
|
|
227
|
+
title?: string | Record<string, any>;
|
|
228
|
+
[key: string]: any;
|
|
229
|
+
}>;
|
|
230
|
+
[key: string]: any;
|
|
231
|
+
}>;
|
|
221
232
|
/** 商品原信息 */
|
|
222
233
|
origin?: any;
|
|
223
234
|
/** 容量 */
|
|
@@ -227,7 +227,7 @@ export var ProductList = /*#__PURE__*/function (_BaseModule) {
|
|
|
227
227
|
online_store: 'online-store',
|
|
228
228
|
scan_to_order: 'online-store',
|
|
229
229
|
'scan-to-order': 'online-store',
|
|
230
|
-
scan_to_order_2: '
|
|
230
|
+
scan_to_order_2: 'online-store',
|
|
231
231
|
scan_to_order_3: 'scantoorder3'
|
|
232
232
|
};
|
|
233
233
|
rawApplicationCode = (_this$otherParams = this.otherParams) === null || _this$otherParams === void 0 ? void 0 : _this$otherParams.channel;
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import type { AvailabilityProjection, AvailabilityProjectionInput, AvailabilityQuery, AvailabilityQueryResult, AvailabilitySelectionValidationParams, AvailabilitySelectionValidationResult, GetProductTimeRangesRequest, GetProductTimeRangesRuntimeOptions, ProductTimeRangeGroup } from './types';
|
|
2
2
|
export declare function createAvailabilityProjection(input: AvailabilityProjectionInput): AvailabilityProjection;
|
|
3
|
+
/** Resolve the label without changing the real calendar timestamp. */
|
|
4
|
+
export declare function getDurationBusinessDate(projection: AvailabilityProjection, startAt: string): string;
|
|
3
5
|
export declare function getProductTimeRanges(projection: AvailabilityProjection, request?: GetProductTimeRangesRequest, runtimeOptions?: GetProductTimeRangesRuntimeOptions): ProductTimeRangeGroup[];
|
|
4
6
|
export declare function queryAvailabilityProjection(projection: AvailabilityProjection, request: AvailabilityQuery, runtimeOptions?: GetProductTimeRangesRuntimeOptions): AvailabilityQueryResult;
|
|
5
7
|
export declare function validateAvailabilitySelection(projection: AvailabilityProjection, params: AvailabilitySelectionValidationParams, runtimeOptions?: GetProductTimeRangesRuntimeOptions): AvailabilitySelectionValidationResult;
|