@pisell/pisellos 0.10.59 → 0.10.61

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 (72) hide show
  1. package/dist/modules/BookingContext/utils/buildNormalProductCacheItemFromOrderLine.d.ts +3 -1
  2. package/dist/modules/BookingContext/utils/buildNormalProductCacheItemFromOrderLine.js +25 -2
  3. package/dist/modules/Discount/index.js +1 -0
  4. package/dist/modules/Order/holderRelations.d.ts +14 -0
  5. package/dist/modules/Order/holderRelations.js +154 -0
  6. package/dist/modules/Order/index.d.ts +1 -1
  7. package/dist/modules/Order/index.js +92 -47
  8. package/dist/modules/Order/types.d.ts +19 -1
  9. package/dist/modules/Order/types.js +2 -0
  10. package/dist/modules/Order/utils/discountProductLineIdentity.d.ts +1 -1
  11. package/dist/modules/Order/utils/discountProductLineIdentity.js +142 -7
  12. package/dist/modules/Order/utils/orderCollectionIdentity.js +24 -10
  13. package/dist/modules/Order/utils.d.ts +1 -1
  14. package/dist/modules/Order/utils.js +35 -9
  15. package/dist/server/index.js +18 -12
  16. package/dist/server/modules/order/index.d.ts +4 -0
  17. package/dist/server/modules/order/index.js +255 -190
  18. package/dist/server/modules/order/types.d.ts +3 -0
  19. package/dist/shared/receipt/small-ticket.js +17 -0
  20. package/dist/shared/sales/loadSalesOrderSnapshot.js +1 -1
  21. package/dist/solution/BaseSales/index.js +97 -27
  22. package/dist/solution/BaseSales/types.d.ts +2 -1
  23. package/dist/solution/BaseSales/utils/parseSalesResponse.d.ts +3 -1
  24. package/dist/solution/BaseSales/utils/parseSalesResponse.js +7 -3
  25. package/dist/solution/BaseSales/utils/transformBaseProductToOrderProduct.js +12 -3
  26. package/dist/solution/BookingTicket/index.js +7 -4
  27. package/dist/solution/BookingTicket/utils/addProductDecision.d.ts +1 -1
  28. package/dist/solution/BookingTicket/utils/addProductDecision.js +4 -3
  29. package/dist/solution/BookingTicket/utils/scan/applyGlobalScan.js +6 -2
  30. package/dist/solution/BookingTicket/utils/scan/cloudSearch.js +1 -0
  31. package/dist/solution/BookingTicket/utils/scan/handleScan.js +2 -1
  32. package/dist/solution/UnifiedBookingSales/index.d.ts +1 -1
  33. package/dist/solution/UnifiedBookingSales/index.js +4 -4
  34. package/dist/utils/platform.d.ts +2 -0
  35. package/dist/utils/platform.js +6 -0
  36. package/lib/model/strategy/adapter/promotion/index.js +46 -1
  37. package/lib/modules/BookingContext/utils/buildNormalProductCacheItemFromOrderLine.d.ts +3 -1
  38. package/lib/modules/BookingContext/utils/buildNormalProductCacheItemFromOrderLine.js +16 -1
  39. package/lib/modules/Discount/index.js +1 -0
  40. package/lib/modules/Order/holderRelations.d.ts +14 -0
  41. package/lib/modules/Order/holderRelations.js +98 -0
  42. package/lib/modules/Order/index.d.ts +1 -1
  43. package/lib/modules/Order/index.js +44 -12
  44. package/lib/modules/Order/types.d.ts +19 -1
  45. package/lib/modules/Order/types.js +1 -0
  46. package/lib/modules/Order/utils/discountProductLineIdentity.d.ts +1 -1
  47. package/lib/modules/Order/utils/discountProductLineIdentity.js +51 -2
  48. package/lib/modules/Order/utils/orderCollectionIdentity.js +5 -0
  49. package/lib/modules/Order/utils.d.ts +1 -1
  50. package/lib/modules/Order/utils.js +27 -6
  51. package/lib/server/index.js +6 -0
  52. package/lib/server/modules/order/index.d.ts +4 -0
  53. package/lib/server/modules/order/index.js +46 -4
  54. package/lib/server/modules/order/types.d.ts +3 -0
  55. package/lib/shared/receipt/small-ticket.js +15 -0
  56. package/lib/shared/sales/loadSalesOrderSnapshot.js +1 -1
  57. package/lib/solution/BaseSales/index.js +39 -2
  58. package/lib/solution/BaseSales/types.d.ts +2 -1
  59. package/lib/solution/BaseSales/utils/parseSalesResponse.d.ts +3 -1
  60. package/lib/solution/BaseSales/utils/parseSalesResponse.js +4 -0
  61. package/lib/solution/BaseSales/utils/transformBaseProductToOrderProduct.js +7 -0
  62. package/lib/solution/BookingTicket/index.js +4 -1
  63. package/lib/solution/BookingTicket/utils/addProductDecision.d.ts +1 -1
  64. package/lib/solution/BookingTicket/utils/addProductDecision.js +4 -3
  65. package/lib/solution/BookingTicket/utils/scan/applyGlobalScan.js +7 -1
  66. package/lib/solution/BookingTicket/utils/scan/cloudSearch.js +1 -0
  67. package/lib/solution/BookingTicket/utils/scan/handleScan.js +2 -1
  68. package/lib/solution/UnifiedBookingSales/index.d.ts +1 -1
  69. package/lib/solution/UnifiedBookingSales/index.js +3 -3
  70. package/lib/utils/platform.d.ts +2 -0
  71. package/lib/utils/platform.js +7 -0
  72. package/package.json +1 -1
