@pisell/pisellos 2.3.129 → 2.3.131
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/index.d.ts +2 -0
- package/dist/index.js +3 -1
- package/dist/modules/BusinessAvailability/index.d.ts +30 -0
- package/dist/modules/BusinessAvailability/index.js +204 -0
- package/dist/modules/FulfillmentTiming/index.d.ts +11 -0
- package/dist/modules/FulfillmentTiming/index.js +407 -0
- package/dist/modules/FulfillmentTiming/types.d.ts +67 -0
- package/dist/modules/FulfillmentTiming/types.js +1 -0
- package/dist/modules/OpenData/types.d.ts +8 -0
- package/dist/modules/Order/index.d.ts +11 -2
- package/dist/modules/Order/index.js +370 -253
- package/dist/modules/Order/pickupTiming.d.ts +46 -0
- package/dist/modules/Order/pickupTiming.js +53 -0
- package/dist/modules/Order/types.d.ts +13 -1
- package/dist/modules/Order/utils.js +16 -6
- package/dist/modules/Payment/index.js +9 -10
- package/dist/modules/Schedule/index.d.ts +8 -0
- package/dist/modules/Schedule/index.js +141 -39
- package/dist/modules/index.d.ts +1 -0
- package/dist/modules/index.js +1 -0
- package/dist/plugins/request.d.ts +7 -0
- package/dist/server/utils/small-ticket.d.ts +1 -85
- package/dist/server/utils/small-ticket.js +2 -2542
- package/dist/shared/payment/loadPaymentMethods.d.ts +9 -0
- package/dist/shared/payment/loadPaymentMethods.js +66 -0
- package/dist/shared/receipt/loadCustomerInvoiceLayout.d.ts +22 -0
- package/dist/shared/receipt/loadCustomerInvoiceLayout.js +142 -0
- package/dist/shared/receipt/small-ticket.d.ts +85 -0
- package/dist/shared/receipt/small-ticket.js +2576 -0
- package/dist/shared/sales/loadSalesOrderSnapshot.d.ts +9 -0
- package/dist/shared/sales/loadSalesOrderSnapshot.js +21 -0
- package/dist/solution/BaseSales/index.d.ts +28 -15
- package/dist/solution/BaseSales/index.js +1346 -1101
- package/dist/solution/BaseSales/pickupTiming.d.ts +43 -0
- package/dist/solution/BaseSales/pickupTiming.js +589 -0
- package/dist/solution/BaseSales/types.d.ts +11 -0
- package/dist/solution/BaseSales/utils/parseSalesResponse.js +3 -0
- package/dist/solution/BookingByStep/index.d.ts +1 -1
- package/dist/solution/BookingTicket/index.d.ts +2 -2
- package/dist/solution/BookingTicket/index.js +41 -13
- package/dist/solution/BookingTicket/utils/cartView.js +3 -1
- package/dist/solution/OrderInvoicePreview/index.d.ts +56 -0
- package/dist/solution/OrderInvoicePreview/index.js +269 -0
- package/dist/solution/UnifiedBookingSales/businessAvailability.d.ts +27 -0
- package/dist/solution/UnifiedBookingSales/businessAvailability.js +292 -0
- package/dist/solution/UnifiedBookingSales/index.d.ts +24 -4
- package/dist/solution/UnifiedBookingSales/index.js +953 -709
- package/dist/solution/UnifiedBookingSales/types.d.ts +2 -0
- package/dist/solution/index.d.ts +1 -0
- package/dist/solution/index.js +2 -1
- package/lib/index.d.ts +2 -0
- package/lib/index.js +21 -1
- package/lib/model/strategy/adapter/promotion/index.js +46 -1
- package/lib/modules/BusinessAvailability/index.d.ts +30 -0
- package/lib/modules/BusinessAvailability/index.js +146 -0
- package/lib/modules/FulfillmentTiming/index.d.ts +11 -0
- package/lib/modules/FulfillmentTiming/index.js +359 -0
- package/lib/modules/FulfillmentTiming/types.d.ts +67 -0
- package/lib/modules/FulfillmentTiming/types.js +5 -0
- package/lib/modules/OpenData/types.d.ts +8 -0
- package/lib/modules/Order/index.d.ts +11 -2
- package/lib/modules/Order/index.js +101 -14
- package/lib/modules/Order/pickupTiming.d.ts +46 -0
- package/lib/modules/Order/pickupTiming.js +61 -0
- package/lib/modules/Order/types.d.ts +13 -1
- package/lib/modules/Order/utils.js +12 -4
- package/lib/modules/Payment/index.js +3 -4
- package/lib/modules/Schedule/index.d.ts +8 -0
- package/lib/modules/Schedule/index.js +68 -12
- package/lib/modules/index.d.ts +1 -0
- package/lib/modules/index.js +11 -0
- package/lib/plugins/request.d.ts +7 -0
- package/lib/server/utils/small-ticket.d.ts +1 -85
- package/lib/server/utils/small-ticket.js +9 -2305
- package/lib/shared/payment/loadPaymentMethods.d.ts +9 -0
- package/lib/shared/payment/loadPaymentMethods.js +40 -0
- package/lib/shared/receipt/loadCustomerInvoiceLayout.d.ts +22 -0
- package/lib/shared/receipt/loadCustomerInvoiceLayout.js +86 -0
- package/lib/shared/receipt/small-ticket.d.ts +85 -0
- package/lib/shared/receipt/small-ticket.js +2342 -0
- package/lib/shared/sales/loadSalesOrderSnapshot.d.ts +9 -0
- package/lib/shared/sales/loadSalesOrderSnapshot.js +22 -0
- package/lib/solution/BaseSales/index.d.ts +28 -15
- package/lib/solution/BaseSales/index.js +161 -25
- package/lib/solution/BaseSales/pickupTiming.d.ts +43 -0
- package/lib/solution/BaseSales/pickupTiming.js +269 -0
- package/lib/solution/BaseSales/types.d.ts +11 -0
- package/lib/solution/BaseSales/utils/parseSalesResponse.js +3 -0
- package/lib/solution/BookingByStep/index.d.ts +1 -1
- package/lib/solution/BookingTicket/index.d.ts +2 -2
- package/lib/solution/BookingTicket/index.js +37 -4
- package/lib/solution/BookingTicket/utils/cartView.js +3 -1
- package/lib/solution/OrderInvoicePreview/index.d.ts +56 -0
- package/lib/solution/OrderInvoicePreview/index.js +192 -0
- package/lib/solution/UnifiedBookingSales/businessAvailability.d.ts +27 -0
- package/lib/solution/UnifiedBookingSales/businessAvailability.js +138 -0
- package/lib/solution/UnifiedBookingSales/index.d.ts +24 -4
- package/lib/solution/UnifiedBookingSales/index.js +184 -46
- package/lib/solution/UnifiedBookingSales/types.d.ts +2 -0
- package/lib/solution/index.d.ts +1 -0
- package/lib/solution/index.js +11 -0
- package/package.json +1 -1
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { RequestPlugin } from '../../plugins/request';
|
|
2
|
+
export declare const SALES_ORDER_RELATIONS: string[];
|
|
3
|
+
/** Shared transport contract; remote callers use their host's /h5 prefix. */
|
|
4
|
+
export declare function loadSalesOrderSnapshot(request: RequestPlugin, params: {
|
|
5
|
+
lookup: string | number;
|
|
6
|
+
transport: 'remote' | 'os-server';
|
|
7
|
+
forceRemote?: boolean;
|
|
8
|
+
with?: string[];
|
|
9
|
+
}): Promise<any>;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
3
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
4
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
5
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
6
|
+
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); }
|
|
7
|
+
export var SALES_ORDER_RELATIONS = ['products', 'bookings', 'payments', 'customer', 'summary', 'contacts_info', 'order_meta_list', 'refunds', 'notes'];
|
|
8
|
+
|
|
9
|
+
/** Shared transport contract; remote callers use their host's /h5 prefix. */
|
|
10
|
+
export function loadSalesOrderSnapshot(request, params) {
|
|
11
|
+
var _params$lookup, _params$with;
|
|
12
|
+
var lookup = String((_params$lookup = params.lookup) !== null && _params$lookup !== void 0 ? _params$lookup : '').trim();
|
|
13
|
+
if (!lookup) throw new Error('加载销售详情需要 lookup');
|
|
14
|
+
return request.get("/order/sales/".concat(encodeURIComponent(lookup)), _objectSpread({
|
|
15
|
+
with: (_params$with = params.with) !== null && _params$with !== void 0 ? _params$with : SALES_ORDER_RELATIONS
|
|
16
|
+
}, params.forceRemote && !lookup.startsWith('LOCAL_') ? {
|
|
17
|
+
forceRemote: true
|
|
18
|
+
} : {}), params.transport === 'os-server' ? {
|
|
19
|
+
osServer: true
|
|
20
|
+
} : undefined);
|
|
21
|
+
}
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { Module, ModuleOptions, PisellCore } from '../../types';
|
|
2
2
|
import { BaseModule } from '../../modules/BaseModule';
|
|
3
|
-
import { BaseSalesOrderProduct, BaseSalesOrderProductIdentity, BaseSalesPaymentStatus, BaseSalesUpdateOrderProductQuantityParams, BaseSalesCalculateProductBookingPriceParams, BaseSalesPriceRecalculationContextChange, BaseSalesProductBookingPriceResult, BaseSalesQuotationCustomerScopeInfo, BaseSalesScanCodeResult, BaseSalesCashPaymentOptions, BaseSalesCashPaymentConfig, BaseSalesPayCashParams, BaseSalesPayCashResult, BaseSalesCommitPaymentMethodParams, BaseSalesCommitPaymentMethodResult, BaseSalesConfirmWalletPaymentResult } from './types';
|
|
3
|
+
import { BaseSalesOrderProduct, BaseSalesOrderProductIdentity, BaseSalesPaymentStatus, BaseSalesSubmitSalesOrderParams, BaseSalesUpdateOrderProductQuantityParams, BaseSalesCalculateProductBookingPriceParams, BaseSalesPriceRecalculationContextChange, BaseSalesProductBookingPriceResult, BaseSalesQuotationCustomerScopeInfo, BaseSalesScanCodeResult, BaseSalesCashPaymentOptions, BaseSalesCashPaymentConfig, BaseSalesPayCashParams, BaseSalesPayCashResult, BaseSalesCommitPaymentMethodParams, BaseSalesCommitPaymentMethodResult, BaseSalesConfirmWalletPaymentResult } from './types';
|
|
4
4
|
import { OrderModule } from '../../modules/Order';
|
|
5
|
+
import { type PickupTimingBookingInput } from '../../modules/Order/pickupTiming';
|
|
6
|
+
import type { PickupTimingAvailability, PickupTimingSelection, PickupTimingValidationResult } from '../../modules/FulfillmentTiming';
|
|
5
7
|
import type { AddProductBookingInput, AddProductToOrderOptions, LoadSalesDetailParams, OrderPaymentData, OrderPaymentUpdateOptions, OrderPaymentUpdateResult, OrderPaymentSource, SendCustomerPayLinkParams, SyncPaymentsToOrderParams, SyncPaymentsToOrderResult, UpdateTempOrderCustomerInput, UpdateOrderBookingParams, UpdateOrderProductParams, OrderTempOrder, OrderSummary, OrderPromotionEvaluator, OrderGiftSelectResolver, OrderUnfulfilledPromotion, OrderLastGiftActions, RemoveProductsFromOrderOptions, ReplaceTempOrderOptions, SalesNote, SalesNotesMutationSnapshot, SetSalesNoteInput, PickupReferenceMode, ShopServiceData, ShopServiceType } from '../../modules/Order/types';
|
|
6
8
|
import type { SubmitPayloadEnhancer } from '../../modules/Order/utils';
|
|
7
9
|
import type { Discount, VirtualCurrencyAsset } from '../../modules/Discount/types';
|
|
@@ -76,6 +78,8 @@ export declare class BaseSalesImpl extends BaseModule implements Module {
|
|
|
76
78
|
private serverOrderChangeHydrateInFlight;
|
|
77
79
|
private queuedServerOrderChanges;
|
|
78
80
|
private serverOrderChangeSyncEnabled;
|
|
81
|
+
protected pickupTimingEnabled: boolean;
|
|
82
|
+
private pickupTimingController?;
|
|
79
83
|
constructor(name?: string, version?: string);
|
|
80
84
|
/**
|
|
81
85
|
* 子类可覆盖此方法以追加/收敛要注册的子模块。
|
|
@@ -153,6 +157,23 @@ export declare class BaseSalesImpl extends BaseModule implements Module {
|
|
|
153
157
|
private getAuthoritativeBundleUnitPrice;
|
|
154
158
|
private mergeProductForPriceQuery;
|
|
155
159
|
protected getSubmitOrderSalesChannel(): string | undefined;
|
|
160
|
+
/** Only solutions opting into Pickup Timing supply effective OpenData. */
|
|
161
|
+
protected loadPickupTimingOpenData(_force: boolean): Promise<Record<string, unknown>>;
|
|
162
|
+
protected isPickupTimingEnabled(): boolean;
|
|
163
|
+
protected getPickupTimingContextData(key: string): unknown;
|
|
164
|
+
protected getPickupTimingScope(): string;
|
|
165
|
+
protected resetPickupTimingCache(): void;
|
|
166
|
+
private getPickupTimingController;
|
|
167
|
+
getPickupTimingAvailability(params?: {
|
|
168
|
+
date?: string;
|
|
169
|
+
force?: boolean;
|
|
170
|
+
}): Promise<PickupTimingAvailability>;
|
|
171
|
+
getPickupTimingSelection(): PickupTimingSelection;
|
|
172
|
+
setPickupTimingSelection(selection: PickupTimingSelection): Promise<PickupTimingSelection>;
|
|
173
|
+
validatePickupTimingSelection(selection: PickupTimingSelection): Promise<PickupTimingValidationResult>;
|
|
174
|
+
preparePickupTimingForCheckout(options?: {
|
|
175
|
+
freeze?: boolean;
|
|
176
|
+
}): Promise<PickupTimingSelection>;
|
|
156
177
|
/** Subclasses with target-scoped OpenData override this guard before reusing the cache. */
|
|
157
178
|
protected isInvoiceOpenDataCacheCurrent(): boolean;
|
|
158
179
|
private getFulfillmentRefModeConfigs;
|
|
@@ -250,6 +271,9 @@ export declare class BaseSalesImpl extends BaseModule implements Module {
|
|
|
250
271
|
updateTempOrderDepositAmount(amount: string | number): OrderSummary;
|
|
251
272
|
setPickupReferenceMode(mode: PickupReferenceMode): ShopServiceData;
|
|
252
273
|
setServiceType(serviceType: ShopServiceType): ShopServiceData;
|
|
274
|
+
getPickupTimingBooking(): import("../../modules/Order").PickupTimingBooking | null;
|
|
275
|
+
setPickupTimingBooking(input: PickupTimingBookingInput): import("../../modules/Order").PickupTimingBooking;
|
|
276
|
+
clearPickupTimingBooking(): void;
|
|
253
277
|
updateTempOrderContactsInfo(contactsInfo: Record<string, any> | null): Record<string, any> | null;
|
|
254
278
|
/** @deprecated OrderModule 不再负责 tempOrder localStorage 持久化。 */
|
|
255
279
|
setEnableTempOrderPersist(enabled: boolean): void;
|
|
@@ -315,13 +339,8 @@ export declare class BaseSalesImpl extends BaseModule implements Module {
|
|
|
315
339
|
productList?: Record<string, any>[];
|
|
316
340
|
discountList?: Discount[];
|
|
317
341
|
}): Promise<void>;
|
|
318
|
-
submitScanOrder<T = any>(params?:
|
|
319
|
-
|
|
320
|
-
paymentStatus?: BaseSalesPaymentStatus;
|
|
321
|
-
smallTicketDataFlag?: number;
|
|
322
|
-
confirmPendingVoucherPayments?: boolean;
|
|
323
|
-
enhancePayload?: SubmitPayloadEnhancer;
|
|
324
|
-
}): Promise<T>;
|
|
342
|
+
submitScanOrder<T = any>(params?: BaseSalesSubmitSalesOrderParams): Promise<T>;
|
|
343
|
+
private buildVirtualSettlementOrderData;
|
|
325
344
|
private buildVirtualSettlementSubmitData;
|
|
326
345
|
/**
|
|
327
346
|
* 提交当前 Sales 订单。
|
|
@@ -329,13 +348,7 @@ export declare class BaseSalesImpl extends BaseModule implements Module {
|
|
|
329
348
|
* PaymentModal 场景通过 smallTicketDataFlag=1 请求 B 端小票数据;
|
|
330
349
|
* payments 会交给 OrderModule 统一映射为 Sales 协议支付项。
|
|
331
350
|
*/
|
|
332
|
-
submitSalesOrder<T = any>(params?:
|
|
333
|
-
payments?: OrderPaymentSource[];
|
|
334
|
-
paymentStatus?: BaseSalesPaymentStatus;
|
|
335
|
-
smallTicketDataFlag?: number;
|
|
336
|
-
confirmPendingVoucherPayments?: boolean;
|
|
337
|
-
enhancePayload?: SubmitPayloadEnhancer;
|
|
338
|
-
}): Promise<T>;
|
|
351
|
+
submitSalesOrder<T = any>(params?: BaseSalesSubmitSalesOrderParams): Promise<T>;
|
|
339
352
|
saveSalesOrderDraft<T = any>(params?: {
|
|
340
353
|
platform?: string;
|
|
341
354
|
businessCode?: string;
|