@pisell/pisellos 0.0.507 → 0.0.509
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/Order/index.d.ts +1 -1
- package/dist/modules/Order/index.js +2 -2
- package/dist/modules/Order/utils.d.ts +2 -0
- package/dist/modules/Order/utils.js +8 -0
- package/dist/solution/BookingByStep/index.d.ts +1 -1
- package/dist/solution/BookingTicket/index.d.ts +1 -1
- package/dist/solution/ScanOrder/index.d.ts +21 -1
- package/dist/solution/ScanOrder/index.js +948 -497
- package/dist/solution/ScanOrder/types.d.ts +6 -0
- package/dist/solution/ScanOrder/types.js +3 -1
- package/dist/solution/ScanOrder/utils.d.ts +5 -0
- package/dist/solution/ScanOrder/utils.js +32 -0
- package/lib/modules/Order/index.d.ts +1 -1
- package/lib/modules/Order/index.js +3 -1
- package/lib/modules/Order/utils.d.ts +2 -0
- package/lib/modules/Order/utils.js +8 -0
- package/lib/solution/BookingByStep/index.d.ts +1 -1
- package/lib/solution/BookingTicket/index.d.ts +1 -1
- package/lib/solution/ScanOrder/index.d.ts +21 -1
- package/lib/solution/ScanOrder/index.js +259 -14
- package/lib/solution/ScanOrder/types.d.ts +6 -0
- package/lib/solution/ScanOrder/utils.d.ts +5 -0
- package/lib/solution/ScanOrder/utils.js +26 -0
- package/package.json +1 -1
|
@@ -86,7 +86,7 @@ export declare class OrderModule extends BaseModule implements Module, OrderModu
|
|
|
86
86
|
enhancePayload?: SubmitPayloadEnhancer;
|
|
87
87
|
}): Promise<T>;
|
|
88
88
|
createOrder(params: CommitOrderParams['query']): {
|
|
89
|
-
type: "
|
|
89
|
+
type: "virtual" | "appointment_booking";
|
|
90
90
|
platform: string;
|
|
91
91
|
sales_channel: string;
|
|
92
92
|
order_sales_channel: string;
|
|
@@ -25,7 +25,7 @@ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key i
|
|
|
25
25
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
26
26
|
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
27
27
|
import { BaseModule } from "../BaseModule";
|
|
28
|
-
import { generateDuration, getAllDiscountList, mergeRelationForms, buildSubmitPayload, createDefaultTempOrder, createDefaultOrderRulesHooks, createEmptySummary, formatDateTime, formatV1Product, isTempOrder } from "./utils";
|
|
28
|
+
import { generateDuration, getAllDiscountList, mergeRelationForms, buildSubmitPayload, createDefaultTempOrder, createDefaultOrderRulesHooks, createEmptySummary, formatDateTime, filterProductsForScanOrderMore, formatV1Product, isTempOrder } from "./utils";
|
|
29
29
|
import { isNormalProduct } from "../Product/utils";
|
|
30
30
|
import dayjs from 'dayjs';
|
|
31
31
|
import { getProductIdentityIndex, getSafeProductNum, isIdentityMatch, normalizeOrderProduct } from "../../solution/ScanOrder/utils";
|
|
@@ -737,7 +737,7 @@ export var OrderModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
737
737
|
_context10.next = 12;
|
|
738
738
|
break;
|
|
739
739
|
}
|
|
740
|
-
products = formatV1Product(payload.products);
|
|
740
|
+
products = formatV1Product(filterProductsForScanOrderMore(payload.products));
|
|
741
741
|
_context10.next = 8;
|
|
742
742
|
return this.scanOrderMore({
|
|
743
743
|
query: {
|
|
@@ -72,6 +72,8 @@ export declare function buildSubmitPayload(params: {
|
|
|
72
72
|
type?: string;
|
|
73
73
|
enhance?: SubmitPayloadEnhancer;
|
|
74
74
|
}): ScanOrderSubmitPayload;
|
|
75
|
+
/** 加单(scanOrderMore)不应提交 booking 关联的虚拟规则商品行 */
|
|
76
|
+
export declare function filterProductsForScanOrderMore(products: ScanOrderSubmitProduct[]): ScanOrderSubmitProduct[];
|
|
75
77
|
export declare function formatV1Product(products: ScanOrderSubmitProduct[]): {
|
|
76
78
|
bundle: any[];
|
|
77
79
|
key: number | null;
|
|
@@ -390,6 +390,14 @@ export function buildSubmitPayload(params) {
|
|
|
390
390
|
now: now
|
|
391
391
|
}) : payload;
|
|
392
392
|
}
|
|
393
|
+
|
|
394
|
+
/** 加单(scanOrderMore)不应提交 booking 关联的虚拟规则商品行 */
|
|
395
|
+
export function filterProductsForScanOrderMore(products) {
|
|
396
|
+
return (products || []).filter(function (p) {
|
|
397
|
+
var _p$metadata;
|
|
398
|
+
return ((_p$metadata = p.metadata) === null || _p$metadata === void 0 ? void 0 : _p$metadata.is_rule) !== true;
|
|
399
|
+
});
|
|
400
|
+
}
|
|
393
401
|
export function formatV1Product(products) {
|
|
394
402
|
return products.map(function (product) {
|
|
395
403
|
return {
|
|
@@ -311,7 +311,7 @@ export declare class BookingByStepImpl extends BaseModule implements Module {
|
|
|
311
311
|
date: string;
|
|
312
312
|
status: string;
|
|
313
313
|
week: string;
|
|
314
|
-
weekNum: 0 |
|
|
314
|
+
weekNum: 0 | 1 | 2 | 3 | 4 | 5 | 6;
|
|
315
315
|
}[]>;
|
|
316
316
|
submitTimeSlot(timeSlots: TimeSliceItem): void;
|
|
317
317
|
private getScheduleDataByIds;
|
|
@@ -131,7 +131,7 @@ export declare class BookingTicketImpl extends BaseModule implements Module {
|
|
|
131
131
|
* 获取当前的客户搜索条件
|
|
132
132
|
* @returns 当前搜索条件
|
|
133
133
|
*/
|
|
134
|
-
getCurrentCustomerSearchParams(): Omit<import("../../modules").ShopGetCustomerListParams, "
|
|
134
|
+
getCurrentCustomerSearchParams(): Omit<import("../../modules").ShopGetCustomerListParams, "num" | "skip">;
|
|
135
135
|
/**
|
|
136
136
|
* 获取客户列表状态(包含滚动加载相关状态)
|
|
137
137
|
* @returns 客户状态
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Module, ModuleOptions, PisellCore } from '../../types';
|
|
2
2
|
import { BaseModule } from '../../modules/BaseModule';
|
|
3
|
-
import { ScanOrderAddLogParams, ScanOrderAvailabilityInfo, ScanOrderOrderProduct, ScanOrderOrderProductIdentity } from './types';
|
|
3
|
+
import { ScanOrderAddLogParams, ScanOrderAvailabilityInfo, ScanOrderOrderProduct, ScanOrderOrderProductIdentity, ScanOrderScanCodeResult } from './types';
|
|
4
|
+
import type { Discount } from '../../modules/Discount/types';
|
|
4
5
|
import { type CartItemSummary, type PaxInfo, type QuantityCheckResult, type QuantityLimitResult } from '../../model/strategy/adapter/itemRule';
|
|
5
6
|
import type { StrategyConfig } from '../../model/strategy/type';
|
|
6
7
|
export * from './types';
|
|
@@ -29,6 +30,10 @@ export declare class ScanOrderImpl extends BaseModule implements Module {
|
|
|
29
30
|
private itemRuleRuntimeConfig;
|
|
30
31
|
/** 最近一次 checkResourceAvailable 从预约规则 link 拉取的商品快照 */
|
|
31
32
|
private enabledReservationRuleProducts;
|
|
33
|
+
private loginEffectDisposers;
|
|
34
|
+
private customerLoginRefreshInFlight;
|
|
35
|
+
private customerLoginRefreshIdInFlight;
|
|
36
|
+
private static readonly PISELL1_LOGIN_SUCCESS;
|
|
32
37
|
private getScanOrderLoggerContext;
|
|
33
38
|
private serializeError;
|
|
34
39
|
private addScanOrderLog;
|
|
@@ -36,6 +41,12 @@ export declare class ScanOrderImpl extends BaseModule implements Module {
|
|
|
36
41
|
private logMethodSuccess;
|
|
37
42
|
private logMethodError;
|
|
38
43
|
addLog(params: ScanOrderAddLogParams): Promise<void>;
|
|
44
|
+
private normalizeCustomerId;
|
|
45
|
+
private resolveCustomerIdFromLoginPayload;
|
|
46
|
+
private clearLoginEffectListeners;
|
|
47
|
+
private registerLoginEffect;
|
|
48
|
+
private registerCustomerLoginListeners;
|
|
49
|
+
private refreshOrderMarketingAfterLogin;
|
|
39
50
|
constructor(name?: string, version?: string);
|
|
40
51
|
initialize(core: PisellCore, options?: ModuleOptions): Promise<void>;
|
|
41
52
|
destroy(): Promise<void>;
|
|
@@ -62,6 +73,15 @@ export declare class ScanOrderImpl extends BaseModule implements Module {
|
|
|
62
73
|
restoreOrder(): Promise<import("./types").ScanOrderTempOrder>;
|
|
63
74
|
getOrderProducts(): ScanOrderOrderProduct[];
|
|
64
75
|
getSummary(): Promise<import("./types").ScanOrderSummary>;
|
|
76
|
+
getDiscountList(): Discount[];
|
|
77
|
+
scanCode(code: string, customerId?: number): Promise<ScanOrderScanCodeResult>;
|
|
78
|
+
setDiscountSelected(params: {
|
|
79
|
+
discountId: number;
|
|
80
|
+
isSelected: boolean;
|
|
81
|
+
}): Promise<void>;
|
|
82
|
+
onCustomerLogin(params: {
|
|
83
|
+
customerId: number;
|
|
84
|
+
}): Promise<void>;
|
|
65
85
|
private buildSubmitPayloadEnhancer;
|
|
66
86
|
submitScanOrder<T = any>(): Promise<T>;
|
|
67
87
|
addProductToOrder(product: Partial<ScanOrderOrderProduct> & ScanOrderOrderProductIdentity): Promise<ScanOrderOrderProduct[]>;
|