@pisell/pisellos 2.2.243 → 2.2.245
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/modules/Discount/index.d.ts +1 -1
- package/dist/modules/Discount/index.js +10 -4
- package/dist/modules/Order/index.d.ts +7 -1
- package/dist/modules/Order/index.js +649 -514
- package/dist/modules/Order/types.d.ts +7 -0
- package/dist/modules/Order/utils.js +5 -2
- package/dist/modules/Payment/walletpass.js +33 -24
- package/dist/modules/Rules/index.js +4 -1
- package/dist/server/index.js +6 -4
- package/dist/server/modules/order/index.d.ts +1 -0
- package/dist/server/modules/order/index.js +60 -46
- package/dist/server/utils/small-ticket.js +39 -29
- package/dist/solution/BaseSales/index.d.ts +3 -2
- package/dist/solution/BaseSales/index.js +6 -0
- package/dist/solution/BaseSales/types.d.ts +6 -0
- package/dist/solution/BookingByStep/index.d.ts +1 -1
- package/dist/solution/BookingTicket/index.d.ts +1 -1
- package/dist/solution/BookingTicket/utils/scan/applyGlobalScan.js +46 -45
- package/lib/modules/Discount/index.d.ts +1 -1
- package/lib/modules/Discount/index.js +4 -0
- package/lib/modules/Order/index.d.ts +7 -1
- package/lib/modules/Order/index.js +105 -1
- package/lib/modules/Order/types.d.ts +7 -0
- package/lib/modules/Order/utils.js +1 -0
- package/lib/modules/Payment/walletpass.js +9 -0
- package/lib/modules/Rules/index.js +1 -0
- package/lib/server/index.js +1 -0
- package/lib/server/modules/order/index.d.ts +1 -0
- package/lib/server/modules/order/index.js +54 -42
- package/lib/server/utils/small-ticket.js +21 -2
- package/lib/solution/BaseSales/index.d.ts +3 -2
- package/lib/solution/BaseSales/index.js +5 -0
- package/lib/solution/BaseSales/types.d.ts +6 -0
- package/lib/solution/BookingByStep/index.d.ts +1 -1
- package/lib/solution/BookingTicket/index.d.ts +1 -1
- package/lib/solution/BookingTicket/utils/scan/applyGlobalScan.js +2 -1
- package/package.json +1 -1
|
@@ -23,7 +23,7 @@ export declare class DiscountModule extends BaseModule implements Module, Discou
|
|
|
23
23
|
customer_id: number;
|
|
24
24
|
with_wallet_pass_holder: 0 | 1;
|
|
25
25
|
request_timezone: string;
|
|
26
|
-
order_id?: number;
|
|
26
|
+
order_id?: number | string;
|
|
27
27
|
}): Promise<Discount[]>;
|
|
28
28
|
batchSearch(code: string, options?: {
|
|
29
29
|
customerId?: number;
|
|
@@ -13,6 +13,8 @@ function _asyncToGenerator(fn) { return function () { var self = this, args = ar
|
|
|
13
13
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
14
14
|
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
|
|
15
15
|
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
16
|
+
function _get() { if (typeof Reflect !== "undefined" && Reflect.get) { _get = Reflect.get.bind(); } else { _get = function _get(target, property, receiver) { var base = _superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return _get.apply(this, arguments); }
|
|
17
|
+
function _superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = _getPrototypeOf(object); if (object === null) break; } return object; }
|
|
16
18
|
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
17
19
|
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
18
20
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
@@ -158,14 +160,17 @@ export var DiscountModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
158
160
|
return _regeneratorRuntime().wrap(function _callee4$(_context4) {
|
|
159
161
|
while (1) switch (_context4.prev = _context4.next) {
|
|
160
162
|
case 0:
|
|
161
|
-
|
|
163
|
+
if (typeof params.order_id === 'string' && params.order_id.startsWith('LOCAL_')) {
|
|
164
|
+
params.order_id = undefined;
|
|
165
|
+
}
|
|
166
|
+
_context4.next = 3;
|
|
162
167
|
return this.request.post("/order/prepare/config", params);
|
|
163
|
-
case
|
|
168
|
+
case 3:
|
|
164
169
|
prepareConfig = _context4.sent;
|
|
165
170
|
rawDiscountList = [].concat(_toConsumableArray((prepareConfig === null || prepareConfig === void 0 || (_prepareConfig$data = prepareConfig.data) === null || _prepareConfig$data === void 0 ? void 0 : _prepareConfig$data.good_pass_list) || []), _toConsumableArray((prepareConfig === null || prepareConfig === void 0 || (_prepareConfig$data2 = prepareConfig.data) === null || _prepareConfig$data2 === void 0 ? void 0 : _prepareConfig$data2.discount_card_list) || []));
|
|
166
171
|
goodPassList = this.filterEnabledDiscountList(rawDiscountList) || []; // this.setDiscountList(goodPassList);
|
|
167
172
|
return _context4.abrupt("return", goodPassList);
|
|
168
|
-
case
|
|
173
|
+
case 7:
|
|
169
174
|
case "end":
|
|
170
175
|
return _context4.stop();
|
|
171
176
|
}
|
|
@@ -412,7 +417,8 @@ export var DiscountModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
412
417
|
return this.core.effects.emit("".concat(this.name, ":onDestroy"), {});
|
|
413
418
|
case 4:
|
|
414
419
|
console.log('[Discount] 已销毁');
|
|
415
|
-
|
|
420
|
+
_get(_getPrototypeOf(DiscountModule.prototype), "destroy", this).call(this);
|
|
421
|
+
case 6:
|
|
416
422
|
case "end":
|
|
417
423
|
return _context6.stop();
|
|
418
424
|
}
|
|
@@ -44,6 +44,7 @@ export declare class OrderModule extends BaseModule implements Module, OrderModu
|
|
|
44
44
|
private applyProductDiscountPrices;
|
|
45
45
|
constructor(name?: string, version?: string);
|
|
46
46
|
initialize(core: PisellCore, options: ModuleOptions): Promise<void>;
|
|
47
|
+
destroy(): Promise<void>;
|
|
47
48
|
/**
|
|
48
49
|
* 更新父级解决方案透传的运行态参数,并同步 Order 内部依赖的派生字段。
|
|
49
50
|
*
|
|
@@ -150,9 +151,13 @@ export declare class OrderModule extends BaseModule implements Module, OrderModu
|
|
|
150
151
|
private calculatePaymentEffectiveAmount;
|
|
151
152
|
private calculatePaymentTotal;
|
|
152
153
|
private getDepositAmount;
|
|
154
|
+
private normalizeDepositAmount;
|
|
155
|
+
private applyDepositAmountToSummary;
|
|
153
156
|
private isDepositOrder;
|
|
154
157
|
private getOrderExpectedAmount;
|
|
155
158
|
private isDepositCovered;
|
|
159
|
+
private calculateDepositPaidAmount;
|
|
160
|
+
private resolveNextOrderPaymentType;
|
|
156
161
|
private normalizePaymentSource;
|
|
157
162
|
private updateTempOrderPaymentStatus;
|
|
158
163
|
private shouldKeepPaymentStatusAfterAmountRecalc;
|
|
@@ -245,6 +250,7 @@ export declare class OrderModule extends BaseModule implements Module, OrderModu
|
|
|
245
250
|
syncTempOrderNoteToRemote(orderId: number | string, note: string): Promise<string>;
|
|
246
251
|
getTempOrderNote(): string;
|
|
247
252
|
updateTempOrderShopDiscount(amount: string | number): string;
|
|
253
|
+
updateTempOrderDepositAmount(amount: string | number): OrderSummary;
|
|
248
254
|
updateTempOrderBuzzer(buzzer: string): string;
|
|
249
255
|
updateTempOrderContactsInfo(contactsInfo: Record<string, any> | null): Record<string, any> | null;
|
|
250
256
|
private buildTempOrderCustomer;
|
|
@@ -416,7 +422,7 @@ export declare class OrderModule extends BaseModule implements Module, OrderModu
|
|
|
416
422
|
generateIdempotencyToken(): string;
|
|
417
423
|
syncPaymentsToOrder<T = any>(params: SyncPaymentsToOrderParams): Promise<SyncPaymentsToOrderResult<T>>;
|
|
418
424
|
createOrder(params: CommitOrderParams['query']): {
|
|
419
|
-
type: "
|
|
425
|
+
type: "appointment_booking" | "virtual";
|
|
420
426
|
platform: string;
|
|
421
427
|
sales_channel: string;
|
|
422
428
|
order_sales_channel: string;
|