@pisell/pisellos 2.2.321 → 2.2.323
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/Order/index.d.ts +1 -1
- package/dist/modules/Order/utils.js +12 -1
- package/dist/modules/Product/index.d.ts +1 -1
- package/dist/modules/Product/types.d.ts +5 -0
- package/dist/server/index.js +3 -1
- package/dist/server/modules/order/types.d.ts +2 -0
- package/dist/server/modules/order/utils/filterOrders.js +20 -0
- package/dist/solution/BaseSales/index.d.ts +1 -0
- package/dist/solution/BaseSales/index.js +298 -209
- package/dist/solution/BaseSales/types.d.ts +3 -0
- package/dist/solution/BaseSales/utils/posDurationPricing.d.ts +21 -0
- package/dist/solution/BaseSales/utils/posDurationPricing.js +174 -0
- package/dist/solution/BaseSales/utils/transformBaseProductToOrderProduct.d.ts +2 -0
- package/dist/solution/BaseSales/utils/transformBaseProductToOrderProduct.js +8 -8
- package/dist/solution/BookingByStep/index.d.ts +3 -3
- package/dist/solution/BookingTicket/index.d.ts +1 -13
- package/dist/solution/UnifiedBookingSales/index.js +34 -16
- package/lib/modules/Order/index.d.ts +1 -1
- package/lib/modules/Order/utils.js +13 -0
- package/lib/modules/Product/index.d.ts +1 -1
- package/lib/modules/Product/types.d.ts +5 -0
- package/lib/server/index.js +4 -1
- package/lib/server/modules/order/types.d.ts +2 -0
- package/lib/server/modules/order/utils/filterOrders.js +18 -0
- package/lib/solution/BaseSales/index.d.ts +1 -0
- package/lib/solution/BaseSales/index.js +95 -36
- package/lib/solution/BaseSales/types.d.ts +3 -0
- package/lib/solution/BaseSales/utils/posDurationPricing.d.ts +21 -0
- package/lib/solution/BaseSales/utils/posDurationPricing.js +133 -0
- package/lib/solution/BaseSales/utils/transformBaseProductToOrderProduct.d.ts +2 -0
- package/lib/solution/BaseSales/utils/transformBaseProductToOrderProduct.js +1 -1
- package/lib/solution/BookingByStep/index.d.ts +3 -3
- package/lib/solution/BookingTicket/index.d.ts +1 -13
- package/lib/solution/UnifiedBookingSales/index.js +23 -1
- package/package.json +1 -1
|
@@ -595,7 +595,7 @@ export declare class OrderModule extends BaseModule implements Module, OrderModu
|
|
|
595
595
|
generateIdempotencyToken(): string;
|
|
596
596
|
syncPaymentsToOrder<T = any>(params: SyncPaymentsToOrderParams): Promise<SyncPaymentsToOrderResult<T>>;
|
|
597
597
|
createOrder(params: CommitOrderParams['query']): {
|
|
598
|
-
type: "
|
|
598
|
+
type: "appointment_booking" | "virtual";
|
|
599
599
|
platform: string;
|
|
600
600
|
sales_channel: string;
|
|
601
601
|
order_sales_channel: string;
|
|
@@ -1218,7 +1218,7 @@ function formatSubmitBundleItems(bundle) {
|
|
|
1218
1218
|
* 法币仅做字段/metadata 裁剪;虚拟币在出站前再次执行零加价与固定单价断言。
|
|
1219
1219
|
*/
|
|
1220
1220
|
function normalizeSubmitProduct(product) {
|
|
1221
|
-
var _ref39, _submitProduct$bundle, _rawMetadata$product_, _rawMetadata$selected, _rawMetadata$selected2, _submitProduct$produc, _submitProduct$paymen;
|
|
1221
|
+
var _ref39, _submitProduct$bundle, _rawMetadata$pricing_, _rawMetadata$product_, _rawMetadata$selected, _rawMetadata$selected2, _submitProduct$produc, _submitProduct$paymen;
|
|
1222
1222
|
var formatOptions = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
1223
1223
|
var _ref38 = product,
|
|
1224
1224
|
_runtimeUid = _ref38.unique_identification_number,
|
|
@@ -1252,6 +1252,17 @@ function normalizeSubmitProduct(product) {
|
|
|
1252
1252
|
cleanMetadata[key] = rawMetadata[key];
|
|
1253
1253
|
}
|
|
1254
1254
|
}
|
|
1255
|
+
// Persist only an applied pricing snapshot, so reopening a saved order can
|
|
1256
|
+
// compare it with the latest catalog without reinterpreting legacy duration.
|
|
1257
|
+
var pricingMethod = (_rawMetadata$pricing_ = rawMetadata.pricing_method) === null || _rawMetadata$pricing_ === void 0 ? void 0 : _rawMetadata$pricing_.type;
|
|
1258
|
+
if (pricingMethod === 'duration_based' || pricingMethod === 'fixed_price') {
|
|
1259
|
+
cleanMetadata.pricing_method = {
|
|
1260
|
+
type: pricingMethod
|
|
1261
|
+
};
|
|
1262
|
+
if (pricingMethod === 'duration_based' && rawMetadata.duration) {
|
|
1263
|
+
cleanMetadata.duration = _objectSpread({}, rawMetadata.duration);
|
|
1264
|
+
}
|
|
1265
|
+
}
|
|
1255
1266
|
cleanMetadata.product_discount_difference = (_rawMetadata$product_ = rawMetadata.product_discount_difference) !== null && _rawMetadata$product_ !== void 0 ? _rawMetadata$product_ : '';
|
|
1256
1267
|
if (rawMetadata.price_breakdown) {
|
|
1257
1268
|
cleanMetadata.price_breakdown = rawMetadata.price_breakdown;
|
|
@@ -49,5 +49,5 @@ export declare class Product extends BaseModule implements Module {
|
|
|
49
49
|
getCategories(): ProductCategory[];
|
|
50
50
|
setOtherParams(key: string, value: any): void;
|
|
51
51
|
getOtherParams(): any;
|
|
52
|
-
getProductType(): "
|
|
52
|
+
getProductType(): "duration" | "session" | "normal";
|
|
53
53
|
}
|
|
@@ -42,6 +42,9 @@ export interface ProductSettlementOption extends Record<string, any> {
|
|
|
42
42
|
available: boolean;
|
|
43
43
|
disabled_reason?: string;
|
|
44
44
|
}
|
|
45
|
+
export interface ProductPricingMethod {
|
|
46
|
+
type: 'fixed_price' | 'duration_based';
|
|
47
|
+
}
|
|
45
48
|
/**
|
|
46
49
|
* 商品基本信息接口
|
|
47
50
|
*/
|
|
@@ -74,6 +77,8 @@ export interface ProductData {
|
|
|
74
77
|
sum_stock: number;
|
|
75
78
|
/** 商品价格 */
|
|
76
79
|
price: string;
|
|
80
|
+
/** POS booking pricing; missing configuration retains existing fixed pricing. */
|
|
81
|
+
pricing_method?: ProductPricingMethod;
|
|
77
82
|
/** 当前上下文解析出的可选结算货币 */
|
|
78
83
|
available_settlement_options?: ProductSettlementOption[];
|
|
79
84
|
/** 商品原价 */
|
package/dist/server/index.js
CHANGED
|
@@ -4873,7 +4873,9 @@ var Server = /*#__PURE__*/function () {
|
|
|
4873
4873
|
case 3:
|
|
4874
4874
|
_context52.prev = 3;
|
|
4875
4875
|
_context52.next = 6;
|
|
4876
|
-
return this.app.request.post('/shop/order/v2/list', data, {
|
|
4876
|
+
return this.app.request.post('/shop/order/v2/list', _objectSpread(_objectSpread({}, data), {}, {
|
|
4877
|
+
with: _toConsumableArray(new Set([].concat(_toConsumableArray(Array.isArray(data.with) ? data.with : []), ['buzzer'])))
|
|
4878
|
+
}), {
|
|
4877
4879
|
isShopApi: true
|
|
4878
4880
|
});
|
|
4879
4881
|
case 6:
|
|
@@ -519,6 +519,8 @@ export interface OrderFilters {
|
|
|
519
519
|
max_total_amount?: number;
|
|
520
520
|
tag_ids?: (string | number)[];
|
|
521
521
|
shipping_type?: string[];
|
|
522
|
+
/** 交付方式,精确匹配 metadata.shop_service_data.service_type;多选之间为 OR */
|
|
523
|
+
service_type?: string[];
|
|
522
524
|
delivery_zone_name?: string;
|
|
523
525
|
location_id?: string | number;
|
|
524
526
|
shipping_order_number?: string;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
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); }
|
|
1
2
|
import dayjs from 'dayjs';
|
|
2
3
|
/** 从订单 payments 提取支付方式 code,与 UI 筛选选项及 filterBookings 一致 */
|
|
3
4
|
function getOrderPaymentCodes(order) {
|
|
@@ -248,6 +249,25 @@ export function filterOrders(orders, filters) {
|
|
|
248
249
|
}
|
|
249
250
|
}
|
|
250
251
|
|
|
252
|
+
// service_type - 交付方式(同组多选 OR,与其他条件 AND)
|
|
253
|
+
if (Array.isArray(safeFilters.service_type) && safeFilters.service_type.length > 0) {
|
|
254
|
+
var _order$metadata;
|
|
255
|
+
var shopServiceData = (_order$metadata = order.metadata) === null || _order$metadata === void 0 ? void 0 : _order$metadata.shop_service_data;
|
|
256
|
+
var serviceType = shopServiceData && _typeof(shopServiceData) === 'object' ? shopServiceData.service_type : undefined;
|
|
257
|
+
if (typeof serviceType !== 'string' || !safeFilters.service_type.includes(serviceType)) {
|
|
258
|
+
rejected.push({
|
|
259
|
+
order_id: order.order_id,
|
|
260
|
+
order_number: order.order_number,
|
|
261
|
+
reason: {
|
|
262
|
+
field: 'service_type',
|
|
263
|
+
actual: serviceType,
|
|
264
|
+
expected: safeFilters.service_type
|
|
265
|
+
}
|
|
266
|
+
});
|
|
267
|
+
return false;
|
|
268
|
+
}
|
|
269
|
+
}
|
|
270
|
+
|
|
251
271
|
// delivery_zone_name - 配送区域(模糊匹配)
|
|
252
272
|
if (safeFilters.delivery_zone_name !== undefined && safeFilters.delivery_zone_name !== null && safeFilters.delivery_zone_name !== '') {
|
|
253
273
|
if (!order.delivery_zone_name || !order.delivery_zone_name.toLowerCase().includes(safeFilters.delivery_zone_name.toLowerCase())) {
|
|
@@ -524,6 +524,7 @@ export declare class BaseSalesImpl extends BaseModule implements Module {
|
|
|
524
524
|
getQuotationCustomerScopeInfo(): BaseSalesQuotationCustomerScopeInfo;
|
|
525
525
|
private hasSmartPricingStrategies;
|
|
526
526
|
shouldRecalculateProductBookingPricesForContextChange(params: BaseSalesPriceRecalculationContextChange): boolean;
|
|
527
|
+
private resolveProductBookingPriceGroups;
|
|
527
528
|
calculateProductBookingPrices(paramsList: BaseSalesCalculateProductBookingPriceParams[]): Promise<BaseSalesProductBookingPriceResult[]>;
|
|
528
529
|
addProductToOrder(product: Partial<BaseSalesOrderProduct> & BaseSalesOrderProductIdentity, booking?: AddProductBookingInput, options?: AddProductToOrderOptions): Promise<import("../../modules/Order/types").OrderProduct[]>;
|
|
529
530
|
updateOrderProduct(params: UpdateOrderProductParams): Promise<import("../../modules/Order/types").OrderProduct[]>;
|