@pisell/pisellos 0.10.98 → 0.10.99

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.
Files changed (36) hide show
  1. package/dist/model/strategy/adapter/promotion/index.js +9 -0
  2. package/dist/model/strategy/adapter/walletPass/locales.js +9 -0
  3. package/dist/modules/Order/index.js +7 -0
  4. package/dist/modules/Order/types.d.ts +6 -0
  5. package/dist/modules/Payment/utils.d.ts +2 -0
  6. package/dist/modules/Payment/utils.js +6 -6
  7. package/dist/modules/Payment/walletpass.d.ts +2 -0
  8. package/dist/modules/Payment/walletpass.js +75 -34
  9. package/dist/modules/Product/index.d.ts +1 -1
  10. package/dist/server/index.js +26 -13
  11. package/dist/server/modules/products/index.d.ts +6 -2
  12. package/dist/server/modules/products/index.js +476 -400
  13. package/dist/solution/BookingByStep/index.d.ts +2 -2
  14. package/dist/solution/BookingTicket/index.d.ts +1 -1
  15. package/dist/solution/BookingTicket/index.js +6 -5
  16. package/dist/solution/BookingTicket/utils/redeemArrival.d.ts +20 -20
  17. package/dist/solution/BookingTicket/utils/scan/applyGlobalScan.js +1 -1
  18. package/dist/solution/UnifiedBookingSales/index.js +34 -23
  19. package/lib/model/strategy/adapter/walletPass/locales.js +9 -0
  20. package/lib/modules/Order/index.js +5 -0
  21. package/lib/modules/Order/types.d.ts +6 -0
  22. package/lib/modules/Payment/utils.d.ts +2 -0
  23. package/lib/modules/Payment/utils.js +7 -7
  24. package/lib/modules/Payment/walletpass.d.ts +2 -0
  25. package/lib/modules/Payment/walletpass.js +42 -11
  26. package/lib/modules/Product/index.d.ts +1 -1
  27. package/lib/server/index.js +9 -4
  28. package/lib/server/modules/products/index.d.ts +6 -2
  29. package/lib/server/modules/products/index.js +40 -7
  30. package/lib/solution/BookingByStep/index.d.ts +2 -2
  31. package/lib/solution/BookingTicket/index.d.ts +1 -1
  32. package/lib/solution/BookingTicket/index.js +2 -1
  33. package/lib/solution/BookingTicket/utils/redeemArrival.d.ts +20 -20
  34. package/lib/solution/BookingTicket/utils/scan/applyGlobalScan.js +1 -1
  35. package/lib/solution/UnifiedBookingSales/index.js +3 -2
  36. package/package.json +1 -1
