@pisell/pisellos 2.3.147 → 2.3.149
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/shared/receipt/small-ticket.js +1 -1
- package/dist/solution/BaseSales/pickupTiming.d.ts +2 -0
- package/dist/solution/BaseSales/pickupTiming.js +19 -3
- package/lib/model/strategy/adapter/promotion/index.js +1 -46
- package/lib/shared/receipt/small-ticket.js +1 -1
- package/lib/solution/BaseSales/pickupTiming.d.ts +2 -0
- package/lib/solution/BaseSales/pickupTiming.js +19 -2
- package/package.json +1 -1
|
@@ -1250,7 +1250,7 @@ function buildFees(params) {
|
|
|
1250
1250
|
customer_paid_amount: formatMoney(financials.customerPaidAmount, currencySymbol),
|
|
1251
1251
|
net_payment_applied: formatMoney(financials.netPaymentApplied, currencySymbol)
|
|
1252
1252
|
}, isPresentId(roundingAmount) ? {
|
|
1253
|
-
rounding_amount:
|
|
1253
|
+
rounding_amount: formatCalculatedMoney(roundingAmount, currencySymbol)
|
|
1254
1254
|
} : {}), isNonZero(totalSavingsAmount) ? {
|
|
1255
1255
|
order_total_discount: formatMoney(totalSavingsAmount, currencySymbol)
|
|
1256
1256
|
} : {}), financials.hasPayProcessingFee ? {
|
|
@@ -24,6 +24,8 @@ export declare class PickupTimingController {
|
|
|
24
24
|
private getRuntime;
|
|
25
25
|
private loadConfig;
|
|
26
26
|
private loadSchedules;
|
|
27
|
+
/** Preserve an existing POS choice without adding it to the shared settings cache. */
|
|
28
|
+
private getEffectiveConfig;
|
|
27
29
|
private snapshot;
|
|
28
30
|
getAvailability(params?: {
|
|
29
31
|
date?: string;
|
|
@@ -217,7 +217,20 @@ export var PickupTimingController = /*#__PURE__*/function () {
|
|
|
217
217
|
return _loadSchedules.apply(this, arguments);
|
|
218
218
|
}
|
|
219
219
|
return loadSchedules;
|
|
220
|
-
}()
|
|
220
|
+
}() /** Preserve an existing POS choice without adding it to the shared settings cache. */
|
|
221
|
+
}, {
|
|
222
|
+
key: "getEffectiveConfig",
|
|
223
|
+
value: function getEffectiveConfig(config) {
|
|
224
|
+
var _this$host$getOrder$g;
|
|
225
|
+
if (!this.host.isPos()) return config;
|
|
226
|
+
var serviceType = (_this$host$getOrder$g = this.host.getOrder().getTempOrder()) === null || _this$host$getOrder$g === void 0 || (_this$host$getOrder$g = _this$host$getOrder$g.metadata) === null || _this$host$getOrder$g === void 0 || (_this$host$getOrder$g = _this$host$getOrder$g.shop_service_data) === null || _this$host$getOrder$g === void 0 ? void 0 : _this$host$getOrder$g.service_type;
|
|
227
|
+
if (serviceType !== 'dine_in' && serviceType !== 'takeaway' || config.handoverModes.includes(serviceType)) {
|
|
228
|
+
return config;
|
|
229
|
+
}
|
|
230
|
+
return _objectSpread(_objectSpread({}, config), {}, {
|
|
231
|
+
handoverModes: [].concat(_toConsumableArray(config.handoverModes), [serviceType])
|
|
232
|
+
});
|
|
233
|
+
}
|
|
221
234
|
}, {
|
|
222
235
|
key: "snapshot",
|
|
223
236
|
value: function () {
|
|
@@ -271,7 +284,10 @@ export var PickupTimingController = /*#__PURE__*/function () {
|
|
|
271
284
|
error: error
|
|
272
285
|
};
|
|
273
286
|
this.latest = result;
|
|
274
|
-
|
|
287
|
+
// Read the live order after async loading; cached snapshots retain only configured modes.
|
|
288
|
+
return _context5.abrupt("return", _objectSpread(_objectSpread({}, result), {}, {
|
|
289
|
+
config: this.getEffectiveConfig(config)
|
|
290
|
+
}));
|
|
275
291
|
case 23:
|
|
276
292
|
case "end":
|
|
277
293
|
return _context5.stop();
|
|
@@ -339,7 +355,7 @@ export var PickupTimingController = /*#__PURE__*/function () {
|
|
|
339
355
|
var order = this.host.getOrder();
|
|
340
356
|
var tempOrder = order.getTempOrder();
|
|
341
357
|
var booking = order.getPickupTimingBooking();
|
|
342
|
-
var config = ((_this$latest = this.latest) === null || _this$latest === void 0 ? void 0 : _this$latest.scope) === this.host.getScope() ? this.latest.config : undefined;
|
|
358
|
+
var config = ((_this$latest = this.latest) === null || _this$latest === void 0 ? void 0 : _this$latest.scope) === this.host.getScope() ? this.getEffectiveConfig(this.latest.config) : undefined;
|
|
343
359
|
var storedServiceType = String((tempOrder === null || tempOrder === void 0 || (_tempOrder$metadata = tempOrder.metadata) === null || _tempOrder$metadata === void 0 || (_tempOrder$metadata = _tempOrder$metadata.shop_service_data) === null || _tempOrder$metadata === void 0 ? void 0 : _tempOrder$metadata.service_type) || '');
|
|
344
360
|
var serviceType = config !== null && config !== void 0 && config.handoverModes.length ? config.handoverModes.includes(storedServiceType) ? storedServiceType : config.handoverModes[0] : storedServiceType;
|
|
345
361
|
var details = serviceType === 'pick_up' ? booking === null || booking === void 0 ? void 0 : booking.metadata.fulfillment_timing : undefined;
|
|
@@ -1,46 +1 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
Object.defineProperty(exports, "BUY_X_GET_Y_FREE_STRATEGY", {
|
|
7
|
-
enumerable: true,
|
|
8
|
-
get: function () {
|
|
9
|
-
return _examples.BUY_X_GET_Y_FREE_STRATEGY;
|
|
10
|
-
}
|
|
11
|
-
});
|
|
12
|
-
Object.defineProperty(exports, "ITEM_REWARD_STRATEGY", {
|
|
13
|
-
enumerable: true,
|
|
14
|
-
get: function () {
|
|
15
|
-
return _examples.ITEM_REWARD_STRATEGY;
|
|
16
|
-
}
|
|
17
|
-
});
|
|
18
|
-
Object.defineProperty(exports, "PromotionAdapter", {
|
|
19
|
-
enumerable: true,
|
|
20
|
-
get: function () {
|
|
21
|
-
return _adapter.PromotionAdapter;
|
|
22
|
-
}
|
|
23
|
-
});
|
|
24
|
-
Object.defineProperty(exports, "PromotionEvaluator", {
|
|
25
|
-
enumerable: true,
|
|
26
|
-
get: function () {
|
|
27
|
-
return _evaluator.PromotionEvaluator;
|
|
28
|
-
}
|
|
29
|
-
});
|
|
30
|
-
Object.defineProperty(exports, "X_ITEMS_FOR_Y_PRICE_STRATEGY", {
|
|
31
|
-
enumerable: true,
|
|
32
|
-
get: function () {
|
|
33
|
-
return _examples.X_ITEMS_FOR_Y_PRICE_STRATEGY;
|
|
34
|
-
}
|
|
35
|
-
});
|
|
36
|
-
Object.defineProperty(exports, "default", {
|
|
37
|
-
enumerable: true,
|
|
38
|
-
get: function () {
|
|
39
|
-
return _adapter.default;
|
|
40
|
-
}
|
|
41
|
-
});
|
|
42
|
-
var _evaluator = require("./evaluator");
|
|
43
|
-
var _adapter = _interopRequireWildcard(require("./adapter"));
|
|
44
|
-
var _examples = require("./examples");
|
|
45
|
-
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
46
|
-
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
1
|
+
"use strict";
|
|
@@ -1192,7 +1192,7 @@ function buildFees(params) {
|
|
|
1192
1192
|
customer_paid_amount: formatMoney(financials.customerPaidAmount, currencySymbol),
|
|
1193
1193
|
net_payment_applied: formatMoney(financials.netPaymentApplied, currencySymbol),
|
|
1194
1194
|
...(isPresentId(roundingAmount) ? {
|
|
1195
|
-
rounding_amount:
|
|
1195
|
+
rounding_amount: formatCalculatedMoney(roundingAmount, currencySymbol)
|
|
1196
1196
|
} : {}),
|
|
1197
1197
|
...(isNonZero(totalSavingsAmount) ? {
|
|
1198
1198
|
order_total_discount: formatMoney(totalSavingsAmount, currencySymbol)
|
|
@@ -24,6 +24,8 @@ export declare class PickupTimingController {
|
|
|
24
24
|
private getRuntime;
|
|
25
25
|
private loadConfig;
|
|
26
26
|
private loadSchedules;
|
|
27
|
+
/** Preserve an existing POS choice without adding it to the shared settings cache. */
|
|
28
|
+
private getEffectiveConfig;
|
|
27
29
|
private snapshot;
|
|
28
30
|
getAvailability(params?: {
|
|
29
31
|
date?: string;
|
|
@@ -93,6 +93,19 @@ class PickupTimingController {
|
|
|
93
93
|
if (runtime.scheduleRequest === request) runtime.scheduleRequest = undefined;
|
|
94
94
|
}
|
|
95
95
|
}
|
|
96
|
+
|
|
97
|
+
/** Preserve an existing POS choice without adding it to the shared settings cache. */
|
|
98
|
+
getEffectiveConfig(config) {
|
|
99
|
+
if (!this.host.isPos()) return config;
|
|
100
|
+
const serviceType = this.host.getOrder().getTempOrder()?.metadata?.shop_service_data?.service_type;
|
|
101
|
+
if (serviceType !== 'dine_in' && serviceType !== 'takeaway' || config.handoverModes.includes(serviceType)) {
|
|
102
|
+
return config;
|
|
103
|
+
}
|
|
104
|
+
return {
|
|
105
|
+
...config,
|
|
106
|
+
handoverModes: [...config.handoverModes, serviceType]
|
|
107
|
+
};
|
|
108
|
+
}
|
|
96
109
|
async snapshot(includeSchedule, tolerateScheduleError = false) {
|
|
97
110
|
const runtime = this.getRuntime();
|
|
98
111
|
const config = await this.loadConfig(runtime);
|
|
@@ -116,7 +129,11 @@ class PickupTimingController {
|
|
|
116
129
|
error
|
|
117
130
|
};
|
|
118
131
|
this.latest = result;
|
|
119
|
-
|
|
132
|
+
// Read the live order after async loading; cached snapshots retain only configured modes.
|
|
133
|
+
return {
|
|
134
|
+
...result,
|
|
135
|
+
config: this.getEffectiveConfig(config)
|
|
136
|
+
};
|
|
120
137
|
}
|
|
121
138
|
async getAvailability(params = {}) {
|
|
122
139
|
// `force` remains accepted for older callers; refresh recomputes time using the runtime catalog.
|
|
@@ -150,7 +167,7 @@ class PickupTimingController {
|
|
|
150
167
|
const order = this.host.getOrder();
|
|
151
168
|
const tempOrder = order.getTempOrder();
|
|
152
169
|
const booking = order.getPickupTimingBooking();
|
|
153
|
-
const config = this.latest?.scope === this.host.getScope() ? this.latest.config : undefined;
|
|
170
|
+
const config = this.latest?.scope === this.host.getScope() ? this.getEffectiveConfig(this.latest.config) : undefined;
|
|
154
171
|
const storedServiceType = String(tempOrder?.metadata?.shop_service_data?.service_type || '');
|
|
155
172
|
const serviceType = config?.handoverModes.length ? config.handoverModes.includes(storedServiceType) ? storedServiceType : config.handoverModes[0] : storedServiceType;
|
|
156
173
|
const details = serviceType === 'pick_up' ? booking?.metadata.fulfillment_timing : undefined;
|