@pisell/pisellos 2.3.43 → 2.3.45
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 +0 -1
- package/dist/modules/Discount/index.js +11 -40
- package/dist/modules/Discount/types.d.ts +0 -1
- package/dist/modules/OpenData/index.js +2 -2
- package/dist/modules/Order/index.d.ts +2 -3
- package/dist/modules/Order/index.js +98 -82
- package/dist/modules/Order/types.d.ts +2 -9
- package/dist/modules/Order/utils.d.ts +0 -10
- package/dist/modules/Order/utils.js +3 -35
- package/dist/modules/Payment/walletpass.d.ts +10 -3
- package/dist/modules/Payment/walletpass.js +425 -282
- package/dist/modules/Product/types.d.ts +0 -1
- package/dist/modules/ProductList/index.js +14 -33
- package/dist/modules/Quotation/index.d.ts +1 -1
- package/dist/modules/Quotation/index.js +2 -2
- package/dist/modules/Rules/index.d.ts +2 -0
- package/dist/modules/Rules/index.js +72 -102
- package/dist/modules/SalesSummary/index.js +13 -12
- package/dist/modules/ScanOrderLogger/index.d.ts +0 -2
- package/dist/modules/ScanOrderLogger/index.js +2 -15
- package/dist/modules/ScanOrderLogger/providers/feishu.js +27 -45
- package/dist/modules/ScanOrderLogger/types.d.ts +0 -1
- package/dist/modules/Schedule/index.d.ts +1 -3
- package/dist/modules/Schedule/index.js +16 -21
- package/dist/modules/Summary/utils.js +13 -38
- package/dist/modules/index.d.ts +0 -2
- package/dist/modules/index.js +1 -3
- package/dist/plugins/window.d.ts +0 -1
- package/dist/server/index.d.ts +0 -14
- package/dist/server/index.js +657 -772
- package/dist/solution/BaseSales/index.d.ts +0 -7
- package/dist/solution/BaseSales/index.js +48 -67
- package/dist/solution/BaseSales/types.d.ts +3 -1
- package/dist/solution/BaseSales/utils/transformBaseProductToOrderProduct.js +6 -3
- package/dist/solution/BookingByStep/index.d.ts +1 -16
- package/dist/solution/BookingByStep/index.js +215 -294
- package/dist/solution/BookingByStep/types.d.ts +1 -2
- package/dist/solution/BookingByStep/types.js +1 -3
- package/dist/solution/BookingByStep/utils/capacity.js +1 -17
- package/dist/solution/BookingByStep/utils/timeslots.d.ts +1 -3
- package/dist/solution/BookingByStep/utils/timeslots.js +12 -19
- package/dist/solution/BookingTicket/index.d.ts +1 -13
- package/dist/solution/BookingTicket/index.js +8 -5
- package/dist/solution/BookingTicket/types.d.ts +1 -0
- package/dist/solution/BookingTicket/utils/scan/applyGlobalScan.js +3 -3
- package/dist/solution/BookingTicket/utils/scan/handleScan.d.ts +1 -3
- package/dist/solution/BookingTicket/utils/scan/handleScan.js +2 -10
- package/dist/solution/ScanOrder/index.d.ts +14 -26
- package/dist/solution/ScanOrder/index.js +739 -1142
- package/dist/solution/ScanOrder/types.d.ts +1 -21
- package/dist/solution/ScanOrder/utils.d.ts +0 -8
- package/dist/solution/ScanOrder/utils.js +25 -66
- package/dist/solution/ShopDiscount/index.d.ts +0 -1
- package/dist/solution/ShopDiscount/index.js +87 -125
- package/dist/solution/VenueBooking/index.d.ts +12 -39
- package/dist/solution/VenueBooking/index.js +841 -1167
- package/dist/solution/VenueBooking/types.d.ts +0 -3
- package/dist/solution/VenueBooking/utils/resource.js +0 -1
- package/dist/solution/VenueBooking/utils/slotMerge.d.ts +4 -4
- package/dist/solution/VenueBooking/utils/slotMerge.js +5 -10
- package/dist/solution/index.d.ts +0 -1
- package/dist/solution/index.js +1 -2
- package/dist/types/index.d.ts +0 -1
- package/lib/model/strategy/adapter/promotion/index.js +51 -0
- package/lib/modules/Discount/index.d.ts +0 -1
- package/lib/modules/Discount/index.js +0 -9
- package/lib/modules/Discount/types.d.ts +0 -1
- package/lib/modules/OpenData/index.js +1 -1
- package/lib/modules/Order/index.d.ts +2 -3
- package/lib/modules/Order/index.js +56 -33
- package/lib/modules/Order/types.d.ts +2 -9
- package/lib/modules/Order/utils.d.ts +0 -10
- package/lib/modules/Order/utils.js +5 -36
- package/lib/modules/Payment/walletpass.d.ts +10 -3
- package/lib/modules/Payment/walletpass.js +218 -56
- package/lib/modules/Product/types.d.ts +0 -1
- package/lib/modules/ProductList/index.js +31 -40
- package/lib/modules/Quotation/index.d.ts +1 -1
- package/lib/modules/Quotation/index.js +2 -2
- package/lib/modules/Rules/index.d.ts +2 -0
- package/lib/modules/Rules/index.js +24 -36
- package/lib/modules/SalesSummary/index.js +7 -6
- package/lib/modules/ScanOrderLogger/index.d.ts +0 -2
- package/lib/modules/ScanOrderLogger/index.js +1 -13
- package/lib/modules/ScanOrderLogger/providers/feishu.js +6 -15
- package/lib/modules/ScanOrderLogger/types.d.ts +0 -1
- package/lib/modules/Schedule/index.d.ts +1 -3
- package/lib/modules/Schedule/index.js +8 -10
- package/lib/modules/Summary/utils.js +1 -21
- package/lib/modules/index.d.ts +0 -2
- package/lib/modules/index.js +1 -5
- package/lib/plugins/window.d.ts +0 -1
- package/lib/server/index.d.ts +0 -14
- package/lib/server/index.js +5 -65
- package/lib/solution/BaseSales/index.d.ts +0 -7
- package/lib/solution/BaseSales/index.js +9 -24
- package/lib/solution/BaseSales/types.d.ts +3 -1
- package/lib/solution/BaseSales/utils/transformBaseProductToOrderProduct.js +3 -2
- package/lib/solution/BookingByStep/index.d.ts +1 -16
- package/lib/solution/BookingByStep/index.js +18 -60
- package/lib/solution/BookingByStep/types.d.ts +1 -2
- package/lib/solution/BookingByStep/types.js +0 -5
- package/lib/solution/BookingByStep/utils/capacity.js +1 -20
- package/lib/solution/BookingByStep/utils/timeslots.d.ts +1 -3
- package/lib/solution/BookingByStep/utils/timeslots.js +11 -19
- package/lib/solution/BookingTicket/index.d.ts +1 -13
- package/lib/solution/BookingTicket/index.js +3 -10
- package/lib/solution/BookingTicket/types.d.ts +1 -0
- package/lib/solution/BookingTicket/utils/scan/applyGlobalScan.js +2 -2
- package/lib/solution/BookingTicket/utils/scan/handleScan.d.ts +1 -3
- package/lib/solution/BookingTicket/utils/scan/handleScan.js +2 -2
- package/lib/solution/ScanOrder/index.d.ts +14 -26
- package/lib/solution/ScanOrder/index.js +182 -449
- package/lib/solution/ScanOrder/types.d.ts +1 -21
- package/lib/solution/ScanOrder/utils.d.ts +0 -8
- package/lib/solution/ScanOrder/utils.js +0 -31
- package/lib/solution/ShopDiscount/index.d.ts +0 -1
- package/lib/solution/ShopDiscount/index.js +0 -14
- package/lib/solution/VenueBooking/index.d.ts +12 -39
- package/lib/solution/VenueBooking/index.js +110 -322
- package/lib/solution/VenueBooking/types.d.ts +0 -3
- package/lib/solution/VenueBooking/utils/resource.js +0 -1
- package/lib/solution/VenueBooking/utils/slotMerge.d.ts +4 -4
- package/lib/solution/VenueBooking/utils/slotMerge.js +4 -6
- package/lib/solution/index.d.ts +0 -1
- package/lib/solution/index.js +1 -3
- package/lib/types/index.d.ts +0 -1
- package/package.json +1 -1
- package/dist/modules/Holder/index.d.ts +0 -48
- package/dist/modules/Holder/index.js +0 -640
- package/dist/modules/Holder/types.d.ts +0 -123
- package/dist/modules/Holder/types.js +0 -1
- package/dist/modules/Holder/utils.d.ts +0 -13
- package/dist/modules/Holder/utils.js +0 -34
- package/dist/modules/ResourcePlanner/index.d.ts +0 -24
- package/dist/modules/ResourcePlanner/index.js +0 -181
- package/dist/modules/ResourcePlanner/planner.d.ts +0 -14
- package/dist/modules/ResourcePlanner/planner.js +0 -1069
- package/dist/modules/ResourcePlanner/types.d.ts +0 -227
- package/dist/modules/ResourcePlanner/types.js +0 -1
- package/dist/solution/UnifiedBookingSales/index.d.ts +0 -183
- package/dist/solution/UnifiedBookingSales/index.js +0 -1891
- package/dist/solution/UnifiedBookingSales/types.d.ts +0 -143
- package/dist/solution/UnifiedBookingSales/types.js +0 -11
- package/lib/modules/Holder/index.d.ts +0 -48
- package/lib/modules/Holder/index.js +0 -402
- package/lib/modules/Holder/types.d.ts +0 -123
- package/lib/modules/Holder/types.js +0 -17
- package/lib/modules/Holder/utils.d.ts +0 -13
- package/lib/modules/Holder/utils.js +0 -71
- package/lib/modules/ResourcePlanner/index.d.ts +0 -24
- package/lib/modules/ResourcePlanner/index.js +0 -148
- package/lib/modules/ResourcePlanner/planner.d.ts +0 -14
- package/lib/modules/ResourcePlanner/planner.js +0 -933
- package/lib/modules/ResourcePlanner/types.d.ts +0 -227
- package/lib/modules/ResourcePlanner/types.js +0 -17
- package/lib/solution/UnifiedBookingSales/index.d.ts +0 -183
- package/lib/solution/UnifiedBookingSales/index.js +0 -1084
- package/lib/solution/UnifiedBookingSales/types.d.ts +0 -143
- package/lib/solution/UnifiedBookingSales/types.js +0 -33
|
@@ -165,6 +165,8 @@ export interface OrderCustomerChangePayload {
|
|
|
165
165
|
}
|
|
166
166
|
export interface OrderScanCodeResult {
|
|
167
167
|
isAvailable: boolean;
|
|
168
|
+
/** 卡券已加入当前订单折扣列表,但不一定能立即应用。 */
|
|
169
|
+
isAccepted?: boolean;
|
|
168
170
|
discountList: Discount[];
|
|
169
171
|
scannedDiscountList: Discount[];
|
|
170
172
|
type: 'server' | 'clientCalc';
|
|
@@ -394,7 +396,6 @@ export interface CommitOrderParams {
|
|
|
394
396
|
type: 'virtual' | 'appointment_booking';
|
|
395
397
|
platform?: string;
|
|
396
398
|
extraData?: Record<string, any>;
|
|
397
|
-
business_code?: string;
|
|
398
399
|
};
|
|
399
400
|
}
|
|
400
401
|
export interface OrderSubmitBooking {
|
|
@@ -570,12 +571,6 @@ export interface SyncPaymentsToOrderParams {
|
|
|
570
571
|
payments: OrderPaymentSource[];
|
|
571
572
|
paymentStatus?: SubmitSalesOrderParams['query']['payment_status'];
|
|
572
573
|
submitWhenPaid?: boolean;
|
|
573
|
-
/**
|
|
574
|
-
* Whether the checkout should be queued as the local `sync_sales` task.
|
|
575
|
-
* Defaults to true to preserve the WebPOS retry path. Set to false when
|
|
576
|
-
* the caller must wait for the cloud checkout response before proceeding.
|
|
577
|
-
*/
|
|
578
|
-
checkoutSyncTaskEnabled?: boolean;
|
|
579
574
|
smallTicketDataFlag?: number;
|
|
580
575
|
businessCode?: string;
|
|
581
576
|
channel?: string;
|
|
@@ -738,8 +733,6 @@ export interface OrderModuleAPI {
|
|
|
738
733
|
setEnableTempOrderPersist: (enabled: boolean) => void;
|
|
739
734
|
/** 是否允许 saveDraft 写入 IndexedDB 草稿。 */
|
|
740
735
|
isTempOrderPersistEnabled: () => boolean;
|
|
741
|
-
/** 提交 tempOrder 变更并触发 `{moduleName}:changed` 事件 */
|
|
742
|
-
notifyTempOrderChanged: () => void;
|
|
743
736
|
submitTempOrder: <T = any>(params?: {
|
|
744
737
|
cacheId?: string;
|
|
745
738
|
platform?: string;
|
|
@@ -15,7 +15,6 @@ export interface OrderProductsDepositSummary {
|
|
|
15
15
|
deposit_policy_ids: number[];
|
|
16
16
|
hasDeposit: boolean;
|
|
17
17
|
}
|
|
18
|
-
import type { WindowPlugin } from '../../plugins';
|
|
19
18
|
/**
|
|
20
19
|
* 把"含 option 的主商品单价"与 bundle 合成"单行 composite 单价"。
|
|
21
20
|
*
|
|
@@ -178,15 +177,6 @@ export declare const mergeRelationForms: (relationForms: {
|
|
|
178
177
|
form_id: number;
|
|
179
178
|
form_record_ids: number[];
|
|
180
179
|
}[];
|
|
181
|
-
export interface CartOrderHolder {
|
|
182
|
-
customer_id?: number;
|
|
183
|
-
form_id: number | string;
|
|
184
|
-
form_record: (number | string)[] | null;
|
|
185
|
-
}
|
|
186
|
-
/**
|
|
187
|
-
* 为购物车行补齐订单所需的 holder 信息(与 cartAccount 结构保持一致)
|
|
188
|
-
*/
|
|
189
|
-
export declare function ensureCartItemOriginHolder(cartItem: CartItem, window?: WindowPlugin): void;
|
|
190
180
|
export declare const getAllDiscountList: (cartItem: CartItem) => any;
|
|
191
181
|
export { createUuidV4 };
|
|
192
182
|
export declare function isTempOrder(data: any): data is OrderTempOrder;
|
|
@@ -20,7 +20,6 @@ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o =
|
|
|
20
20
|
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
21
21
|
import dayjs from "dayjs";
|
|
22
22
|
import Decimal from 'decimal.js';
|
|
23
|
-
import { getProductHolderConfig } from "../Holder/utils";
|
|
24
23
|
import { buildProductLineFingerprint, createEmptySummary } from "../../solution/ScanOrder/utils";
|
|
25
24
|
import { createUuidV4 } from "./utils/orderCollectionIdentity";
|
|
26
25
|
/**
|
|
@@ -745,41 +744,10 @@ export var mergeRelationForms = function mergeRelationForms(relationForms) {
|
|
|
745
744
|
return item.form_record_ids.length > 0;
|
|
746
745
|
}); // 过滤掉没有有效记录的表单
|
|
747
746
|
};
|
|
748
|
-
function getCustomerIdFromStorage(window) {
|
|
749
|
-
try {
|
|
750
|
-
var _window$getLocalStora;
|
|
751
|
-
var customer = JSON.parse((window === null || window === void 0 || (_window$getLocalStora = window.getLocalStorage) === null || _window$getLocalStora === void 0 ? void 0 : _window$getLocalStora.call(window, 'customer')) || '{}');
|
|
752
|
-
var customerId = Number(customer === null || customer === void 0 ? void 0 : customer.id);
|
|
753
|
-
return Number.isFinite(customerId) && customerId > 0 ? customerId : undefined;
|
|
754
|
-
} catch (_unused) {
|
|
755
|
-
return undefined;
|
|
756
|
-
}
|
|
757
|
-
}
|
|
758
|
-
|
|
759
|
-
/**
|
|
760
|
-
* 为购物车行补齐订单所需的 holder 信息(与 cartAccount 结构保持一致)
|
|
761
|
-
*/
|
|
762
|
-
export function ensureCartItemOriginHolder(cartItem, window) {
|
|
763
|
-
var _cartItem$_origin, _cartItem$_productIni;
|
|
764
|
-
if (cartItem !== null && cartItem !== void 0 && (_cartItem$_origin = cartItem._origin) !== null && _cartItem$_origin !== void 0 && _cartItem$_origin.holder) {
|
|
765
|
-
return;
|
|
766
|
-
}
|
|
767
|
-
var holderConfig = getProductHolderConfig((_cartItem$_productIni = cartItem === null || cartItem === void 0 ? void 0 : cartItem._productInit) !== null && _cartItem$_productIni !== void 0 ? _cartItem$_productIni : cartItem === null || cartItem === void 0 ? void 0 : cartItem._productOrigin);
|
|
768
|
-
var formRecordId = cartItem === null || cartItem === void 0 ? void 0 : cartItem.holder_id;
|
|
769
|
-
if (!(holderConfig !== null && holderConfig !== void 0 && holderConfig.resource_id) || formRecordId == null) {
|
|
770
|
-
return;
|
|
771
|
-
}
|
|
772
|
-
cartItem._origin.holder = {
|
|
773
|
-
customer_id: getCustomerIdFromStorage(window),
|
|
774
|
-
form_id: holderConfig.resource_id,
|
|
775
|
-
form_record: [formRecordId]
|
|
776
|
-
};
|
|
777
|
-
}
|
|
778
|
-
;
|
|
779
747
|
export var getAllDiscountList = function getAllDiscountList(cartItem) {
|
|
780
|
-
var _cartItem$
|
|
781
|
-
var discountList = (cartItem === null || cartItem === void 0 || (_cartItem$
|
|
782
|
-
((cartItem === null || cartItem === void 0 || (_cartItem$
|
|
748
|
+
var _cartItem$_origin, _cartItem$_origin2;
|
|
749
|
+
var discountList = (cartItem === null || cartItem === void 0 || (_cartItem$_origin = cartItem._origin) === null || _cartItem$_origin === void 0 || (_cartItem$_origin = _cartItem$_origin.product) === null || _cartItem$_origin === void 0 ? void 0 : _cartItem$_origin.discount_list) || [];
|
|
750
|
+
((cartItem === null || cartItem === void 0 || (_cartItem$_origin2 = cartItem._origin) === null || _cartItem$_origin2 === void 0 || (_cartItem$_origin2 = _cartItem$_origin2.product) === null || _cartItem$_origin2 === void 0 ? void 0 : _cartItem$_origin2.product_bundle) || []).forEach(function (item) {
|
|
783
751
|
discountList = [].concat(_toConsumableArray(discountList), _toConsumableArray((item === null || item === void 0 ? void 0 : item.discount_list) || []));
|
|
784
752
|
item.discount_list = undefined;
|
|
785
753
|
});
|
|
@@ -21,11 +21,13 @@ export declare class WalletPassPaymentImpl implements WalletPassPayment {
|
|
|
21
21
|
private emitEvent;
|
|
22
22
|
private publishWalletAssetsState;
|
|
23
23
|
private recalculateWalletAssets;
|
|
24
|
+
/** 获取当前缓存中所有支付类 Wallet 资产的扫码 code。 */
|
|
25
|
+
private getSearchedWalletAssetCodes;
|
|
24
26
|
/**
|
|
25
|
-
*
|
|
26
|
-
*
|
|
27
|
+
* 用订单重算接口返回的数据更新扫码 Wallet 缓存。
|
|
28
|
+
* 接口暂时缺失某个扫码 code 时继续保留旧值,避免列表闪空。
|
|
27
29
|
*/
|
|
28
|
-
private
|
|
30
|
+
private syncSearchedWalletAssets;
|
|
29
31
|
/**
|
|
30
32
|
* 生成钱包API默认参数
|
|
31
33
|
* 根据业务数据生成标准的钱包API参数,并存储在模块中
|
|
@@ -67,6 +69,11 @@ export declare class WalletPassPaymentImpl implements WalletPassPayment {
|
|
|
67
69
|
noApplicableVoucher: any[];
|
|
68
70
|
products: any[];
|
|
69
71
|
}>;
|
|
72
|
+
/**
|
|
73
|
+
* 商品或订单金额变化后,使用聚合接口一次重算已选与剩余 WalletPass。
|
|
74
|
+
* Walk-In 不发送 customer_id;会员才携带真实 customer_id。
|
|
75
|
+
*/
|
|
76
|
+
private aggregateRecalculateWalletAssetsAsync;
|
|
70
77
|
getWalletPassRecommendListAsync(params: WalletDeductionRecommendParams): Promise<WalletRecommendItem[]>;
|
|
71
78
|
formatWalletPassList2PreparePayments(list: WalletRecommendItem[]): {
|
|
72
79
|
voucher_id: number;
|