@@ -366,7 +366,7 @@ export declare class BookingTicketImpl extends BaseSalesImpl implements Module {
366
366
  * 获取当前的客户搜索条件
367
367
  * @returns 当前搜索条件
368
368
  */
369
- getCurrentCustomerSearchParams(): Omit<import("../../modules").ShopGetCustomerListParams, "skip" | "num">;
369
+ getCurrentCustomerSearchParams(): Omit<import("../../modules").ShopGetCustomerListParams, "num" | "skip">;
370
370
  /**
371
371
  * 获取客户列表状态(包含滚动加载相关状态)
372
372
  * @returns 客户状态
@@ -386,6 +386,7 @@ class BookingTicketImpl extends _BaseSales.BaseSalesImpl {
386
386
  await idGenerator.configure({
387
387
  biz: businessCode,
388
388
  config: {
389
+ enableShortNumber: openDataConfig?.['sale.enable_short_number'] !== false,
389
390
  prefix,
390
391
  deviceCode: deviceId,
391
392
  padReceiptSequence: openDataConfig?.['sale.pad_with_leading_zeros'] === true,
@@ -2078,7 +2079,7 @@ class BookingTicketImpl extends _BaseSales.BaseSalesImpl {
2078
2079
  if (invoiceContextChanged) {
2079
2080
  await this.prepareInvoiceTemplateAtSolutionReady(Object.prototype.hasOwnProperty.call(params, 'openData') ? this.getInjectedOpenDataConfig() : undefined);
2080
2081
  }
2081
- if (params?.businessCode !== undefined || params?.business_code !== undefined) {
2082
+ if (params?.businessCode !== undefined || params?.business_code !== undefined || Object.prototype.hasOwnProperty.call(params ?? {}, 'openData')) {
2082
2083
  await this.configureIdGeneratorFromOpenData();
2083
2084
  }
2084
2085
  }
@@ -24,23 +24,28 @@ export declare function buildArrivalCheckoutQuery(order: OrderTempOrder, summary
24
24
  products: import("../../../modules/Order/types").OrderSubmitProduct[];
25
25
  notes?: import("../../../modules/Order/types").SalesNote[] | undefined;
26
26
  summary?: import("../../../modules/Order/types").OrderSummary | undefined;
27
- bookings: any[];
28
- external_sale_number: string;
29
- payments: any[];
27
+ status: string;
28
+ metadata: Record<string, any>;
29
+ business_code?: string | undefined;
30
30
  customer_id: number | null;
31
+ type: string;
32
+ holder: Record<string, any> | null;
33
+ email: string;
34
+ phone: string;
35
+ note: string;
36
+ relation_forms: any[];
37
+ holder_relations?: import("../../../modules/Order/types").OrderHolderRelation[] | undefined;
38
+ country_calling_code: string;
39
+ contacts_info: Record<string, any> | null;
31
40
  order_id: number | null;
41
+ external_sale_number: string;
32
42
  order_number: string | null;
33
43
  shop_order_number: string | null;
34
- type: string;
35
- business_code?: string | undefined;
44
+ shop_full_order_number: string | null;
36
45
  sales_channel: string;
37
46
  order_sales_channel: string;
38
- status: string;
39
47
  shipping_status: string;
40
48
  customer_name: string;
41
- country_calling_code: string;
42
- phone: string;
43
- email: string;
44
49
  is_price_include_tax: number;
45
50
  tax_title: string;
46
51
  tax_country_code: string;
@@ -51,21 +56,16 @@ export declare function buildArrivalCheckoutQuery(order: OrderTempOrder, summary
51
56
  deposit_amount: string;
52
57
  shop_discount: string;
53
58
  surcharge_fee: string;
54
- note: string;
59
+ buzzer?: string | undefined;
60
+ delivery_type?: string | undefined;
61
+ table_number?: Record<string, any> | undefined;
55
62
  schedule_date: string;
63
+ bookings: any[];
64
+ payments: any[];
65
+ order_meta_list?: import("../../../modules/Order/types").OrderMetaList | undefined;
56
66
  refunds?: any[] | undefined;
57
67
  surcharges: any[];
58
- relation_forms: any[];
59
68
  contacts: any[];
60
- contacts_info: Record<string, any> | null;
61
- holder: Record<string, any> | null;
62
- holder_relations?: import("../../../modules/Order/types").OrderHolderRelation[] | undefined;
63
- order_meta_list?: import("../../../modules/Order/types").OrderMetaList | undefined;
64
- metadata: Record<string, any>;
65
- buzzer?: string | undefined;
66
- shop_full_order_number: string | null;
67
- delivery_type?: string | undefined;
68
- table_number?: Record<string, any> | undefined;
69
69
  };
70
70
  export declare function describeChangedBookings(before: OrderTempOrder['bookings'], after: OrderTempOrder['bookings']): {
71
71
  schedule_event_id: any;
@@ -278,7 +278,7 @@ async function applyGlobalScan(host, formatted, bridge) {
278
278
  }
279
279
  // 已识别为 Wallet 支付资产但当前不可用:保留禁用展示,不回退优惠码。
280
280
  if (!bindResult.resolveFailed) {
281
- bridge?.onNotify?.('fail', 'pisell2.text.goodpass.code-invalid-cart');
281
+ bridge?.onNotify?.('fail', walletResult.asset.reasonCode === 'empty_cart' ? 'pisell2.sale-detail.promotion-panel.add-items-first' : 'pisell2.text.goodpass.code-invalid-cart');
282
282
  }
283
283
  return {
284
284
  status: 'failed',
@@ -2029,7 +2029,8 @@ class UnifiedBookingSalesImpl extends _BookingTicket.BookingTicket {
2029
2029
  const biz = this.getBookingTicketBusinessCode();
2030
2030
  if (!biz) throw new Error('当前订单缺少业务类型,无法生成订单编号');
2031
2031
  const idGenerator = this.appPlugin?.getApp?.()?.getPlugin?.('idGenerator');
2032
- if (!tempOrder.shop_order_number && typeof idGenerator?.generateShopOrderNumber !== 'function' || !tempOrder.shop_full_order_number && typeof idGenerator?.generateReceiptId !== 'function') {
2032
+ const useLongNumber = idGenerator?.getConfig?.(biz)?.enableShortNumber === false;
2033
+ if (!tempOrder.shop_order_number && typeof idGenerator?.generateShopOrderNumber !== 'function' || !tempOrder.shop_full_order_number && !useLongNumber && typeof idGenerator?.generateReceiptId !== 'function') {
2033
2034
  throw new Error('订单编号生成器不可用,请重启应用后重试');
2034
2035
  }
2035
2036
  try {
@@ -2039,7 +2040,7 @@ class UnifiedBookingSalesImpl extends _BookingTicket.BookingTicket {
2039
2040
  });
2040
2041
  }
2041
2042
  if (!tempOrder.shop_full_order_number) {
2042
- tempOrder.shop_full_order_number = await idGenerator.generateReceiptId({
2043
+ tempOrder.shop_full_order_number = useLongNumber ? tempOrder.shop_order_number : await idGenerator.generateReceiptId({
2043
2044
  biz
2044
2045
  });
2045
2046
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "private": false,
3
3
  "name": "@pisell/pisellos",
4
- "version": "0.10.98",
4
+ "version": "0.10.99",
5
5
  "description": "一个可扩展的前端模块化SDK框架,支持插件系统",
6
6
  "main": "dist/index.js",
7
7
  "types": "dist/index.d.ts",