@pisell/pisellos 0.10.7 → 0.10.8

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 (57) hide show
  1. package/dist/model/strategy/adapter/promotion/index.js +9 -0
  2. package/dist/modules/BookingContext/utils/buildCacheItemFromOrderLine.js +12 -10
  3. package/dist/modules/Order/index.d.ts +12 -5
  4. package/dist/modules/Order/index.js +310 -210
  5. package/dist/modules/Order/types.d.ts +26 -3
  6. package/dist/modules/Order/types.js +11 -0
  7. package/dist/modules/Order/utils/discountProductLineIdentity.d.ts +45 -0
  8. package/dist/modules/Order/utils/discountProductLineIdentity.js +227 -0
  9. package/dist/modules/Rules/index.js +125 -52
  10. package/dist/modules/SalesSummary/utils.js +7 -1
  11. package/dist/server/index.d.ts +6 -0
  12. package/dist/server/index.js +810 -729
  13. package/dist/server/modules/order/index.d.ts +1 -0
  14. package/dist/server/modules/order/index.js +9 -2
  15. package/dist/server/modules/order/types.d.ts +1 -1
  16. package/dist/solution/BaseSales/index.d.ts +15 -5
  17. package/dist/solution/BaseSales/index.js +211 -159
  18. package/dist/solution/BaseSales/utils/cartPromotion.js +26 -3
  19. package/dist/solution/BaseSales/utils/transformBaseProductToOrderProduct.js +1 -1
  20. package/dist/solution/BaseSales/utils.js +31 -20
  21. package/dist/solution/BookingByStep/index.d.ts +1 -1
  22. package/dist/solution/BookingTicket/index.js +1 -4
  23. package/dist/solution/BookingTicket/types.d.ts +3 -0
  24. package/dist/solution/BookingTicket/utils/cartView.js +44 -32
  25. package/dist/solution/Sales/index.d.ts +1 -0
  26. package/dist/solution/Sales/index.js +16 -2
  27. package/dist/solution/ScanOrder/utils.js +31 -20
  28. package/dist/solution/UnifiedBookingSales/index.d.ts +5 -4
  29. package/dist/solution/UnifiedBookingSales/index.js +51 -39
  30. package/lib/modules/BookingContext/utils/buildCacheItemFromOrderLine.js +3 -1
  31. package/lib/modules/Order/index.d.ts +12 -5
  32. package/lib/modules/Order/index.js +148 -43
  33. package/lib/modules/Order/types.d.ts +26 -3
  34. package/lib/modules/Order/utils/discountProductLineIdentity.d.ts +45 -0
  35. package/lib/modules/Order/utils/discountProductLineIdentity.js +170 -0
  36. package/lib/modules/Rules/index.js +100 -20
  37. package/lib/modules/SalesSummary/utils.js +5 -1
  38. package/lib/server/index.d.ts +6 -0
  39. package/lib/server/index.js +51 -0
  40. package/lib/server/modules/order/index.d.ts +1 -0
  41. package/lib/server/modules/order/index.js +9 -3
  42. package/lib/server/modules/order/types.d.ts +1 -1
  43. package/lib/solution/BaseSales/index.d.ts +15 -5
  44. package/lib/solution/BaseSales/index.js +64 -16
  45. package/lib/solution/BaseSales/utils/cartPromotion.js +26 -2
  46. package/lib/solution/BaseSales/utils/transformBaseProductToOrderProduct.js +1 -1
  47. package/lib/solution/BaseSales/utils.js +29 -18
  48. package/lib/solution/BookingByStep/index.d.ts +1 -1
  49. package/lib/solution/BookingTicket/index.js +1 -4
  50. package/lib/solution/BookingTicket/types.d.ts +3 -0
  51. package/lib/solution/BookingTicket/utils/cartView.js +43 -30
  52. package/lib/solution/Sales/index.d.ts +1 -0
  53. package/lib/solution/Sales/index.js +15 -3
  54. package/lib/solution/ScanOrder/utils.js +29 -18
  55. package/lib/solution/UnifiedBookingSales/index.d.ts +5 -4
  56. package/lib/solution/UnifiedBookingSales/index.js +35 -26
  57. package/package.json +1 -1
