@pisell/pisellos 2.2.265 → 2.2.267
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/model/strategy/adapter/promotion/index.js +0 -9
- package/dist/modules/BookingContext/utils/buildCacheItemFromOrderLine.js +5 -3
- package/dist/modules/BookingContext/utils/buildNormalProductCacheItemFromOrderLine.js +6 -3
- package/dist/modules/Order/index.d.ts +8 -27
- package/dist/modules/Order/index.js +490 -743
- package/dist/modules/Order/types.d.ts +1 -33
- package/dist/modules/Order/utils/orderCollectionIdentity.js +2 -7
- package/dist/modules/Order/utils.js +5 -8
- package/dist/modules/Payment/index.d.ts +0 -2
- package/dist/modules/Payment/index.js +50 -79
- package/dist/modules/Payment/types.d.ts +27 -29
- package/dist/modules/Payment/types.js +3 -5
- package/dist/server/index.d.ts +0 -16
- package/dist/server/index.js +1036 -1933
- package/dist/server/modules/order/index.d.ts +4 -49
- package/dist/server/modules/order/index.js +695 -1574
- package/dist/server/modules/order/types.d.ts +3 -11
- package/dist/server/modules/order/types.js +1 -1
- package/dist/solution/BaseSales/index.d.ts +11 -42
- package/dist/solution/BaseSales/index.js +385 -676
- package/dist/solution/BaseSales/utils/cartPromotion.js +5 -3
- package/dist/solution/BaseSales/utils/parseSalesResponse.d.ts +1 -6
- package/dist/solution/BookingTicket/index.d.ts +1 -1
- package/dist/solution/BookingTicket/index.js +1 -2
- package/dist/solution/BookingTicket/utils/addProductDecision.js +6 -0
- package/dist/solution/BookingTicket/utils/weighingProductSku.d.ts +5 -0
- package/dist/solution/BookingTicket/utils/weighingProductSku.js +45 -0
- package/dist/solution/Sales/index.d.ts +0 -1
- package/dist/solution/Sales/index.js +2 -10
- package/lib/model/strategy/adapter/promotion/index.js +0 -49
- package/lib/modules/BookingContext/utils/buildCacheItemFromOrderLine.js +2 -1
- package/lib/modules/BookingContext/utils/buildNormalProductCacheItemFromOrderLine.js +2 -1
- package/lib/modules/Order/index.d.ts +8 -27
- package/lib/modules/Order/index.js +69 -184
- package/lib/modules/Order/types.d.ts +1 -33
- package/lib/modules/Order/utils/orderCollectionIdentity.js +0 -3
- package/lib/modules/Order/utils.js +3 -5
- package/lib/modules/Payment/index.d.ts +0 -2
- package/lib/modules/Payment/index.js +13 -34
- package/lib/modules/Payment/types.d.ts +27 -29
- package/lib/modules/Payment/types.js +3 -3
- package/lib/server/index.d.ts +0 -16
- package/lib/server/index.js +18 -670
- package/lib/server/modules/order/index.d.ts +4 -49
- package/lib/server/modules/order/index.js +66 -657
- package/lib/server/modules/order/types.d.ts +3 -11
- package/lib/solution/BaseSales/index.d.ts +11 -42
- package/lib/solution/BaseSales/index.js +35 -214
- package/lib/solution/BaseSales/utils/cartPromotion.js +5 -2
- package/lib/solution/BaseSales/utils/parseSalesResponse.d.ts +1 -6
- package/lib/solution/BookingTicket/index.d.ts +1 -1
- package/lib/solution/BookingTicket/index.js +1 -2
- package/lib/solution/BookingTicket/utils/addProductDecision.js +4 -0
- package/lib/solution/BookingTicket/utils/weighingProductSku.d.ts +5 -0
- package/lib/solution/BookingTicket/utils/weighingProductSku.js +63 -0
- package/lib/solution/Sales/index.d.ts +0 -1
- package/lib/solution/Sales/index.js +3 -5
- package/package.json +2 -2
- package/dist/modules/Order/payment-utils.d.ts +0 -26
- package/dist/modules/Order/payment-utils.js +0 -225
- package/dist/utils/payment-number.d.ts +0 -9
- package/dist/utils/payment-number.js +0 -69
- package/lib/modules/Order/payment-utils.d.ts +0 -26
- package/lib/modules/Order/payment-utils.js +0 -224
- package/lib/utils/payment-number.d.ts +0 -9
- package/lib/utils/payment-number.js +0 -64
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
// 导出评估器
|
|
2
|
-
export { PromotionEvaluator } from "./evaluator";
|
|
3
|
-
|
|
4
|
-
// 导出适配器
|
|
5
|
-
export { PromotionAdapter } from "./adapter";
|
|
6
|
-
export { default } from "./adapter";
|
|
7
|
-
|
|
8
|
-
// 导出策略配置示例常量
|
|
9
|
-
export { X_ITEMS_FOR_Y_PRICE_STRATEGY, BUY_X_GET_Y_FREE_STRATEGY } from "./examples";
|
|
@@ -190,7 +190,7 @@ function synthesizeProductResourceFromBooking(booking) {
|
|
|
190
190
|
* 调用方须传入与该行关联的 booking(通常 bookings[].product_uid === product.metadata.unique_identification_number)。
|
|
191
191
|
*/
|
|
192
192
|
export function buildCacheItemFromOrderLine(input) {
|
|
193
|
-
var _product$product_id, _product$selling_pric, _product$original_pri, _booking$metadata$hol, _booking$metadata2, _product$product_vari, _product$num, _ref10, _product$note, _booking$detail2, _product$metadata, _product$metadata2, _ref11, _extension_type, _booking$product2, _booking$product3, _price, _product$order_detail, _ref12, _booking$id;
|
|
193
|
+
var _product$product_id, _product$selling_pric, _product$original_pri, _booking$metadata$hol, _booking$metadata2, _product$product_vari, _product$num, _ref10, _product$note, _booking$detail2, _product$metadata, _product$metadata2, _ref11, _extension_type, _booking$product2, _booking$product3, _price, _product$product_sku, _product$order_detail, _ref12, _booking$id;
|
|
194
194
|
var product = input.product,
|
|
195
195
|
booking = input.booking,
|
|
196
196
|
sourceProduct = input.sourceProduct;
|
|
@@ -257,7 +257,7 @@ export function buildCacheItemFromOrderLine(input) {
|
|
|
257
257
|
if (Array.isArray(booking.relation_forms)) {
|
|
258
258
|
extend.relation_forms = booking.relation_forms;
|
|
259
259
|
}
|
|
260
|
-
var base = _objectSpread(_objectSpread(_objectSpread({}, sourceProduct || {}), {}, {
|
|
260
|
+
var base = _objectSpread(_objectSpread(_objectSpread(_objectSpread({}, sourceProduct || {}), {}, {
|
|
261
261
|
id: resolvedId,
|
|
262
262
|
product_id: resolvedId,
|
|
263
263
|
extension_type: (_ref11 = (_extension_type = sourceProduct === null || sourceProduct === void 0 ? void 0 : sourceProduct.extension_type) !== null && _extension_type !== void 0 ? _extension_type : booking === null || booking === void 0 || (_booking$product2 = booking.product) === null || _booking$product2 === void 0 ? void 0 : _booking$product2.extension_type) !== null && _ref11 !== void 0 ? _ref11 : sourceProduct === null || sourceProduct === void 0 ? void 0 : sourceProduct.extension_type,
|
|
@@ -265,7 +265,9 @@ export function buildCacheItemFromOrderLine(input) {
|
|
|
265
265
|
price: (_price = sourceProduct === null || sourceProduct === void 0 ? void 0 : sourceProduct.price) !== null && _price !== void 0 ? _price : selling,
|
|
266
266
|
selling_price: product.selling_price,
|
|
267
267
|
original_price: product.original_price
|
|
268
|
-
},
|
|
268
|
+
}, Number(((_product$product_sku = product.product_sku) === null || _product$product_sku === void 0 ? void 0 : _product$product_sku.open_sold_weight) || 0) === 1 ? {
|
|
269
|
+
product_sku: JSON.parse(JSON.stringify(product.product_sku))
|
|
270
|
+
} : {}), productOptionString ? {
|
|
269
271
|
product_option_string: productOptionString
|
|
270
272
|
} : {}), {}, {
|
|
271
273
|
_extend: extend,
|
|
@@ -75,7 +75,7 @@ function mapOrderBundleToOtherBundle(bundle) {
|
|
|
75
75
|
});
|
|
76
76
|
}
|
|
77
77
|
export function buildNormalProductCacheItemFromOrderLine(input) {
|
|
78
|
-
var _product$product_id, _product$selling_pric2, _product$original_pri, _product$metadata, _product$metadata2, _product$product_vari, _originExtend$other, _product$num, _product$product_vari2, _product$num2, _title, _product$note, _originExtend$price, _originExtend$total, _originExtend$origin_, _product$metadata3, _ref6, _title2, _ref7, _cover, _price3, _product$order_detail;
|
|
78
|
+
var _product$product_id, _product$selling_pric2, _product$original_pri, _product$metadata, _product$metadata2, _product$product_vari, _originExtend$other, _product$num, _product$product_vari2, _product$num2, _title, _product$note, _originExtend$price, _originExtend$total, _originExtend$origin_, _product$metadata3, _ref6, _title2, _ref7, _cover, _price3, _product$order_detail, _product$product_sku;
|
|
79
79
|
var product = input.product,
|
|
80
80
|
sourceProduct = input.sourceProduct;
|
|
81
81
|
var resolvedId = (_product$product_id = product.product_id) !== null && _product$product_id !== void 0 ? _product$product_id : sourceProduct === null || sourceProduct === void 0 ? void 0 : sourceProduct.id;
|
|
@@ -127,7 +127,7 @@ export function buildNormalProductCacheItemFromOrderLine(input) {
|
|
|
127
127
|
extend.skuValue = JSON.parse(JSON.stringify(originExtend.skuValue || originExtend._skuValue));
|
|
128
128
|
extend._skuValue = JSON.parse(JSON.stringify(extend.skuValue));
|
|
129
129
|
}
|
|
130
|
-
return _objectSpread(_objectSpread(_objectSpread({}, sourceProduct || {}), {}, {
|
|
130
|
+
return _objectSpread(_objectSpread(_objectSpread(_objectSpread({}, sourceProduct || {}), {}, {
|
|
131
131
|
id: resolvedId,
|
|
132
132
|
product_id: resolvedId,
|
|
133
133
|
_id: uid,
|
|
@@ -141,7 +141,10 @@ export function buildNormalProductCacheItemFromOrderLine(input) {
|
|
|
141
141
|
} : {}), {}, {
|
|
142
142
|
note: product.note,
|
|
143
143
|
order_detail_id: (_product$order_detail = product.order_detail_id) !== null && _product$order_detail !== void 0 ? _product$order_detail : null,
|
|
144
|
-
discount_list: discountList
|
|
144
|
+
discount_list: discountList
|
|
145
|
+
}, Number(((_product$product_sku = product.product_sku) === null || _product$product_sku === void 0 ? void 0 : _product$product_sku.open_sold_weight) || 0) === 1 ? {
|
|
146
|
+
product_sku: JSON.parse(JSON.stringify(product.product_sku))
|
|
147
|
+
} : {}), {}, {
|
|
145
148
|
new: 0,
|
|
146
149
|
autoClose: true,
|
|
147
150
|
_extend: extend
|
|
@@ -3,7 +3,7 @@ import { BaseModule } from '../BaseModule';
|
|
|
3
3
|
import { OrderModuleAPI, CommitOrderParams, UpdateOrderBookingParams, UpdateOrderProductParams, UpdateOrderProductQuantityParams, CheckoutOrderParams, CancelOrderParams, ChangeBookingStatusParams } from './types';
|
|
4
4
|
import { CartItem } from '../Cart/types';
|
|
5
5
|
import { type SubmitPayloadEnhancer } from './utils';
|
|
6
|
-
import type { OrderAmountSnapshot, AddProductBookingInput, OrderIdentitySnapshot, OrderPaymentSource, OrderSnapshot, OrderSyncState, SyncPaymentsToOrderParams, SyncPaymentsToOrderResult, SubmitSalesOrderParams, OrderProduct, OrderProductIdentity, OrderSummary, OrderTempOrder, OrderPaymentData,
|
|
6
|
+
import type { OrderAmountSnapshot, AddProductBookingInput, OrderIdentitySnapshot, OrderPaymentSource, OrderSnapshot, OrderSyncState, SyncPaymentsToOrderParams, SyncPaymentsToOrderResult, SubmitSalesOrderParams, OrderProduct, OrderProductIdentity, OrderSummary, OrderTempOrder, OrderPaymentData, SendCustomerPayLinkParams, UpdateTempOrderCustomerInput, OrderCustomerPatch, OrderCustomerView, ReplaceTempOrderOptions, OrderPromotionEvaluator, OrderGiftSelectResolver, OrderUnfulfilledPromotion, OrderLastGiftActions } from './types';
|
|
7
7
|
import type { ICustomer } from '../AccountList/types';
|
|
8
8
|
import type { Discount } from '../Discount/types';
|
|
9
9
|
import { UnavailableReason } from '../Rules/types';
|
|
@@ -14,7 +14,6 @@ export declare class OrderModule extends BaseModule implements Module, OrderModu
|
|
|
14
14
|
private request;
|
|
15
15
|
private logger;
|
|
16
16
|
private window;
|
|
17
|
-
private appPlugin;
|
|
18
17
|
private cacheId;
|
|
19
18
|
private salesSummaryModuleName;
|
|
20
19
|
private rulesHooksOverride?;
|
|
@@ -177,9 +176,6 @@ export declare class OrderModule extends BaseModule implements Module, OrderModu
|
|
|
177
176
|
};
|
|
178
177
|
private calculateDepositPaidAmount;
|
|
179
178
|
private resolveNextOrderPaymentType;
|
|
180
|
-
private getPaymentNumberAppData;
|
|
181
|
-
private getPaymentNumberDevicePrefixSync;
|
|
182
|
-
private getPaymentNumberDevicePrefixAsync;
|
|
183
179
|
private normalizePaymentSource;
|
|
184
180
|
private updateTempOrderPaymentStatus;
|
|
185
181
|
private shouldKeepPaymentStatusAfterAmountRecalc;
|
|
@@ -311,20 +307,19 @@ export declare class OrderModule extends BaseModule implements Module, OrderModu
|
|
|
311
307
|
* 用一组支付来源覆盖当前订单支付项。
|
|
312
308
|
*
|
|
313
309
|
* 入参允许来自 PaymentModule 的 PaymentItem,内部统一映射为 Sales 协议:
|
|
314
|
-
*
|
|
310
|
+
* uuid -> metadata.unique_payment_number,id -> custom_payment_id,
|
|
315
311
|
* isSynced 等运行态字段不会进入 tempOrder.payments。
|
|
316
312
|
*/
|
|
317
313
|
setOrderPayments(payments: OrderPaymentSource[]): OrderPaymentData[];
|
|
318
|
-
/**
|
|
314
|
+
/** 追加单个支付项,并立即持久化当前 tempOrder。 */
|
|
319
315
|
addOrderPayment(payment: OrderPaymentSource): OrderPaymentData[];
|
|
320
|
-
/** 异步入口:创建支付项时读取最新 IoT 设备短号。 */
|
|
321
|
-
addOrderPaymentAsync(payment: OrderPaymentSource): Promise<OrderPaymentData[]>;
|
|
322
|
-
private addOrderPaymentWithDevicePrefix;
|
|
323
316
|
/**
|
|
324
|
-
*
|
|
325
|
-
*
|
|
317
|
+
* 按支付唯一号、后端支付 ID、自定义支付方式 ID 或旧 uuid 更新支付项。
|
|
318
|
+
*
|
|
319
|
+
* 该方法服务 PaymentModal 的 void / 编辑场景;更新 metadata 时会做浅合并,
|
|
320
|
+
* 避免覆盖 unique_payment_number、现金实付/找零等已有元数据。
|
|
326
321
|
*/
|
|
327
|
-
updateOrderPayment(paymentIdentity: string | number, updates: Partial<OrderPaymentData> & Record<string, any
|
|
322
|
+
updateOrderPayment(paymentIdentity: string | number, updates: Partial<OrderPaymentData> & Record<string, any>): OrderPaymentData[];
|
|
328
323
|
/** 从当前订单支付项中移除指定支付项。 */
|
|
329
324
|
deleteOrderPayment(paymentIdentity: string | number): OrderPaymentData[];
|
|
330
325
|
private confirmPendingVoucherPaymentsInList;
|
|
@@ -347,11 +342,7 @@ export declare class OrderModule extends BaseModule implements Module, OrderModu
|
|
|
347
342
|
*/
|
|
348
343
|
updateVoucherOrderPayments(payments: OrderPaymentSource[], options?: {
|
|
349
344
|
status?: 'paid' | 'payment_pending';
|
|
350
|
-
devicePrefix?: string;
|
|
351
345
|
}): OrderPaymentData[];
|
|
352
|
-
updateVoucherOrderPaymentsAsync(payments: OrderPaymentSource[], options?: {
|
|
353
|
-
status?: 'paid' | 'payment_pending';
|
|
354
|
-
}): Promise<OrderPaymentData[]>;
|
|
355
346
|
private shouldMergeProductToOrder;
|
|
356
347
|
private hasOrderProductLineNote;
|
|
357
348
|
/**
|
|
@@ -436,14 +427,6 @@ export declare class OrderModule extends BaseModule implements Module, OrderModu
|
|
|
436
427
|
type?: string;
|
|
437
428
|
}): import("./types").OrderSubmitPayload;
|
|
438
429
|
applyLocalPrintOrderNumbers(order?: Record<string, any> | null): Promise<OrderTempOrder>;
|
|
439
|
-
saveTempOrderAsDraft<T = any>(params?: {
|
|
440
|
-
cacheId?: string;
|
|
441
|
-
platform?: string;
|
|
442
|
-
businessCode?: string;
|
|
443
|
-
channel?: string;
|
|
444
|
-
type?: string;
|
|
445
|
-
enhancePayload?: SubmitPayloadEnhancer;
|
|
446
|
-
}): Promise<T>;
|
|
447
430
|
/**
|
|
448
431
|
* 提交当前 Sales tempOrder。
|
|
449
432
|
*
|
|
@@ -548,8 +531,6 @@ export declare class OrderModule extends BaseModule implements Module, OrderModu
|
|
|
548
531
|
*/
|
|
549
532
|
private seedAnonymousBookingUidsFromProducts;
|
|
550
533
|
private normalizeTempOrderForRuntime;
|
|
551
|
-
private isSyntheticDraftOrderIdForRuntime;
|
|
552
|
-
private withoutSyntheticDraftOrderIdForRuntime;
|
|
553
534
|
private hydrateLinkedBookingIdentity;
|
|
554
535
|
private pickHydratedDisplayText;
|
|
555
536
|
private formatHydratedNamePair;
|