@pisell/pisellos 2.2.222 → 2.2.223
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/OpenData/index.js +1 -1
- package/dist/modules/SalesSummary/index.js +3 -3
- package/dist/modules/Summary/index.js +2 -1
- package/lib/model/strategy/adapter/promotion/index.js +49 -0
- package/lib/modules/OpenData/index.js +1 -1
- package/lib/modules/SalesSummary/index.js +2 -1
- package/lib/modules/Summary/index.js +2 -1
- package/package.json +1 -1
|
@@ -155,7 +155,7 @@ export var OpenDataModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
155
155
|
key: "checkAvailability",
|
|
156
156
|
value: function checkAvailability(scheduleModule) {
|
|
157
157
|
var _this$store$data;
|
|
158
|
-
var scheduleList = scheduleModule ? scheduleModule.getScheduleListByIds(((_this$store$data = this.store.data) === null || _this$store$data === void 0 ? void 0 : _this$store$data['availability.operating_hours']) || []) : undefined;
|
|
158
|
+
var scheduleList = scheduleModule ? scheduleModule === null || scheduleModule === void 0 ? void 0 : scheduleModule.getScheduleListByIds(((_this$store$data = this.store.data) === null || _this$store$data === void 0 ? void 0 : _this$store$data['availability.operating_hours']) || []) : undefined;
|
|
159
159
|
return computeAvailability({
|
|
160
160
|
config: this.store.data,
|
|
161
161
|
scheduleList: scheduleList
|
|
@@ -158,7 +158,7 @@ export var SalesSummaryModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
158
158
|
key: "getSummary",
|
|
159
159
|
value: function () {
|
|
160
160
|
var _getSummary = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(params) {
|
|
161
|
-
var _ref;
|
|
161
|
+
var _this$store$surcharge, _ref;
|
|
162
162
|
var _params$products, products, isPriceIncludeTax, taxRate, shopDiscount, taxConfig, summarySchedule, needScheduleIds, scheduleList, scheduleById, _iterator, _step, item, summary, summaryWithTaxMeta;
|
|
163
163
|
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
|
164
164
|
while (1) switch (_context3.prev = _context3.next) {
|
|
@@ -166,9 +166,9 @@ export var SalesSummaryModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
166
166
|
_params$products = params.products, products = _params$products === void 0 ? [] : _params$products, isPriceIncludeTax = params.isPriceIncludeTax, taxRate = params.taxRate, shopDiscount = params.shopDiscount;
|
|
167
167
|
taxConfig = this.getTaxConfig();
|
|
168
168
|
summarySchedule = this.core.getModule("".concat(this.name.split('_')[0], "_schedule"));
|
|
169
|
-
needScheduleIds = this.store.surchargeList.map(function (item) {
|
|
169
|
+
needScheduleIds = (_this$store$surcharge = this.store.surchargeList) === null || _this$store$surcharge === void 0 || (_this$store$surcharge = _this$store$surcharge.map(function (item) {
|
|
170
170
|
return item.available_schedule_ids;
|
|
171
|
-
}).flat();
|
|
171
|
+
})) === null || _this$store$surcharge === void 0 ? void 0 : _this$store$surcharge.flat();
|
|
172
172
|
scheduleList = summarySchedule === null || summarySchedule === void 0 ? void 0 : summarySchedule.getScheduleListByIds(needScheduleIds);
|
|
173
173
|
scheduleById = {};
|
|
174
174
|
if (Array.isArray(scheduleList)) {
|
|
@@ -208,9 +208,10 @@ export var SummaryModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
208
208
|
}, {
|
|
209
209
|
key: "getSurchargeforUtils",
|
|
210
210
|
value: function getSurchargeforUtils(items) {
|
|
211
|
+
var _this$store$surcharge2;
|
|
211
212
|
// const surchargeList = this.store.surchargeList;
|
|
212
213
|
var scheduleModule = this.core.getModule('appointmentBooking_schedule');
|
|
213
|
-
var needScheduleIds = this.store.surchargeList.map(function (item) {
|
|
214
|
+
var needScheduleIds = (_this$store$surcharge2 = this.store.surchargeList) === null || _this$store$surcharge2 === void 0 ? void 0 : _this$store$surcharge2.map(function (item) {
|
|
214
215
|
return item.available_schedule_ids;
|
|
215
216
|
}).flat();
|
|
216
217
|
var scheduleList = scheduleModule === null || scheduleModule === void 0 ? void 0 : scheduleModule.getScheduleListByIds(needScheduleIds);
|
|
@@ -0,0 +1,49 @@
|
|
|
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
|
+
PromotionAdapter: () => import_adapter.PromotionAdapter,
|
|
34
|
+
PromotionEvaluator: () => import_evaluator.PromotionEvaluator,
|
|
35
|
+
X_ITEMS_FOR_Y_PRICE_STRATEGY: () => import_examples.X_ITEMS_FOR_Y_PRICE_STRATEGY,
|
|
36
|
+
default: () => import_adapter2.default
|
|
37
|
+
});
|
|
38
|
+
module.exports = __toCommonJS(promotion_exports);
|
|
39
|
+
var import_evaluator = require("./evaluator");
|
|
40
|
+
var import_adapter = require("./adapter");
|
|
41
|
+
var import_adapter2 = __toESM(require("./adapter"));
|
|
42
|
+
var import_examples = require("./examples");
|
|
43
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
44
|
+
0 && (module.exports = {
|
|
45
|
+
BUY_X_GET_Y_FREE_STRATEGY,
|
|
46
|
+
PromotionAdapter,
|
|
47
|
+
PromotionEvaluator,
|
|
48
|
+
X_ITEMS_FOR_Y_PRICE_STRATEGY
|
|
49
|
+
});
|
|
@@ -94,7 +94,7 @@ var OpenDataModule = class extends import_BaseModule.BaseModule {
|
|
|
94
94
|
}
|
|
95
95
|
checkAvailability(scheduleModule) {
|
|
96
96
|
var _a;
|
|
97
|
-
const scheduleList = scheduleModule ? scheduleModule.getScheduleListByIds(
|
|
97
|
+
const scheduleList = scheduleModule ? scheduleModule == null ? void 0 : scheduleModule.getScheduleListByIds(
|
|
98
98
|
((_a = this.store.data) == null ? void 0 : _a["availability.operating_hours"]) || []
|
|
99
99
|
) : void 0;
|
|
100
100
|
return (0, import_utils.computeAvailability)({
|
|
@@ -100,12 +100,13 @@ var SalesSummaryModule = class extends import_BaseModule.BaseModule {
|
|
|
100
100
|
};
|
|
101
101
|
}
|
|
102
102
|
async getSummary(params) {
|
|
103
|
+
var _a, _b;
|
|
103
104
|
const { products = [], isPriceIncludeTax, taxRate, shopDiscount } = params;
|
|
104
105
|
const taxConfig = this.getTaxConfig();
|
|
105
106
|
const summarySchedule = this.core.getModule(
|
|
106
107
|
`${this.name.split("_")[0]}_schedule`
|
|
107
108
|
);
|
|
108
|
-
const needScheduleIds = this.store.surchargeList.map((item) => item.available_schedule_ids).flat();
|
|
109
|
+
const needScheduleIds = (_b = (_a = this.store.surchargeList) == null ? void 0 : _a.map((item) => item.available_schedule_ids)) == null ? void 0 : _b.flat();
|
|
109
110
|
const scheduleList = summarySchedule == null ? void 0 : summarySchedule.getScheduleListByIds(needScheduleIds);
|
|
110
111
|
const scheduleById = {};
|
|
111
112
|
if (Array.isArray(scheduleList)) {
|
|
@@ -119,8 +119,9 @@ var SummaryModule = class extends import_BaseModule.BaseModule {
|
|
|
119
119
|
});
|
|
120
120
|
}
|
|
121
121
|
getSurchargeforUtils(items) {
|
|
122
|
+
var _a;
|
|
122
123
|
const scheduleModule = this.core.getModule("appointmentBooking_schedule");
|
|
123
|
-
const needScheduleIds = this.store.surchargeList.map((item) => item.available_schedule_ids).flat();
|
|
124
|
+
const needScheduleIds = (_a = this.store.surchargeList) == null ? void 0 : _a.map((item) => item.available_schedule_ids).flat();
|
|
124
125
|
const scheduleList = scheduleModule == null ? void 0 : scheduleModule.getScheduleListByIds(needScheduleIds);
|
|
125
126
|
const scheduleById = {};
|
|
126
127
|
if (Array.isArray(scheduleList)) {
|