@pisell/pisellos 2.2.152 → 2.2.154
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/core/index.js +1 -0
- package/dist/model/strategy/adapter/promotion/index.js +9 -0
- package/dist/modules/Cart/utils/cartProduct.js +1 -1
- package/dist/modules/Discount/index.d.ts +6 -2
- package/dist/modules/Discount/index.js +14 -8
- package/dist/modules/Order/index.d.ts +2 -0
- package/dist/modules/Order/index.js +234 -161
- package/dist/modules/Order/types.d.ts +19 -0
- package/dist/modules/Order/utils.js +7 -6
- package/dist/modules/Payment/index.d.ts +4 -0
- package/dist/modules/Payment/index.js +567 -505
- package/dist/modules/Payment/types.d.ts +29 -9
- package/dist/modules/SalesSummary/index.d.ts +7 -5
- package/dist/modules/SalesSummary/index.js +35 -11
- package/dist/plugins/app.d.ts +2 -0
- package/dist/server/index.d.ts +2 -5
- package/dist/server/index.js +58 -66
- package/dist/server/modules/index.d.ts +1 -1
- package/dist/server/modules/products/index.d.ts +12 -1
- package/dist/server/modules/products/index.js +169 -78
- package/dist/server/modules/products/types.d.ts +11 -0
- package/dist/server/modules/products/types.js +4 -0
- package/dist/server/utils/product.js +2 -2
- package/dist/solution/BaseSales/index.d.ts +26 -2
- package/dist/solution/BaseSales/index.js +342 -112
- package/dist/solution/BaseSales/types.d.ts +4 -4
- package/dist/solution/BaseSales/types.js +4 -4
- package/dist/solution/BaseSales/utils/transformBaseProductToOrderProduct.d.ts +62 -0
- package/dist/solution/BaseSales/utils/transformBaseProductToOrderProduct.js +116 -0
- package/dist/solution/BaseSales/utils.js +3 -3
- package/dist/solution/BookingByStep/index.d.ts +1 -1
- package/dist/solution/BookingTicket/index.d.ts +11 -13
- package/dist/solution/BookingTicket/index.js +23 -37
- package/dist/solution/BookingTicket/types.d.ts +9 -6
- package/dist/solution/BookingTicket/types.js +6 -3
- package/dist/solution/BookingTicket/utils/cartView.d.ts +7 -12
- package/dist/solution/BookingTicket/utils/cartView.js +52 -14
- package/dist/solution/BookingTicket/utils/orderCustomer.d.ts +4 -0
- package/dist/solution/BookingTicket/utils/orderCustomer.js +31 -0
- package/dist/solution/Sales/index.d.ts +3 -0
- package/dist/solution/Sales/index.js +85 -43
- package/dist/solution/Sales/types.d.ts +3 -0
- package/dist/solution/ScanOrder/types.d.ts +4 -4
- package/dist/solution/ScanOrder/types.js +4 -4
- package/dist/solution/ScanOrder/utils.js +3 -3
- package/dist/solution/ShopDiscount/index.d.ts +2 -1
- package/dist/solution/ShopDiscount/index.js +32 -20
- package/dist/solution/ShopDiscount/types.d.ts +1 -0
- package/lib/core/index.js +1 -0
- package/lib/modules/Cart/utils/cartProduct.js +1 -1
- package/lib/modules/Discount/index.d.ts +6 -2
- package/lib/modules/Discount/index.js +3 -1
- package/lib/modules/Order/index.d.ts +2 -0
- package/lib/modules/Order/index.js +40 -8
- package/lib/modules/Order/types.d.ts +19 -0
- package/lib/modules/Order/utils.js +4 -2
- package/lib/modules/Payment/index.d.ts +4 -0
- package/lib/modules/Payment/index.js +26 -2
- package/lib/modules/Payment/types.d.ts +29 -9
- package/lib/modules/SalesSummary/index.d.ts +7 -5
- package/lib/modules/SalesSummary/index.js +29 -9
- package/lib/plugins/app.d.ts +2 -0
- package/lib/server/index.d.ts +2 -5
- package/lib/server/index.js +38 -58
- package/lib/server/modules/index.d.ts +1 -1
- package/lib/server/modules/products/index.d.ts +12 -1
- package/lib/server/modules/products/index.js +69 -9
- package/lib/server/modules/products/types.d.ts +11 -0
- package/lib/server/utils/product.js +2 -2
- package/lib/solution/BaseSales/index.d.ts +26 -2
- package/lib/solution/BaseSales/index.js +169 -3
- package/lib/solution/BaseSales/types.d.ts +4 -4
- package/lib/solution/BaseSales/utils/transformBaseProductToOrderProduct.d.ts +62 -0
- package/lib/solution/BaseSales/utils/transformBaseProductToOrderProduct.js +155 -0
- package/lib/solution/BaseSales/utils.js +3 -3
- package/lib/solution/BookingByStep/index.d.ts +1 -1
- package/lib/solution/BookingTicket/index.d.ts +11 -13
- package/lib/solution/BookingTicket/index.js +17 -27
- package/lib/solution/BookingTicket/types.d.ts +9 -6
- package/lib/solution/BookingTicket/utils/cartView.d.ts +7 -12
- package/lib/solution/BookingTicket/utils/cartView.js +44 -18
- package/lib/solution/BookingTicket/utils/orderCustomer.d.ts +4 -0
- package/lib/solution/BookingTicket/utils/orderCustomer.js +58 -0
- package/lib/solution/Sales/index.d.ts +3 -0
- package/lib/solution/Sales/index.js +50 -15
- package/lib/solution/Sales/types.d.ts +3 -0
- package/lib/solution/ScanOrder/types.d.ts +4 -4
- package/lib/solution/ScanOrder/utils.js +3 -3
- package/lib/solution/ShopDiscount/index.d.ts +2 -1
- package/lib/solution/ShopDiscount/index.js +10 -4
- package/lib/solution/ShopDiscount/types.d.ts +1 -0
- package/package.json +1 -1
package/dist/core/index.js
CHANGED
|
@@ -0,0 +1,9 @@
|
|
|
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";
|
|
@@ -326,7 +326,7 @@ export var formatOptionsToOrigin = function formatOptionsToOrigin(options) {
|
|
|
326
326
|
return options.map(function (d) {
|
|
327
327
|
return {
|
|
328
328
|
num: d.num,
|
|
329
|
-
option_group_item_id: d.
|
|
329
|
+
option_group_item_id: d.option_group_item_id,
|
|
330
330
|
option_group_id: d.option_group_id
|
|
331
331
|
};
|
|
332
332
|
});
|
|
@@ -17,14 +17,18 @@ export declare class DiscountModule extends BaseModule implements Module, Discou
|
|
|
17
17
|
setOriginalDiscountList(originalDiscountList: Discount[]): Promise<void>;
|
|
18
18
|
getOriginalDiscountList(): Discount[];
|
|
19
19
|
loadPrepareConfig(params: {
|
|
20
|
-
action?: 'create';
|
|
20
|
+
action?: 'create' | 'edit';
|
|
21
21
|
with_good_pass: 0 | 1;
|
|
22
22
|
with_discount_card: 0 | 1;
|
|
23
23
|
customer_id: number;
|
|
24
24
|
with_wallet_pass_holder: 0 | 1;
|
|
25
25
|
request_timezone: string;
|
|
26
|
+
order_id?: number;
|
|
27
|
+
}): Promise<Discount[]>;
|
|
28
|
+
batchSearch(code: string, options?: {
|
|
29
|
+
customerId?: number;
|
|
30
|
+
orderId?: number;
|
|
26
31
|
}): Promise<Discount[]>;
|
|
27
|
-
batchSearch(code: string, customerId?: number): Promise<Discount[]>;
|
|
28
32
|
filterEnabledDiscountList(discountList: Discount[]): Discount[];
|
|
29
33
|
private checkUsageCreditsLimit;
|
|
30
34
|
uniqueByProductId(discountList: Discount[]): Discount[];
|
|
@@ -1,4 +1,6 @@
|
|
|
1
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); }
|
|
2
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
3
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
2
4
|
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
3
5
|
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
4
6
|
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
@@ -176,13 +178,14 @@ export var DiscountModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
176
178
|
}, {
|
|
177
179
|
key: "batchSearch",
|
|
178
180
|
value: function () {
|
|
179
|
-
var _batchSearch = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5(code,
|
|
180
|
-
var result, resultDiscountList;
|
|
181
|
+
var _batchSearch = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5(code, options) {
|
|
182
|
+
var _ref, customerId, orderId, result, resultDiscountList;
|
|
181
183
|
return _regeneratorRuntime().wrap(function _callee5$(_context5) {
|
|
182
184
|
while (1) switch (_context5.prev = _context5.next) {
|
|
183
185
|
case 0:
|
|
184
|
-
|
|
185
|
-
|
|
186
|
+
_ref = options || {}, customerId = _ref.customerId, orderId = _ref.orderId;
|
|
187
|
+
_context5.next = 3;
|
|
188
|
+
return this.request.get("/machinecode/batch-search", _objectSpread(_objectSpread({
|
|
186
189
|
code: code,
|
|
187
190
|
translate_flag: 1,
|
|
188
191
|
tags: ['good_pass', 'product_discount_card'],
|
|
@@ -190,14 +193,17 @@ export var DiscountModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
190
193
|
relation_product: 1,
|
|
191
194
|
with: ['extensionData', 'customScheduleSnapshot', 'holder.detail'],
|
|
192
195
|
order_behavior_count: 1,
|
|
193
|
-
order_behavior_count_customer_id: customerId || 1
|
|
196
|
+
order_behavior_count_customer_id: customerId || 1
|
|
197
|
+
}, orderId ? {
|
|
198
|
+
order_behavior_count_order_id: orderId
|
|
199
|
+
} : {}), {}, {
|
|
194
200
|
request_timezone: Intl.DateTimeFormat().resolvedOptions().timeZone
|
|
195
|
-
});
|
|
196
|
-
case
|
|
201
|
+
}));
|
|
202
|
+
case 3:
|
|
197
203
|
result = _context5.sent;
|
|
198
204
|
resultDiscountList = this.filterEnabledDiscountList((result === null || result === void 0 ? void 0 : result.data) || []) || [];
|
|
199
205
|
return _context5.abrupt("return", resultDiscountList);
|
|
200
|
-
case
|
|
206
|
+
case 6:
|
|
201
207
|
case "end":
|
|
202
208
|
return _context5.stop();
|
|
203
209
|
}
|
|
@@ -18,6 +18,7 @@ export declare class OrderModule extends BaseModule implements Module, OrderModu
|
|
|
18
18
|
private cacheId;
|
|
19
19
|
private salesSummaryModuleName;
|
|
20
20
|
private rulesHooksOverride?;
|
|
21
|
+
private orderHooks?;
|
|
21
22
|
private otherParams?;
|
|
22
23
|
/**
|
|
23
24
|
* Populate `savedAmount` on each discount based on product-level discount details.
|
|
@@ -143,6 +144,7 @@ export declare class OrderModule extends BaseModule implements Module, OrderModu
|
|
|
143
144
|
* 视为 wallet pass;其它支付项保持不变。
|
|
144
145
|
*/
|
|
145
146
|
updateVoucherOrderPayments(payments: OrderPaymentSource[]): OrderPaymentData[];
|
|
147
|
+
private shouldMergeProductToOrder;
|
|
146
148
|
addProductToOrder(product: Partial<OrderProduct> & OrderProductIdentity, booking?: AddProductBookingInput): Promise<OrderProduct[]>;
|
|
147
149
|
private hasGoodPassDiscount;
|
|
148
150
|
updateProductInOrder(params: UpdateProductInOrderParams): Promise<OrderProduct[]>;
|