@pisell/pisellos 0.10.42 → 0.10.44
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/model/strategy/adapter/itemRule/adapter.d.ts +4 -1
- package/dist/model/strategy/adapter/itemRule/adapter.js +135 -35
- package/dist/model/strategy/adapter/itemRule/evaluator.d.ts +8 -1
- package/dist/model/strategy/adapter/itemRule/evaluator.js +25 -1
- package/dist/model/strategy/adapter/itemRule/type.d.ts +44 -0
- package/dist/model/strategy/adapter/itemRule/type.js +19 -1
- package/dist/model/strategy/adapter/promotion/index.js +0 -9
- package/dist/modules/Order/index.d.ts +40 -8
- package/dist/modules/Order/index.js +1438 -878
- package/dist/modules/Order/salesNotes.d.ts +31 -0
- package/dist/modules/Order/salesNotes.js +492 -0
- package/dist/modules/Order/types.d.ts +105 -8
- package/dist/modules/Order/types.js +6 -1
- package/dist/modules/Order/utils.d.ts +3 -1
- package/dist/modules/Order/utils.js +191 -71
- package/dist/modules/Payment/cashRecommendationAlgorithm.d.ts +4 -5
- package/dist/modules/Payment/cashRecommendationAlgorithm.js +17 -367
- package/dist/modules/ProductList/index.d.ts +2 -1
- package/dist/modules/ProductList/index.js +100 -20
- package/dist/modules/ProductList/types.d.ts +10 -0
- package/dist/modules/Rules/index.js +2 -1
- package/dist/server/index.d.ts +7 -0
- package/dist/server/index.js +45 -3
- package/dist/server/modules/order/index.js +6 -0
- package/dist/server/modules/order/types.d.ts +9 -0
- package/dist/server/utils/small-ticket.d.ts +1 -0
- package/dist/server/utils/small-ticket.js +142 -14
- package/dist/solution/BaseSales/index.d.ts +15 -1
- package/dist/solution/BaseSales/index.js +1240 -877
- package/dist/solution/BookingByStep/index.d.ts +1 -1
- package/dist/solution/BookingTicket/index.d.ts +1 -0
- package/dist/solution/BookingTicket/index.js +37 -16
- package/dist/solution/BookingTicket/types.d.ts +5 -1
- package/dist/solution/BookingTicket/utils/orderCustomer.js +3 -2
- package/dist/solution/BookingTicket/utils/scan/applyGlobalScan.js +171 -96
- package/dist/solution/BookingTicket/utils/scan/cloudSearch.js +1 -1
- package/dist/solution/BookingTicket/utils/scan/formatGlobalScan.d.ts +2 -0
- package/dist/solution/BookingTicket/utils/scan/formatGlobalScan.js +12 -3
- package/dist/solution/RegisterAndLogin/config.d.ts +9 -3
- package/dist/solution/RegisterAndLogin/config.js +95 -40
- package/dist/solution/RegisterAndLogin/index.js +4 -1
- package/dist/solution/ScanOrder/index.d.ts +1 -0
- package/dist/solution/ScanOrder/index.js +31 -27
- package/dist/solution/ScanOrder/utils.d.ts +1 -0
- package/dist/solution/ScanOrder/utils.js +2 -0
- package/dist/solution/UnifiedBookingSales/index.d.ts +15 -2
- package/dist/solution/UnifiedBookingSales/index.js +777 -510
- package/dist/solution/UnifiedBookingSales/types.d.ts +14 -1
- package/dist/solution/VenueBooking/index.d.ts +1 -0
- package/dist/solution/VenueBooking/index.js +8 -4
- package/lib/model/strategy/adapter/itemRule/adapter.d.ts +4 -1
- package/lib/model/strategy/adapter/itemRule/adapter.js +73 -4
- package/lib/model/strategy/adapter/itemRule/evaluator.d.ts +8 -1
- package/lib/model/strategy/adapter/itemRule/evaluator.js +23 -1
- package/lib/model/strategy/adapter/itemRule/type.d.ts +44 -0
- package/lib/model/strategy/adapter/itemRule/type.js +19 -1
- package/lib/model/strategy/adapter/promotion/index.js +1 -46
- package/lib/modules/Order/index.d.ts +40 -8
- package/lib/modules/Order/index.js +434 -61
- package/lib/modules/Order/salesNotes.d.ts +31 -0
- package/lib/modules/Order/salesNotes.js +382 -0
- package/lib/modules/Order/types.d.ts +105 -8
- package/lib/modules/Order/types.js +5 -1
- package/lib/modules/Order/utils.d.ts +3 -1
- package/lib/modules/Order/utils.js +114 -1
- package/lib/modules/Payment/cashRecommendationAlgorithm.d.ts +4 -5
- package/lib/modules/Payment/cashRecommendationAlgorithm.js +9 -354
- package/lib/modules/ProductList/index.d.ts +2 -1
- package/lib/modules/ProductList/index.js +47 -2
- package/lib/modules/ProductList/types.d.ts +10 -0
- package/lib/modules/Rules/index.js +2 -1
- package/lib/server/index.d.ts +7 -0
- package/lib/server/index.js +39 -3
- package/lib/server/modules/order/index.js +6 -0
- package/lib/server/modules/order/types.d.ts +9 -0
- package/lib/server/utils/small-ticket.d.ts +1 -0
- package/lib/server/utils/small-ticket.js +136 -12
- package/lib/solution/BaseSales/index.d.ts +15 -1
- package/lib/solution/BaseSales/index.js +192 -22
- package/lib/solution/BookingByStep/index.d.ts +1 -1
- package/lib/solution/BookingTicket/index.d.ts +1 -0
- package/lib/solution/BookingTicket/index.js +23 -5
- package/lib/solution/BookingTicket/types.d.ts +5 -1
- package/lib/solution/BookingTicket/utils/orderCustomer.js +2 -1
- package/lib/solution/BookingTicket/utils/scan/applyGlobalScan.js +65 -18
- package/lib/solution/BookingTicket/utils/scan/cloudSearch.js +1 -1
- package/lib/solution/BookingTicket/utils/scan/formatGlobalScan.d.ts +2 -0
- package/lib/solution/BookingTicket/utils/scan/formatGlobalScan.js +5 -1
- package/lib/solution/RegisterAndLogin/config.d.ts +9 -3
- package/lib/solution/RegisterAndLogin/config.js +49 -8
- package/lib/solution/RegisterAndLogin/index.js +4 -1
- package/lib/solution/ScanOrder/index.d.ts +1 -0
- package/lib/solution/ScanOrder/index.js +5 -1
- package/lib/solution/ScanOrder/utils.d.ts +1 -0
- package/lib/solution/ScanOrder/utils.js +1 -0
- package/lib/solution/UnifiedBookingSales/index.d.ts +15 -2
- package/lib/solution/UnifiedBookingSales/index.js +125 -1
- package/lib/solution/UnifiedBookingSales/types.d.ts +14 -1
- package/lib/solution/VenueBooking/index.d.ts +1 -0
- package/lib/solution/VenueBooking/index.js +5 -1
- package/package.json +1 -1
|
@@ -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 | 2 | 1 | 6 | 4 | 5 | 3;
|
|
330
330
|
}[]>;
|
|
331
331
|
submitTimeSlot(timeSlots: TimeSliceItem): void;
|
|
332
332
|
private getScheduleDataByIds;
|
|
@@ -29,6 +29,7 @@ export declare class BookingTicketImpl extends BaseSalesImpl implements Module {
|
|
|
29
29
|
private addTimeProductsCatalog;
|
|
30
30
|
private orderCustomerDiscountRefreshInFlight;
|
|
31
31
|
private orderCustomerDiscountRefreshCustomerId;
|
|
32
|
+
private orderCustomerDiscountRefreshTarget;
|
|
32
33
|
private orderCustomerPromotionRefreshInFlight;
|
|
33
34
|
protected loadOpenDataInFlight: Promise<OpenDataConfig> | null;
|
|
34
35
|
protected loadOpenDataInFlightTarget: string | null;
|
|
@@ -180,6 +180,7 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
|
|
|
180
180
|
_defineProperty(_assertThisInitialized(_this), "addTimeProductsCatalog", []);
|
|
181
181
|
_defineProperty(_assertThisInitialized(_this), "orderCustomerDiscountRefreshInFlight", null);
|
|
182
182
|
_defineProperty(_assertThisInitialized(_this), "orderCustomerDiscountRefreshCustomerId", null);
|
|
183
|
+
_defineProperty(_assertThisInitialized(_this), "orderCustomerDiscountRefreshTarget", null);
|
|
183
184
|
_defineProperty(_assertThisInitialized(_this), "orderCustomerPromotionRefreshInFlight", null);
|
|
184
185
|
_defineProperty(_assertThisInitialized(_this), "loadOpenDataInFlight", null);
|
|
185
186
|
_defineProperty(_assertThisInitialized(_this), "loadOpenDataInFlightTarget", null);
|
|
@@ -1884,15 +1885,24 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
|
|
|
1884
1885
|
}, {
|
|
1885
1886
|
key: "refreshDiscountConfigAfterOrderCustomerChange",
|
|
1886
1887
|
value: function refreshDiscountConfigAfterOrderCustomerChange(customerId) {
|
|
1887
|
-
var
|
|
1888
|
+
var _this$store$order$get4,
|
|
1889
|
+
_this$store$order6,
|
|
1890
|
+
_this$getOrderIdentit,
|
|
1891
|
+
_this5 = this;
|
|
1888
1892
|
if (!customerId || customerId === 1) return Promise.resolve();
|
|
1889
|
-
|
|
1893
|
+
var tempOrder = (_this$store$order$get4 = (_this$store$order6 = this.store.order).getTempOrder) === null || _this$store$order$get4 === void 0 ? void 0 : _this$store$order$get4.call(_this$store$order6);
|
|
1894
|
+
var orderIdentity = (_this$getOrderIdentit = this.getOrderIdentity) === null || _this$getOrderIdentit === void 0 ? void 0 : _this$getOrderIdentit.call(this);
|
|
1895
|
+
var orderId = (tempOrder === null || tempOrder === void 0 ? void 0 : tempOrder.order_id) || (orderIdentity === null || orderIdentity === void 0 ? void 0 : orderIdentity.orderId);
|
|
1896
|
+
var action = !orderId || String(orderId).startsWith('local_order') ? 'create' : 'edit';
|
|
1897
|
+
var orderTarget = orderId ? "order:".concat(String(orderId)) : "external:".concat(String((tempOrder === null || tempOrder === void 0 ? void 0 : tempOrder.external_sale_number) || (orderIdentity === null || orderIdentity === void 0 ? void 0 : orderIdentity.externalSaleNumber) || (orderIdentity === null || orderIdentity === void 0 ? void 0 : orderIdentity.localId) || 'new'));
|
|
1898
|
+
var refreshTarget = "".concat(customerId, ":").concat(action, ":").concat(orderTarget);
|
|
1899
|
+
if (this.orderCustomerDiscountRefreshInFlight && this.orderCustomerDiscountRefreshTarget === refreshTarget) {
|
|
1890
1900
|
return this.orderCustomerDiscountRefreshInFlight;
|
|
1891
1901
|
}
|
|
1892
1902
|
var previousRefresh = this.orderCustomerDiscountRefreshInFlight;
|
|
1893
1903
|
var refreshTask = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee25() {
|
|
1894
1904
|
var _this5$store$order$ge, _this5$store$order, _this5$getOrderIdenti;
|
|
1895
|
-
var currentCustomer,
|
|
1905
|
+
var currentCustomer, currentTempOrder, currentOrderIdentity, currentOrderId, currentAction, currentOrderTarget;
|
|
1896
1906
|
return _regeneratorRuntime().wrap(function _callee25$(_context25) {
|
|
1897
1907
|
while (1) switch (_context25.prev = _context25.next) {
|
|
1898
1908
|
case 0:
|
|
@@ -1912,15 +1922,24 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
|
|
|
1912
1922
|
}
|
|
1913
1923
|
return _context25.abrupt("return");
|
|
1914
1924
|
case 6:
|
|
1915
|
-
|
|
1916
|
-
|
|
1917
|
-
|
|
1918
|
-
|
|
1925
|
+
currentTempOrder = (_this5$store$order$ge = (_this5$store$order = _this5.store.order).getTempOrder) === null || _this5$store$order$ge === void 0 ? void 0 : _this5$store$order$ge.call(_this5$store$order);
|
|
1926
|
+
currentOrderIdentity = (_this5$getOrderIdenti = _this5.getOrderIdentity) === null || _this5$getOrderIdenti === void 0 ? void 0 : _this5$getOrderIdenti.call(_this5);
|
|
1927
|
+
currentOrderId = (currentTempOrder === null || currentTempOrder === void 0 ? void 0 : currentTempOrder.order_id) || (currentOrderIdentity === null || currentOrderIdentity === void 0 ? void 0 : currentOrderIdentity.orderId);
|
|
1928
|
+
currentAction = !currentOrderId || String(currentOrderId).startsWith('local_order') ? 'create' : 'edit';
|
|
1929
|
+
currentOrderTarget = currentOrderId ? "order:".concat(String(currentOrderId)) : "external:".concat(String((currentTempOrder === null || currentTempOrder === void 0 ? void 0 : currentTempOrder.external_sale_number) || (currentOrderIdentity === null || currentOrderIdentity === void 0 ? void 0 : currentOrderIdentity.externalSaleNumber) || (currentOrderIdentity === null || currentOrderIdentity === void 0 ? void 0 : currentOrderIdentity.localId) || 'new'));
|
|
1930
|
+
if (!("".concat(customerId, ":").concat(currentAction, ":").concat(currentOrderTarget) !== refreshTarget)) {
|
|
1931
|
+
_context25.next = 13;
|
|
1932
|
+
break;
|
|
1933
|
+
}
|
|
1934
|
+
return _context25.abrupt("return");
|
|
1935
|
+
case 13:
|
|
1936
|
+
_context25.next = 15;
|
|
1919
1937
|
return _this5.loadDiscountConfig({
|
|
1920
1938
|
customerId: customerId,
|
|
1921
|
-
action: action
|
|
1939
|
+
action: action,
|
|
1940
|
+
force: true
|
|
1922
1941
|
});
|
|
1923
|
-
case
|
|
1942
|
+
case 15:
|
|
1924
1943
|
case "end":
|
|
1925
1944
|
return _context25.stop();
|
|
1926
1945
|
}
|
|
@@ -1928,12 +1947,14 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
|
|
|
1928
1947
|
}))();
|
|
1929
1948
|
this.orderCustomerDiscountRefreshInFlight = refreshTask;
|
|
1930
1949
|
this.orderCustomerDiscountRefreshCustomerId = customerId;
|
|
1950
|
+
this.orderCustomerDiscountRefreshTarget = refreshTarget;
|
|
1931
1951
|
refreshTask.catch(function (error) {
|
|
1932
1952
|
console.error('Failed to load discount config after customer change:', error);
|
|
1933
1953
|
}).finally(function () {
|
|
1934
1954
|
if (_this5.orderCustomerDiscountRefreshInFlight !== refreshTask) return;
|
|
1935
1955
|
_this5.orderCustomerDiscountRefreshInFlight = null;
|
|
1936
1956
|
_this5.orderCustomerDiscountRefreshCustomerId = null;
|
|
1957
|
+
_this5.orderCustomerDiscountRefreshTarget = null;
|
|
1937
1958
|
});
|
|
1938
1959
|
return refreshTask;
|
|
1939
1960
|
}
|
|
@@ -2497,10 +2518,10 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
|
|
|
2497
2518
|
}, {
|
|
2498
2519
|
key: "buildAddProductCtx",
|
|
2499
2520
|
value: function buildAddProductCtx(extra) {
|
|
2500
|
-
var _extra$date2, _ref12, _this$getOrderCustome4, _this$getOrderCustome5, _this$store$order$
|
|
2521
|
+
var _extra$date2, _ref12, _this$getOrderCustome4, _this$getOrderCustome5, _this$store$order$get5, _extra$presetStartTim2;
|
|
2501
2522
|
var bookingContextState = this.store.bookingContext.getState();
|
|
2502
2523
|
var date = (_extra$date2 = extra === null || extra === void 0 ? void 0 : extra.date) !== null && _extra$date2 !== void 0 ? _extra$date2 : bookingContextState.date;
|
|
2503
|
-
var orderCustomerId = (_ref12 = (_this$getOrderCustome4 = (_this$getOrderCustome5 = this.getOrderCustomerSnapshot()) === null || _this$getOrderCustome5 === void 0 ? void 0 : _this$getOrderCustome5.id) !== null && _this$getOrderCustome4 !== void 0 ? _this$getOrderCustome4 : (_this$store$order$
|
|
2524
|
+
var orderCustomerId = (_ref12 = (_this$getOrderCustome4 = (_this$getOrderCustome5 = this.getOrderCustomerSnapshot()) === null || _this$getOrderCustome5 === void 0 ? void 0 : _this$getOrderCustome5.id) !== null && _this$getOrderCustome4 !== void 0 ? _this$getOrderCustome4 : (_this$store$order$get5 = this.store.order.getTempOrder()) === null || _this$store$order$get5 === void 0 ? void 0 : _this$store$order$get5.customer_id) !== null && _ref12 !== void 0 ? _ref12 : undefined;
|
|
2504
2525
|
return _objectSpread(_objectSpread({
|
|
2505
2526
|
bookingConfig: bookingContextState.bookingConfig,
|
|
2506
2527
|
resourcesOrigin: bookingContextState.resourcesOrigin,
|
|
@@ -2996,7 +3017,7 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
|
|
|
2996
3017
|
key: "handlePrintWristband",
|
|
2997
3018
|
value: function () {
|
|
2998
3019
|
var _handlePrintWristband = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee36(params) {
|
|
2999
|
-
var _this$
|
|
3020
|
+
var _this$getOrderIdentit2;
|
|
3000
3021
|
var deviceTask, deviceId, idempotencyKey;
|
|
3001
3022
|
return _regeneratorRuntime().wrap(function _callee36$(_context36) {
|
|
3002
3023
|
while (1) switch (_context36.prev = _context36.next) {
|
|
@@ -3033,7 +3054,7 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
|
|
|
3033
3054
|
payload: {
|
|
3034
3055
|
type: 'WRISTBAND',
|
|
3035
3056
|
data: {
|
|
3036
|
-
order_id: (_this$
|
|
3057
|
+
order_id: (_this$getOrderIdentit2 = this.getOrderIdentity()) === null || _this$getOrderIdentit2 === void 0 ? void 0 : _this$getOrderIdentit2.orderId,
|
|
3037
3058
|
voucher_ids: Array.isArray(params.voucher_ids) ? params.voucher_ids : [params.voucher_ids]
|
|
3038
3059
|
}
|
|
3039
3060
|
},
|
|
@@ -3058,7 +3079,7 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
|
|
|
3058
3079
|
key: "handleRedeem",
|
|
3059
3080
|
value: function () {
|
|
3060
3081
|
var _handleRedeem = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee37(params) {
|
|
3061
|
-
var _this$store$
|
|
3082
|
+
var _this$store$order7, _this$store$order7$ge, _this$store$order8, _ref20, _tempOrder$order_id2;
|
|
3062
3083
|
var voucherIds, status, voucherIdSet, tempOrder, vouchers, hasUpdatedVoucher, nextVouchers, identity, externalSaleNumber, orderId, orderLookup;
|
|
3063
3084
|
return _regeneratorRuntime().wrap(function _callee37$(_context37) {
|
|
3064
3085
|
while (1) switch (_context37.prev = _context37.next) {
|
|
@@ -3074,8 +3095,8 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
|
|
|
3074
3095
|
}
|
|
3075
3096
|
});
|
|
3076
3097
|
voucherIdSet = new Set(voucherIds);
|
|
3077
|
-
tempOrder = (_this$store$
|
|
3078
|
-
vouchers = (tempOrder === null || tempOrder === void 0 ? void 0 : tempOrder.vouchers) || ((_this$store$
|
|
3098
|
+
tempOrder = (_this$store$order7 = this.store.order) === null || _this$store$order7 === void 0 || (_this$store$order7$ge = _this$store$order7.getTempOrder) === null || _this$store$order7$ge === void 0 ? void 0 : _this$store$order7$ge.call(_this$store$order7);
|
|
3099
|
+
vouchers = (tempOrder === null || tempOrder === void 0 ? void 0 : tempOrder.vouchers) || ((_this$store$order8 = this.store.order) === null || _this$store$order8 === void 0 ? void 0 : _this$store$order8.getVouchers()) || [];
|
|
3079
3100
|
hasUpdatedVoucher = false;
|
|
3080
3101
|
nextVouchers = vouchers.map(function (voucher) {
|
|
3081
3102
|
if (!voucherIdSet.has(voucher.voucher_id)) return voucher;
|
|
@@ -230,12 +230,16 @@ export interface GlobalScanHostBridge {
|
|
|
230
230
|
/**
|
|
231
231
|
* walk-in 扫 walletPass:直接核销优惠码(对齐 SaleDetail Voucher.handleApplyCode / cart.scanCode)。
|
|
232
232
|
*/
|
|
233
|
-
applyPromotionCode?: (code: string, customerId?: number
|
|
233
|
+
applyPromotionCode?: (code: string, customerId?: number, options?: {
|
|
234
|
+
suppressFailureNotification?: boolean;
|
|
235
|
+
}) => Promise<{
|
|
234
236
|
isAvailable?: boolean;
|
|
235
237
|
isAccepted?: boolean;
|
|
236
238
|
type?: string;
|
|
237
239
|
unavailableReason?: string;
|
|
238
240
|
}>;
|
|
241
|
+
/** 当前订单已有其他客户时,由宿主复用客户组件完成确认及切换。 */
|
|
242
|
+
requestCustomerSwitch?: (customer: ICustomer) => Promise<boolean | null>;
|
|
239
243
|
onNotify?: (type: 'success' | 'fail' | 'info', messageKey?: string) => void;
|
|
240
244
|
refresh?: () => void;
|
|
241
245
|
}
|
|
@@ -18,8 +18,9 @@ function resolveCustomerDisplayName(customer) {
|
|
|
18
18
|
|
|
19
19
|
/** 将 ICustomer 格式化为写入 tempOrder 的协议字段。 */
|
|
20
20
|
export function formatOrderCustomerPatch(customer) {
|
|
21
|
-
var _customer$phone, _customer$email, _country_calling_code, _country_calling_code2;
|
|
22
|
-
var
|
|
21
|
+
var _ref, _c$customer_id, _customer$phone, _customer$email, _country_calling_code, _country_calling_code2;
|
|
22
|
+
var c = customer;
|
|
23
|
+
var rawId = (_ref = (_c$customer_id = c.customer_id) !== null && _c$customer_id !== void 0 ? _c$customer_id : c.customerId) !== null && _ref !== void 0 ? _ref : customer.id;
|
|
23
24
|
var numericId = typeof rawId === 'number' ? rawId : rawId !== undefined && rawId !== null && rawId !== '' ? Number(rawId) : null;
|
|
24
25
|
return {
|
|
25
26
|
customer_id: Number.isFinite(numericId) ? numericId : null,
|