@pisell/pisellos 2.3.64 → 2.3.65
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/server/index.js +3 -3
- package/dist/server/utils/small-ticket.js +2 -1
- package/dist/solution/BookingByStep/index.d.ts +1 -1
- package/lib/model/strategy/adapter/promotion/index.js +51 -0
- package/lib/server/index.js +3 -3
- package/lib/server/utils/small-ticket.js +1 -1
- package/lib/solution/BookingByStep/index.d.ts +1 -1
- package/package.json +1 -1
package/dist/server/index.js
CHANGED
|
@@ -1243,7 +1243,8 @@ var Server = /*#__PURE__*/function () {
|
|
|
1243
1243
|
checkoutData: checkoutData,
|
|
1244
1244
|
order: printableOrder,
|
|
1245
1245
|
response: null,
|
|
1246
|
-
requireFullyPaid: false
|
|
1246
|
+
requireFullyPaid: false,
|
|
1247
|
+
isManualPrint: true
|
|
1247
1248
|
});
|
|
1248
1249
|
case 27:
|
|
1249
1250
|
printResult = _context19.sent;
|
|
@@ -6040,9 +6041,8 @@ var Server = /*#__PURE__*/function () {
|
|
|
6040
6041
|
checkoutData: syncResult.checkoutData,
|
|
6041
6042
|
order: syncedOrder,
|
|
6042
6043
|
response: syncResult.normalizedResponse,
|
|
6043
|
-
requireFullyPaid: true
|
|
6044
|
+
requireFullyPaid: true
|
|
6044
6045
|
// print_all 的 type=0 是收据打印;不要沿用同步成功后的券/手环打印 type=99。
|
|
6045
|
-
isManualPrint: true
|
|
6046
6046
|
});
|
|
6047
6047
|
case 16:
|
|
6048
6048
|
return _context61.abrupt("return", response);
|
|
@@ -619,7 +619,8 @@ function formatBundlePrice(bundle, currencySymbol) {
|
|
|
619
619
|
var _ref33, _ref34, _bundle$bundle_sellin;
|
|
620
620
|
var value = (_ref33 = (_ref34 = (_bundle$bundle_sellin = bundle.bundle_selling_price) !== null && _bundle$bundle_sellin !== void 0 ? _bundle$bundle_sellin : bundle.bundle_sum_price) !== null && _ref34 !== void 0 ? _ref34 : bundle.price) !== null && _ref33 !== void 0 ? _ref33 : 0;
|
|
621
621
|
var amount = new Decimal(toMoneyNumber(value));
|
|
622
|
-
|
|
622
|
+
// 套餐价格协议:只有 markdown 是减价;加价与商品原价都保持正数。
|
|
623
|
+
var isNegative = bundle.price_type === 'markdown';
|
|
623
624
|
if (isNegative) return "-".concat(currencySymbol).concat(amount.abs().toFixed(2));
|
|
624
625
|
return formatMoney(amount, currencySymbol);
|
|
625
626
|
}
|
|
@@ -326,7 +326,7 @@ export declare class BookingByStepImpl extends BaseModule implements Module {
|
|
|
326
326
|
date: string;
|
|
327
327
|
status: string;
|
|
328
328
|
week: string;
|
|
329
|
-
weekNum: 0 |
|
|
329
|
+
weekNum: 0 | 1 | 2 | 3 | 4 | 5 | 6;
|
|
330
330
|
}[]>;
|
|
331
331
|
submitTimeSlot(timeSlots: TimeSliceItem): void;
|
|
332
332
|
private getScheduleDataByIds;
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
21
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
22
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
24
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
25
|
+
mod
|
|
26
|
+
));
|
|
27
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
|
+
|
|
29
|
+
// src/model/strategy/adapter/promotion/index.ts
|
|
30
|
+
var promotion_exports = {};
|
|
31
|
+
__export(promotion_exports, {
|
|
32
|
+
BUY_X_GET_Y_FREE_STRATEGY: () => import_examples.BUY_X_GET_Y_FREE_STRATEGY,
|
|
33
|
+
ITEM_REWARD_STRATEGY: () => import_examples.ITEM_REWARD_STRATEGY,
|
|
34
|
+
PromotionAdapter: () => import_adapter.PromotionAdapter,
|
|
35
|
+
PromotionEvaluator: () => import_evaluator.PromotionEvaluator,
|
|
36
|
+
X_ITEMS_FOR_Y_PRICE_STRATEGY: () => import_examples.X_ITEMS_FOR_Y_PRICE_STRATEGY,
|
|
37
|
+
default: () => import_adapter2.default
|
|
38
|
+
});
|
|
39
|
+
module.exports = __toCommonJS(promotion_exports);
|
|
40
|
+
var import_evaluator = require("./evaluator");
|
|
41
|
+
var import_adapter = require("./adapter");
|
|
42
|
+
var import_adapter2 = __toESM(require("./adapter"));
|
|
43
|
+
var import_examples = require("./examples");
|
|
44
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
45
|
+
0 && (module.exports = {
|
|
46
|
+
BUY_X_GET_Y_FREE_STRATEGY,
|
|
47
|
+
ITEM_REWARD_STRATEGY,
|
|
48
|
+
PromotionAdapter,
|
|
49
|
+
PromotionEvaluator,
|
|
50
|
+
X_ITEMS_FOR_Y_PRICE_STRATEGY
|
|
51
|
+
});
|
package/lib/server/index.js
CHANGED
|
@@ -795,7 +795,8 @@ var Server = class {
|
|
|
795
795
|
checkoutData,
|
|
796
796
|
order: printableOrder,
|
|
797
797
|
response: null,
|
|
798
|
-
requireFullyPaid: false
|
|
798
|
+
requireFullyPaid: false,
|
|
799
|
+
isManualPrint: true
|
|
799
800
|
});
|
|
800
801
|
return {
|
|
801
802
|
code: 200,
|
|
@@ -3915,9 +3916,8 @@ var Server = class {
|
|
|
3915
3916
|
checkoutData: syncResult.checkoutData,
|
|
3916
3917
|
order: syncedOrder,
|
|
3917
3918
|
response: syncResult.normalizedResponse,
|
|
3918
|
-
requireFullyPaid: true
|
|
3919
|
+
requireFullyPaid: true
|
|
3919
3920
|
// print_all 的 type=0 是收据打印;不要沿用同步成功后的券/手环打印 type=99。
|
|
3920
|
-
isManualPrint: true
|
|
3921
3921
|
});
|
|
3922
3922
|
}
|
|
3923
3923
|
return response;
|
|
@@ -562,7 +562,7 @@ function buildOptionTitleSuffix(options) {
|
|
|
562
562
|
function formatBundlePrice(bundle, currencySymbol) {
|
|
563
563
|
const value = bundle.bundle_selling_price ?? bundle.bundle_sum_price ?? bundle.price ?? 0;
|
|
564
564
|
const amount = new import_decimal.default(toMoneyNumber(value));
|
|
565
|
-
const isNegative = bundle.price_type === "markdown"
|
|
565
|
+
const isNegative = bundle.price_type === "markdown";
|
|
566
566
|
if (isNegative)
|
|
567
567
|
return `-${currencySymbol}${amount.abs().toFixed(2)}`;
|
|
568
568
|
return formatMoney(amount, currencySymbol);
|
|
@@ -326,7 +326,7 @@ export declare class BookingByStepImpl extends BaseModule implements Module {
|
|
|
326
326
|
date: string;
|
|
327
327
|
status: string;
|
|
328
328
|
week: string;
|
|
329
|
-
weekNum: 0 |
|
|
329
|
+
weekNum: 0 | 1 | 2 | 3 | 4 | 5 | 6;
|
|
330
330
|
}[]>;
|
|
331
331
|
submitTimeSlot(timeSlots: TimeSliceItem): void;
|
|
332
332
|
private getScheduleDataByIds;
|