@pisell/pisellos 2.2.189 → 2.2.191
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 +2 -1
- package/dist/modules/BookingContext/utils/buildNormalProductCacheItemFromOrderLine.js +2 -7
- package/dist/modules/Cart/utils/cartProduct.js +13 -2
- package/dist/modules/Order/index.d.ts +1 -3
- package/dist/modules/Order/index.js +88 -114
- package/dist/modules/Order/types.d.ts +10 -6
- package/dist/modules/Order/utils.d.ts +9 -2
- package/dist/modules/Order/utils.js +36 -13
- package/dist/modules/SalesSummary/types.d.ts +3 -1
- package/dist/modules/SalesSummary/utils.js +7 -3
- package/dist/server/modules/order/index.d.ts +126 -6
- package/dist/server/modules/order/index.js +1204 -285
- package/dist/server/modules/order/types.d.ts +0 -2
- package/dist/server/modules/products/index.d.ts +90 -6
- package/dist/server/modules/products/index.js +1017 -361
- package/dist/solution/BaseSales/index.js +54 -39
- package/dist/solution/BaseSales/types.d.ts +8 -5
- package/dist/solution/BaseSales/types.js +2 -3
- package/dist/solution/BaseSales/utils/cartPromotion.js +7 -7
- package/dist/solution/BaseSales/utils/transformBaseProductToOrderProduct.d.ts +1 -0
- package/dist/solution/BaseSales/utils/transformBaseProductToOrderProduct.js +29 -14
- package/dist/solution/BaseSales/utils.d.ts +1 -1
- package/dist/solution/BaseSales/utils.js +22 -19
- package/dist/solution/BookingByStep/index.d.ts +1 -1
- package/dist/solution/ScanOrder/index.js +7 -5
- package/dist/solution/ScanOrder/types.d.ts +8 -5
- package/dist/solution/ScanOrder/types.js +2 -3
- package/dist/solution/ScanOrder/utils.d.ts +1 -1
- package/dist/solution/ScanOrder/utils.js +26 -23
- package/dist/solution/VenueBooking/index.js +5 -3
- package/dist/solution/VenueBooking/sales-section-4-annotated.json +0 -2
- 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/Cart/utils/cartProduct.js +9 -2
- package/lib/modules/Order/index.d.ts +1 -3
- package/lib/modules/Order/index.js +50 -63
- package/lib/modules/Order/types.d.ts +10 -6
- package/lib/modules/Order/utils.d.ts +9 -2
- package/lib/modules/Order/utils.js +41 -10
- package/lib/modules/SalesSummary/types.d.ts +3 -1
- package/lib/modules/SalesSummary/utils.js +5 -3
- package/lib/server/modules/order/index.d.ts +126 -6
- package/lib/server/modules/order/index.js +722 -42
- package/lib/server/modules/order/types.d.ts +0 -2
- package/lib/server/modules/products/index.d.ts +90 -6
- package/lib/server/modules/products/index.js +492 -30
- package/lib/solution/BaseSales/index.js +26 -8
- package/lib/solution/BaseSales/types.d.ts +8 -5
- package/lib/solution/BaseSales/utils/cartPromotion.js +6 -6
- package/lib/solution/BaseSales/utils/transformBaseProductToOrderProduct.d.ts +1 -0
- package/lib/solution/BaseSales/utils/transformBaseProductToOrderProduct.js +32 -16
- package/lib/solution/BaseSales/utils.d.ts +1 -1
- package/lib/solution/BaseSales/utils.js +11 -7
- package/lib/solution/BookingByStep/index.d.ts +1 -1
- package/lib/solution/ScanOrder/index.js +4 -4
- package/lib/solution/ScanOrder/types.d.ts +8 -5
- package/lib/solution/ScanOrder/utils.d.ts +1 -1
- package/lib/solution/ScanOrder/utils.js +12 -8
- package/lib/solution/VenueBooking/index.js +2 -2
- package/lib/solution/VenueBooking/sales-section-4-annotated.json +0 -2
- package/package.json +1 -1
- package/dist/solution/Checkout/appointmentDemo.json +0 -1
- package/lib/solution/Checkout/appointmentDemo.json +0 -1
|
@@ -266,7 +266,16 @@ var BaseSalesImpl = class extends import_BaseModule.BaseModule {
|
|
|
266
266
|
product_variant_id: product.product_variant_id ?? authoritativeProduct.product_variant_id ?? 0,
|
|
267
267
|
num: product.num ?? product.quantity ?? authoritativeProduct.num,
|
|
268
268
|
quantity: product.quantity ?? product.num ?? authoritativeProduct.quantity,
|
|
269
|
-
|
|
269
|
+
product_sku: (() => {
|
|
270
|
+
const authoritativeSku = (0, import_utils.ensureProductSku)(authoritativeProduct);
|
|
271
|
+
const productSku = (0, import_utils.ensureProductSku)(product);
|
|
272
|
+
const hasProductSku = product.product_sku && typeof product.product_sku === "object";
|
|
273
|
+
return {
|
|
274
|
+
...authoritativeSku,
|
|
275
|
+
...productSku,
|
|
276
|
+
option: hasProductSku ? productSku.option : authoritativeSku.option
|
|
277
|
+
};
|
|
278
|
+
})(),
|
|
270
279
|
product_bundle: productBundle,
|
|
271
280
|
metadata: product.metadata ?? authoritativeProduct.metadata
|
|
272
281
|
};
|
|
@@ -823,7 +832,7 @@ var BaseSalesImpl = class extends import_BaseModule.BaseModule {
|
|
|
823
832
|
(sum, pd) => sum + Number(pd.amount || 0),
|
|
824
833
|
0
|
|
825
834
|
);
|
|
826
|
-
const optionSum = (0, import_utils.sumOptionUnitPrice)(
|
|
835
|
+
const optionSum = (0, import_utils.sumOptionUnitPrice)((0, import_utils.getProductSkuOptions)(product));
|
|
827
836
|
const sourcePrice = ((_t = product.metadata) == null ? void 0 : _t.source_product_price) ?? (((_u = product.metadata) == null ? void 0 : _u.main_product_original_price) != null ? new import_decimal.default(Number(product.metadata.main_product_original_price) || 0).minus(optionSum).toFixed(2) : product.original_price ?? "0");
|
|
828
837
|
const newSourceSellingPrice = new import_decimal.default(Number(sourcePrice) || 0).minus(totalPerUnitDiscount).toDecimalPlaces(2).toString();
|
|
829
838
|
const newMainSellingPrice = new import_decimal.default(Number(newSourceSellingPrice) || 0).plus(optionSum).toDecimalPlaces(2).toFixed(2);
|
|
@@ -1002,7 +1011,7 @@ var BaseSalesImpl = class extends import_BaseModule.BaseModule {
|
|
|
1002
1011
|
(sum, pd) => sum + (pd.amount || 0),
|
|
1003
1012
|
0
|
|
1004
1013
|
);
|
|
1005
|
-
const optionSum = (0, import_utils.sumOptionUnitPrice)(
|
|
1014
|
+
const optionSum = (0, import_utils.sumOptionUnitPrice)((0, import_utils.getProductSkuOptions)(product));
|
|
1006
1015
|
const sourcePrice = ((_h = product.metadata) == null ? void 0 : _h.source_product_price) ?? (((_i = product.metadata) == null ? void 0 : _i.main_product_original_price) != null ? new import_decimal.default(Number(product.metadata.main_product_original_price) || 0).minus(optionSum).toFixed(2) : product.original_price ?? "0");
|
|
1007
1016
|
const newSourceSellingPrice = new import_decimal.default(Number(sourcePrice) || 0).minus(totalPerUnitDiscount).toDecimalPlaces(2).toString();
|
|
1008
1017
|
const newMainSellingPrice = new import_decimal.default(Number(newSourceSellingPrice) || 0).plus(optionSum).toDecimalPlaces(2).toFixed(2);
|
|
@@ -1068,7 +1077,7 @@ var BaseSalesImpl = class extends import_BaseModule.BaseModule {
|
|
|
1068
1077
|
* payments 会交给 OrderModule 统一映射为 Sales 协议支付项。
|
|
1069
1078
|
*/
|
|
1070
1079
|
async submitSalesOrder(params) {
|
|
1071
|
-
var _a, _b, _c;
|
|
1080
|
+
var _a, _b, _c, _d;
|
|
1072
1081
|
if (!this.store.order) {
|
|
1073
1082
|
throw new Error("BaseSales 解决方案需要 order 模块支持");
|
|
1074
1083
|
}
|
|
@@ -1077,9 +1086,9 @@ var BaseSalesImpl = class extends import_BaseModule.BaseModule {
|
|
|
1077
1086
|
const submitParams = {
|
|
1078
1087
|
cacheId: this.cacheId,
|
|
1079
1088
|
platform: (_a = this.otherParams) == null ? void 0 : _a.platform,
|
|
1080
|
-
businessCode: (_b = this.otherParams) == null ? void 0 : _b.businessCode,
|
|
1089
|
+
businessCode: ((_b = this.otherParams) == null ? void 0 : _b.businessCode) || ((_c = this.otherParams) == null ? void 0 : _c.business_code),
|
|
1081
1090
|
channel: this.getSubmitOrderSalesChannel(),
|
|
1082
|
-
type: (
|
|
1091
|
+
type: (_d = this.otherParams) == null ? void 0 : _d.type,
|
|
1083
1092
|
...(params == null ? void 0 : params.payments) !== void 0 ? { payments: params.payments } : {},
|
|
1084
1093
|
...inferredPaymentStatus !== void 0 ? { paymentStatus: inferredPaymentStatus } : {},
|
|
1085
1094
|
...(params == null ? void 0 : params.smallTicketDataFlag) !== void 0 ? { smallTicketDataFlag: params.smallTicketDataFlag } : {},
|
|
@@ -1102,11 +1111,14 @@ var BaseSalesImpl = class extends import_BaseModule.BaseModule {
|
|
|
1102
1111
|
}
|
|
1103
1112
|
}
|
|
1104
1113
|
async syncPaymentsToOrder(params) {
|
|
1114
|
+
var _a, _b;
|
|
1105
1115
|
if (!this.store.order)
|
|
1106
1116
|
throw new Error("order 模块未初始化");
|
|
1117
|
+
const businessCode = params.businessCode ?? ((_a = this.otherParams) == null ? void 0 : _a.businessCode) ?? ((_b = this.otherParams) == null ? void 0 : _b.business_code);
|
|
1107
1118
|
const channel = params.channel ?? this.getSubmitOrderSalesChannel();
|
|
1108
1119
|
const syncParams = {
|
|
1109
1120
|
...params,
|
|
1121
|
+
...businessCode !== void 0 ? { businessCode } : {},
|
|
1110
1122
|
...channel !== void 0 ? { channel } : {}
|
|
1111
1123
|
};
|
|
1112
1124
|
const syncState = this.store.order.getOrderSyncState();
|
|
@@ -1157,10 +1169,16 @@ var BaseSalesImpl = class extends import_BaseModule.BaseModule {
|
|
|
1157
1169
|
}
|
|
1158
1170
|
/** 追加单个支付项到当前订单。 */
|
|
1159
1171
|
addOrderPayment(payment) {
|
|
1172
|
+
var _a;
|
|
1160
1173
|
if (!this.store.order)
|
|
1161
1174
|
throw new Error("order 模块未初始化");
|
|
1162
1175
|
const paymentRecord = payment;
|
|
1163
1176
|
const metadata = paymentRecord.metadata && typeof paymentRecord.metadata === "object" ? { ...paymentRecord.metadata } : {};
|
|
1177
|
+
debugger;
|
|
1178
|
+
const shopWalletPassId = (_a = this.otherParams) == null ? void 0 : _a.shop_wallet_pass_id;
|
|
1179
|
+
if (shopWalletPassId !== void 0 && shopWalletPassId !== null) {
|
|
1180
|
+
metadata.shop_wallet_pass_id = shopWalletPassId;
|
|
1181
|
+
}
|
|
1164
1182
|
if (!metadata.unique_identification_number) {
|
|
1165
1183
|
metadata.unique_identification_number = (0, import_utils.createUuidV4)();
|
|
1166
1184
|
}
|
|
@@ -1446,8 +1464,8 @@ var BaseSalesImpl = class extends import_BaseModule.BaseModule {
|
|
|
1446
1464
|
if (identity.unique_identification_number !== void 0) {
|
|
1447
1465
|
params.unique_identification_number = identity.unique_identification_number;
|
|
1448
1466
|
}
|
|
1449
|
-
if (identity.
|
|
1450
|
-
params.
|
|
1467
|
+
if (identity.product_sku !== void 0) {
|
|
1468
|
+
params.product_sku = identity.product_sku;
|
|
1451
1469
|
}
|
|
1452
1470
|
if (identity.product_bundle !== void 0)
|
|
1453
1471
|
params.product_bundle = identity.product_bundle;
|
|
@@ -41,16 +41,20 @@ export interface BaseSalesOrderProductIdentity {
|
|
|
41
41
|
identity_key?: string;
|
|
42
42
|
unique_identification_number?: string;
|
|
43
43
|
/** 参与合并/匹配;与 remove 通配语义见 isSkuOnlyDeleteIdentity */
|
|
44
|
-
|
|
44
|
+
product_sku?: BaseSalesProductSku;
|
|
45
45
|
product_bundle?: any[];
|
|
46
46
|
}
|
|
47
|
+
export interface BaseSalesProductSku {
|
|
48
|
+
option: any[];
|
|
49
|
+
[key: string]: any;
|
|
50
|
+
}
|
|
47
51
|
export interface BaseSalesUpdateOrderProductQuantityParams extends BaseSalesOrderProductIdentity {
|
|
48
52
|
num: number;
|
|
49
53
|
}
|
|
50
54
|
export interface BaseSalesOrderProduct extends BaseSalesOrderProductIdentity {
|
|
51
55
|
order_detail_id: number | null;
|
|
52
56
|
num: number;
|
|
53
|
-
|
|
57
|
+
product_sku: BaseSalesProductSku;
|
|
54
58
|
/**
|
|
55
59
|
* 券后 **行 composite 单价** = `metadata.main_product_selling_price`
|
|
56
60
|
* + Σ((bundle.bundle_selling_price ?? bundle.price) × (bundle.num ?? 1))
|
|
@@ -96,9 +100,8 @@ export interface BaseSalesOrderProduct extends BaseSalesOrderProductIdentity {
|
|
|
96
100
|
* 出站 payload 版本的商品行。
|
|
97
101
|
*
|
|
98
102
|
* 与 tempOrder 内部 `BaseSalesOrderProduct` 的字段差异:
|
|
99
|
-
* - `
|
|
100
|
-
*
|
|
101
|
-
* (后端 checkout 协议;丢弃 `price` 等运行时辅助字段)。
|
|
103
|
+
* - `product_sku.option[*]`:内部直接维护统一 Sales 协议字段;
|
|
104
|
+
* 提交时仅规范 `add_price`,保留传入/恢复得到的展示字段。
|
|
102
105
|
* - `product_bundle[*].option[*]`:同上重命名规则。
|
|
103
106
|
*
|
|
104
107
|
* 运行时(UI 显示、加购合并、指纹、持久化)与提交边界统一消费字段名
|
|
@@ -48,7 +48,7 @@ var import_utils = require("../../../modules/Order/utils");
|
|
|
48
48
|
var import_utils2 = require("../../ScanOrder/utils");
|
|
49
49
|
function getOrderProductBasePrice(product) {
|
|
50
50
|
const metadata = (product == null ? void 0 : product.metadata) || {};
|
|
51
|
-
const optionSum = (0, import_utils.sumOptionUnitPrice)(
|
|
51
|
+
const optionSum = (0, import_utils.sumOptionUnitPrice)((0, import_utils.getProductSkuOptions)(product)).toNumber();
|
|
52
52
|
if (metadata.source_product_price !== void 0) {
|
|
53
53
|
const v2 = Number(metadata.source_product_price);
|
|
54
54
|
return Number.isFinite(v2) ? v2 : 0;
|
|
@@ -63,7 +63,7 @@ function getOrderProductBasePrice(product) {
|
|
|
63
63
|
function getOrderProductOriginalPriceForPromotion(product) {
|
|
64
64
|
var _a;
|
|
65
65
|
const metadata = (product == null ? void 0 : product.metadata) || {};
|
|
66
|
-
const optionSum = (0, import_utils.sumOptionUnitPrice)(
|
|
66
|
+
const optionSum = (0, import_utils.sumOptionUnitPrice)((0, import_utils.getProductSkuOptions)(product)).toNumber();
|
|
67
67
|
if (metadata.main_product_original_price !== void 0 && metadata.main_product_original_price !== null && metadata.main_product_original_price !== "") {
|
|
68
68
|
const v = Number(metadata.main_product_original_price) - optionSum;
|
|
69
69
|
if (Number.isFinite(v) && v >= 0)
|
|
@@ -101,7 +101,7 @@ function updatePromotionDiscountList(item, promotionDiscount) {
|
|
|
101
101
|
var X_ITEMS_FOR_Y_PRICE = "X_ITEMS_FOR_Y_PRICE";
|
|
102
102
|
function applyPromoUnitPriceToLine(item, input) {
|
|
103
103
|
const metadata = item.metadata || (item.metadata = {});
|
|
104
|
-
const optionSum = (0, import_utils.sumOptionUnitPrice)(
|
|
104
|
+
const optionSum = (0, import_utils.sumOptionUnitPrice)((0, import_utils.getProductSkuOptions)(item)).toNumber();
|
|
105
105
|
const promoUnitPrice = new import_decimal.default(Number(input.promoUnitPrice) || 0).toDecimalPlaces(2).toFixed(2);
|
|
106
106
|
const mainSelling = new import_decimal.default(Number(promoUnitPrice) || 0).plus(optionSum).toDecimalPlaces(2).toFixed(2);
|
|
107
107
|
const catalogSource = new import_decimal.default(input.originalBasePrice).toDecimalPlaces(2).toFixed(2);
|
|
@@ -169,7 +169,7 @@ function mergeIdenticalPromotionCartLines(products) {
|
|
|
169
169
|
continue;
|
|
170
170
|
}
|
|
171
171
|
const fingerprint = (0, import_utils2.buildProductLineFingerprint)(
|
|
172
|
-
line
|
|
172
|
+
(0, import_utils.getProductSkuOptions)(line),
|
|
173
173
|
line.product_bundle
|
|
174
174
|
);
|
|
175
175
|
const unitPrice = String(
|
|
@@ -340,7 +340,7 @@ function getProductBundleForEvaluator(product) {
|
|
|
340
340
|
function buildConsolidateKeyForPromotion(item) {
|
|
341
341
|
var _a;
|
|
342
342
|
const fingerprint = (0, import_utils2.buildProductLineFingerprint)(
|
|
343
|
-
item
|
|
343
|
+
(0, import_utils.getProductSkuOptions)(item),
|
|
344
344
|
item.product_bundle
|
|
345
345
|
);
|
|
346
346
|
const bookingUid = (item == null ? void 0 : item.booking_uid) ?? ((_a = item == null ? void 0 : item.metadata) == null ? void 0 : _a.booking_uid);
|
|
@@ -795,7 +795,7 @@ function processCartPromotion(list, evaluator, options) {
|
|
|
795
795
|
strategyTitle: (_b = priced.strategyMetadata) == null ? void 0 : _b.name
|
|
796
796
|
});
|
|
797
797
|
} else {
|
|
798
|
-
const optionSum = (0, import_utils.sumOptionUnitPrice)(
|
|
798
|
+
const optionSum = (0, import_utils.sumOptionUnitPrice)((0, import_utils.getProductSkuOptions)(newItem)).toNumber();
|
|
799
799
|
const sourceRestore = new import_decimal.default(originalBasePrice).toDecimalPlaces(2).toFixed(2);
|
|
800
800
|
const mainRestore = new import_decimal.default(Number(sourceRestore) || 0).plus(optionSum).toDecimalPlaces(2).toFixed(2);
|
|
801
801
|
metadata.source_product_price = sourceRestore;
|
|
@@ -23,6 +23,7 @@ export interface BaseProductDetailPayload {
|
|
|
23
23
|
option?: BaseProductDetailOptionItem[];
|
|
24
24
|
options?: BaseProductDetailOptionItem[];
|
|
25
25
|
product_option_item?: BaseProductDetailOptionItem[];
|
|
26
|
+
product_sku?: Record<string, any>;
|
|
26
27
|
bundle?: BaseProductDetailBundleItem[];
|
|
27
28
|
product_bundle?: BaseProductDetailBundleItem[];
|
|
28
29
|
unique?: string;
|
|
@@ -22,6 +22,7 @@ __export(transformBaseProductToOrderProduct_exports, {
|
|
|
22
22
|
transformBaseProductToOrderProduct: () => transformBaseProductToOrderProduct
|
|
23
23
|
});
|
|
24
24
|
module.exports = __toCommonJS(transformBaseProductToOrderProduct_exports);
|
|
25
|
+
var import_utils = require("../../../modules/Order/utils");
|
|
25
26
|
var import_manualProductDiscount = require("../../../modules/Order/utils/manualProductDiscount");
|
|
26
27
|
function toNumber(value, fallback = 0) {
|
|
27
28
|
const parsedValue = Number(value);
|
|
@@ -53,13 +54,15 @@ function normalizeOptionItems(optionItems) {
|
|
|
53
54
|
if (!Array.isArray(optionItems))
|
|
54
55
|
return [];
|
|
55
56
|
return optionItems.map((optionItem) => {
|
|
56
|
-
const optionGroupItemId = toNumber(optionItem == null ? void 0 : optionItem.id);
|
|
57
|
+
const optionGroupItemId = toNumber((optionItem == null ? void 0 : optionItem.option_group_item_id) ?? (optionItem == null ? void 0 : optionItem.id));
|
|
57
58
|
const price = (optionItem == null ? void 0 : optionItem.price) ?? (optionItem == null ? void 0 : optionItem.add_price) ?? 0;
|
|
58
59
|
return {
|
|
60
|
+
...optionItem,
|
|
59
61
|
option_group_item_id: optionGroupItemId,
|
|
60
62
|
option_group_id: toNumber(optionItem == null ? void 0 : optionItem.option_group_id),
|
|
61
63
|
num: toSafePositiveInt((optionItem == null ? void 0 : optionItem.num) ?? (optionItem == null ? void 0 : optionItem.quantity), 1),
|
|
62
|
-
|
|
64
|
+
add_price: toNumber(price, 0),
|
|
65
|
+
price: void 0
|
|
63
66
|
};
|
|
64
67
|
});
|
|
65
68
|
}
|
|
@@ -88,7 +91,7 @@ function findVariantById(origin, variantId) {
|
|
|
88
91
|
return variants.find((variant) => Number(variant == null ? void 0 : variant.id) === variantId) || null;
|
|
89
92
|
}
|
|
90
93
|
function transformBaseProductToOrderProduct(params) {
|
|
91
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k;
|
|
94
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l;
|
|
92
95
|
const { payload, fallbackProductId = null } = params;
|
|
93
96
|
if (!payload || typeof payload !== "object")
|
|
94
97
|
return null;
|
|
@@ -117,8 +120,10 @@ function transformBaseProductToOrderProduct(params) {
|
|
|
117
120
|
sourceProductPrice
|
|
118
121
|
);
|
|
119
122
|
const hasPriceOverride = payload.price_override !== void 0 && payload.price_override !== null && payload.price_override !== "";
|
|
120
|
-
const productOptionItem =
|
|
121
|
-
|
|
123
|
+
const productOptionItem = (0, import_utils.normalizeProductSkuOptions)(
|
|
124
|
+
normalizeOptionItems(
|
|
125
|
+
((_d = payload.product_sku) == null ? void 0 : _d.option) ?? payload.option ?? payload.options ?? payload.product_option_item
|
|
126
|
+
)
|
|
122
127
|
);
|
|
123
128
|
const productBundle = normalizeBundleItems(
|
|
124
129
|
payload.bundle ?? payload.product_bundle,
|
|
@@ -128,19 +133,19 @@ function transformBaseProductToOrderProduct(params) {
|
|
|
128
133
|
const resolvedQuantity = toSafePositiveInt(payload.quantity ?? payload.num, 1);
|
|
129
134
|
const originTotal = (0, import_manualProductDiscount.resolveManualDiscountOriginTotal)({
|
|
130
135
|
originTotal: payload.origin_total,
|
|
131
|
-
extendOriginTotal: (
|
|
132
|
-
originExtendOriginTotal: (
|
|
133
|
-
sourceExtendOriginTotal: (
|
|
136
|
+
extendOriginTotal: (_e = payload._extend) == null ? void 0 : _e.origin_total,
|
|
137
|
+
originExtendOriginTotal: (_f = origin == null ? void 0 : origin._extend) == null ? void 0 : _f.origin_total,
|
|
138
|
+
sourceExtendOriginTotal: (_g = sourceProduct == null ? void 0 : sourceProduct._extend) == null ? void 0 : _g.origin_total,
|
|
134
139
|
catalogUnitPrice: (origin == null ? void 0 : origin.base_price) ?? (origin == null ? void 0 : origin.price) ?? (sourceProduct == null ? void 0 : sourceProduct.base_price) ?? (sourceProduct == null ? void 0 : sourceProduct.price),
|
|
135
140
|
quantity: resolvedQuantity
|
|
136
141
|
});
|
|
137
142
|
const sellingTotal = Number(
|
|
138
|
-
payload.line_total ?? payload.total ?? ((
|
|
143
|
+
payload.line_total ?? payload.total ?? ((_h = payload._extend) == null ? void 0 : _h.total) ?? lineCompositeTotal
|
|
139
144
|
);
|
|
140
145
|
const discountReason = (0, import_manualProductDiscount.resolveManualDiscountReasonFromSources)({
|
|
141
146
|
discountReason: payload.discount_reason,
|
|
142
|
-
extendDiscountReason: (
|
|
143
|
-
originExtendDiscountReason: (
|
|
147
|
+
extendDiscountReason: (_i = payload._extend) == null ? void 0 : _i.discount_reason,
|
|
148
|
+
originExtendDiscountReason: (_j = origin == null ? void 0 : origin._extend) == null ? void 0 : _j.discount_reason
|
|
144
149
|
});
|
|
145
150
|
const lineOriginalPrice = hasPriceOverride && Number.isFinite(originTotal) ? toPriceString(originTotal) : lineCompositeTotal;
|
|
146
151
|
const manualDiscountList = (0, import_manualProductDiscount.shouldBuildManualProductDiscount)({
|
|
@@ -154,10 +159,17 @@ function transformBaseProductToOrderProduct(params) {
|
|
|
154
159
|
sellingTotal: Number.isFinite(sellingTotal) ? sellingTotal : Number(lineCompositeTotal),
|
|
155
160
|
quantity: resolvedQuantity,
|
|
156
161
|
message: discountReason,
|
|
157
|
-
discountway: (
|
|
158
|
-
discount_per: (
|
|
162
|
+
discountway: (_k = payload._extend) == null ? void 0 : _k.discountway,
|
|
163
|
+
discount_per: (_l = payload._extend) == null ? void 0 : _l.discount_per
|
|
159
164
|
})
|
|
160
165
|
) : payload.discount_list || [];
|
|
166
|
+
const optionSum = (0, import_utils.sumOptionUnitPrice)(productOptionItem).toNumber();
|
|
167
|
+
const mainProductOriginalPrice = toPriceString(Number(sourceProductPrice) + optionSum);
|
|
168
|
+
const bundleOnlyComposite = (0, import_utils.composeLinePrice)({ mainPrice: 0, bundle: productBundle });
|
|
169
|
+
const derivedMainSelling = Number(lineCompositeTotal) - Number(bundleOnlyComposite);
|
|
170
|
+
const mainProductSellingPrice = toPriceString(
|
|
171
|
+
Number.isFinite(derivedMainSelling) && derivedMainSelling >= 0 ? derivedMainSelling : Number(mainProductOriginalPrice)
|
|
172
|
+
);
|
|
161
173
|
const metadata = {
|
|
162
174
|
unique: payload.unique,
|
|
163
175
|
session: payload.session,
|
|
@@ -170,8 +182,9 @@ function transformBaseProductToOrderProduct(params) {
|
|
|
170
182
|
source_shop_id: payload.source_shop_id,
|
|
171
183
|
origin,
|
|
172
184
|
source_product_price: sourceProductPrice,
|
|
173
|
-
main_product_selling_price:
|
|
174
|
-
main_product_original_price:
|
|
185
|
+
main_product_selling_price: mainProductSellingPrice,
|
|
186
|
+
main_product_original_price: mainProductOriginalPrice,
|
|
187
|
+
price_schema_version: 2,
|
|
175
188
|
...hasPriceOverride ? {
|
|
176
189
|
price_override: String(payload.price_override),
|
|
177
190
|
is_manual_discount: 1
|
|
@@ -186,7 +199,10 @@ function transformBaseProductToOrderProduct(params) {
|
|
|
186
199
|
product_variant_id: productVariantId,
|
|
187
200
|
unique_identification_number: uniqueIdentificationNumber ? String(uniqueIdentificationNumber) : void 0,
|
|
188
201
|
num: resolvedQuantity,
|
|
189
|
-
|
|
202
|
+
product_sku: {
|
|
203
|
+
...payload.product_sku && typeof payload.product_sku === "object" ? payload.product_sku : {},
|
|
204
|
+
option: productOptionItem
|
|
205
|
+
},
|
|
190
206
|
product_bundle: productBundle,
|
|
191
207
|
discount_list: manualDiscountList,
|
|
192
208
|
// 折后行价由 normalizeOrderProduct 按 main + bundle 合成;手动改价时 bundle 已为分摊后单价
|
|
@@ -12,7 +12,7 @@ export declare function buildProductLineFingerprint(productOptionItem?: unknown,
|
|
|
12
12
|
export declare function getSafeProductNum(num?: number): number;
|
|
13
13
|
/**
|
|
14
14
|
* removeProductFromOrder 仅传 SKU 时的通配 identity(对象上未声明选项键)。
|
|
15
|
-
* 与显式 `
|
|
15
|
+
* 与显式 `product_sku: { option: [] }` 区分:后者只匹配「无选项」行。
|
|
16
16
|
*/
|
|
17
17
|
export declare function isSkuOnlyDeleteIdentity(x: BaseSalesOrderProductIdentity): boolean;
|
|
18
18
|
/**
|
|
@@ -65,7 +65,7 @@ function buildProductLineFingerprint(productOptionItem, productBundle) {
|
|
|
65
65
|
option_group_item_id: Number(item == null ? void 0 : item.option_group_item_id) || 0,
|
|
66
66
|
option_group_id: Number(item == null ? void 0 : item.option_group_id) || 0,
|
|
67
67
|
num: typeof (item == null ? void 0 : item.num) === "number" && !Number.isNaN(item.num) ? Math.max(1, Math.floor(item.num)) : 1,
|
|
68
|
-
price: String((item == null ? void 0 : item.price) ?? "")
|
|
68
|
+
price: String((item == null ? void 0 : item.add_price) ?? (item == null ? void 0 : item.price) ?? "")
|
|
69
69
|
})).sort((p, q) => {
|
|
70
70
|
if (p.option_group_item_id !== q.option_group_item_id) {
|
|
71
71
|
return p.option_group_item_id - q.option_group_item_id;
|
|
@@ -100,10 +100,10 @@ function getSafeProductNum(num) {
|
|
|
100
100
|
function isSkuOnlyDeleteIdentity(x) {
|
|
101
101
|
if (x.identity_key)
|
|
102
102
|
return false;
|
|
103
|
-
return !("
|
|
103
|
+
return !("product_sku" in x) && !("product_bundle" in x);
|
|
104
104
|
}
|
|
105
105
|
function normalizeOrderProduct(product) {
|
|
106
|
-
var _a, _b, _c, _d, _e, _f;
|
|
106
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
107
107
|
const metadata = { ...product.metadata || {} };
|
|
108
108
|
const resolvedIdentityKey = ((_a = product.metadata) == null ? void 0 : _a.unique_identification_number) ? String(product.metadata.unique_identification_number) : product.unique_identification_number && String(product.unique_identification_number).length > 0 ? String(product.unique_identification_number) : product.identity_key && String(product.identity_key).length > 0 ? String(product.identity_key) : (0, import_utils.createUuidV4)();
|
|
109
109
|
metadata.unique_identification_number = resolvedIdentityKey;
|
|
@@ -142,12 +142,16 @@ function normalizeOrderProduct(product) {
|
|
|
142
142
|
price_type: item.price_type ?? item.custom_price_type ?? "",
|
|
143
143
|
price_type_ext: item.price_type_ext ?? item.custom_price_type_ext ?? ""
|
|
144
144
|
}));
|
|
145
|
-
const normalizedOptions = product.
|
|
145
|
+
const normalizedOptions = (0, import_utils.normalizeProductSkuOptions)((_e = product.product_sku) == null ? void 0 : _e.option);
|
|
146
146
|
const optionSum = (0, import_utils.sumOptionUnitPrice)(normalizedOptions);
|
|
147
|
+
const productSku = {
|
|
148
|
+
...(0, import_utils.ensureProductSku)(product),
|
|
149
|
+
option: normalizedOptions
|
|
150
|
+
};
|
|
147
151
|
const isV2 = metadata.price_schema_version === 2 || metadata.price_schema_version === "2";
|
|
148
152
|
const variantId = Number(product.product_variant_id || 0);
|
|
149
|
-
const variantList = variantId ? (
|
|
150
|
-
const variantPrice = Array.isArray(variantList) ? (
|
|
153
|
+
const variantList = variantId ? (_f = metadata == null ? void 0 : metadata.origin) == null ? void 0 : _f.variant : null;
|
|
154
|
+
const variantPrice = Array.isArray(variantList) ? (_g = variantList.find((v) => Number(v == null ? void 0 : v.id) === variantId)) == null ? void 0 : _g.price : void 0;
|
|
151
155
|
const resolvedSource = (() => {
|
|
152
156
|
var _a2, _b2;
|
|
153
157
|
if (metadata.source_product_price !== void 0) {
|
|
@@ -219,7 +223,7 @@ function normalizeOrderProduct(product) {
|
|
|
219
223
|
product_id: product.product_id,
|
|
220
224
|
num: getSafeProductNum(product.num),
|
|
221
225
|
product_variant_id: product.product_variant_id,
|
|
222
|
-
|
|
226
|
+
product_sku: productSku,
|
|
223
227
|
selling_price: composedSellingPrice,
|
|
224
228
|
original_price: finalOriginalPrice,
|
|
225
229
|
tax_fee: product.tax_fee || "0.00",
|
|
@@ -311,7 +311,7 @@ export declare class BookingByStepImpl extends BaseModule implements Module {
|
|
|
311
311
|
date: string;
|
|
312
312
|
status: string;
|
|
313
313
|
week: string;
|
|
314
|
-
weekNum: 0 |
|
|
314
|
+
weekNum: 0 | 2 | 1 | 5 | 3 | 4 | 6;
|
|
315
315
|
}[]>;
|
|
316
316
|
submitTimeSlot(timeSlots: TimeSliceItem): void;
|
|
317
317
|
private getScheduleDataByIds;
|
|
@@ -751,7 +751,7 @@ var _ScanOrderImpl = class extends import_BaseModule.BaseModule {
|
|
|
751
751
|
(sum, pd) => sum + (pd.amount || 0),
|
|
752
752
|
0
|
|
753
753
|
);
|
|
754
|
-
const optionSum = (0, import_utils2.sumOptionUnitPrice)(
|
|
754
|
+
const optionSum = (0, import_utils2.sumOptionUnitPrice)((0, import_utils2.getProductSkuOptions)(product));
|
|
755
755
|
const sourcePrice = ((_d = product.metadata) == null ? void 0 : _d.source_product_price) ?? (((_e = product.metadata) == null ? void 0 : _e.main_product_original_price) != null ? new import_decimal.default(Number(product.metadata.main_product_original_price) || 0).minus(optionSum).toFixed(2) : product.original_price ?? "0");
|
|
756
756
|
const newSourceSellingPrice = new import_decimal.default(Number(sourcePrice) || 0).minus(totalPerUnitDiscount).toDecimalPlaces(2).toString();
|
|
757
757
|
const newMainSellingPrice = new import_decimal.default(Number(newSourceSellingPrice) || 0).plus(optionSum).toDecimalPlaces(2).toFixed(2);
|
|
@@ -899,7 +899,7 @@ var _ScanOrderImpl = class extends import_BaseModule.BaseModule {
|
|
|
899
899
|
original_price: originalPrice,
|
|
900
900
|
payment_price: sellingPrice,
|
|
901
901
|
is_charge_tax: ruleProduct.is_gst ?? 0,
|
|
902
|
-
|
|
902
|
+
product_sku: { option: [] },
|
|
903
903
|
discount_list: [],
|
|
904
904
|
product_bundle: [],
|
|
905
905
|
booking_uid: bookingUuid,
|
|
@@ -1009,8 +1009,8 @@ var _ScanOrderImpl = class extends import_BaseModule.BaseModule {
|
|
|
1009
1009
|
};
|
|
1010
1010
|
if (identity.identity_key !== void 0)
|
|
1011
1011
|
params.identity_key = identity.identity_key;
|
|
1012
|
-
if (identity.
|
|
1013
|
-
params.
|
|
1012
|
+
if (identity.product_sku !== void 0) {
|
|
1013
|
+
params.product_sku = identity.product_sku;
|
|
1014
1014
|
}
|
|
1015
1015
|
if (identity.product_bundle !== void 0)
|
|
1016
1016
|
params.product_bundle = identity.product_bundle;
|
|
@@ -33,13 +33,17 @@ export interface ScanOrderOrderProductIdentity {
|
|
|
33
33
|
identity_key?: string;
|
|
34
34
|
unique_identification_number?: string;
|
|
35
35
|
/** 参与合并/匹配;与 remove 通配语义见 isSkuOnlyDeleteIdentity */
|
|
36
|
-
|
|
36
|
+
product_sku?: ScanOrderProductSku;
|
|
37
37
|
product_bundle?: any[];
|
|
38
38
|
}
|
|
39
|
+
export interface ScanOrderProductSku {
|
|
40
|
+
option: any[];
|
|
41
|
+
[key: string]: any;
|
|
42
|
+
}
|
|
39
43
|
export interface ScanOrderOrderProduct extends ScanOrderOrderProductIdentity {
|
|
40
44
|
order_detail_id: number | null;
|
|
41
45
|
num: number;
|
|
42
|
-
|
|
46
|
+
product_sku: ScanOrderProductSku;
|
|
43
47
|
/**
|
|
44
48
|
* 券后 **行 composite 单价** = `metadata.main_product_selling_price`
|
|
45
49
|
* + Σ((bundle.bundle_selling_price ?? bundle.price) × (bundle.num ?? 1))
|
|
@@ -85,9 +89,8 @@ export interface ScanOrderOrderProduct extends ScanOrderOrderProductIdentity {
|
|
|
85
89
|
* 出站 payload 版本的商品行。
|
|
86
90
|
*
|
|
87
91
|
* 与 tempOrder 内部 `ScanOrderOrderProduct` 的字段差异:
|
|
88
|
-
* - `
|
|
89
|
-
*
|
|
90
|
-
* (后端 checkout 协议;丢弃 `price` 等运行时辅助字段)。
|
|
92
|
+
* - `product_sku.option[*]`:内部直接维护统一 Sales 协议字段;
|
|
93
|
+
* 提交时仅规范 `add_price`,保留传入/恢复得到的展示字段。
|
|
91
94
|
* - `product_bundle[*].option[*]`:同上重命名规则。
|
|
92
95
|
*
|
|
93
96
|
* 运行时(UI 显示、加购合并、指纹、持久化)与提交边界统一消费字段名
|
|
@@ -88,7 +88,7 @@ export declare function attachItemRuleLimitsToTopLevelProducts<T>(productList: T
|
|
|
88
88
|
export declare function buildProductLineFingerprint(productOptionItem?: unknown, productBundle?: unknown): string;
|
|
89
89
|
/**
|
|
90
90
|
* removeProductFromOrder 仅传 SKU 时的通配 identity(对象上未声明选项键)。
|
|
91
|
-
* 与显式 `
|
|
91
|
+
* 与显式 `product_sku: { option: [] }` 区分:后者只匹配「无选项」行。
|
|
92
92
|
*/
|
|
93
93
|
export declare function isSkuOnlyDeleteIdentity(x: ScanOrderOrderProductIdentity): boolean;
|
|
94
94
|
/**
|
|
@@ -353,7 +353,7 @@ function buildProductLineFingerprint(productOptionItem, productBundle) {
|
|
|
353
353
|
option_group_item_id: Number(item == null ? void 0 : item.option_group_item_id) || 0,
|
|
354
354
|
option_group_id: Number(item == null ? void 0 : item.option_group_id) || 0,
|
|
355
355
|
num: typeof (item == null ? void 0 : item.num) === "number" && !Number.isNaN(item.num) ? Math.max(1, Math.floor(item.num)) : 1,
|
|
356
|
-
price: String((item == null ? void 0 : item.price) ?? "")
|
|
356
|
+
price: String((item == null ? void 0 : item.add_price) ?? (item == null ? void 0 : item.price) ?? "")
|
|
357
357
|
})).sort((p, q) => {
|
|
358
358
|
if (p.option_group_item_id !== q.option_group_item_id) {
|
|
359
359
|
return p.option_group_item_id - q.option_group_item_id;
|
|
@@ -381,11 +381,11 @@ function buildProductLineFingerprint(productOptionItem, productBundle) {
|
|
|
381
381
|
function isSkuOnlyDeleteIdentity(x) {
|
|
382
382
|
if (x.unique_identification_number || x.identity_key)
|
|
383
383
|
return false;
|
|
384
|
-
return !("
|
|
384
|
+
return !("product_sku" in x) && !("product_bundle" in x);
|
|
385
385
|
}
|
|
386
386
|
function fingerprintForIdentityWithOptionKeys(x) {
|
|
387
387
|
const row = x;
|
|
388
|
-
const opts = "
|
|
388
|
+
const opts = "product_sku" in row ? (0, import_utils.getProductSkuOptions)(row) : [];
|
|
389
389
|
const buds = "product_bundle" in row ? Array.isArray(row.product_bundle) ? row.product_bundle : [] : [];
|
|
390
390
|
return buildProductLineFingerprint(opts, buds);
|
|
391
391
|
}
|
|
@@ -407,7 +407,7 @@ function getProductIdentityIndex(products, identity) {
|
|
|
407
407
|
return products.findIndex((item) => isIdentityMatch(item, identity));
|
|
408
408
|
}
|
|
409
409
|
function normalizeOrderProduct(product) {
|
|
410
|
-
var _a, _b, _c, _d, _e, _f;
|
|
410
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
411
411
|
const metadata = { ...product.metadata || {} };
|
|
412
412
|
const resolvedIdentityKey = ((_a = product.metadata) == null ? void 0 : _a.unique_identification_number) ? String(product.metadata.unique_identification_number) : product.unique_identification_number && String(product.unique_identification_number).length > 0 ? String(product.unique_identification_number) : product.identity_key && String(product.identity_key).length > 0 ? String(product.identity_key) : (0, import_utils.createUuidV4)();
|
|
413
413
|
metadata.unique_identification_number = resolvedIdentityKey;
|
|
@@ -446,12 +446,16 @@ function normalizeOrderProduct(product) {
|
|
|
446
446
|
price_type: item.price_type ?? item.custom_price_type ?? "",
|
|
447
447
|
price_type_ext: item.price_type_ext ?? item.custom_price_type_ext ?? ""
|
|
448
448
|
}));
|
|
449
|
-
const normalizedOptions = product.
|
|
449
|
+
const normalizedOptions = (0, import_utils.normalizeProductSkuOptions)((_e = product.product_sku) == null ? void 0 : _e.option);
|
|
450
450
|
const optionSum = (0, import_utils.sumOptionUnitPrice)(normalizedOptions);
|
|
451
|
+
const productSku = {
|
|
452
|
+
...(0, import_utils.ensureProductSku)(product),
|
|
453
|
+
option: normalizedOptions
|
|
454
|
+
};
|
|
451
455
|
const isV2 = metadata.price_schema_version === 2 || metadata.price_schema_version === "2";
|
|
452
456
|
const variantId = Number(product.product_variant_id || 0);
|
|
453
|
-
const variantList = variantId ? (
|
|
454
|
-
const variantPrice = Array.isArray(variantList) ? (
|
|
457
|
+
const variantList = variantId ? (_f = metadata == null ? void 0 : metadata.origin) == null ? void 0 : _f.variant : null;
|
|
458
|
+
const variantPrice = Array.isArray(variantList) ? (_g = variantList.find((v) => Number(v == null ? void 0 : v.id) === variantId)) == null ? void 0 : _g.price : void 0;
|
|
455
459
|
const resolvedSource = (() => {
|
|
456
460
|
var _a2, _b2;
|
|
457
461
|
if (metadata.source_product_price !== void 0) {
|
|
@@ -527,7 +531,7 @@ function normalizeOrderProduct(product) {
|
|
|
527
531
|
product_id: product.product_id,
|
|
528
532
|
num: getSafeProductNum(product.num),
|
|
529
533
|
product_variant_id: product.product_variant_id,
|
|
530
|
-
|
|
534
|
+
product_sku: productSku,
|
|
531
535
|
selling_price: composedSellingPrice,
|
|
532
536
|
original_price: manualOriginalPrice,
|
|
533
537
|
tax_fee: product.tax_fee || "0.00",
|
|
@@ -1077,7 +1077,7 @@ var _VenueBookingImpl = class extends import_BaseModule.BaseModule {
|
|
|
1077
1077
|
product_variant_id: 0,
|
|
1078
1078
|
num: 1,
|
|
1079
1079
|
product_bundle: [],
|
|
1080
|
-
|
|
1080
|
+
product_sku: { option: [] },
|
|
1081
1081
|
discount_list: [],
|
|
1082
1082
|
custom_deposit_data: customDepositData,
|
|
1083
1083
|
metadata: {}
|
|
@@ -1348,7 +1348,7 @@ var _VenueBookingImpl = class extends import_BaseModule.BaseModule {
|
|
|
1348
1348
|
(sum, pd) => sum + (pd.amount || 0),
|
|
1349
1349
|
0
|
|
1350
1350
|
);
|
|
1351
|
-
const optionSum = (0, import_utils3.sumOptionUnitPrice)(
|
|
1351
|
+
const optionSum = (0, import_utils3.sumOptionUnitPrice)((0, import_utils3.getProductSkuOptions)(product));
|
|
1352
1352
|
const sourcePrice = ((_d = product.metadata) == null ? void 0 : _d.source_product_price) ?? (((_e = product.metadata) == null ? void 0 : _e.main_product_original_price) != null ? new import_decimal.default(Number(product.metadata.main_product_original_price) || 0).minus(optionSum).toFixed(2) : product.original_price ?? "0");
|
|
1353
1353
|
const newSourceSellingPrice = new import_decimal.default(Number(sourcePrice) || 0).minus(totalPerUnitDiscount).toDecimalPlaces(2).toString();
|
|
1354
1354
|
const newMainSellingPrice = new import_decimal.default(Number(newSourceSellingPrice) || 0).plus(optionSum).toDecimalPlaces(2).toFixed(2);
|
|
@@ -71,8 +71,6 @@
|
|
|
71
71
|
"num__comment": "数量;int;↕;必填。统一使用 num,不再使用 product_quantity。",
|
|
72
72
|
"product_variant_id": 0,
|
|
73
73
|
"product_variant_id__comment": "多规格 ID;int;↕;可选。",
|
|
74
|
-
"product_option_item": [],
|
|
75
|
-
"product_option_item__comment": "选项配置;array;↕;可选。",
|
|
76
74
|
"selling_price": "50.00",
|
|
77
75
|
"selling_price__comment": "销售单价(交易快照);string;←;服务端返回,不能依赖基准数据回填。",
|
|
78
76
|
"original_price": "60.00",
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"type":"appointment_booking","platform":"PC","sales_channel":"my_pisel","order_sales_channel":"online_store","bookings":[{"id":0,"number":1,"registration_type":"all","relation_products":[],"is_all":false,"product":{"num":1,"product_id":61170,"product_variant_id":0,"product_bundle":[],"product_option_item":[],"discount_list":[{"amount":100,"type":"good_pass","discount":{"resource_id":64523,"title":{"auto":"玄-商品券","original":"玄-商品券","en":null,"zh-CN":null,"zh-HK":null},"original_amount":100,"product_id":61170,"percent":"1.00"}}]},"sub_type":"minutes","duration":480,"like_status":"common","resources":[{"relation_type":"form","like_status":"common","form_id":35,"relation_id":40357,"capacity":1,"metadata":{"combined_resource":{"status":1,"resource_ids":[40262,40263]},"form_name":"桌台","resource_name":"组合资源测试table-0422-01"},"children":[{"relation_type":"form","like_status":"common","id":40262,"main_field":"A01(组合资源-小桌-4 人)","resourceType":"single","form_id":35,"relation_id":40262,"capacity":1,"metadata":{"combined_resource":null,"form_name":"桌台","resource_name":"A01(组合资源-小桌-4 人)"}},{"relation_type":"form","like_status":"common","id":40263,"main_field":"A02(组合资源-小桌-4 人)","resourceType":"single","form_id":35,"relation_id":40263,"capacity":0,"metadata":{"combined_resource":null,"form_name":"桌台","resource_name":"A02(组合资源-小桌-4 人)"}}]},{"relation_type":"form","like_status":"common","form_id":214,"relation_id":38350,"capacity":1,"metadata":{"combined_resource":null,"form_name":"校区2","resource_name":"West Campus"}}],"schedule_id":0,"start_date":"2025-08-22","start_time":"09:00","select_date":"2025-08-22","end_time":"17:00","end_date":"2025-08-22","metadata":{"account":{"id":13433,"username":"a a"},"capacity":[{"id":0,"value":1,"name":""}]},"holder":null,"relation_forms":[]}],"shop_note":"","schedule_date":"2025-08-22 09:00:00","is_deposit":0,"relation_products":[],"relation_forms":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"type":"appointment_booking","platform":"PC","sales_channel":"my_pisel","order_sales_channel":"online_store","bookings":[{"id":0,"number":1,"registration_type":"all","relation_products":[],"is_all":false,"product":{"num":1,"product_id":61170,"product_variant_id":0,"product_bundle":[],"product_option_item":[],"discount_list":[{"amount":100,"type":"good_pass","discount":{"resource_id":64523,"title":{"auto":"玄-商品券","original":"玄-商品券","en":null,"zh-CN":null,"zh-HK":null},"original_amount":100,"product_id":61170,"percent":"1.00"}}]},"sub_type":"minutes","duration":480,"like_status":"common","resources":[{"relation_type":"form","like_status":"common","form_id":35,"relation_id":40357,"capacity":1,"metadata":{"combined_resource":{"status":1,"resource_ids":[40262,40263]},"form_name":"桌台","resource_name":"组合资源测试table-0422-01"},"children":[{"relation_type":"form","like_status":"common","id":40262,"main_field":"A01(组合资源-小桌-4 人)","resourceType":"single","form_id":35,"relation_id":40262,"capacity":1,"metadata":{"combined_resource":null,"form_name":"桌台","resource_name":"A01(组合资源-小桌-4 人)"}},{"relation_type":"form","like_status":"common","id":40263,"main_field":"A02(组合资源-小桌-4 人)","resourceType":"single","form_id":35,"relation_id":40263,"capacity":0,"metadata":{"combined_resource":null,"form_name":"桌台","resource_name":"A02(组合资源-小桌-4 人)"}}]},{"relation_type":"form","like_status":"common","form_id":214,"relation_id":38350,"capacity":1,"metadata":{"combined_resource":null,"form_name":"校区2","resource_name":"West Campus"}}],"schedule_id":0,"start_date":"2025-08-22","start_time":"09:00","select_date":"2025-08-22","end_time":"17:00","end_date":"2025-08-22","metadata":{"account":{"id":13433,"username":"a a"},"capacity":[{"id":0,"value":1,"name":""}]},"holder":null,"relation_forms":[]}],"shop_note":"","schedule_date":"2025-08-22 09:00:00","is_deposit":0,"relation_products":[],"relation_forms":[]}
|