@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
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
* - 不在此处发明等价关系;UI 侧(ticketBooking)若需要别的字段,由 view-model 适配层做转换
|
|
15
15
|
*/
|
|
16
16
|
import type { BaseSalesOrderProduct } from '../types';
|
|
17
|
-
import type { OrderMetaList } from '../../../modules/Order/types';
|
|
17
|
+
import type { OrderHolderRelation, OrderMetaList } from '../../../modules/Order/types';
|
|
18
18
|
export interface ISalesDetailHeader {
|
|
19
19
|
order_id: number | string | null;
|
|
20
20
|
order_number?: string;
|
|
@@ -121,6 +121,8 @@ export interface ISalesDetail {
|
|
|
121
121
|
header: ISalesDetailHeader;
|
|
122
122
|
/** 商品行快照(保留 tempOrder / 后端详情原字段) */
|
|
123
123
|
products: BaseSalesOrderProduct[];
|
|
124
|
+
/** 非预约商品 Holder 关系,保留关系及 metadata 的扩展字段。 */
|
|
125
|
+
holder_relations?: OrderHolderRelation[];
|
|
124
126
|
/** 全部 bookings,按服务端原始顺序输出(含 root + child) */
|
|
125
127
|
bookings: ISalesBooking[];
|
|
126
128
|
/** root booking(parent_id === 0),多个时取首个,无则为 null */
|
|
@@ -24,6 +24,8 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
|
|
|
24
24
|
*/
|
|
25
25
|
|
|
26
26
|
import { normalizeOrderCollections } from "../../../modules/Order/utils/orderCollectionIdentity";
|
|
27
|
+
import { isFulfillmentTimingBooking } from "../../../modules/Order/pickupTiming";
|
|
28
|
+
import { cloneDeep } from 'lodash-es';
|
|
27
29
|
/** OrderData 中除大数组外的"顶层 header 字段"白名单,按需扩展。 */
|
|
28
30
|
var HEADER_KEYS = ['order_id', 'order_number', 'shop_order_number', 'shop_full_order_number', 'type', 'business_code', 'platform', 'sales_channel', 'order_sales_channel', 'vouchers', 'status', 'payment_status', 'shipping_status', 'customer_id', 'customer_name', 'country_calling_code', 'phone', 'email', 'is_price_include_tax', 'tax_title', 'tax_country_code', 'currency_code', 'currency_symbol', 'currency_format', 'is_deposit', 'deposit_amount', 'shop_discount', 'surcharge_fee', 'note', 'schedule_date', 'created_at', 'updated_at', 'order_meta_list', 'metadata', 'total_amount', 'shop_id', 'create_date', 'holder', 'relation_forms', 'contacts', 'contacts_info'];
|
|
29
31
|
function pickHeader(raw) {
|
|
@@ -78,6 +80,7 @@ function pickCustomer(raw) {
|
|
|
78
80
|
*/
|
|
79
81
|
function isRootBooking(booking) {
|
|
80
82
|
if (!booking || _typeof(booking) !== 'object') return false;
|
|
83
|
+
if (isFulfillmentTimingBooking(booking)) return false;
|
|
81
84
|
var parentId = booking.parent_id;
|
|
82
85
|
if (parentId === 0 || parentId === null || parentId === undefined) return true;
|
|
83
86
|
return false;
|
|
@@ -90,6 +93,7 @@ function indexBookingsByProductUid(bookings) {
|
|
|
90
93
|
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
|
|
91
94
|
var _b$metadata;
|
|
92
95
|
var b = _step2.value;
|
|
96
|
+
if (isFulfillmentTimingBooking(b)) continue;
|
|
93
97
|
var uid = b && (b.product_uid || ((_b$metadata = b.metadata) === null || _b$metadata === void 0 ? void 0 : _b$metadata.product_uid)) || '';
|
|
94
98
|
if (!uid) continue;
|
|
95
99
|
var _key2 = String(uid);
|
|
@@ -141,9 +145,12 @@ export function parseSalesResponse(input) {
|
|
|
141
145
|
return _objectSpread({}, d || {});
|
|
142
146
|
}) : [];
|
|
143
147
|
var summary = raw !== null && raw !== void 0 && raw.summary && _typeof(raw.summary) === 'object' ? _objectSpread({}, raw.summary) : {};
|
|
144
|
-
return {
|
|
148
|
+
return _objectSpread(_objectSpread({
|
|
145
149
|
header: pickHeader(raw),
|
|
146
|
-
products: products
|
|
150
|
+
products: products
|
|
151
|
+
}, Array.isArray(raw === null || raw === void 0 ? void 0 : raw.holder_relations) ? {
|
|
152
|
+
holder_relations: cloneDeep(raw.holder_relations)
|
|
153
|
+
} : {}), {}, {
|
|
147
154
|
bookings: bookings,
|
|
148
155
|
rootBooking: rootBooking,
|
|
149
156
|
bookingsByProductUid: bookingsByProductUid,
|
|
@@ -153,5 +160,5 @@ export function parseSalesResponse(input) {
|
|
|
153
160
|
customer: pickCustomer(raw),
|
|
154
161
|
summary: summary,
|
|
155
162
|
raw: raw
|
|
156
|
-
};
|
|
163
|
+
});
|
|
157
164
|
}
|
|
@@ -12,6 +12,8 @@ function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symb
|
|
|
12
12
|
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
13
13
|
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; }
|
|
14
14
|
import { resolveWeighedSourcePrice, withOriginalBundleOptionPrices } from "../../../modules/Order/utils/weighedProduct";
|
|
15
|
+
import { resolveProductHolderConfig } from "../../../modules/Holder/utils";
|
|
16
|
+
import { isBookingProduct } from "../../../modules/BookingContext/utils/serviceTimes";
|
|
15
17
|
import { composeLinePrice, getBundleSellingMagnitude, normalizeProductSkuOptions, sumOptionUnitPrice } from "../../../modules/Order/utils";
|
|
16
18
|
import { buildManualProductDiscountItem, mergeManualProductDiscountIntoList, resolveManualDiscountOriginTotal, resolveManualDiscountReasonFromSources, shouldBuildManualProductDiscount } from "../../../modules/Order/utils/manualProductDiscount";
|
|
17
19
|
function toNumber(value) {
|
|
@@ -168,7 +170,7 @@ function findVariantById(origin, variantId) {
|
|
|
168
170
|
* 注意:这里不生成 identity,缺省时由 OrderModule 自动补齐。
|
|
169
171
|
*/
|
|
170
172
|
export function transformBaseProductToOrderProduct(params) {
|
|
171
|
-
var _ref12, _ref13, _ref14, _payload$product_id, _ref15, _ref16, _payload$product_vari, _payload$_origin, _payload$_origin2, _payload$metadata, _sourceProduct$metada, _callbackOrigin$metad, _origin$metadata, _payload$metadata2, _payload$_extend, _sourceProduct$metada2, _sourceProduct$_exten, _callbackOrigin$metad2, _callbackOrigin$_exte, _payload$_dataVariant, _sourceProduct$_dataV, _callbackOrigin$_data, _origin$_dataVariant, _ref17, _findVariantById, _origin$production_co, _ref18, _ref19, _ref20, _ref21, _ref22, _matchedVariant$price, _payload$product_sku, _payload$_extend$weig, _payload$_extend2, _origin$_extend, _ref23, _ref24, _payload$price, _ref25, _payload$line_total, _payload$_extend3, _ref26, _ref27, _payload$product_sku$, _payload$product_sku2, _payload$bundle, _payload$quantity, _payload$_extend4, _extend, _extend2, _ref28, _ref29, _origin$base_price, _ref30, _ref31, _payload$line_total2, _payload$_extend5, _payload$_extend6, _extend3, _payload$_extend7, _payload$_extend8, _ref32, _ref33, _payload$tax_fee, _ref34, _ref35, _payload$is_charge_ta;
|
|
173
|
+
var _ref12, _ref13, _ref14, _payload$product_id, _ref15, _ref16, _payload$product_vari, _payload$_origin, _payload$_origin2, _payload$metadata, _sourceProduct$metada, _callbackOrigin$metad, _origin$metadata, _payload$metadata2, _payload$_extend, _sourceProduct$metada2, _sourceProduct$_exten, _callbackOrigin$metad2, _callbackOrigin$_exte, _payload$_dataVariant, _sourceProduct$_dataV, _callbackOrigin$_data, _origin$_dataVariant, _ref17, _findVariantById, _origin$production_co, _ref18, _ref19, _ref20, _ref21, _ref22, _matchedVariant$price, _payload$product_sku, _payload$_extend$weig, _payload$_extend2, _origin$_extend, _ref23, _ref24, _payload$price, _ref25, _payload$line_total, _payload$_extend3, _ref26, _ref27, _payload$product_sku$, _payload$product_sku2, _payload$bundle, _payload$quantity, _payload$_extend4, _extend, _extend2, _ref28, _ref29, _origin$base_price, _ref30, _ref31, _payload$line_total2, _payload$_extend5, _payload$_extend6, _extend3, _payload$_extend7, _payload$_extend8, _find, _resolveProductHolder, _ref32, _ref33, _payload$tax_fee, _ref34, _ref35, _payload$is_charge_ta;
|
|
172
174
|
var payload = params.payload,
|
|
173
175
|
_params$fallbackProdu = params.fallbackProductId,
|
|
174
176
|
fallbackProductId = _params$fallbackProdu === void 0 ? null : _params$fallbackProdu;
|
|
@@ -242,6 +244,9 @@ export function transformBaseProductToOrderProduct(params) {
|
|
|
242
244
|
});
|
|
243
245
|
var derivedMainSelling = hasExplicitLineTotal ? Number(lineCompositeTotal) - Number(bundleOnlyComposite) : Number(mainProductOriginalPrice);
|
|
244
246
|
var mainProductSellingPrice = toPriceString(Number.isFinite(derivedMainSelling) && derivedMainSelling >= 0 ? derivedMainSelling : Number(mainProductOriginalPrice));
|
|
247
|
+
var holderRelations = (_find = [payload._extend, callbackOrigin === null || callbackOrigin === void 0 ? void 0 : callbackOrigin._extend, sourceProduct === null || sourceProduct === void 0 ? void 0 : sourceProduct._extend].find(function (source) {
|
|
248
|
+
return Array.isArray(source === null || source === void 0 ? void 0 : source.holder_relations);
|
|
249
|
+
})) === null || _find === void 0 ? void 0 : _find.holder_relations;
|
|
245
250
|
var metadata = _objectSpread(_objectSpread(_objectSpread(_objectSpread({
|
|
246
251
|
unique: payload.unique,
|
|
247
252
|
session: payload.session,
|
|
@@ -256,7 +261,7 @@ export function transformBaseProductToOrderProduct(params) {
|
|
|
256
261
|
main_product_selling_price: mainProductSellingPrice,
|
|
257
262
|
main_product_original_price: mainProductOriginalPrice,
|
|
258
263
|
price_schema_version: 2,
|
|
259
|
-
holder_config: sourceProduct
|
|
264
|
+
holder_config: (_resolveProductHolder = resolveProductHolderConfig(sourceProduct)) !== null && _resolveProductHolder !== void 0 ? _resolveProductHolder : undefined
|
|
260
265
|
}, dataVariantIds !== undefined ? {
|
|
261
266
|
data_variant_ids: dataVariantIds
|
|
262
267
|
} : {}), selectedSettlementSnapshot ? {
|
|
@@ -275,7 +280,7 @@ export function transformBaseProductToOrderProduct(params) {
|
|
|
275
280
|
var productTitle = _objectSpread(_objectSpread({}, productTitleI18n), {}, {
|
|
276
281
|
original: productTitleI18n.original || (sourceProduct === null || sourceProduct === void 0 ? void 0 : sourceProduct.original_title) || (sourceProduct === null || sourceProduct === void 0 ? void 0 : sourceProduct.title) || ''
|
|
277
282
|
});
|
|
278
|
-
return _objectSpread(_objectSpread({
|
|
283
|
+
return _objectSpread(_objectSpread(_objectSpread({
|
|
279
284
|
product_id: productId,
|
|
280
285
|
product_variant_id: productVariantId,
|
|
281
286
|
production_code: productionCode,
|
|
@@ -294,7 +299,12 @@ export function transformBaseProductToOrderProduct(params) {
|
|
|
294
299
|
original_price: lineOriginalPrice,
|
|
295
300
|
tax_fee: toPriceString((_ref32 = (_ref33 = (_payload$tax_fee = payload.tax_fee) !== null && _payload$tax_fee !== void 0 ? _payload$tax_fee : matchedVariant === null || matchedVariant === void 0 ? void 0 : matchedVariant.tax_fee) !== null && _ref33 !== void 0 ? _ref33 : origin === null || origin === void 0 ? void 0 : origin.tax_fee) !== null && _ref32 !== void 0 ? _ref32 : sourceProduct === null || sourceProduct === void 0 ? void 0 : sourceProduct.tax_fee, '0.00'),
|
|
296
301
|
is_charge_tax: toNumber((_ref34 = (_ref35 = (_payload$is_charge_ta = payload.is_charge_tax) !== null && _payload$is_charge_ta !== void 0 ? _payload$is_charge_ta : matchedVariant === null || matchedVariant === void 0 ? void 0 : matchedVariant.is_charge_tax) !== null && _ref35 !== void 0 ? _ref35 : origin === null || origin === void 0 ? void 0 : origin.is_charge_tax) !== null && _ref34 !== void 0 ? _ref34 : sourceProduct === null || sourceProduct === void 0 ? void 0 : sourceProduct.is_charge_tax, 0),
|
|
297
|
-
metadata: metadata
|
|
302
|
+
metadata: metadata
|
|
303
|
+
}, holderRelations !== undefined && !isBookingProduct(origin) && !isBookingProduct(payload) ? {
|
|
304
|
+
_extend: {
|
|
305
|
+
holder_relations: holderRelations
|
|
306
|
+
}
|
|
307
|
+
} : {}), {}, {
|
|
298
308
|
note: payload.note != null ? String(payload.note) : '',
|
|
299
309
|
product_title: productTitle,
|
|
300
310
|
product_cover: firstNonBlank(matchedVariant === null || matchedVariant === void 0 ? void 0 : matchedVariant.cover, sourceProduct === null || sourceProduct === void 0 ? void 0 : sourceProduct.cover),
|
|
@@ -210,6 +210,7 @@ export declare class BookingByStepImpl extends BaseModule implements Module {
|
|
|
210
210
|
* product: ProductData;
|
|
211
211
|
* date?: { startTime: string; endTime: string } | null;
|
|
212
212
|
* account?: Account | null;
|
|
213
|
+
* isLegacyOrder?: boolean;
|
|
213
214
|
* })} {
|
|
214
215
|
* product,
|
|
215
216
|
* date,
|
|
@@ -218,13 +219,14 @@ export declare class BookingByStepImpl extends BaseModule implements Module {
|
|
|
218
219
|
* @return {*}
|
|
219
220
|
* @memberof BookingByStepImpl
|
|
220
221
|
*/
|
|
221
|
-
addProductToCart({ product, date, account, }: {
|
|
222
|
+
addProductToCart({ product, date, account, isLegacyOrder, }: {
|
|
222
223
|
product: ProductData;
|
|
223
224
|
date?: {
|
|
224
225
|
startTime: string;
|
|
225
226
|
endTime: string;
|
|
226
227
|
} | null;
|
|
227
228
|
account?: Account | null;
|
|
229
|
+
isLegacyOrder?: boolean;
|
|
228
230
|
}): {
|
|
229
231
|
success: boolean;
|
|
230
232
|
errorCode?: string;
|
|
@@ -326,7 +328,7 @@ export declare class BookingByStepImpl extends BaseModule implements Module {
|
|
|
326
328
|
date: string;
|
|
327
329
|
status: string;
|
|
328
330
|
week: string;
|
|
329
|
-
weekNum: 0 | 5 |
|
|
331
|
+
weekNum: 0 | 5 | 1 | 2 | 4 | 3 | 6;
|
|
330
332
|
}[]>;
|
|
331
333
|
submitTimeSlot(timeSlots: TimeSliceItem): void;
|
|
332
334
|
private getScheduleDataByIds;
|
|
@@ -1189,7 +1189,8 @@ export var BookingByStepImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
1189
1189
|
// 直接调用 addProductToCart,不传递 date 参数以避免日期检查逻辑
|
|
1190
1190
|
return this.addProductToCart({
|
|
1191
1191
|
product: productData,
|
|
1192
|
-
account: activeAccount
|
|
1192
|
+
account: activeAccount,
|
|
1193
|
+
isLegacyOrder: true
|
|
1193
1194
|
});
|
|
1194
1195
|
}
|
|
1195
1196
|
|
|
@@ -1200,6 +1201,7 @@ export var BookingByStepImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
1200
1201
|
* product: ProductData;
|
|
1201
1202
|
* date?: { startTime: string; endTime: string } | null;
|
|
1202
1203
|
* account?: Account | null;
|
|
1204
|
+
* isLegacyOrder?: boolean;
|
|
1203
1205
|
* })} {
|
|
1204
1206
|
* product,
|
|
1205
1207
|
* date,
|
|
@@ -1213,7 +1215,9 @@ export var BookingByStepImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
1213
1215
|
value: function addProductToCart(_ref6) {
|
|
1214
1216
|
var product = _ref6.product,
|
|
1215
1217
|
date = _ref6.date,
|
|
1216
|
-
account = _ref6.account
|
|
1218
|
+
account = _ref6.account,
|
|
1219
|
+
_ref6$isLegacyOrder = _ref6.isLegacyOrder,
|
|
1220
|
+
isLegacyOrder = _ref6$isLegacyOrder === void 0 ? false : _ref6$isLegacyOrder;
|
|
1217
1221
|
var _ref7 = product || {},
|
|
1218
1222
|
bundle = _ref7.bundle,
|
|
1219
1223
|
options = _ref7.options,
|
|
@@ -1278,7 +1282,8 @@ export var BookingByStepImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
1278
1282
|
product: productData,
|
|
1279
1283
|
bundle: bundle,
|
|
1280
1284
|
options: options,
|
|
1281
|
-
quantity: quantity
|
|
1285
|
+
quantity: quantity,
|
|
1286
|
+
isLegacyOrder: isLegacyOrder
|
|
1282
1287
|
};
|
|
1283
1288
|
if (date) {
|
|
1284
1289
|
addItemParams.date = date;
|
|
@@ -32,6 +32,7 @@ export declare class BookingTicketImpl extends BaseSalesImpl implements Module {
|
|
|
32
32
|
private orderCustomerDiscountRefreshCustomerId;
|
|
33
33
|
private orderCustomerDiscountRefreshTarget;
|
|
34
34
|
private orderCustomerPromotionRefreshInFlight;
|
|
35
|
+
private orderCustomerContactRequest;
|
|
35
36
|
private readonly customerResolveRequests;
|
|
36
37
|
protected loadOpenDataInFlight: Promise<OpenDataConfig> | null;
|
|
37
38
|
protected loadOpenDataInFlightTarget: string | null;
|
|
@@ -42,6 +43,10 @@ export declare class BookingTicketImpl extends BaseSalesImpl implements Module {
|
|
|
42
43
|
*/
|
|
43
44
|
protected getRegisteredModuleNames(): readonly string[];
|
|
44
45
|
protected getSubmitOrderSalesChannel(): string;
|
|
46
|
+
/** 供销售展示层按 booking.resources[].form_id 读取当前多语言表单标题。 */
|
|
47
|
+
getFormTitleMap(): Record<string, Record<string, string> | string>;
|
|
48
|
+
/** 表单定义由 Ably 更新后通知展示层刷新,不改动订单里的历史 metadata。 */
|
|
49
|
+
onFormTitlesChanged(callback: (titles: Record<string, Record<string, string> | string>) => void): () => void;
|
|
45
50
|
/**
|
|
46
51
|
* 业务侧子模块工厂:BookingTicket 自带的 createBookingTicketModule 优先匹配;
|
|
47
52
|
* 未识别的模块名(如 BookingByStep 公共类型)回退到父类工厂。
|
|
@@ -53,11 +58,13 @@ export declare class BookingTicketImpl extends BaseSalesImpl implements Module {
|
|
|
53
58
|
* 在解决方案对外 ready 前准备 Invoice Document;失败只降级模板,不阻断销售。
|
|
54
59
|
* 已由页面取得的 OpenData 直接交给模块接管,没有注入数据时再走 target-scoped 加载。
|
|
55
60
|
*/
|
|
56
|
-
|
|
61
|
+
protected prepareInvoiceTemplateAtSolutionReady(injectedOpenData?: OpenDataConfig): Promise<void>;
|
|
57
62
|
protected getBookingTicketBusinessCode(): string | null;
|
|
58
63
|
private getIdGeneratorPlugin;
|
|
59
|
-
|
|
64
|
+
protected loadOpenDataConfig(): Promise<OpenDataConfig | null>;
|
|
60
65
|
getOpenData(): Promise<OpenDataConfig | null>;
|
|
66
|
+
protected loadContactInfoOpenData(): Promise<OpenDataConfig | null>;
|
|
67
|
+
protected loadFulfillmentItemRuleOpenData(): Promise<OpenDataConfig | null>;
|
|
61
68
|
getInvoiceLayoutConfig(): Promise<InvoiceLayoutConfig>;
|
|
62
69
|
getInvoiceTemplateSettings(): Promise<InvoiceTemplateSettings>;
|
|
63
70
|
protected isInvoiceOpenDataCacheCurrent(): boolean;
|
|
@@ -66,6 +73,7 @@ export declare class BookingTicketImpl extends BaseSalesImpl implements Module {
|
|
|
66
73
|
private getShortNumberOrDeviceId;
|
|
67
74
|
private configureIdGeneratorFromOpenData;
|
|
68
75
|
private normalizePositiveInteger;
|
|
76
|
+
private normalizeShortNumberMaximum;
|
|
69
77
|
private normalizeIdPrefix;
|
|
70
78
|
/**
|
|
71
79
|
* 加载销售详情,并在父类基础上把 customer 信息装配到 CustomerModule。
|
|
@@ -275,6 +283,16 @@ export declare class BookingTicketImpl extends BaseSalesImpl implements Module {
|
|
|
275
283
|
setOrderCustomer(customer: ICustomer | null, options?: {
|
|
276
284
|
source?: OrderCustomerChangePayload['source'];
|
|
277
285
|
}): void;
|
|
286
|
+
private resetOrderCustomerContactInfo;
|
|
287
|
+
/** Explicit edits, including clearing the contact, must win over a pending default. */
|
|
288
|
+
updateTempOrderContactsInfo(contact: Record<string, any> | null): Record<string, any> | null;
|
|
289
|
+
private getCustomerContactScope;
|
|
290
|
+
private getCustomerContactOrderKey;
|
|
291
|
+
replaceTempOrder(...args: Parameters<BaseSalesImpl['replaceTempOrder']>): Promise<import("../../modules/Order/types").OrderTempOrder>;
|
|
292
|
+
private applyDefaultOrderCustomerContactInfo;
|
|
293
|
+
private prefillOrderCustomerContactInfo;
|
|
294
|
+
protected waitForOrderCustomerContactInfo(): Promise<void>;
|
|
295
|
+
validateContactInfo(): Promise<void>;
|
|
278
296
|
/**
|
|
279
297
|
* 读取 tempOrder 上的下单客户协议字段;customer_id 缺失时返回 null。
|
|
280
298
|
*/
|
|
@@ -286,7 +304,9 @@ export declare class BookingTicketImpl extends BaseSalesImpl implements Module {
|
|
|
286
304
|
/**
|
|
287
305
|
* 清空下单客户(协议字段 + snapshot)。
|
|
288
306
|
*/
|
|
289
|
-
clearOrderCustomer(
|
|
307
|
+
clearOrderCustomer(options?: {
|
|
308
|
+
preserveContactInfo?: boolean;
|
|
309
|
+
}): void;
|
|
290
310
|
/**
|
|
291
311
|
* 重置 tempOrder,并同步清空下单客户运行态。
|
|
292
312
|
*
|