@pisell/pisellos 2.3.185 → 2.3.187

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 (297) hide show
  1. package/dist/modules/Order/utils.d.ts +3 -1
  2. package/dist/modules/Order/utils.js +17 -3
  3. package/dist/modules/Product/index.d.ts +1 -1
  4. package/dist/modules/Product/types.d.ts +5 -0
  5. package/dist/modules/Rules/index.js +30 -19
  6. package/dist/solution/BaseSales/index.d.ts +1 -0
  7. package/dist/solution/BaseSales/index.js +298 -209
  8. package/dist/solution/BaseSales/types.d.ts +3 -0
  9. package/dist/solution/BaseSales/utils/posDurationPricing.d.ts +21 -0
  10. package/dist/solution/BaseSales/utils/posDurationPricing.js +174 -0
  11. package/dist/solution/BaseSales/utils/transformBaseProductToOrderProduct.d.ts +2 -0
  12. package/dist/solution/BaseSales/utils/transformBaseProductToOrderProduct.js +8 -8
  13. package/dist/solution/BookingByStep/index.d.ts +2 -2
  14. package/dist/solution/UnifiedBookingSales/index.js +34 -16
  15. package/lib/modules/Order/utils.d.ts +3 -1
  16. package/lib/modules/Order/utils.js +18 -2
  17. package/lib/modules/Product/index.d.ts +1 -1
  18. package/lib/modules/Product/types.d.ts +5 -0
  19. package/lib/modules/Rules/index.js +19 -9
  20. package/lib/solution/BaseSales/index.d.ts +1 -0
  21. package/lib/solution/BaseSales/index.js +95 -36
  22. package/lib/solution/BaseSales/types.d.ts +3 -0
  23. package/lib/solution/BaseSales/utils/posDurationPricing.d.ts +21 -0
  24. package/lib/solution/BaseSales/utils/posDurationPricing.js +133 -0
  25. package/lib/solution/BaseSales/utils/transformBaseProductToOrderProduct.d.ts +2 -0
  26. package/lib/solution/BaseSales/utils/transformBaseProductToOrderProduct.js +1 -1
  27. package/lib/solution/BookingByStep/index.d.ts +2 -2
  28. package/lib/solution/UnifiedBookingSales/index.js +23 -1
  29. package/package.json +1 -1
  30. package/dist/apis/picoding.d.ts.map +0 -1
  31. package/dist/core/index.d.ts.map +0 -1
  32. package/dist/effects/index.d.ts.map +0 -1
  33. package/dist/index.d.ts.map +0 -1
  34. package/dist/inventory/index.d.ts.map +0 -1
  35. package/dist/model/index.d.ts.map +0 -1
  36. package/dist/model/strategy/adapter/dataVariant/adapter.d.ts.map +0 -1
  37. package/dist/model/strategy/adapter/dataVariant/evaluator.d.ts.map +0 -1
  38. package/dist/model/strategy/adapter/dataVariant/examples.d.ts.map +0 -1
  39. package/dist/model/strategy/adapter/dataVariant/index.d.ts.map +0 -1
  40. package/dist/model/strategy/adapter/dataVariant/type.d.ts.map +0 -1
  41. package/dist/model/strategy/adapter/index.d.ts.map +0 -1
  42. package/dist/model/strategy/adapter/itemRule/adapter.d.ts.map +0 -1
  43. package/dist/model/strategy/adapter/itemRule/evaluator.d.ts.map +0 -1
  44. package/dist/model/strategy/adapter/itemRule/examples.d.ts.map +0 -1
  45. package/dist/model/strategy/adapter/itemRule/index.d.ts.map +0 -1
  46. package/dist/model/strategy/adapter/itemRule/type.d.ts.map +0 -1
  47. package/dist/model/strategy/adapter/promotion/adapter.d.ts.map +0 -1
  48. package/dist/model/strategy/adapter/promotion/evaluator.d.ts.map +0 -1
  49. package/dist/model/strategy/adapter/promotion/examples.d.ts.map +0 -1
  50. package/dist/model/strategy/adapter/promotion/index.d.ts.map +0 -1
  51. package/dist/model/strategy/adapter/promotion/type.d.ts.map +0 -1
  52. package/dist/model/strategy/adapter/type.d.ts.map +0 -1
  53. package/dist/model/strategy/adapter/walletPass/evaluator.d.ts.map +0 -1
  54. package/dist/model/strategy/adapter/walletPass/example.d.ts.map +0 -1
  55. package/dist/model/strategy/adapter/walletPass/index.d.ts.map +0 -1
  56. package/dist/model/strategy/adapter/walletPass/locales.d.ts.map +0 -1
  57. package/dist/model/strategy/adapter/walletPass/type.d.ts.map +0 -1
  58. package/dist/model/strategy/adapter/walletPass/utils.d.ts.map +0 -1
  59. package/dist/model/strategy/engine.d.ts.map +0 -1
  60. package/dist/model/strategy/index.d.ts.map +0 -1
  61. package/dist/model/strategy/strategy-example.d.ts.map +0 -1
  62. package/dist/model/strategy/type.d.ts.map +0 -1
  63. package/dist/modules/Account/index.d.ts.map +0 -1
  64. package/dist/modules/Account/types.d.ts.map +0 -1
  65. package/dist/modules/AccountList/index.d.ts.map +0 -1
  66. package/dist/modules/AccountList/types.d.ts.map +0 -1
  67. package/dist/modules/AccountList/utils.d.ts.map +0 -1
  68. package/dist/modules/BaseModule.d.ts.map +0 -1
  69. package/dist/modules/BookingContext/index.d.ts.map +0 -1
  70. package/dist/modules/BookingContext/types.d.ts.map +0 -1
  71. package/dist/modules/BookingContext/utils/buildCacheItemFromOrderLine.d.ts.map +0 -1
  72. package/dist/modules/BookingContext/utils/buildNormalProductCacheItemFromOrderLine.d.ts.map +0 -1
  73. package/dist/modules/BookingContext/utils/cacheItemToBookingInput.d.ts.map +0 -1
  74. package/dist/modules/BookingContext/utils/flexible.d.ts.map +0 -1
  75. package/dist/modules/BookingContext/utils/formatResourceList.d.ts.map +0 -1
  76. package/dist/modules/BookingContext/utils/index.d.ts.map +0 -1
  77. package/dist/modules/BookingContext/utils/noResource.d.ts.map +0 -1
  78. package/dist/modules/BookingContext/utils/orderLineDisplay.d.ts.map +0 -1
  79. package/dist/modules/BookingContext/utils/productExtend.d.ts.map +0 -1
  80. package/dist/modules/BookingContext/utils/resourceErrors.d.ts.map +0 -1
  81. package/dist/modules/BookingContext/utils/resourceSelection.d.ts.map +0 -1
  82. package/dist/modules/BookingContext/utils/resources.d.ts.map +0 -1
  83. package/dist/modules/BookingContext/utils/serviceTimes.d.ts.map +0 -1
  84. package/dist/modules/BookingContext/utils/timeSlices.d.ts.map +0 -1
  85. package/dist/modules/BusinessAvailability/index.d.ts.map +0 -1
  86. package/dist/modules/Cart/index.d.ts.map +0 -1
  87. package/dist/modules/Cart/types.d.ts.map +0 -1
  88. package/dist/modules/Cart/utils/cartAccount.d.ts.map +0 -1
  89. package/dist/modules/Cart/utils/cartDate.d.ts.map +0 -1
  90. package/dist/modules/Cart/utils/cartDiscount.d.ts.map +0 -1
  91. package/dist/modules/Cart/utils/cartNote.d.ts.map +0 -1
  92. package/dist/modules/Cart/utils/cartProduct.d.ts.map +0 -1
  93. package/dist/modules/Cart/utils/cartRelationForms.d.ts.map +0 -1
  94. package/dist/modules/Cart/utils/cartResource.d.ts.map +0 -1
  95. package/dist/modules/Cart/utils/changePrice.d.ts.map +0 -1
  96. package/dist/modules/Cart/utils/index.d.ts.map +0 -1
  97. package/dist/modules/Customer/constants.d.ts.map +0 -1
  98. package/dist/modules/Customer/index.d.ts.map +0 -1
  99. package/dist/modules/Customer/types.d.ts.map +0 -1
  100. package/dist/modules/Date/index.d.ts.map +0 -1
  101. package/dist/modules/Date/types.d.ts.map +0 -1
  102. package/dist/modules/Date/utils.d.ts.map +0 -1
  103. package/dist/modules/Discount/availability.d.ts.map +0 -1
  104. package/dist/modules/Discount/entitlementPass.d.ts.map +0 -1
  105. package/dist/modules/Discount/index.d.ts.map +0 -1
  106. package/dist/modules/Discount/types.d.ts.map +0 -1
  107. package/dist/modules/FulfillmentTiming/index.d.ts.map +0 -1
  108. package/dist/modules/FulfillmentTiming/types.d.ts.map +0 -1
  109. package/dist/modules/Guests/index.d.ts.map +0 -1
  110. package/dist/modules/Guests/types.d.ts.map +0 -1
  111. package/dist/modules/Holder/index.d.ts.map +0 -1
  112. package/dist/modules/Holder/types.d.ts.map +0 -1
  113. package/dist/modules/Holder/utils.d.ts.map +0 -1
  114. package/dist/modules/OpenData/contactInfo.d.ts.map +0 -1
  115. package/dist/modules/OpenData/index.d.ts.map +0 -1
  116. package/dist/modules/OpenData/salesSettings.d.ts.map +0 -1
  117. package/dist/modules/OpenData/types.d.ts.map +0 -1
  118. package/dist/modules/OpenData/utils.d.ts.map +0 -1
  119. package/dist/modules/Order/holderRelations.d.ts.map +0 -1
  120. package/dist/modules/Order/index.d.ts.map +0 -1
  121. package/dist/modules/Order/localEftposState.d.ts.map +0 -1
  122. package/dist/modules/Order/payment-utils.d.ts.map +0 -1
  123. package/dist/modules/Order/pickupTiming.d.ts.map +0 -1
  124. package/dist/modules/Order/salesNotes.d.ts.map +0 -1
  125. package/dist/modules/Order/types.d.ts.map +0 -1
  126. package/dist/modules/Order/utils/bundleDiscountHydration.d.ts.map +0 -1
  127. package/dist/modules/Order/utils/discountProductLineIdentity.d.ts.map +0 -1
  128. package/dist/modules/Order/utils/manualProductDiscount.d.ts.map +0 -1
  129. package/dist/modules/Order/utils/orderCollectionIdentity.d.ts.map +0 -1
  130. package/dist/modules/Order/utils/productVoucherGroups.d.ts.map +0 -1
  131. package/dist/modules/Order/utils/virtualSettlement.d.ts.map +0 -1
  132. package/dist/modules/Order/utils/weighedProduct.d.ts.map +0 -1
  133. package/dist/modules/Order/utils.d.ts.map +0 -1
  134. package/dist/modules/Payment/cash.d.ts.map +0 -1
  135. package/dist/modules/Payment/cashRecommendationAlgorithm.d.ts.map +0 -1
  136. package/dist/modules/Payment/eftpos.d.ts.map +0 -1
  137. package/dist/modules/Payment/index.d.ts.map +0 -1
  138. package/dist/modules/Payment/mx51.d.ts.map +0 -1
  139. package/dist/modules/Payment/types.d.ts.map +0 -1
  140. package/dist/modules/Payment/utils.d.ts.map +0 -1
  141. package/dist/modules/Payment/walletpass.d.ts.map +0 -1
  142. package/dist/modules/Product/index.d.ts.map +0 -1
  143. package/dist/modules/Product/types.d.ts.map +0 -1
  144. package/dist/modules/Product/utils.d.ts.map +0 -1
  145. package/dist/modules/ProductList/clientDataVariants.d.ts.map +0 -1
  146. package/dist/modules/ProductList/index.d.ts.map +0 -1
  147. package/dist/modules/ProductList/types.d.ts.map +0 -1
  148. package/dist/modules/Quotation/index.d.ts.map +0 -1
  149. package/dist/modules/Quotation/types.d.ts.map +0 -1
  150. package/dist/modules/Resource/index.d.ts.map +0 -1
  151. package/dist/modules/Resource/types.d.ts.map +0 -1
  152. package/dist/modules/Resource/utils.d.ts.map +0 -1
  153. package/dist/modules/ResourcePlanner/index.d.ts.map +0 -1
  154. package/dist/modules/ResourcePlanner/localClock.d.ts.map +0 -1
  155. package/dist/modules/ResourcePlanner/planner.d.ts.map +0 -1
  156. package/dist/modules/ResourcePlanner/types.d.ts.map +0 -1
  157. package/dist/modules/Rules/index.d.ts.map +0 -1
  158. package/dist/modules/Rules/promotionSelection.d.ts.map +0 -1
  159. package/dist/modules/Rules/types.d.ts.map +0 -1
  160. package/dist/modules/SalesSummary/index.d.ts.map +0 -1
  161. package/dist/modules/SalesSummary/types.d.ts.map +0 -1
  162. package/dist/modules/SalesSummary/utils.d.ts.map +0 -1
  163. package/dist/modules/ScanOrderLogger/index.d.ts.map +0 -1
  164. package/dist/modules/ScanOrderLogger/providers/feishu.d.ts.map +0 -1
  165. package/dist/modules/ScanOrderLogger/providers/grafana.d.ts.map +0 -1
  166. package/dist/modules/ScanOrderLogger/types.d.ts.map +0 -1
  167. package/dist/modules/Schedule/getDateIsInSchedule.d.ts.map +0 -1
  168. package/dist/modules/Schedule/index.d.ts.map +0 -1
  169. package/dist/modules/Schedule/type.d.ts.map +0 -1
  170. package/dist/modules/Schedule/types.d.ts.map +0 -1
  171. package/dist/modules/Schedule/utils.d.ts.map +0 -1
  172. package/dist/modules/Step/index.d.ts.map +0 -1
  173. package/dist/modules/Step/tyeps.d.ts.map +0 -1
  174. package/dist/modules/Summary/index.d.ts.map +0 -1
  175. package/dist/modules/Summary/types.d.ts.map +0 -1
  176. package/dist/modules/Summary/utils.d.ts.map +0 -1
  177. package/dist/modules/SurchargeList/index.d.ts.map +0 -1
  178. package/dist/modules/SurchargeList/types.d.ts.map +0 -1
  179. package/dist/modules/index.d.ts.map +0 -1
  180. package/dist/plugins/app.d.ts.map +0 -1
  181. package/dist/plugins/index.d.ts.map +0 -1
  182. package/dist/plugins/request.d.ts.map +0 -1
  183. package/dist/plugins/shopStore.d.ts.map +0 -1
  184. package/dist/plugins/user.d.ts.map +0 -1
  185. package/dist/plugins/window.d.ts.map +0 -1
  186. package/dist/server/index.d.ts.map +0 -1
  187. package/dist/server/modules/floor-plan/index.d.ts.map +0 -1
  188. package/dist/server/modules/floor-plan/types.d.ts.map +0 -1
  189. package/dist/server/modules/form/index.d.ts.map +0 -1
  190. package/dist/server/modules/form/types.d.ts.map +0 -1
  191. package/dist/server/modules/index.d.ts.map +0 -1
  192. package/dist/server/modules/menu/index.d.ts.map +0 -1
  193. package/dist/server/modules/menu/types.d.ts.map +0 -1
  194. package/dist/server/modules/order/index.d.ts.map +0 -1
  195. package/dist/server/modules/order/types.d.ts.map +0 -1
  196. package/dist/server/modules/order/utils/filterBookings.d.ts.map +0 -1
  197. package/dist/server/modules/order/utils/filterOrders.d.ts.map +0 -1
  198. package/dist/server/modules/payment/index.d.ts.map +0 -1
  199. package/dist/server/modules/payment/types.d.ts.map +0 -1
  200. package/dist/server/modules/products/index.d.ts.map +0 -1
  201. package/dist/server/modules/products/replication.d.ts.map +0 -1
  202. package/dist/server/modules/products/types.d.ts.map +0 -1
  203. package/dist/server/modules/quotation/index.d.ts.map +0 -1
  204. package/dist/server/modules/quotation/types.d.ts.map +0 -1
  205. package/dist/server/modules/resource/index.d.ts.map +0 -1
  206. package/dist/server/modules/resource/types.d.ts.map +0 -1
  207. package/dist/server/modules/schedule/index.d.ts.map +0 -1
  208. package/dist/server/modules/schedule/types.d.ts.map +0 -1
  209. package/dist/server/modules/schedule/utils.d.ts.map +0 -1
  210. package/dist/server/types.d.ts.map +0 -1
  211. package/dist/server/utils/index.d.ts.map +0 -1
  212. package/dist/server/utils/product.d.ts.map +0 -1
  213. package/dist/server/utils/schedule.d.ts.map +0 -1
  214. package/dist/server/utils/small-ticket.d.ts.map +0 -1
  215. package/dist/server/utils/time.d.ts.map +0 -1
  216. package/dist/shared/payment/loadPaymentMethods.d.ts.map +0 -1
  217. package/dist/shared/receipt/customerInvoiceLanguages.d.ts.map +0 -1
  218. package/dist/shared/receipt/loadCustomerInvoiceLayout.d.ts.map +0 -1
  219. package/dist/shared/receipt/small-ticket.d.ts.map +0 -1
  220. package/dist/shared/receipt/templateVisibility.d.ts.map +0 -1
  221. package/dist/shared/sales/loadSalesOrderSnapshot.d.ts.map +0 -1
  222. package/dist/solution/BaseSales/fulfillmentItemRules.d.ts.map +0 -1
  223. package/dist/solution/BaseSales/index.d.ts.map +0 -1
  224. package/dist/solution/BaseSales/pickupTiming.d.ts.map +0 -1
  225. package/dist/solution/BaseSales/types.d.ts.map +0 -1
  226. package/dist/solution/BaseSales/utils/cartPromotion.d.ts.map +0 -1
  227. package/dist/solution/BaseSales/utils/parseSalesResponse.d.ts.map +0 -1
  228. package/dist/solution/BaseSales/utils/quotationPrice.d.ts.map +0 -1
  229. package/dist/solution/BaseSales/utils/transformBaseProductToOrderProduct.d.ts.map +0 -1
  230. package/dist/solution/BaseSales/utils.d.ts.map +0 -1
  231. package/dist/solution/BookingByStep/index.d.ts.map +0 -1
  232. package/dist/solution/BookingByStep/types.d.ts.map +0 -1
  233. package/dist/solution/BookingByStep/utils/capacity.d.ts.map +0 -1
  234. package/dist/solution/BookingByStep/utils/products.d.ts.map +0 -1
  235. package/dist/solution/BookingByStep/utils/resources.d.ts.map +0 -1
  236. package/dist/solution/BookingByStep/utils/stock.d.ts.map +0 -1
  237. package/dist/solution/BookingByStep/utils/timeslots.d.ts.map +0 -1
  238. package/dist/solution/BookingTicket/index.d.ts.map +0 -1
  239. package/dist/solution/BookingTicket/types.d.ts.map +0 -1
  240. package/dist/solution/BookingTicket/utils/addProductDecision.d.ts.map +0 -1
  241. package/dist/solution/BookingTicket/utils/addTimeAvailability.d.ts.map +0 -1
  242. package/dist/solution/BookingTicket/utils/bookingStatus.d.ts.map +0 -1
  243. package/dist/solution/BookingTicket/utils/cartView.d.ts.map +0 -1
  244. package/dist/solution/BookingTicket/utils/exampleData.d.ts.map +0 -1
  245. package/dist/solution/BookingTicket/utils/orderCustomer.d.ts.map +0 -1
  246. package/dist/solution/BookingTicket/utils/resolveBestAddTimePlan.d.ts.map +0 -1
  247. package/dist/solution/BookingTicket/utils/scan/applyGlobalScan.d.ts.map +0 -1
  248. package/dist/solution/BookingTicket/utils/scan/applyProductVoucherCollectionScan.d.ts.map +0 -1
  249. package/dist/solution/BookingTicket/utils/scan/cloudSearch.d.ts.map +0 -1
  250. package/dist/solution/BookingTicket/utils/scan/formatGlobalScan.d.ts.map +0 -1
  251. package/dist/solution/BookingTicket/utils/scan/handleScan.d.ts.map +0 -1
  252. package/dist/solution/BookingTicket/utils/scan/index.d.ts.map +0 -1
  253. package/dist/solution/BookingTicket/utils/scan/scanCache.d.ts.map +0 -1
  254. package/dist/solution/BookingTicket/utils/scan/scanProductValues.d.ts.map +0 -1
  255. package/dist/solution/BookingTicket/utils/sessionCatalogStale.d.ts.map +0 -1
  256. package/dist/solution/BookingTicket/utils/weighingProductSku.d.ts.map +0 -1
  257. package/dist/solution/BuyTickets/index.d.ts.map +0 -1
  258. package/dist/solution/BuyTickets/types.d.ts.map +0 -1
  259. package/dist/solution/Checkout/index.d.ts.map +0 -1
  260. package/dist/solution/Checkout/types.d.ts.map +0 -1
  261. package/dist/solution/Checkout/utils/index.d.ts.map +0 -1
  262. package/dist/solution/OrderInvoicePreview/index.d.ts.map +0 -1
  263. package/dist/solution/PlaceOrder/index.d.ts.map +0 -1
  264. package/dist/solution/RegisterAndLogin/config.d.ts.map +0 -1
  265. package/dist/solution/RegisterAndLogin/index.d.ts.map +0 -1
  266. package/dist/solution/RegisterAndLogin/types.d.ts.map +0 -1
  267. package/dist/solution/RegisterAndLogin/utils.d.ts.map +0 -1
  268. package/dist/solution/Sales/index.d.ts.map +0 -1
  269. package/dist/solution/Sales/types.d.ts.map +0 -1
  270. package/dist/solution/ScanOrder/index.d.ts.map +0 -1
  271. package/dist/solution/ScanOrder/menuAvailability.d.ts.map +0 -1
  272. package/dist/solution/ScanOrder/types.d.ts.map +0 -1
  273. package/dist/solution/ScanOrder/utils.d.ts.map +0 -1
  274. package/dist/solution/ShopDiscount/index.d.ts.map +0 -1
  275. package/dist/solution/ShopDiscount/types.d.ts.map +0 -1
  276. package/dist/solution/ShopDiscount/utils.d.ts.map +0 -1
  277. package/dist/solution/UnifiedBookingSales/businessAvailability.d.ts.map +0 -1
  278. package/dist/solution/UnifiedBookingSales/index.d.ts.map +0 -1
  279. package/dist/solution/UnifiedBookingSales/remoteOccupancyCache.d.ts.map +0 -1
  280. package/dist/solution/UnifiedBookingSales/salesSettings.d.ts.map +0 -1
  281. package/dist/solution/UnifiedBookingSales/types.d.ts.map +0 -1
  282. package/dist/solution/VenueBooking/index.d.ts.map +0 -1
  283. package/dist/solution/VenueBooking/types.d.ts.map +0 -1
  284. package/dist/solution/VenueBooking/utils/dateSummary.d.ts.map +0 -1
  285. package/dist/solution/VenueBooking/utils/resource.d.ts.map +0 -1
  286. package/dist/solution/VenueBooking/utils/slotMerge.d.ts.map +0 -1
  287. package/dist/solution/VenueBooking/utils/smartPricing.d.ts.map +0 -1
  288. package/dist/solution/VenueBooking/utils/timeSlot.d.ts.map +0 -1
  289. package/dist/solution/VenueBooking/utils.d.ts.map +0 -1
  290. package/dist/solution/index.d.ts.map +0 -1
  291. package/dist/store/createStore.d.ts.map +0 -1
  292. package/dist/types/index.d.ts.map +0 -1
  293. package/dist/utils/os-private-payload.d.ts.map +0 -1
  294. package/dist/utils/payment-number.d.ts.map +0 -1
  295. package/dist/utils/platform.d.ts.map +0 -1
  296. package/dist/utils/task.d.ts.map +0 -1
  297. package/dist/utils/watch.d.ts.map +0 -1