@@ -1653,14 +1653,14 @@ class UnifiedBookingSalesImpl extends _BookingTicket.BookingTicket {
1653
1653
  }
1654
1654
 
1655
1655
  /**
1656
- * PC/H5/Kiosk 结账默认直接等待云端 checkout;POS/WebPOS 仍保持本地待同步。
1656
+ * PC/H5 及自助终端结账默认直接等待云端 checkout;POS/WebPOS 仍保持本地待同步。
1657
1657
  * 显式传 checkoutSyncTaskEnabled: true 时仍可回退到本地同步模式。
1658
1658
  */
1659
1659
  shouldUseCheckoutSyncTask() {
1660
1660
  const configured = this.otherParams?.checkoutSyncTaskEnabled;
1661
1661
  if (configured === true) return true;
1662
1662
  const platform = (0, _platform.normalizeRuntimePlatform)(this.otherParams?.platform);
1663
- return !(0, _platform.isCustomerUserPlatform)(platform) && platform !== 'kiosk';
1663
+ return !(0, _platform.isCustomerUserPlatform)(platform) && !(0, _platform.isSelfServicePlatform)(platform);
1664
1664
  }
1665
1665
 
1666
1666
  /** UnifiedBookingSales 的真实结账默认请求收据数据,供云端确认后再本地打印。 */
@@ -2017,7 +2017,7 @@ class UnifiedBookingSalesImpl extends _BookingTicket.BookingTicket {
2017
2017
  throw new Error('[UnifiedBookingSales] getProtocol 需要 policyId');
2018
2018
  }
2019
2019
  let policyUrl = 'shop-policy';
2020
- if (this.otherParams.platform === 'kiosk' || this.otherParams.platform === 'pos' || this.otherParams.platform === 'shop') {
2020
+ if ((0, _platform.isSelfServicePlatform)(this.otherParams.platform) || this.otherParams.platform === 'pos' || this.otherParams.platform === 'shop') {
2021
2021
  policyUrl = 'policy';
2022
2022
  }
2023
2023
  return this.request.get(`/${policyUrl}/${encodeURIComponent(normalizedPolicyId)}`);
@@ -6,3 +6,5 @@ export declare function normalizeRuntimePlatform(platform: unknown): string;
6
6
  * PC and H5 are authenticated-customer clients rather than staff terminals.
7
7
  */
8
8
  export declare function isCustomerUserPlatform(platform: unknown): boolean;
9
+ /** Kiosk and vending retain distinct channels but share self-service checkout behavior. */
10
+ export declare function isSelfServicePlatform(platform: unknown): boolean;
@@ -4,8 +4,10 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.isCustomerUserPlatform = isCustomerUserPlatform;
7
+ exports.isSelfServicePlatform = isSelfServicePlatform;
7
8
  exports.normalizeRuntimePlatform = normalizeRuntimePlatform;
8
9
  const CUSTOMER_USER_PLATFORMS = new Set(['pc', 'h5']);
10
+ const SELF_SERVICE_PLATFORMS = new Set(['kiosk', 'vending']);
9
11
 
10
12
  /**
11
13
  * Normalize the runtime platform passed through solution/module otherParams.
@@ -19,4 +21,9 @@ function normalizeRuntimePlatform(platform) {
19
21
  */
20
22
  function isCustomerUserPlatform(platform) {
21
23
  return CUSTOMER_USER_PLATFORMS.has(normalizeRuntimePlatform(platform));
24
+ }
25
+
26
+ /** Kiosk and vending retain distinct channels but share self-service checkout behavior. */
27
+ function isSelfServicePlatform(platform) {
28
+ return SELF_SERVICE_PLATFORMS.has(normalizeRuntimePlatform(platform));
22
29
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "private": false,
3
3
  "name": "@pisell/pisellos",
4
- "version": "0.10.59",
4
+ "version": "0.10.61",
5
5
  "description": "一个可扩展的前端模块化SDK框架,支持插件系统",
6
6
  "main": "dist/index.js",
7
7
  "types": "dist/index.d.ts",