@pisell/pisellos 2.3.170 → 2.3.172
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 +1 -0
- package/dist/index.js +1 -0
- package/dist/inventory/index.d.ts +92 -0
- package/dist/inventory/index.js +509 -0
- package/dist/model/strategy/adapter/promotion/evaluator.js +5 -4
- package/dist/modules/Discount/index.js +1 -0
- package/dist/modules/Discount/types.d.ts +4 -0
- package/dist/modules/Order/index.d.ts +25 -3
- package/dist/modules/Order/index.js +1791 -1318
- package/dist/modules/Order/types.d.ts +7 -0
- package/dist/modules/Order/utils/discountProductLineIdentity.js +2 -2
- package/dist/modules/Order/utils/productVoucherGroups.d.ts +15 -0
- package/dist/modules/Order/utils/productVoucherGroups.js +115 -0
- package/dist/modules/Payment/walletpass.js +32 -6
- package/dist/modules/Product/index.d.ts +1 -1
- package/dist/modules/ProductList/index.js +33 -12
- package/dist/modules/Rules/index.d.ts +5 -10
- package/dist/modules/Rules/index.js +197 -107
- package/dist/modules/Rules/promotionSelection.d.ts +14 -0
- package/dist/modules/Rules/promotionSelection.js +390 -0
- package/dist/modules/Rules/types.d.ts +9 -0
- package/dist/server/modules/order/index.d.ts +6 -0
- package/dist/server/modules/order/index.js +782 -447
- package/dist/solution/BaseSales/index.d.ts +16 -1
- package/dist/solution/BaseSales/index.js +1545 -1339
- package/dist/solution/BaseSales/utils/cartPromotion.js +5 -2
- package/dist/solution/BookingByStep/index.d.ts +2 -2
- package/dist/solution/BookingTicket/index.js +200 -108
- package/dist/solution/BookingTicket/types.d.ts +14 -2
- package/dist/solution/BookingTicket/utils/addProductDecision.d.ts +1 -1
- package/dist/solution/BookingTicket/utils/addProductDecision.js +4 -3
- package/dist/solution/BookingTicket/utils/scan/applyGlobalScan.js +94 -58
- package/dist/solution/BookingTicket/utils/scan/applyProductVoucherCollectionScan.d.ts +10 -0
- package/dist/solution/BookingTicket/utils/scan/applyProductVoucherCollectionScan.js +117 -0
- package/dist/solution/BookingTicket/utils/scan/cloudSearch.js +1 -0
- package/dist/solution/BookingTicket/utils/scan/handleScan.js +2 -1
- package/dist/solution/UnifiedBookingSales/index.d.ts +1 -1
- package/dist/solution/UnifiedBookingSales/index.js +69 -49
- package/dist/utils/platform.d.ts +2 -0
- package/dist/utils/platform.js +6 -0
- package/lib/index.d.ts +1 -0
- package/lib/index.js +12 -0
- package/lib/inventory/index.d.ts +92 -0
- package/lib/inventory/index.js +287 -0
- package/lib/model/strategy/adapter/promotion/evaluator.js +5 -4
- package/lib/model/strategy/adapter/promotion/index.js +1 -46
- package/lib/modules/Discount/index.js +1 -0
- package/lib/modules/Discount/types.d.ts +4 -0
- package/lib/modules/Order/index.d.ts +25 -3
- package/lib/modules/Order/index.js +203 -38
- package/lib/modules/Order/types.d.ts +7 -0
- package/lib/modules/Order/utils/discountProductLineIdentity.js +1 -1
- package/lib/modules/Order/utils/productVoucherGroups.d.ts +15 -0
- package/lib/modules/Order/utils/productVoucherGroups.js +64 -0
- package/lib/modules/Payment/walletpass.js +23 -1
- package/lib/modules/Product/index.d.ts +1 -1
- package/lib/modules/ProductList/index.js +15 -0
- package/lib/modules/Rules/index.d.ts +5 -10
- package/lib/modules/Rules/index.js +68 -22
- package/lib/modules/Rules/promotionSelection.d.ts +14 -0
- package/lib/modules/Rules/promotionSelection.js +230 -0
- package/lib/modules/Rules/types.d.ts +9 -0
- package/lib/server/modules/order/index.d.ts +6 -0
- package/lib/server/modules/order/index.js +226 -29
- package/lib/solution/BaseSales/index.d.ts +16 -1
- package/lib/solution/BaseSales/index.js +108 -14
- package/lib/solution/BaseSales/utils/cartPromotion.js +5 -2
- package/lib/solution/BookingByStep/index.d.ts +2 -2
- package/lib/solution/BookingTicket/index.js +38 -2
- package/lib/solution/BookingTicket/types.d.ts +14 -2
- package/lib/solution/BookingTicket/utils/addProductDecision.d.ts +1 -1
- package/lib/solution/BookingTicket/utils/addProductDecision.js +4 -3
- package/lib/solution/BookingTicket/utils/scan/applyGlobalScan.js +14 -2
- package/lib/solution/BookingTicket/utils/scan/applyProductVoucherCollectionScan.d.ts +10 -0
- package/lib/solution/BookingTicket/utils/scan/applyProductVoucherCollectionScan.js +71 -0
- package/lib/solution/BookingTicket/utils/scan/cloudSearch.js +1 -0
- package/lib/solution/BookingTicket/utils/scan/handleScan.js +2 -1
- package/lib/solution/UnifiedBookingSales/index.d.ts +1 -1
- package/lib/solution/UnifiedBookingSales/index.js +14 -3
- package/lib/utils/platform.d.ts +2 -0
- package/lib/utils/platform.js +7 -0
- package/package.json +1 -1
|
@@ -66,7 +66,13 @@ class ProductList extends _BaseModule.BaseModule {
|
|
|
66
66
|
* productList.updateOtherParams({ channel: 'pos' });
|
|
67
67
|
*/
|
|
68
68
|
updateOtherParams(params) {
|
|
69
|
+
const previousScope = this.otherParams.catalogScopeKey;
|
|
69
70
|
this.otherParams = params || {};
|
|
71
|
+
if (previousScope !== this.otherParams.catalogScopeKey && (previousScope || this.otherParams.catalogScopeKey)) {
|
|
72
|
+
this.store.list = [];
|
|
73
|
+
this.rawProductPriceSources.clear();
|
|
74
|
+
this.core.effects.emit(`${this.name}:changed`, this.store.list);
|
|
75
|
+
}
|
|
70
76
|
}
|
|
71
77
|
async storeChange(path, value) {
|
|
72
78
|
// No longer needed - products are stored as plain objects instead of Product instances
|
|
@@ -101,6 +107,12 @@ class ProductList extends _BaseModule.BaseModule {
|
|
|
101
107
|
status = 'published',
|
|
102
108
|
strategy_context
|
|
103
109
|
} = {}, options) {
|
|
110
|
+
const scope = this.otherParams.catalogScopeKey;
|
|
111
|
+
const assertScope = () => {
|
|
112
|
+
if (scope !== this.otherParams.catalogScopeKey) throw Object.assign(new Error('Product catalog context changed'), {
|
|
113
|
+
name: 'AbortError'
|
|
114
|
+
});
|
|
115
|
+
};
|
|
104
116
|
// // 如果 schedule_ids 为空,则需要尝试从 schedule 模块里获取
|
|
105
117
|
// if (!schedule_ids?.length) {
|
|
106
118
|
// const schedule_ids_data = this.store.schedule
|
|
@@ -180,6 +192,7 @@ class ProductList extends _BaseModule.BaseModule {
|
|
|
180
192
|
const handledByOsServer = (0, _clientDataVariants.isProductQueryHandledByOsServer)(this.core, this.request);
|
|
181
193
|
const originalCallback = options?.callback;
|
|
182
194
|
const subscriptionCallback = typeof originalCallback === 'function' ? async result => {
|
|
195
|
+
if (scope !== this.otherParams.catalogScopeKey) return;
|
|
183
196
|
const callbackList = result?.data?.list;
|
|
184
197
|
if (!Array.isArray(callbackList)) {
|
|
185
198
|
originalCallback(result);
|
|
@@ -197,6 +210,7 @@ class ProductList extends _BaseModule.BaseModule {
|
|
|
197
210
|
queryPayload,
|
|
198
211
|
handledByOsServer
|
|
199
212
|
});
|
|
213
|
+
assertScope();
|
|
200
214
|
await this.addProduct(products);
|
|
201
215
|
originalCallback(handledByOsServer ? result : {
|
|
202
216
|
...result,
|
|
@@ -212,6 +226,7 @@ class ProductList extends _BaseModule.BaseModule {
|
|
|
212
226
|
subscriberId: options?.subscriberId,
|
|
213
227
|
customToast: () => {}
|
|
214
228
|
});
|
|
229
|
+
assertScope();
|
|
215
230
|
if (!handledByOsServer && Array.isArray(productsData.data.list)) {
|
|
216
231
|
this.replaceRawProductQueryResult(productsData.data.list, product_ids);
|
|
217
232
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Module, PisellCore, ModuleOptions } from '../../types';
|
|
2
2
|
import { BaseModule } from '../BaseModule';
|
|
3
|
-
import { Rules, RulesModuleAPI, DiscountResult, RulesFormSubject, RulesCalcDiscountOptions, UnavailableReason } from './types';
|
|
3
|
+
import { Rules, RulesModuleAPI, DiscountResult, RulesFormSubject, RulesCalcDiscountOptions, RulesCalcDiscountParams, UnavailableReason } from './types';
|
|
4
4
|
import { Discount } from '../Discount/types';
|
|
5
5
|
import { WindowPlugin } from '../../plugins';
|
|
6
6
|
export declare class RulesModule extends BaseModule implements Module, RulesModuleAPI {
|
|
@@ -9,6 +9,8 @@ export declare class RulesModule extends BaseModule implements Module, RulesModu
|
|
|
9
9
|
private store;
|
|
10
10
|
window: WindowPlugin;
|
|
11
11
|
private hooks;
|
|
12
|
+
private discountScope?;
|
|
13
|
+
setDiscountScope(scope: (product: any, discount: Discount) => boolean): void;
|
|
12
14
|
constructor(name?: string, version?: string);
|
|
13
15
|
initialize(core: PisellCore, options?: ModuleOptions): Promise<void>;
|
|
14
16
|
setRulesList(rulesList: Rules[]): Promise<void>;
|
|
@@ -44,15 +46,8 @@ export declare class RulesModule extends BaseModule implements Module, RulesModu
|
|
|
44
46
|
resolveDiscountListForManualOverride(discountList: Discount[]): Discount[];
|
|
45
47
|
private isItemRewardProductDiscount;
|
|
46
48
|
private getUnavailableReason;
|
|
47
|
-
calcDiscount(
|
|
48
|
-
|
|
49
|
-
productList: any[];
|
|
50
|
-
holders: {
|
|
51
|
-
form_record_id: number;
|
|
52
|
-
}[];
|
|
53
|
-
isFormSubject: RulesFormSubject;
|
|
54
|
-
orderTotalAmount: number;
|
|
55
|
-
}, options?: RulesCalcDiscountOptions): DiscountResult;
|
|
49
|
+
calcDiscount(params: RulesCalcDiscountParams, options?: RulesCalcDiscountOptions): DiscountResult;
|
|
50
|
+
private calcDiscountCore;
|
|
56
51
|
/**
|
|
57
52
|
* 检查优惠是否符合 PackageSubItemUsageRules 配置
|
|
58
53
|
* @param discount 优惠券
|
|
@@ -14,6 +14,7 @@ var _lodashEs = require("lodash-es");
|
|
|
14
14
|
var _dayjs = _interopRequireDefault(require("dayjs"));
|
|
15
15
|
var _entitlementPass = require("../Discount/entitlementPass");
|
|
16
16
|
var _availability = require("../Discount/availability");
|
|
17
|
+
var _promotionSelection = require("./promotionSelection");
|
|
17
18
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
18
19
|
class RulesModule extends _BaseModule.BaseModule {
|
|
19
20
|
defaultName = 'rules';
|
|
@@ -21,6 +22,10 @@ class RulesModule extends _BaseModule.BaseModule {
|
|
|
21
22
|
store;
|
|
22
23
|
window; // WindowPlugin 实例
|
|
23
24
|
hooks;
|
|
25
|
+
discountScope;
|
|
26
|
+
setDiscountScope(scope) {
|
|
27
|
+
this.discountScope = scope;
|
|
28
|
+
}
|
|
24
29
|
constructor(name, version) {
|
|
25
30
|
super(name, version);
|
|
26
31
|
this.hooks = {};
|
|
@@ -146,6 +151,12 @@ class RulesModule extends _BaseModule.BaseModule {
|
|
|
146
151
|
}
|
|
147
152
|
});
|
|
148
153
|
|
|
154
|
+
// 卡可用但互斥比较选择了促销时,扫码仍应加入可选卡列表,不能被标为商品不适用。
|
|
155
|
+
if (!hasApplicableDiscount) {
|
|
156
|
+
const promotionProductIds = new Set(result.productList.filter(product => (0, _promotionSelection.getExclusivePromotion)(product)?.inPromotion === true).map(product => this.hooks.getProduct(product).id));
|
|
157
|
+
hasApplicableDiscount = result.discountList.some(discount => newDiscountIds.includes(discount.id) && (0, _promotionSelection.isPromotionDiscountCard)(discount) && discount.isAvailable && discount.applicableProductIds?.some(id => promotionProductIds.has(id)));
|
|
158
|
+
}
|
|
159
|
+
|
|
149
160
|
// 如果券不可用,判断不可用原因
|
|
150
161
|
let unavailableReason;
|
|
151
162
|
if (!hasApplicableDiscount) {
|
|
@@ -213,13 +224,28 @@ class RulesModule extends _BaseModule.BaseModule {
|
|
|
213
224
|
}
|
|
214
225
|
return _types.UnavailableReason.Unknown;
|
|
215
226
|
}
|
|
216
|
-
calcDiscount({
|
|
227
|
+
calcDiscount(params, options) {
|
|
228
|
+
return (0, _promotionSelection.calculatePromotionSelection)(params, options, this.hooks, (input, calculationOptions, policy) => this.calcDiscountCore(input, calculationOptions, policy));
|
|
229
|
+
}
|
|
230
|
+
calcDiscountCore({
|
|
217
231
|
discountList,
|
|
218
232
|
productList,
|
|
219
233
|
holders,
|
|
220
234
|
isFormSubject,
|
|
221
235
|
orderTotalAmount
|
|
222
|
-
}, options) {
|
|
236
|
+
}, options, promotionPolicy) {
|
|
237
|
+
const cancelledPromotionCards = discountList.filter(discount => !discount.isEditMode && (0, _promotionSelection.isPromotionDiscountCard)(discount) && discount.promotionSelection === 'promotion');
|
|
238
|
+
const cancelledPromotionProductIds = new Set(cancelledPromotionCards.flatMap(discount => discount.applicableProductIds || []));
|
|
239
|
+
const cancelledPromotionStrategyIds = new Set(cancelledPromotionCards.flatMap(discount => discount.promotionSelectionStrategyIds || []));
|
|
240
|
+
const isCardBlockedByPromotion = (flatItem, discount) => {
|
|
241
|
+
if (flatItem.type !== 'main' || !(0, _promotionSelection.isPromotionDiscountCard)(discount)) return false;
|
|
242
|
+
const originProduct = flatItem.originProduct;
|
|
243
|
+
if (originProduct?.order_detail_id || originProduct?.orderDetailId || originProduct?.booking_id || originProduct?.metadata?.booking_id) return false;
|
|
244
|
+
// 取消卡后即使数量暂未凑足促销,也不能自动改用另一张卡;重新手选/最佳组合会清除该意图。
|
|
245
|
+
if (cancelledPromotionProductIds.has(flatItem.product.id) || cancelledPromotionStrategyIds.has(String(originProduct?.metadata?._promotion?.strategyId))) return true;
|
|
246
|
+
const promotion = (0, _promotionSelection.getExclusivePromotion)(originProduct);
|
|
247
|
+
return Boolean(promotion && promotionPolicy?.blockedStrategyIds.has(String(promotion.strategyId)));
|
|
248
|
+
};
|
|
223
249
|
const preferredEntitlementPassIds = new Set((options?.preferredEntitlementPassIds || []).map(String));
|
|
224
250
|
const resolveIsFormSubject = product => typeof isFormSubject === 'function' ? Boolean(isFormSubject(product)) : Boolean(isFormSubject);
|
|
225
251
|
|
|
@@ -723,7 +749,9 @@ class RulesModule extends _BaseModule.BaseModule {
|
|
|
723
749
|
|
|
724
750
|
// 辅助函数:检查商品是否对某个折扣卡可用
|
|
725
751
|
const checkItemApplicableForDiscount = (flatItem, discount) => {
|
|
752
|
+
if (this.discountScope && !this.discountScope(flatItem.originProduct, discount)) return false;
|
|
726
753
|
if (discount.config?.isAvailable === false) return false;
|
|
754
|
+
if (isCardBlockedByPromotion(flatItem, discount)) return false;
|
|
727
755
|
let product;
|
|
728
756
|
if (flatItem.type === 'main') {
|
|
729
757
|
product = flatItem.product;
|
|
@@ -784,6 +812,11 @@ class RulesModule extends _BaseModule.BaseModule {
|
|
|
784
812
|
return isLimitedProduct && isBundleAvailable;
|
|
785
813
|
};
|
|
786
814
|
|
|
815
|
+
// 分摊占位与实际应用共用选择优先级,数量跌出促销门槛时也保留手选意图。
|
|
816
|
+
const findExplicitlySelectedDiscount = applicableDiscounts => (options?.isSelected === true && options.discountId !== undefined ? applicableDiscounts.find(discount => String(discount.id) === String(options.discountId) && ((0, _entitlementPass.isFullCoveragePass)(discount) || (0, _promotionSelection.isPromotionDiscountCard)(discount))) : undefined) || (options?.preserveEntitlementSelection !== false ? applicableDiscounts.find(discount => discount.promotionSelection === 'card') : undefined);
|
|
817
|
+
const getAppliedWalletDiscountIds = product => new Set((product.discount_list || []).filter(item => ['entitlement_pass', 'discount_card', 'product_discount_card'].includes(item?.tag || item?.type)).map(item => item?.discount?.resource_id ?? item?.resource_id ?? item?.id).filter(id => id !== undefined && id !== null).map(String));
|
|
818
|
+
const findAppliedDiscountCard = (applicableDiscounts, appliedIds) => options?.scan || options?.preserveEntitlementSelection === false ? undefined : applicableDiscounts.find(discount => discount.isSelected === true && (0, _promotionSelection.isPromotionDiscountCard)(discount) && appliedIds.has(String(discount.id)));
|
|
819
|
+
|
|
787
820
|
// 收集所有被勾选的 order_level 折扣卡及其适用商品
|
|
788
821
|
const selectedOrderLevelDiscounts = sortedDiscountList.filter(discount => {
|
|
789
822
|
return (0, _utils.isOrderLevelFixedAmountDiscount)(discount) && discount.isSelected !== false;
|
|
@@ -811,6 +844,18 @@ class RulesModule extends _BaseModule.BaseModule {
|
|
|
811
844
|
// Map<flatItemId, discountId> - 记录被占用的商品及其对应的折扣卡
|
|
812
845
|
const occupiedItems = new Map();
|
|
813
846
|
|
|
847
|
+
// 手选/已应用的卡先占位(包括全品类卡),其他候选卡不能抢走其分摊商品。
|
|
848
|
+
sortedFlattenedList.forEach(flatItem => {
|
|
849
|
+
const product = flatItem.type === 'main' ? flatItem.product : flatItem.bundleItem;
|
|
850
|
+
const holderProduct = flatItem.type === 'main' ? flatItem.product : flatItem.parentProduct;
|
|
851
|
+
const applicableCards = sortedDiscountList.filter(discount => (0, _promotionSelection.isPromotionDiscountCard)(discount) && discount.config?.isAvailable && checkItemApplicableForDiscount(flatItem, discount) && this.checkHolderMatch(discount, {
|
|
852
|
+
isNeedHolder: resolveIsFormSubject(holderProduct) && !holderProduct?.isNormalProduct,
|
|
853
|
+
holder_id: holderProduct?.holder_id || product.holder_id
|
|
854
|
+
}, flatItem.originProduct, holders));
|
|
855
|
+
const preferredCard = findExplicitlySelectedDiscount(applicableCards) || findAppliedDiscountCard(applicableCards, getAppliedWalletDiscountIds(product)) || applicableCards.find(discount => discount.isScan && discount.isSelected);
|
|
856
|
+
if (preferredCard) occupiedItems.set(flatItem._id, preferredCard.id);
|
|
857
|
+
});
|
|
858
|
+
|
|
814
859
|
// 按排序顺序遍历折扣卡,判断哪些是专属折扣卡
|
|
815
860
|
selectedOrderLevelDiscounts.forEach(discount => {
|
|
816
861
|
const limitedData = discount.limited_relation_product_data;
|
|
@@ -970,6 +1015,9 @@ class RulesModule extends _BaseModule.BaseModule {
|
|
|
970
1015
|
if (isAvailableProduct && !isItemRewardProductDiscount && isLimitedProduct && timeLimit && isBundleAvailable && discount.config?.isAvailable && ((0, _entitlementPass.isFullCoveragePass)(discount) || isDiscountCardPriceAvailable(flatItem, discount)) && (!(0, _entitlementPass.isEntitlementPass)(discount) || (0, _entitlementPass.getRemainingEntitlementUses)(discount, 0, 1) > 0)) {
|
|
971
1016
|
// 记录此优惠券适用的商品
|
|
972
1017
|
discountApplicability.get(discount.id)?.push(product.id);
|
|
1018
|
+
if (flatItem.type === 'main' && (0, _promotionSelection.isPromotionDiscountCard)(discount)) {
|
|
1019
|
+
promotionPolicy?.onApplicableCard?.(originProduct, discount);
|
|
1020
|
+
}
|
|
973
1021
|
|
|
974
1022
|
// 记录可抵扣的商品详情
|
|
975
1023
|
const applicableProducts = discountApplicableProducts.get(discount.id) || [];
|
|
@@ -1113,7 +1161,9 @@ class RulesModule extends _BaseModule.BaseModule {
|
|
|
1113
1161
|
|
|
1114
1162
|
// 找到适用于此商品的所有优惠券,仅考虑isSelected不为false的优惠券
|
|
1115
1163
|
const applicableDiscounts = sortedDiscountList.filter(discount => {
|
|
1164
|
+
if (this.discountScope && !this.discountScope(originProduct, discount)) return false;
|
|
1116
1165
|
if (this.isItemRewardProductDiscount(product)) return false;
|
|
1166
|
+
if (isCardBlockedByPromotion(flatItem, discount)) return false;
|
|
1117
1167
|
// 🔥 检查策略可用性(针对全额抵扣卡和折扣卡)
|
|
1118
1168
|
const discountType = discount.tag || discount.type;
|
|
1119
1169
|
const currentOriginUid = getOriginProductUid(originProduct);
|
|
@@ -1193,20 +1243,14 @@ class RulesModule extends _BaseModule.BaseModule {
|
|
|
1193
1243
|
|
|
1194
1244
|
// 识别用户本次显式选择的卡券,供次卡和折扣卡各自的优先级使用。
|
|
1195
1245
|
// 目标仍必须在当前商品的 applicableDiscounts 中,因此不会绕过 Holder、时间或商品范围校验。
|
|
1196
|
-
const explicitlySelectedDiscount =
|
|
1197
|
-
const discountType = discount.tag || discount.type;
|
|
1198
|
-
return String(discount.id) === String(options.discountId) && ['entitlement_pass', 'good_pass', 'discount_card', 'product_discount_card'].includes(discountType ?? '');
|
|
1199
|
-
}) : undefined;
|
|
1246
|
+
const explicitlySelectedDiscount = findExplicitlySelectedDiscount(applicableDiscounts);
|
|
1200
1247
|
// 折扣卡会复用于整条商品行;商品券必须继续按单张拆分,不能复用该分支。
|
|
1201
1248
|
const explicitlySelectedDiscountCard = explicitlySelectedDiscount && !(0, _entitlementPass.isFullCoveragePass)(explicitlySelectedDiscount) ? explicitlySelectedDiscount : undefined;
|
|
1202
1249
|
|
|
1203
1250
|
// 商品数量等变化会触发无 discountId 的重算。只要当前行已应用的卡仍在
|
|
1204
1251
|
// applicableDiscounts 中,就应保留该行选择,避免被自动排序中力度更大的卡替换。
|
|
1205
|
-
const appliedWalletDiscountIds =
|
|
1206
|
-
const appliedDiscountCard =
|
|
1207
|
-
const discountType = discount.tag || discount.type;
|
|
1208
|
-
return discount.isSelected === true && ['discount_card', 'product_discount_card'].includes(discountType ?? '') && appliedWalletDiscountIds.has(String(discount.id));
|
|
1209
|
-
});
|
|
1252
|
+
const appliedWalletDiscountIds = getAppliedWalletDiscountIds(product);
|
|
1253
|
+
const appliedDiscountCard = findAppliedDiscountCard(applicableDiscounts, appliedWalletDiscountIds);
|
|
1210
1254
|
const appliedEntitlementPass = options?.scan || options?.preserveEntitlementSelection === false ? undefined : applicableDiscounts.find(discount => (0, _entitlementPass.isEntitlementPass)(discount) && discount.isSelected === true && appliedWalletDiscountIds.has(String(discount.id)));
|
|
1211
1255
|
|
|
1212
1256
|
// 次卡内部按本次手选/扫码、当前行已应用、默认排序选择。
|
|
@@ -1441,14 +1485,15 @@ class RulesModule extends _BaseModule.BaseModule {
|
|
|
1441
1485
|
let discountedOptions = product.options;
|
|
1442
1486
|
let optionDiscountAmount = 0;
|
|
1443
1487
|
let reapplyDiscountPercent;
|
|
1444
|
-
|
|
1445
|
-
|
|
1446
|
-
|
|
1447
|
-
|
|
1488
|
+
const bookingDiscountPercent = resolveReapplyBookingDiscountPercent(originProduct, selectedDiscount);
|
|
1489
|
+
if (isOrderLevel && (productAllocation || bookingDiscountPercent === undefined)) {
|
|
1490
|
+
// 整单卡只能使用分摊结果,缺少分摊时不能回退为每件扣减整单额度。
|
|
1491
|
+
amount = productAllocation?.discountAmount ?? 0;
|
|
1492
|
+
productDiscountDifference = productAllocation?.difference;
|
|
1448
1493
|
mainProductSellingPrice = Math.max(new _decimal.default(product.price).minus(amount).toNumber(), 0);
|
|
1449
|
-
} else if (
|
|
1494
|
+
} else if (bookingDiscountPercent !== undefined) {
|
|
1450
1495
|
// Change time 重套编辑态折扣卡时,历史 par_value 不是运行时折扣口径,优先使用后端快照里的 percent。
|
|
1451
|
-
const percent =
|
|
1496
|
+
const percent = bookingDiscountPercent;
|
|
1452
1497
|
reapplyDiscountPercent = new _decimal.default(percent).toFixed(2);
|
|
1453
1498
|
mainProductSellingPrice = new _decimal.default(product.price || 0).mul(new _decimal.default(100).minus(percent)).div(100).toDecimalPlaces(2).toNumber();
|
|
1454
1499
|
amount = new _decimal.default(product.price).minus(mainProductSellingPrice).toNumber();
|
|
@@ -1642,15 +1687,16 @@ class RulesModule extends _BaseModule.BaseModule {
|
|
|
1642
1687
|
let fixedAmountPerItem;
|
|
1643
1688
|
let productDiscountDifference;
|
|
1644
1689
|
let reapplyDiscountPercent;
|
|
1645
|
-
|
|
1690
|
+
const bookingDiscountPercent = resolveReapplyBookingDiscountPercent(originProduct, selectedDiscount);
|
|
1691
|
+
if (isOrderLevel && (productAllocation || bookingDiscountPercent === undefined)) {
|
|
1646
1692
|
// order_level:使用预计算的单价折扣金额(已经是单价,无需再除以数量)
|
|
1647
|
-
fixedAmountPerItem = productAllocation
|
|
1648
|
-
productDiscountDifference = productAllocation
|
|
1693
|
+
fixedAmountPerItem = productAllocation?.discountAmount ?? 0;
|
|
1694
|
+
productDiscountDifference = productAllocation?.difference;
|
|
1649
1695
|
targetProductTotal = Math.max(new _decimal.default(productOriginTotal).minus(fixedAmountPerItem).toNumber(), 0);
|
|
1650
|
-
} else if (
|
|
1696
|
+
} else if (bookingDiscountPercent !== undefined) {
|
|
1651
1697
|
// hydrate 后 par_value 可能是余额/原值(例如 3500),百分比口径以
|
|
1652
1698
|
// 后端折扣快照 discount.percent 为准,与主商品重套逻辑保持一致。
|
|
1653
|
-
const percent =
|
|
1699
|
+
const percent = bookingDiscountPercent;
|
|
1654
1700
|
reapplyDiscountPercent = new _decimal.default(percent).toFixed(2);
|
|
1655
1701
|
targetProductTotal = new _decimal.default(productOriginTotal).mul(new _decimal.default(100).minus(percent)).div(100).toDecimalPlaces(2).toNumber();
|
|
1656
1702
|
fixedAmountPerItem = new _decimal.default(productOriginTotal).minus(targetProductTotal).toNumber();
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { Discount } from '../Discount/types';
|
|
2
|
+
import type { DiscountResult, RulesCalcDiscountOptions, RulesCalcDiscountParams, RulesParamsHooks } from './types';
|
|
3
|
+
export declare function isPromotionDiscountCard(discount: any): boolean;
|
|
4
|
+
/** 只处理当前购物车的 X 件 Y 元,历史成交和其他促销继续使用原有规则。 */
|
|
5
|
+
export declare function getExclusivePromotion(product: any): any | undefined;
|
|
6
|
+
export interface PromotionSelectionPolicy {
|
|
7
|
+
blockedStrategyIds: ReadonlySet<string>;
|
|
8
|
+
onApplicableCard?: (product: any, discount: Discount) => void;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* 以完整策略参与组为单位比较两套实际报价。每次试算都从同一快照开始,
|
|
12
|
+
* 由原引擎重新做卡券校验和整单卡分摊,不能从叠加结果里事后减掉某条优惠。
|
|
13
|
+
*/
|
|
14
|
+
export declare function calculatePromotionSelection(params: RulesCalcDiscountParams, options: RulesCalcDiscountOptions | undefined, hooks: RulesParamsHooks, calculate: (params: RulesCalcDiscountParams, options?: RulesCalcDiscountOptions, policy?: PromotionSelectionPolicy) => DiscountResult): DiscountResult;
|
|
@@ -0,0 +1,230 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.calculatePromotionSelection = calculatePromotionSelection;
|
|
7
|
+
exports.getExclusivePromotion = getExclusivePromotion;
|
|
8
|
+
exports.isPromotionDiscountCard = isPromotionDiscountCard;
|
|
9
|
+
var _decimal = _interopRequireDefault(require("decimal.js"));
|
|
10
|
+
var _lodashEs = require("lodash-es");
|
|
11
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
12
|
+
function isPromotionDiscountCard(discount) {
|
|
13
|
+
return ['discount_card', 'product_discount_card'].includes(discount?.tag || discount?.type);
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
/** 只处理当前购物车的 X 件 Y 元,历史成交和其他促销继续使用原有规则。 */
|
|
17
|
+
function getExclusivePromotion(product) {
|
|
18
|
+
const promotion = product?.metadata?._promotion;
|
|
19
|
+
if (product?.order_detail_id || product?.orderDetailId || product?.booking_id || product?.metadata?.booking_id || promotion?.actionType !== 'X_ITEMS_FOR_Y_PRICE' || !promotion.strategyId || !(promotion.inPromotion === true || promotion.excludedByDiscountCard === true)) return undefined;
|
|
20
|
+
return promotion;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* 以完整策略参与组为单位比较两套实际报价。每次试算都从同一快照开始,
|
|
24
|
+
* 由原引擎重新做卡券校验和整单卡分摊,不能从叠加结果里事后减掉某条优惠。
|
|
25
|
+
*/
|
|
26
|
+
function calculatePromotionSelection(params, options, hooks, calculate) {
|
|
27
|
+
const discountList = params.discountList.map(discount => {
|
|
28
|
+
if (discount.isEditMode || !isPromotionDiscountCard(discount)) return discount;
|
|
29
|
+
if (options?.preserveEntitlementSelection === false) {
|
|
30
|
+
return {
|
|
31
|
+
...discount,
|
|
32
|
+
promotionSelection: undefined,
|
|
33
|
+
promotionSelectionStrategyIds: undefined,
|
|
34
|
+
isManualSelect: false
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
if (options?.discountId !== undefined && String(discount.id) === String(options.discountId) && typeof options.isSelected === 'boolean') {
|
|
38
|
+
return {
|
|
39
|
+
...discount,
|
|
40
|
+
promotionSelection: options.isSelected ? 'card' : 'promotion',
|
|
41
|
+
isSelected: options.isSelected,
|
|
42
|
+
isManualSelect: !options.isSelected
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
return {
|
|
46
|
+
...discount
|
|
47
|
+
};
|
|
48
|
+
});
|
|
49
|
+
// 未凑足促销时也要清理重叠商品上的旧手选,避免再次凑组后切回之前的卡。
|
|
50
|
+
const changedCard = options?.discountId !== undefined && typeof options.isSelected === 'boolean' ? discountList.find(discount => !discount.isEditMode && isPromotionDiscountCard(discount) && String(discount.id) === String(options.discountId)) : undefined;
|
|
51
|
+
if (changedCard) {
|
|
52
|
+
const changedProductIds = new Set(changedCard.applicableProductIds || []);
|
|
53
|
+
for (const product of params.productList) {
|
|
54
|
+
const detail = hooks.getProduct(product);
|
|
55
|
+
if (detail.discount_list?.some(discount => isPromotionDiscountCard(discount) && String(discount.discount?.resource_id ?? discount.id) === String(changedCard.id))) changedProductIds.add(detail.id);
|
|
56
|
+
}
|
|
57
|
+
for (const discount of discountList) {
|
|
58
|
+
if (discount.isEditMode || !isPromotionDiscountCard(discount) || String(discount.id) === String(changedCard.id) || !discount.promotionSelection) continue;
|
|
59
|
+
if (discount.applicableProductIds?.some(id => changedProductIds.has(id))) {
|
|
60
|
+
discount.promotionSelection = undefined;
|
|
61
|
+
discount.promotionSelectionStrategyIds = undefined;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
const strategyIds = new Set();
|
|
66
|
+
for (const product of params.productList) {
|
|
67
|
+
const promotion = getExclusivePromotion(product);
|
|
68
|
+
if (promotion && hooks.getProduct(product).isManualDiscount !== true) {
|
|
69
|
+
strategyIds.add(String(promotion.strategyId));
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
if (!strategyIds.size) return calculate({
|
|
73
|
+
...params,
|
|
74
|
+
discountList
|
|
75
|
+
}, options);
|
|
76
|
+
const applicableGroups = new Map();
|
|
77
|
+
const quote = (blockedStrategyIds, collectApplicable = false) => {
|
|
78
|
+
const productList = (0, _lodashEs.cloneDeep)(params.productList).map(product => {
|
|
79
|
+
const promotion = getExclusivePromotion(product);
|
|
80
|
+
if (!promotion || !strategyIds.has(String(promotion.strategyId))) return product;
|
|
81
|
+
const detail = hooks.getProduct(product);
|
|
82
|
+
if (detail.isManualDiscount === true) return product;
|
|
83
|
+
const keepPromotion = blockedStrategyIds.has(String(promotion.strategyId));
|
|
84
|
+
const originalPrice = Number(promotion.originalPrice ?? detail.price);
|
|
85
|
+
const finalPrice = Number(promotion.finalPrice);
|
|
86
|
+
const promotionDiscount = (detail.discount_list || []).find(discount => discount.type === 'promotion');
|
|
87
|
+
const retainedDiscounts = (detail.discount_list || []).filter(discount => discount.type !== 'promotion' && (!isPromotionDiscountCard(discount) || !keepPromotion && discountList.some(card => !card.isManualSelect && String(card.id) === String(discount.discount?.resource_id ?? discount.id))));
|
|
88
|
+
if (keepPromotion && originalPrice !== finalPrice) {
|
|
89
|
+
retainedDiscounts.push(promotionDiscount || {
|
|
90
|
+
type: 'promotion',
|
|
91
|
+
amount: new _decimal.default(originalPrice).minus(finalPrice).toFixed(2),
|
|
92
|
+
discount: {
|
|
93
|
+
original_amount: String(originalPrice),
|
|
94
|
+
fixed_amount: new _decimal.default(originalPrice).minus(finalPrice).toFixed(2),
|
|
95
|
+
title: promotion.strategyMetadata?.name || '',
|
|
96
|
+
resource_id: ''
|
|
97
|
+
}
|
|
98
|
+
});
|
|
99
|
+
}
|
|
100
|
+
product.metadata._promotion = {
|
|
101
|
+
...promotion,
|
|
102
|
+
inPromotion: keepPromotion,
|
|
103
|
+
excludedByDiscountCard: !keepPromotion
|
|
104
|
+
};
|
|
105
|
+
return hooks.setProduct(product, {
|
|
106
|
+
discount_list: retainedDiscounts,
|
|
107
|
+
main_product_selling_price: keepPromotion ? finalPrice : originalPrice
|
|
108
|
+
});
|
|
109
|
+
});
|
|
110
|
+
return calculate({
|
|
111
|
+
...params,
|
|
112
|
+
productList,
|
|
113
|
+
discountList: (0, _lodashEs.cloneDeep)(discountList).map(discount => !discount.isEditMode && isPromotionDiscountCard(discount) && !discount.isManualSelect
|
|
114
|
+
// 自动落选不等于手动禁用;整单卡仍须进入下一轮候选分摊。
|
|
115
|
+
? {
|
|
116
|
+
...discount,
|
|
117
|
+
isSelected: discount.isSelected === false ? undefined : discount.isSelected
|
|
118
|
+
} : discount)
|
|
119
|
+
}, options, {
|
|
120
|
+
blockedStrategyIds,
|
|
121
|
+
onApplicableCard: collectApplicable ? (product, discount) => {
|
|
122
|
+
const promotion = getExclusivePromotion(product);
|
|
123
|
+
if (!promotion || !strategyIds.has(String(promotion.strategyId))) return;
|
|
124
|
+
const id = String(discount.id);
|
|
125
|
+
const groups = applicableGroups.get(id) || new Set();
|
|
126
|
+
groups.add(String(promotion.strategyId));
|
|
127
|
+
applicableGroups.set(id, groups);
|
|
128
|
+
} : undefined
|
|
129
|
+
});
|
|
130
|
+
};
|
|
131
|
+
|
|
132
|
+
// 起点保留所有促销;未发生冲突的商品和卡券仍由原引擎正常计算。
|
|
133
|
+
let blockedStrategyIds = new Set(strategyIds);
|
|
134
|
+
let result = quote(blockedStrategyIds, true);
|
|
135
|
+
// 取消已应用的卡时,即使它刚好失效,也应恢复它原来替代的促销组。
|
|
136
|
+
for (const product of params.productList) {
|
|
137
|
+
const promotion = getExclusivePromotion(product);
|
|
138
|
+
if (!promotion || !strategyIds.has(String(promotion.strategyId))) continue;
|
|
139
|
+
for (const detail of hooks.getProduct(product).discount_list || []) {
|
|
140
|
+
if (!isPromotionDiscountCard(detail)) continue;
|
|
141
|
+
const id = String(detail.discount?.resource_id ?? detail.id);
|
|
142
|
+
if (!discountList.some(discount => String(discount.id) === id && (discount.isManualSelect || discount.promotionSelection === 'promotion'))) continue;
|
|
143
|
+
const groups = applicableGroups.get(id) || new Set();
|
|
144
|
+
groups.add(String(promotion.strategyId));
|
|
145
|
+
applicableGroups.set(id, groups);
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
// 同一参与组以最近一次手动操作为准,不能让先前选过的另一张卡重新压过取消操作。
|
|
149
|
+
const changedGroups = options?.discountId !== undefined && typeof options.isSelected === 'boolean' ? applicableGroups.get(String(options.discountId)) : undefined;
|
|
150
|
+
if (changedGroups?.size) {
|
|
151
|
+
for (const discount of discountList) {
|
|
152
|
+
if (!discount.isEditMode && String(discount.id) === String(options?.discountId)) {
|
|
153
|
+
discount.promotionSelectionStrategyIds = [...changedGroups];
|
|
154
|
+
continue;
|
|
155
|
+
}
|
|
156
|
+
if (discount.isEditMode || !isPromotionDiscountCard(discount) || String(discount.id) === String(options?.discountId) || !discount.promotionSelection) continue;
|
|
157
|
+
const groups = new Set([...(applicableGroups.get(String(discount.id)) || []), ...(discount.promotionSelectionStrategyIds || [])]);
|
|
158
|
+
if ([...groups].some(group => changedGroups.has(group))) {
|
|
159
|
+
discount.promotionSelection = undefined;
|
|
160
|
+
discount.promotionSelectionStrategyIds = undefined;
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
const manualPromotionGroups = new Set();
|
|
165
|
+
const manualCardGroups = new Set();
|
|
166
|
+
for (const discount of discountList) {
|
|
167
|
+
if (!isPromotionDiscountCard(discount) || discount.isEditMode) continue;
|
|
168
|
+
const groups = applicableGroups.get(String(discount.id)) || [];
|
|
169
|
+
if (discount.isManualSelect || discount.promotionSelection === 'promotion') {
|
|
170
|
+
for (const group of groups) manualPromotionGroups.add(group);
|
|
171
|
+
for (const group of discount.promotionSelectionStrategyIds || []) {
|
|
172
|
+
if (strategyIds.has(group)) manualPromotionGroups.add(group);
|
|
173
|
+
}
|
|
174
|
+
} else if (discount.promotionSelection === 'card') {
|
|
175
|
+
for (const group of groups) manualCardGroups.add(group);
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
const total = candidate => candidate.productList.reduce((sum, product) => {
|
|
179
|
+
const detail = hooks.getProduct(product);
|
|
180
|
+
const discounts = [...detail.discount_list, ...(detail.bundle || []).flatMap(bundle => (bundle.discount_list || []).filter(discount => !discount.id))];
|
|
181
|
+
// 与订单小计一致:整单卡未计入单价的尾差按行扣一次,不能漏算或再乘数量。
|
|
182
|
+
const difference = discounts.reduce((amount, discount) => amount.plus(discount.metadata?.product_discount_difference || 0), new _decimal.default(0));
|
|
183
|
+
return sum.plus(detail.total).minus(difference);
|
|
184
|
+
}, new _decimal.default(0));
|
|
185
|
+
const hasAppliedCard = (candidate, strategyId) => candidate.productList.some(product => String(getExclusivePromotion(product)?.strategyId) === strategyId && hooks.getProduct(product).discount_list.some(isPromotionDiscountCard));
|
|
186
|
+
// 手动选择先落定,随后只对未手选的参与组比较优惠。
|
|
187
|
+
for (const strategyId of manualCardGroups) {
|
|
188
|
+
const candidateBlocked = new Set(blockedStrategyIds);
|
|
189
|
+
candidateBlocked.delete(strategyId);
|
|
190
|
+
const candidate = quote(candidateBlocked);
|
|
191
|
+
if (hasAppliedCard(candidate, strategyId)) {
|
|
192
|
+
blockedStrategyIds = candidateBlocked;
|
|
193
|
+
result = candidate;
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
const automaticGroups = new Set([...strategyIds].filter(id => !manualCardGroups.has(id) && !manualPromotionGroups.has(id) && discountList.some(discount => !discount.isEditMode && !discount.isManualSelect && applicableGroups.get(String(discount.id))?.has(id))));
|
|
197
|
+
// 多组共用整单卡时先选节省最多的一组,再重新试算其余组,避免依赖购物车行顺序。
|
|
198
|
+
while (automaticGroups.size) {
|
|
199
|
+
let bestGroup;
|
|
200
|
+
let bestResult = result;
|
|
201
|
+
let bestTotal = total(result);
|
|
202
|
+
for (const strategyId of automaticGroups) {
|
|
203
|
+
const candidateBlocked = new Set(blockedStrategyIds);
|
|
204
|
+
candidateBlocked.delete(strategyId);
|
|
205
|
+
const candidate = quote(candidateBlocked);
|
|
206
|
+
const candidateTotal = total(candidate);
|
|
207
|
+
// 没有实际可用卡时保持促销;同价继续保留促销。
|
|
208
|
+
if (hasAppliedCard(candidate, strategyId) && candidateTotal.lessThan(bestTotal)) {
|
|
209
|
+
bestGroup = strategyId;
|
|
210
|
+
bestResult = candidate;
|
|
211
|
+
bestTotal = candidateTotal;
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
if (bestGroup === undefined) break;
|
|
215
|
+
blockedStrategyIds.delete(bestGroup);
|
|
216
|
+
automaticGroups.delete(bestGroup);
|
|
217
|
+
result = bestResult;
|
|
218
|
+
}
|
|
219
|
+
// 即使最终保留首次报价,也要回写上面清除的旧手动意图。
|
|
220
|
+
result.discountList = result.discountList.map(discount => {
|
|
221
|
+
if (discount.isEditMode || !isPromotionDiscountCard(discount)) return discount;
|
|
222
|
+
const selection = discountList.find(card => !card.isEditMode && String(card.id) === String(discount.id));
|
|
223
|
+
return {
|
|
224
|
+
...discount,
|
|
225
|
+
promotionSelection: selection?.promotionSelection,
|
|
226
|
+
promotionSelectionStrategyIds: selection?.promotionSelectionStrategyIds
|
|
227
|
+
};
|
|
228
|
+
});
|
|
229
|
+
return result;
|
|
230
|
+
}
|
|
@@ -24,6 +24,15 @@ export interface DiscountResult {
|
|
|
24
24
|
discountList: any[];
|
|
25
25
|
}
|
|
26
26
|
export type RulesFormSubject = boolean | ((product: any) => boolean);
|
|
27
|
+
export interface RulesCalcDiscountParams {
|
|
28
|
+
discountList: Discount[];
|
|
29
|
+
productList: any[];
|
|
30
|
+
holders: {
|
|
31
|
+
form_record_id: number;
|
|
32
|
+
}[];
|
|
33
|
+
isFormSubject: RulesFormSubject;
|
|
34
|
+
orderTotalAmount: number;
|
|
35
|
+
}
|
|
27
36
|
export interface RulesCalcDiscountOptions {
|
|
28
37
|
isSelected?: boolean;
|
|
29
38
|
discountId?: number;
|
|
@@ -315,6 +315,8 @@ export declare class OrderModule extends BaseModule implements Module {
|
|
|
315
315
|
*/
|
|
316
316
|
private getOrderStorageKey;
|
|
317
317
|
private getPersistedOrderStorageKey;
|
|
318
|
+
private getRealOrderId;
|
|
319
|
+
private findLocalOrderIndexByIdentity;
|
|
318
320
|
private getOrderIdentityMatchKeys;
|
|
319
321
|
private doOrdersShareIdentity;
|
|
320
322
|
private findOrderIndexByIdentity;
|
|
@@ -346,6 +348,10 @@ export declare class OrderModule extends BaseModule implements Module {
|
|
|
346
348
|
private getStorageItem;
|
|
347
349
|
private setStorageItem;
|
|
348
350
|
private loadOrdersFromSQLite;
|
|
351
|
+
/** 历史记录只按真实订单 ID / 唯一本地编号归组,不使用桌号或小票短号。 */
|
|
352
|
+
private deduplicateStoredOrders;
|
|
353
|
+
private mergeStoredOrderCopies;
|
|
354
|
+
private writeOrderRowsToSQLite;
|
|
349
355
|
private isPendingSyncOrder;
|
|
350
356
|
private isDraftOrder;
|
|
351
357
|
private shouldProtectDraftOrderFromIncoming;
|