@@ -523,6 +523,14 @@ var UnifiedBookingSalesImpl = class extends import_BookingTicket.BookingTicket {
523
523
  cacheKey: ["sessionState"]
524
524
  });
525
525
  }
526
+ /**
527
+ * 清除当前 cacheId 的可恢复订单快照,同时保留 Solution UI sessionState。
528
+ * 用于支付跳转等终态场景,避免浏览器返回时恢复已提交订单。
529
+ */
530
+ clearSessionStorageOrderSnapshot() {
531
+ var _a, _b;
532
+ (_b = (_a = this.store.order) == null ? void 0 : _a.clearSessionStoragePersistedTempOrder) == null ? void 0 : _b.call(_a);
533
+ }
526
534
  /**
527
535
  * Kiosk 不能把已收款订单留在本地等待重试:默认直接等待云端 checkout。
528
536
  * 兼容仍需要 WebPOS 待同步模式的入口可显式传 checkoutSyncTaskEnabled: true。
@@ -806,32 +814,33 @@ var UnifiedBookingSalesImpl = class extends import_BookingTicket.BookingTicket {
806
814
  * Read-only compatibility view for salesSdk skins. It reconnects a booking to its product but
807
815
  * must not be used to mutate tempOrder; all writes go through BaseSales / planner APIs.
808
816
  */
809
- getCart() {
810
- const tempOrder = this.getTempOrder();
811
- const salesDetail = this.getSalesOrder();
812
- const items = (tempOrder == null ? void 0 : tempOrder.products) || [];
813
- const bookings = (salesDetail == null ? void 0 : salesDetail.bookings) || (tempOrder == null ? void 0 : tempOrder.bookings) || [];
814
- return {
815
- items,
816
- bookings: bookings.map((booking) => {
817
- const productUid = booking == null ? void 0 : booking.product_uid;
818
- const product = productUid ? items.find((item) => {
819
- var _a;
820
- const uid = ((_a = item == null ? void 0 : item.metadata) == null ? void 0 : _a.unique_identification_number) || (item == null ? void 0 : item.unique_identification_number);
821
- return String(uid || "") === String(productUid);
822
- }) || null : null;
823
- return {
824
- ...booking,
825
- _extend: {
826
- ...(booking == null ? void 0 : booking._extend) || {},
827
- product,
828
- addTimeProduct: [],
829
- canAddTime: false
830
- }
831
- };
832
- })
833
- };
834
- }
817
+ // getCart(): BookingTicketCartView {
818
+ // const tempOrder = this.getTempOrder();
819
+ // const salesDetail = this.getSalesOrder();
820
+ // const items = tempOrder?.products || [];
821
+ // const bookings = salesDetail?.bookings || tempOrder?.bookings || [];
822
+ // return {
823
+ // items,
824
+ // bookings: bookings.map((booking: any) => {
825
+ // const productUid = booking?.product_uid;
826
+ // const product = productUid
827
+ // ? items.find((item: any) => {
828
+ // const uid = item?.metadata?.unique_identification_number || item?.unique_identification_number;
829
+ // return String(uid || '') === String(productUid);
830
+ // }) || null
831
+ // : null;
832
+ // return {
833
+ // ...booking,
834
+ // _extend: {
835
+ // ...(booking?._extend || {}),
836
+ // product,
837
+ // addTimeProduct: [],
838
+ // canAddTime: false,
839
+ // },
840
+ // };
841
+ // }),
842
+ // };
843
+ // }
835
844
  /**
836
845
  * Loads the current customer's product coupons and discount cards after planner lines exist,
837
846
  * then optionally lets the existing Rules engine select the best valid combination. This is a
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "private": false,
3
3
  "name": "@pisell/pisellos",
4
- "version": "0.10.7",
4
+ "version": "0.10.8",
5
5
  "description": "一个可扩展的前端模块化SDK框架,支持插件系统",
6
6
  "main": "dist/index.js",
7
7
  "types": "dist/index.d.ts",