@@ -128,7 +128,9 @@ export declare function getBundleSellingMagnitude(bundle: Record<string, any> |
128
128
  *
129
129
  * Rules 钩子契约(hook_adapt 方案,Rules 内部保持不变):
130
130
  * - `getProduct.price` / `getProduct.original_price` 回传 **source-level 主价**
131
- * (`metadata.source_product_price`)。Rules 内部 `getProductTotalPrice` /
131
+ * (`metadata.source_product_price`);买赠行的 `price` 为 0,`original_price` 仍保留 source。
132
+ * 赠品基础价已被赠送优惠抵扣,只有收费 option / bundle 继续按卡券规则计算。
133
+ * Rules 内部 `getProductTotalPrice` /
132
134
  * `getProductOriginTotalPrice` 会自行叠加 option + bundle,喂 source 可避免 option 双加。
133
135
  * - `getProduct.total` = `selling_price × num`(行 composite × num),与 Rules 内部产出的
134
136
  * total(source + option + bundle)对齐。
@@ -597,7 +597,9 @@ export function getBundleSellingMagnitude(bundle) {
597
597
  *
598
598
  * Rules 钩子契约(hook_adapt 方案,Rules 内部保持不变):
599
599
  * - `getProduct.price` / `getProduct.original_price` 回传 **source-level 主价**
600
- * (`metadata.source_product_price`)。Rules 内部 `getProductTotalPrice` /
600
+ * (`metadata.source_product_price`);买赠行的 `price` 为 0,`original_price` 仍保留 source。
601
+ * 赠品基础价已被赠送优惠抵扣,只有收费 option / bundle 继续按卡券规则计算。
602
+ * Rules 内部 `getProductTotalPrice` /
601
603
  * `getProductOriginTotalPrice` 会自行叠加 option + bundle,喂 source 可避免 option 双加。
602
604
  * - `getProduct.total` = `selling_price × num`(行 composite × num),与 Rules 内部产出的
603
605
  * total(source + option + bundle)对齐。
@@ -901,7 +903,8 @@ export function createDefaultOrderRulesHooks(getBookings, getHolderRelations) {
901
903
  _id: (_product$metadata7 = product.metadata) !== null && _product$metadata7 !== void 0 && _product$metadata7.unique_identification_number ? "".concat(product.product_id, "_").concat(product.product_variant_id, "_").concat(product.metadata.unique_identification_number) : "".concat(product.product_id, "_").concat(product.product_variant_id, "_").concat(buildProductLineFingerprint(getProductSkuOptions(product), product.product_bundle)),
902
904
  // Rules 内部 getProductTotalPrice / getProductOriginTotalPrice 会各自再叠加 bundle + option,
903
905
  // 所以这里必须喂 source-level(不含 option、不含 bundle、不含折扣)单价,避免双加 option。
904
- price: sourcePrice,
906
+ // 赠品基础价不再参与卡券;source 元数据保留原价,供后续与赠送优惠相抵。
907
+ price: metadataAny._giftInfo ? '0.00' : sourcePrice,
905
908
  // total / origin_total 使用 composite × num,跟 Rules 内部产出的 total 对齐(含 option + bundle)。
906
909
  total: new Decimal(product.selling_price || 0).times(product.num || 1).toNumber(),
907
910
  origin_total: new Decimal(product.original_price || product.selling_price || 0).times(product.num || 1).toNumber(),
@@ -1219,7 +1222,7 @@ function formatSubmitBundleItems(bundle) {
1219
1222
  * 法币仅做字段/metadata 裁剪;虚拟币在出站前再次执行零加价与固定单价断言。
1220
1223
  */
1221
1224
  function normalizeSubmitProduct(product) {
1222
- var _ref39, _submitProduct$bundle, _rawMetadata$product_, _rawMetadata$selected, _rawMetadata$selected2, _submitProduct$produc, _submitProduct$paymen;
1225
+ var _ref39, _submitProduct$bundle, _rawMetadata$pricing_, _rawMetadata$product_, _rawMetadata$selected, _rawMetadata$selected2, _submitProduct$produc, _submitProduct$paymen;
1223
1226
  var formatOptions = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
1224
1227
  var _ref38 = product,
1225
1228
  _runtimeUid = _ref38.unique_identification_number,
@@ -1253,6 +1256,17 @@ function normalizeSubmitProduct(product) {
1253
1256
  cleanMetadata[key] = rawMetadata[key];
1254
1257
  }
1255
1258
  }
1259
+ // Persist only an applied pricing snapshot, so reopening a saved order can
1260
+ // compare it with the latest catalog without reinterpreting legacy duration.
1261
+ var pricingMethod = (_rawMetadata$pricing_ = rawMetadata.pricing_method) === null || _rawMetadata$pricing_ === void 0 ? void 0 : _rawMetadata$pricing_.type;
1262
+ if (pricingMethod === 'duration_based' || pricingMethod === 'fixed_price') {
1263
+ cleanMetadata.pricing_method = {
1264
+ type: pricingMethod
1265
+ };
1266
+ if (pricingMethod === 'duration_based' && rawMetadata.duration) {
1267
+ cleanMetadata.duration = _objectSpread({}, rawMetadata.duration);
1268
+ }
1269
+ }
1256
1270
  cleanMetadata.product_discount_difference = (_rawMetadata$product_ = rawMetadata.product_discount_difference) !== null && _rawMetadata$product_ !== void 0 ? _rawMetadata$product_ : '';
1257
1271
  if (rawMetadata.price_breakdown) {
1258
1272
  cleanMetadata.price_breakdown = rawMetadata.price_breakdown;
@@ -49,5 +49,5 @@ export declare class Product extends BaseModule implements Module {
49
49
  getCategories(): ProductCategory[];
50
50
  setOtherParams(key: string, value: any): void;
51
51
  getOtherParams(): any;
52
- getProductType(): "duration" | "normal" | "session";
52
+ getProductType(): "normal" | "duration" | "session";
53
53
  }
@@ -42,6 +42,9 @@ export interface ProductSettlementOption extends Record<string, any> {
42
42
  available: boolean;
43
43
  disabled_reason?: string;
44
44
  }
45
+ export interface ProductPricingMethod {
46
+ type: 'fixed_price' | 'duration_based';
47
+ }
45
48
  /**
46
49
  * 商品基本信息接口
47
50
  */
@@ -74,6 +77,8 @@ export interface ProductData {
74
77
  sum_stock: number;
75
78
  /** 商品价格 */
76
79
  price: string;
80
+ /** POS booking pricing; missing configuration retains existing fixed pricing. */
81
+ pricing_method?: ProductPricingMethod;
77
82
  /** 当前上下文解析出的可选结算货币 */
78
83
  available_settlement_options?: ProductSettlementOption[];
79
84
  /** 商品原价 */
@@ -1222,10 +1222,28 @@ export var RulesModule = /*#__PURE__*/function (_BaseModule) {
1222
1222
 
1223
1223
  // 记录已应用优惠券的商品信息
1224
1224
  var appliedDiscountProducts = new Map();
1225
+ var hasPayableOptions = function hasPayableOptions(product) {
1226
+ return (product.options || []).reduce(function (total, option) {
1227
+ var _ref14, _ref15, _ref16, _option$_original_pri, _ref17, _option$num;
1228
+ var unitPrice = Number((_ref14 = (_ref15 = (_ref16 = (_option$_original_pri = option._original_price) !== null && _option$_original_pri !== void 0 ? _option$_original_pri : option._original_add_price) !== null && _ref16 !== void 0 ? _ref16 : option.price) !== null && _ref15 !== void 0 ? _ref15 : option.add_price) !== null && _ref14 !== void 0 ? _ref14 : 0);
1229
+ var quantity = Number((_ref17 = (_option$num = option.num) !== null && _option$num !== void 0 ? _option$num : option.quantity) !== null && _ref17 !== void 0 ? _ref17 : 1);
1230
+ if (!Number.isFinite(unitPrice) || !Number.isFinite(quantity) || quantity <= 0) {
1231
+ return total;
1232
+ }
1233
+ return total.plus(new Decimal(unitPrice).mul(quantity));
1234
+ }, new Decimal(0)).greaterThan(0);
1235
+ };
1236
+
1237
+ // 只排除赠品主项的零可抵扣金额;收费 option 和独立 bundle 保持原有规则。
1238
+ var isGiftWithoutDeductibleAmount = function isGiftWithoutDeductibleAmount(flatItem, discount) {
1239
+ var _flatItem$originProdu, _discount$config4;
1240
+ if (flatItem.type !== 'main' || !((_flatItem$originProdu = flatItem.originProduct) !== null && _flatItem$originProdu !== void 0 && (_flatItem$originProdu = _flatItem$originProdu.metadata) !== null && _flatItem$originProdu !== void 0 && _flatItem$originProdu._giftInfo) || Number(flatItem.price || 0) > 0) return false;
1241
+ return !((_discount$config4 = discount.config) !== null && _discount$config4 !== void 0 && _discount$config4.deductOptionPrice) || !hasPayableOptions(flatItem.product);
1242
+ };
1225
1243
 
1226
1244
  // 可用性和实际应用共用金额判断;零基础价商品可按策略抵扣收费 option。
1227
1245
  var isDiscountCardPriceAvailable = function isDiscountCardPriceAvailable(flatItem, discount) {
1228
- var _product$discount_lis2, _discount$config4;
1246
+ var _product$discount_lis2, _discount$config5;
1229
1247
  var product = flatItem.type === 'main' ? flatItem.product : flatItem.bundleItem;
1230
1248
  if (!(Number(flatItem.price) <= 0 || !flatItem.price) || (_product$discount_lis2 = product.discount_list) !== null && _product$discount_lis2 !== void 0 && _product$discount_lis2.some(function (item) {
1231
1249
  var _item$discount2;
@@ -1233,18 +1251,10 @@ export var RulesModule = /*#__PURE__*/function (_BaseModule) {
1233
1251
  })) {
1234
1252
  return true;
1235
1253
  }
1236
- if (flatItem.type !== 'main' || Number(flatItem.price) !== 0 || !['discount_card', 'product_discount_card'].includes(discount.tag || discount.type || '') || !((_discount$config4 = discount.config) !== null && _discount$config4 !== void 0 && _discount$config4.deductOptionPrice) || isOrderLevelFixedAmountDiscount(discount)) {
1254
+ if (flatItem.type !== 'main' || Number(flatItem.price) !== 0 || !['discount_card', 'product_discount_card'].includes(discount.tag || discount.type || '') || !((_discount$config5 = discount.config) !== null && _discount$config5 !== void 0 && _discount$config5.deductOptionPrice) || isOrderLevelFixedAmountDiscount(discount)) {
1237
1255
  return false;
1238
1256
  }
1239
- return (product.options || []).reduce(function (total, option) {
1240
- var _ref14, _ref15, _ref16, _option$_original_pri, _ref17, _option$num;
1241
- var unitPrice = Number((_ref14 = (_ref15 = (_ref16 = (_option$_original_pri = option._original_price) !== null && _option$_original_pri !== void 0 ? _option$_original_pri : option._original_add_price) !== null && _ref16 !== void 0 ? _ref16 : option.price) !== null && _ref15 !== void 0 ? _ref15 : option.add_price) !== null && _ref14 !== void 0 ? _ref14 : 0);
1242
- var quantity = Number((_ref17 = (_option$num = option.num) !== null && _option$num !== void 0 ? _option$num : option.quantity) !== null && _ref17 !== void 0 ? _ref17 : 1);
1243
- if (!Number.isFinite(unitPrice) || !Number.isFinite(quantity) || quantity <= 0) {
1244
- return total;
1245
- }
1246
- return total.plus(new Decimal(unitPrice).mul(quantity));
1247
- }, new Decimal(0)).greaterThan(0);
1257
+ return hasPayableOptions(product);
1248
1258
  };
1249
1259
 
1250
1260
  // 首先遍历所有商品和所有优惠券,确定每个优惠券的适用范围,包括isSelected为false的优惠券
@@ -1274,7 +1284,7 @@ export var RulesModule = /*#__PURE__*/function (_BaseModule) {
1274
1284
  }
1275
1285
  var isItemRewardProductDiscount = _this5.isItemRewardProductDiscount(product);
1276
1286
  addModeDiscount.forEach(function (discount) {
1277
- var _product6, _product7, _product8, _product9, _flatItem$bundleItem3, _flatItem$bundleItem4, _discount$config5;
1287
+ var _product6, _product7, _product8, _product9, _flatItem$bundleItem3, _flatItem$bundleItem4, _discount$config6;
1278
1288
  var limitedData = discount === null || discount === void 0 ? void 0 : discount.limited_relation_product_data;
1279
1289
  // 拿到discount配置的holder信息 product信息 product.holder 加在 isLimitedProduct
1280
1290
  var _tempVar = (flatItem === null || flatItem === void 0 ? void 0 : flatItem.type) === 'bundle' ? flatItem === null || flatItem === void 0 ? void 0 : flatItem.parentProduct : flatItem === null || flatItem === void 0 ? void 0 : flatItem.product;
@@ -1305,7 +1315,7 @@ export var RulesModule = /*#__PURE__*/function (_BaseModule) {
1305
1315
  }
1306
1316
 
1307
1317
  // 判断优惠券是否适用于该商品
1308
- if (isAvailableProduct && !isItemRewardProductDiscount && isLimitedProduct && timeLimit && isBundleAvailable && (_discount$config5 = discount.config) !== null && _discount$config5 !== void 0 && _discount$config5.isAvailable && (isFullCoveragePass(discount) || isDiscountCardPriceAvailable(flatItem, discount)) && (!isEntitlementPass(discount) || getRemainingEntitlementUses(discount, 0, 1) > 0)) {
1318
+ if (isAvailableProduct && !isItemRewardProductDiscount && !isGiftWithoutDeductibleAmount(flatItem, discount) && isLimitedProduct && timeLimit && isBundleAvailable && (_discount$config6 = discount.config) !== null && _discount$config6 !== void 0 && _discount$config6.isAvailable && (isFullCoveragePass(discount) || isDiscountCardPriceAvailable(flatItem, discount)) && (!isEntitlementPass(discount) || getRemainingEntitlementUses(discount, 0, 1) > 0)) {
1309
1319
  var _discountApplicabilit, _discount$metadata4, _discount$metadata5, _discount$metadata6;
1310
1320
  // 记录此优惠券适用的商品
1311
1321
  (_discountApplicabilit = discountApplicability.get(discount.id)) === null || _discountApplicabilit === void 0 || _discountApplicabilit.push(product.id);
@@ -1456,6 +1466,7 @@ export var RulesModule = /*#__PURE__*/function (_BaseModule) {
1456
1466
  // 找到适用于此商品的所有优惠券,仅考虑isSelected不为false的优惠券
1457
1467
  var applicableDiscounts = sortedDiscountList.filter(function (discount) {
1458
1468
  var _product$discount_lis4;
1469
+ if (isGiftWithoutDeductibleAmount(flatItem, discount)) return false;
1459
1470
  if (_this5.discountScope && !_this5.discountScope(originProduct, discount)) return false;
1460
1471
  if (_this5.isItemRewardProductDiscount(product)) return false;
1461
1472
  if (isCardBlockedByPromotion(flatItem, discount)) return false;
@@ -1469,9 +1480,9 @@ export var RulesModule = /*#__PURE__*/function (_BaseModule) {
1469
1480
  if (!discount.isSelected) return false;
1470
1481
  }
1471
1482
  if (['entitlement_pass', 'good_pass', 'discount_card', 'product_discount_card'].includes(discountType !== null && discountType !== void 0 ? discountType : '') && !isReapplyEditModeDiscountForProduct) {
1472
- var _discount$config6;
1483
+ var _discount$config7;
1473
1484
  // 如果策略检查后没有config,说明不可用
1474
- if (discount.config === undefined || !(discount !== null && discount !== void 0 && (_discount$config6 = discount.config) !== null && _discount$config6 !== void 0 && _discount$config6.isAvailable)) {
1485
+ if (discount.config === undefined || !(discount !== null && discount !== void 0 && (_discount$config7 = discount.config) !== null && _discount$config7 !== void 0 && _discount$config7.isAvailable)) {
1475
1486
  return false;
1476
1487
  }
1477
1488
  }
@@ -1493,8 +1504,8 @@ export var RulesModule = /*#__PURE__*/function (_BaseModule) {
1493
1504
 
1494
1505
  // 🔥 检查 maxUsagePerOrder 限制:同一 product_id 的商品券使用数量不能超过配置值
1495
1506
  if (isFullCoveragePass(discount)) {
1496
- var _discount$config7;
1497
- var maxUsagePerOrder = (_discount$config7 = discount.config) === null || _discount$config7 === void 0 ? void 0 : _discount$config7.maxUsagePerOrder;
1507
+ var _discount$config8;
1508
+ var maxUsagePerOrder = (_discount$config8 = discount.config) === null || _discount$config8 === void 0 ? void 0 : _discount$config8.maxUsagePerOrder;
1498
1509
  if (maxUsagePerOrder && maxUsagePerOrder > 0) {
1499
1510
  var currentUsedCount = usedProductIdCounts.get(discount.product_id) || 0;
1500
1511
  if (currentUsedCount >= maxUsagePerOrder) {
@@ -2647,7 +2658,7 @@ export var RulesModule = /*#__PURE__*/function (_BaseModule) {
2647
2658
  }, {
2648
2659
  key: "checkPackageSubItemUsageRules",
2649
2660
  value: function checkPackageSubItemUsageRules(discount, flatItem) {
2650
- var _flatItem$product, _flatItem$originProdu, _flatItem$parentProdu10;
2661
+ var _flatItem$product, _flatItem$originProdu2, _flatItem$parentProdu10;
2651
2662
  var limitedData = discount.limited_relation_product_data;
2652
2663
  var usageRules = limitedData === null || limitedData === void 0 ? void 0 : limitedData.package_sub_item_usage_rules;
2653
2664
  var rules = ['original_price'].concat(_toConsumableArray((usageRules === null || usageRules === void 0 ? void 0 : usageRules.rules) || []));
@@ -2672,7 +2683,7 @@ export var RulesModule = /*#__PURE__*/function (_BaseModule) {
2672
2683
  var isBundleItem = flatItem.type === 'bundle'; // 套餐中购买
2673
2684
  var bundleMainProductId = (_flatItem$product = flatItem.product) === null || _flatItem$product === void 0 ? void 0 : _flatItem$product.product_id;
2674
2685
  // 主商品id
2675
- var mainProductId = (flatItem === null || flatItem === void 0 || (_flatItem$originProdu = flatItem.originProduct) === null || _flatItem$originProdu === void 0 || (_flatItem$originProdu = _flatItem$originProdu._productOrigin) === null || _flatItem$originProdu === void 0 ? void 0 : _flatItem$originProdu.id) || (flatItem === null || flatItem === void 0 || (_flatItem$parentProdu10 = flatItem.parentProduct) === null || _flatItem$parentProdu10 === void 0 ? void 0 : _flatItem$parentProdu10.id) || 0;
2686
+ var mainProductId = (flatItem === null || flatItem === void 0 || (_flatItem$originProdu2 = flatItem.originProduct) === null || _flatItem$originProdu2 === void 0 || (_flatItem$originProdu2 = _flatItem$originProdu2._productOrigin) === null || _flatItem$originProdu2 === void 0 ? void 0 : _flatItem$originProdu2.id) || (flatItem === null || flatItem === void 0 || (_flatItem$parentProdu10 = flatItem.parentProduct) === null || _flatItem$parentProdu10 === void 0 ? void 0 : _flatItem$parentProdu10.id) || 0;
2676
2687
 
2677
2688
  // 主商品直接可用
2678
2689
  if (isMainProduct) {
@@ -535,6 +535,7 @@ export declare class BaseSalesImpl extends BaseModule implements Module {
535
535
  getQuotationCustomerScopeInfo(): BaseSalesQuotationCustomerScopeInfo;
536
536
  private hasSmartPricingStrategies;
537
537
  shouldRecalculateProductBookingPricesForContextChange(params: BaseSalesPriceRecalculationContextChange): boolean;
538
+ private resolveProductBookingPriceGroups;
538
539
  calculateProductBookingPrices(paramsList: BaseSalesCalculateProductBookingPriceParams[]): Promise<BaseSalesProductBookingPriceResult[]>;
539
540
  setProductVoucherGroups(groups: Array<{
540
541
  key: string;