@pisell/pisellos 0.10.15 → 0.10.16

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 (299) hide show
  1. package/dist/core/index.js +6 -9
  2. package/dist/model/strategy/adapter/promotion/index.js +0 -9
  3. package/dist/model/strategy/adapter/walletPass/example.js +3 -26
  4. package/dist/model/strategy/strategy-example.js +5 -19
  5. package/dist/modules/Cart/index.js +0 -3
  6. package/dist/modules/Cart/utils/cartProduct.js +0 -1
  7. package/dist/modules/Date/index.js +1 -5
  8. package/dist/modules/Discount/index.js +2 -4
  9. package/dist/modules/OpenData/index.js +0 -2
  10. package/dist/modules/Order/index.d.ts +1 -1
  11. package/dist/modules/Order/index.js +75 -91
  12. package/dist/modules/Order/types.d.ts +5 -1
  13. package/dist/modules/Order/utils.js +7 -1
  14. package/dist/modules/Payment/index.js +97 -162
  15. package/dist/modules/Product/types.d.ts +2 -0
  16. package/dist/modules/Rules/index.js +1 -4
  17. package/dist/modules/Schedule/index.js +0 -1
  18. package/dist/modules/Schedule/utils.js +0 -1
  19. package/dist/modules/Step/index.js +0 -1
  20. package/dist/plugins/request.js +1 -4
  21. package/dist/plugins/window.js +2 -6
  22. package/dist/server/index.js +97 -129
  23. package/dist/server/modules/menu/index.js +32 -41
  24. package/dist/server/modules/order/index.js +2 -4
  25. package/dist/server/modules/products/index.js +24 -42
  26. package/dist/server/modules/quotation/index.js +29 -38
  27. package/dist/server/modules/resource/index.js +3 -4
  28. package/dist/server/modules/schedule/index.js +27 -35
  29. package/dist/server/utils/product.js +0 -1
  30. package/dist/solution/BaseSales/index.js +100 -72
  31. package/dist/solution/BaseSales/types.d.ts +2 -0
  32. package/dist/solution/BaseSales/utils/cartPromotion.d.ts +5 -0
  33. package/dist/solution/BaseSales/utils/cartPromotion.js +15 -6
  34. package/dist/solution/BaseSales/utils/transformBaseProductToOrderProduct.d.ts +3 -0
  35. package/dist/solution/BaseSales/utils/transformBaseProductToOrderProduct.js +7 -1
  36. package/dist/solution/BaseSales/utils.js +6 -3
  37. package/dist/solution/BookingByStep/index.d.ts +1 -1
  38. package/dist/solution/BookingByStep/index.js +7 -59
  39. package/dist/solution/BookingByStep/utils/capacity.js +1 -11
  40. package/dist/solution/BookingByStep/utils/resources.js +1 -3
  41. package/dist/solution/BookingByStep/utils/timeslots.js +2 -43
  42. package/dist/solution/BookingTicket/index.js +8 -4
  43. package/dist/solution/BookingTicket/utils/addProductDecision.js +3 -1
  44. package/dist/solution/BookingTicket/utils/scan/cloudSearch.js +6 -7
  45. package/dist/solution/BookingTicket/utils/scan/handleScan.js +25 -31
  46. package/dist/solution/BookingTicket/utils/scan/index.js +6 -10
  47. package/dist/solution/BuyTickets/index.js +9 -12
  48. package/dist/solution/Checkout/index.js +177 -252
  49. package/dist/solution/Checkout/utils/index.js +4 -16
  50. package/dist/solution/RegisterAndLogin/index.js +30 -76
  51. package/dist/solution/ScanOrder/index.js +50 -60
  52. package/dist/solution/ScanOrder/types.d.ts +2 -0
  53. package/dist/solution/ScanOrder/utils.js +6 -3
  54. package/dist/solution/ShopDiscount/index.js +2 -7
  55. package/dist/solution/VenueBooking/index.js +45 -55
  56. package/dist/utils/task.js +15 -18
  57. package/dist/utils/watch.js +0 -1
  58. package/lib/apis/picoding.js +2 -0
  59. package/lib/core/index.js +131 -131
  60. package/lib/effects/index.js +46 -57
  61. package/lib/index.js +82 -49
  62. package/lib/model/index.js +14 -21
  63. package/lib/model/strategy/adapter/dataVariant/adapter.js +38 -50
  64. package/lib/model/strategy/adapter/dataVariant/evaluator.js +209 -315
  65. package/lib/model/strategy/adapter/dataVariant/examples.js +229 -237
  66. package/lib/model/strategy/adapter/dataVariant/index.js +39 -34
  67. package/lib/model/strategy/adapter/dataVariant/type.js +57 -28
  68. package/lib/model/strategy/adapter/index.js +100 -64
  69. package/lib/model/strategy/adapter/itemRule/adapter.js +156 -144
  70. package/lib/model/strategy/adapter/itemRule/evaluator.js +36 -48
  71. package/lib/model/strategy/adapter/itemRule/examples.js +295 -225
  72. package/lib/model/strategy/adapter/itemRule/index.js +83 -57
  73. package/lib/model/strategy/adapter/itemRule/type.js +97 -36
  74. package/lib/model/strategy/adapter/promotion/adapter.js +91 -69
  75. package/lib/model/strategy/adapter/promotion/evaluator.js +444 -310
  76. package/lib/model/strategy/adapter/promotion/examples.js +222 -234
  77. package/lib/model/strategy/adapter/promotion/index.js +43 -48
  78. package/lib/model/strategy/adapter/promotion/type.js +243 -36
  79. package/lib/model/strategy/adapter/type.js +4 -16
  80. package/lib/model/strategy/adapter/walletPass/evaluator.js +180 -150
  81. package/lib/model/strategy/adapter/walletPass/example.js +217 -190
  82. package/lib/model/strategy/adapter/walletPass/index.js +75 -51
  83. package/lib/model/strategy/adapter/walletPass/locales.js +36 -58
  84. package/lib/model/strategy/adapter/walletPass/type.js +4 -16
  85. package/lib/model/strategy/adapter/walletPass/utils.js +588 -378
  86. package/lib/model/strategy/engine.js +270 -168
  87. package/lib/model/strategy/index.js +49 -34
  88. package/lib/model/strategy/strategy-example.js +243 -239
  89. package/lib/model/strategy/type.js +100 -40
  90. package/lib/modules/Account/index.js +39 -53
  91. package/lib/modules/Account/types.js +20 -33
  92. package/lib/modules/AccountList/index.js +116 -154
  93. package/lib/modules/AccountList/types.js +30 -31
  94. package/lib/modules/AccountList/utils.js +18 -30
  95. package/lib/modules/BaseModule.js +23 -42
  96. package/lib/modules/BookingContext/index.js +158 -136
  97. package/lib/modules/BookingContext/types.js +46 -32
  98. package/lib/modules/BookingContext/utils/buildCacheItemFromOrderLine.js +138 -146
  99. package/lib/modules/BookingContext/utils/buildNormalProductCacheItemFromOrderLine.js +78 -83
  100. package/lib/modules/BookingContext/utils/cacheItemToBookingInput.js +170 -150
  101. package/lib/modules/BookingContext/utils/flexible.js +38 -55
  102. package/lib/modules/BookingContext/utils/formatResourceList.js +19 -34
  103. package/lib/modules/BookingContext/utils/index.js +124 -41
  104. package/lib/modules/BookingContext/utils/noResource.js +58 -70
  105. package/lib/modules/BookingContext/utils/orderLineDisplay.js +14 -41
  106. package/lib/modules/BookingContext/utils/productExtend.js +202 -155
  107. package/lib/modules/BookingContext/utils/resourceErrors.js +53 -53
  108. package/lib/modules/BookingContext/utils/resourceSelection.js +19 -41
  109. package/lib/modules/BookingContext/utils/resources.js +209 -167
  110. package/lib/modules/BookingContext/utils/serviceTimes.js +115 -116
  111. package/lib/modules/BookingContext/utils/timeSlices.js +76 -86
  112. package/lib/modules/Cart/index.js +170 -124
  113. package/lib/modules/Cart/types.js +46 -51
  114. package/lib/modules/Cart/utils/cartAccount.js +40 -39
  115. package/lib/modules/Cart/utils/cartDate.js +56 -61
  116. package/lib/modules/Cart/utils/cartDiscount.js +28 -33
  117. package/lib/modules/Cart/utils/cartNote.js +27 -32
  118. package/lib/modules/Cart/utils/cartProduct.js +321 -251
  119. package/lib/modules/Cart/utils/cartRelationForms.js +29 -35
  120. package/lib/modules/Cart/utils/cartResource.js +70 -78
  121. package/lib/modules/Cart/utils/changePrice.js +22 -50
  122. package/lib/modules/Cart/utils/index.js +106 -48
  123. package/lib/modules/Customer/constants.js +13 -34
  124. package/lib/modules/Customer/index.js +235 -172
  125. package/lib/modules/Customer/types.js +38 -35
  126. package/lib/modules/Date/index.js +116 -115
  127. package/lib/modules/Date/types.js +16 -28
  128. package/lib/modules/Date/utils.js +174 -123
  129. package/lib/modules/Discount/index.js +133 -143
  130. package/lib/modules/Discount/types.js +9 -31
  131. package/lib/modules/Guests/index.js +30 -56
  132. package/lib/modules/Guests/types.js +23 -33
  133. package/lib/modules/Holder/index.js +209 -189
  134. package/lib/modules/Holder/types.js +4 -16
  135. package/lib/modules/Holder/utils.js +20 -49
  136. package/lib/modules/OpenData/index.js +70 -76
  137. package/lib/modules/OpenData/types.js +4 -16
  138. package/lib/modules/OpenData/utils.js +44 -78
  139. package/lib/modules/Order/index.d.ts +1 -1
  140. package/lib/modules/Order/index.js +1810 -2238
  141. package/lib/modules/Order/payment-utils.js +77 -120
  142. package/lib/modules/Order/types.d.ts +5 -1
  143. package/lib/modules/Order/types.js +87 -35
  144. package/lib/modules/Order/utils/bundleDiscountHydration.js +41 -74
  145. package/lib/modules/Order/utils/discountProductLineIdentity.js +142 -100
  146. package/lib/modules/Order/utils/manualProductDiscount.js +124 -123
  147. package/lib/modules/Order/utils/orderCollectionIdentity.js +184 -244
  148. package/lib/modules/Order/utils/virtualSettlement.js +120 -171
  149. package/lib/modules/Order/utils.js +834 -668
  150. package/lib/modules/Payment/cash.js +20 -33
  151. package/lib/modules/Payment/cashRecommendationAlgorithm.js +145 -76
  152. package/lib/modules/Payment/eftpos.js +16 -30
  153. package/lib/modules/Payment/index.js +532 -399
  154. package/lib/modules/Payment/mx51.js +1 -0
  155. package/lib/modules/Payment/types.js +230 -108
  156. package/lib/modules/Payment/utils.js +52 -51
  157. package/lib/modules/Payment/walletpass.js +485 -660
  158. package/lib/modules/Product/index.js +51 -46
  159. package/lib/modules/Product/types.d.ts +2 -0
  160. package/lib/modules/Product/types.js +4 -16
  161. package/lib/modules/Product/utils.js +32 -33
  162. package/lib/modules/ProductList/index.js +138 -161
  163. package/lib/modules/ProductList/types.js +9 -31
  164. package/lib/modules/Quotation/index.js +66 -100
  165. package/lib/modules/Quotation/types.js +4 -16
  166. package/lib/modules/Resource/index.js +27 -59
  167. package/lib/modules/Resource/types.js +22 -32
  168. package/lib/modules/Resource/utils.js +30 -38
  169. package/lib/modules/ResourcePlanner/index.js +25 -23
  170. package/lib/modules/ResourcePlanner/localClock.js +54 -119
  171. package/lib/modules/ResourcePlanner/planner.js +591 -772
  172. package/lib/modules/ResourcePlanner/types.js +10 -29
  173. package/lib/modules/Rules/index.js +1218 -959
  174. package/lib/modules/Rules/types.js +17 -40
  175. package/lib/modules/SalesSummary/index.js +78 -89
  176. package/lib/modules/SalesSummary/types.js +4 -16
  177. package/lib/modules/SalesSummary/utils.js +359 -442
  178. package/lib/modules/ScanOrderLogger/index.js +59 -79
  179. package/lib/modules/ScanOrderLogger/providers/feishu.js +54 -78
  180. package/lib/modules/ScanOrderLogger/providers/grafana.js +13 -36
  181. package/lib/modules/ScanOrderLogger/types.js +4 -16
  182. package/lib/modules/Schedule/getDateIsInSchedule.js +334 -163
  183. package/lib/modules/Schedule/index.js +100 -114
  184. package/lib/modules/Schedule/type.js +4 -16
  185. package/lib/modules/Schedule/types.js +4 -16
  186. package/lib/modules/Schedule/utils.js +433 -291
  187. package/lib/modules/Step/index.js +40 -52
  188. package/lib/modules/Step/tyeps.js +4 -16
  189. package/lib/modules/Summary/index.js +66 -71
  190. package/lib/modules/Summary/types.js +4 -16
  191. package/lib/modules/Summary/utils.js +773 -418
  192. package/lib/modules/SurchargeList/index.js +46 -60
  193. package/lib/modules/SurchargeList/types.js +4 -16
  194. package/lib/modules/index.js +245 -63
  195. package/lib/plugins/app.js +4 -16
  196. package/lib/plugins/index.js +36 -25
  197. package/lib/plugins/request.js +137 -126
  198. package/lib/plugins/shopStore.js +4 -16
  199. package/lib/plugins/user.js +4 -16
  200. package/lib/plugins/window.js +171 -179
  201. package/lib/server/index.js +3027 -2655
  202. package/lib/server/modules/floor-plan/index.js +102 -123
  203. package/lib/server/modules/floor-plan/types.js +15 -30
  204. package/lib/server/modules/index.js +106 -68
  205. package/lib/server/modules/menu/index.js +146 -122
  206. package/lib/server/modules/menu/types.js +18 -31
  207. package/lib/server/modules/order/index.js +758 -956
  208. package/lib/server/modules/order/types.js +122 -33
  209. package/lib/server/modules/order/utils/filterBookings.js +219 -194
  210. package/lib/server/modules/order/utils/filterOrders.js +118 -92
  211. package/lib/server/modules/payment/index.js +59 -83
  212. package/lib/server/modules/payment/types.js +4 -16
  213. package/lib/server/modules/products/index.js +575 -459
  214. package/lib/server/modules/products/types.js +44 -34
  215. package/lib/server/modules/quotation/index.js +137 -172
  216. package/lib/server/modules/quotation/types.js +21 -31
  217. package/lib/server/modules/resource/index.js +213 -184
  218. package/lib/server/modules/resource/types.js +42 -33
  219. package/lib/server/modules/schedule/index.js +135 -123
  220. package/lib/server/modules/schedule/types.js +14 -21
  221. package/lib/server/modules/schedule/utils.js +334 -163
  222. package/lib/server/types.js +4 -16
  223. package/lib/server/utils/index.js +25 -23
  224. package/lib/server/utils/product.js +196 -139
  225. package/lib/server/utils/schedule.js +34 -41
  226. package/lib/server/utils/small-ticket.js +479 -456
  227. package/lib/server/utils/time.js +40 -49
  228. package/lib/solution/BaseSales/index.js +1274 -1489
  229. package/lib/solution/BaseSales/types.d.ts +2 -0
  230. package/lib/solution/BaseSales/types.js +42 -38
  231. package/lib/solution/BaseSales/utils/cartPromotion.d.ts +5 -0
  232. package/lib/solution/BaseSales/utils/cartPromotion.js +652 -498
  233. package/lib/solution/BaseSales/utils/parseSalesResponse.js +85 -105
  234. package/lib/solution/BaseSales/utils/quotationPrice.js +56 -114
  235. package/lib/solution/BaseSales/utils/transformBaseProductToOrderProduct.d.ts +3 -0
  236. package/lib/solution/BaseSales/utils/transformBaseProductToOrderProduct.js +138 -180
  237. package/lib/solution/BaseSales/utils.js +161 -143
  238. package/lib/solution/BookingByStep/index.d.ts +1 -1
  239. package/lib/solution/BookingByStep/index.js +1527 -1340
  240. package/lib/solution/BookingByStep/types.js +40 -99
  241. package/lib/solution/BookingByStep/utils/capacity.js +192 -160
  242. package/lib/solution/BookingByStep/utils/products.js +42 -52
  243. package/lib/solution/BookingByStep/utils/resources.js +527 -330
  244. package/lib/solution/BookingByStep/utils/stock.js +65 -44
  245. package/lib/solution/BookingByStep/utils/timeslots.js +129 -131
  246. package/lib/solution/BookingTicket/index.js +598 -514
  247. package/lib/solution/BookingTicket/types.js +99 -77
  248. package/lib/solution/BookingTicket/utils/addProductDecision.js +229 -190
  249. package/lib/solution/BookingTicket/utils/addTimeAvailability.js +58 -89
  250. package/lib/solution/BookingTicket/utils/bookingStatus.js +107 -78
  251. package/lib/solution/BookingTicket/utils/cartView.js +114 -99
  252. package/lib/solution/BookingTicket/utils/exampleData.js +185 -0
  253. package/lib/solution/BookingTicket/utils/orderCustomer.js +18 -41
  254. package/lib/solution/BookingTicket/utils/resolveBestAddTimePlan.js +219 -86
  255. package/lib/solution/BookingTicket/utils/scan/applyGlobalScan.js +168 -116
  256. package/lib/solution/BookingTicket/utils/scan/cloudSearch.js +79 -91
  257. package/lib/solution/BookingTicket/utils/scan/formatGlobalScan.js +54 -41
  258. package/lib/solution/BookingTicket/utils/scan/handleScan.js +84 -81
  259. package/lib/solution/BookingTicket/utils/scan/index.js +98 -104
  260. package/lib/solution/BookingTicket/utils/scan/scanCache.js +90 -43
  261. package/lib/solution/BookingTicket/utils/scan/scanProductValues.js +52 -64
  262. package/lib/solution/BookingTicket/utils/sessionCatalogStale.js +56 -58
  263. package/lib/solution/BookingTicket/utils/weighingProductSku.js +34 -48
  264. package/lib/solution/BuyTickets/index.js +67 -70
  265. package/lib/solution/BuyTickets/types.js +22 -38
  266. package/lib/solution/Checkout/index.js +1451 -1158
  267. package/lib/solution/Checkout/types.js +91 -61
  268. package/lib/solution/Checkout/utils/index.js +228 -156
  269. package/lib/solution/PlaceOrder/index.js +55 -0
  270. package/lib/solution/RegisterAndLogin/config.js +493 -460
  271. package/lib/solution/RegisterAndLogin/index.js +633 -630
  272. package/lib/solution/RegisterAndLogin/types.js +189 -76
  273. package/lib/solution/RegisterAndLogin/utils.js +183 -125
  274. package/lib/solution/Sales/index.js +328 -324
  275. package/lib/solution/Sales/types.js +27 -33
  276. package/lib/solution/ScanOrder/index.js +822 -852
  277. package/lib/solution/ScanOrder/types.d.ts +2 -0
  278. package/lib/solution/ScanOrder/types.js +33 -34
  279. package/lib/solution/ScanOrder/utils.js +412 -374
  280. package/lib/solution/ShopDiscount/index.js +226 -232
  281. package/lib/solution/ShopDiscount/types.js +15 -37
  282. package/lib/solution/ShopDiscount/utils.js +300 -172
  283. package/lib/solution/UnifiedBookingSales/index.js +1052 -1213
  284. package/lib/solution/UnifiedBookingSales/remoteOccupancyCache.js +99 -159
  285. package/lib/solution/UnifiedBookingSales/types.js +10 -32
  286. package/lib/solution/VenueBooking/index.js +811 -879
  287. package/lib/solution/VenueBooking/types.js +19 -39
  288. package/lib/solution/VenueBooking/utils/dateSummary.js +27 -56
  289. package/lib/solution/VenueBooking/utils/resource.js +31 -54
  290. package/lib/solution/VenueBooking/utils/slotMerge.js +94 -107
  291. package/lib/solution/VenueBooking/utils/timeSlot.js +132 -132
  292. package/lib/solution/VenueBooking/utils.js +130 -67
  293. package/lib/solution/index.js +124 -41
  294. package/lib/store/createStore.js +32 -29
  295. package/lib/types/index.js +4 -16
  296. package/lib/utils/payment-number.js +26 -46
  297. package/lib/utils/task.js +36 -36
  298. package/lib/utils/watch.js +81 -47
  299. package/package.json +2 -1
@@ -37,7 +37,7 @@ import { isNormalProduct } from "../Product/utils";
37
37
  import dayjs from 'dayjs';
38
38
  import { ensureOrderPaymentNumber, mergeOrderPaymentRecord, resolveOrderPaymentIdentity } from "./payment-utils";
39
39
  import { resolvePaymentNumberDevicePrefix, resolvePaymentNumberDevicePrefixFromDeviceId } from "../../utils/payment-number";
40
- import { processCartPromotion, appendPromotionTags as _appendPromotionTags, getOrderProductUid as getPromotionUid } from "../../solution/BaseSales/utils/cartPromotion";
40
+ import { processCartPromotion, appendPromotionTags as _appendPromotionTags, getOrderProductUid as getPromotionUid, PRODUCT_LINE_MERGE_DISABLED_METADATA_KEY } from "../../solution/BaseSales/utils/cartPromotion";
41
41
  import { buildProductLineFingerprint, getProductIdentityIndex, getSafeProductNum, isIdentityMatch, normalizeOrderProduct } from "../../solution/ScanOrder/utils";
42
42
  import { hasManualProductDiscountFlag, syncManualProductDiscountProductNum } from "./utils/manualProductDiscount";
43
43
  import { expandHydratedProductsForDiscountCollection, restoreHydratedBundleDiscounts } from "./utils/bundleDiscountHydration";
@@ -2355,6 +2355,8 @@ export var OrderModule = /*#__PURE__*/function (_BaseModule) {
2355
2355
  }, {
2356
2356
  key: "restoreOriginalSnapshotIfProductsUnchanged",
2357
2357
  value: function restoreOriginalSnapshotIfProductsUnchanged(tempOrder, snapshot) {
2358
+ // merge hydrate 的商品集合包含本地未提交行,但 summary 仍来自远端旧订单,不能复用。
2359
+ if (snapshot.requiresFullSummaryRecalculation === true) return null;
2358
2360
  var currentFingerprint = this.buildOrderProductsFingerprint(tempOrder.products);
2359
2361
  var manualDepositOverride = this.getManualDepositOverride(tempOrder);
2360
2362
  if (currentFingerprint !== snapshot.productFingerprint) {
@@ -4168,9 +4170,13 @@ export var OrderModule = /*#__PURE__*/function (_BaseModule) {
4168
4170
  booking: booking
4169
4171
  }) : null;
4170
4172
  var productToAdd = (linked === null || linked === void 0 ? void 0 : linked.product) || product;
4173
+ var disableMerge = (options === null || options === void 0 ? void 0 : options.disableMerge) === true;
4171
4174
  this.assertAndLockProductSettlement(tempOrder, productToAdd);
4172
- var incomingFingerprint = buildProductLineFingerprint(getProductSkuOptions(productToAdd), productToAdd.product_bundle);
4175
+ var incomingFingerprint = disableMerge ? '' : buildProductLineFingerprint(getProductSkuOptions(productToAdd), productToAdd.product_bundle);
4173
4176
  var normalizedIncoming = this.normalizeVirtualSettlementProductIfEnabled(mergeOrderProductDisplayFields(productToAdd, normalizeOrderProduct(productToAdd)));
4177
+ if (disableMerge) {
4178
+ normalizedIncoming.metadata = _objectSpread(_objectSpread({}, normalizedIncoming.metadata || {}), {}, _defineProperty({}, PRODUCT_LINE_MERGE_DISABLED_METADATA_KEY, true));
4179
+ }
4174
4180
  var isWeighingProduct = Number(((_normalizedIncoming$p = normalizedIncoming.product_sku) === null || _normalizedIncoming$p === void 0 ? void 0 : _normalizedIncoming$p.open_sold_weight) || 0) === 1;
4175
4181
  var netWeight = Number((_normalizedIncoming$p2 = normalizedIncoming.product_sku) === null || _normalizedIncoming$p2 === void 0 ? void 0 : _normalizedIncoming$p2.net_weight);
4176
4182
  if (isWeighingProduct && (!Number.isFinite(netWeight) || netWeight <= 0)) {
@@ -4189,7 +4195,7 @@ export var OrderModule = /*#__PURE__*/function (_BaseModule) {
4189
4195
  var hasIncomingManualProductDiscount = isManualProductDiscountProduct(normalizedIncoming);
4190
4196
  var hasIncomingBookingUid = this.hasLinkedBookingUid(productToAdd) || this.hasLinkedBookingUid(normalizedIncoming);
4191
4197
  var isIncomingCustomItem = ((_productToAdd$metadat = productToAdd.metadata) === null || _productToAdd$metadat === void 0 || (_productToAdd$metadat = _productToAdd$metadat.origin) === null || _productToAdd$metadat === void 0 ? void 0 : _productToAdd$metadat.isCustomItem) === true || ((_origin = productToAdd._origin) === null || _origin === void 0 ? void 0 : _origin.isCustomItem) === true;
4192
- var shouldForceNewLine = !!booking || hasIncomingProductNote || hasIncomingManualProductDiscount || hasIncomingBookingUid || isIncomingCustomItem || isWeighingProduct;
4198
+ var shouldForceNewLine = disableMerge || !!booking || hasIncomingProductNote || hasIncomingManualProductDiscount || hasIncomingBookingUid || isIncomingCustomItem || isWeighingProduct;
4193
4199
  var matchedIndex = hasIncomingGoodPass || shouldForceNewLine ? -1 : tempOrder.products.findIndex(function (item) {
4194
4200
  var _item$metadata3;
4195
4201
  if (_this27.hasGoodPassDiscount(item)) return false;
@@ -4319,7 +4325,8 @@ export var OrderModule = /*#__PURE__*/function (_BaseModule) {
4319
4325
  singleLine.num = 1;
4320
4326
  delete singleLine.product_quantity;
4321
4327
  _appendResult = this.appendProductLineToTempOrder(tempOrder, singleLine, cloneDeep(booking), {
4322
- insertAtIndex: insertAtIndex
4328
+ insertAtIndex: insertAtIndex,
4329
+ disableMerge: options === null || options === void 0 ? void 0 : options.disableMerge
4323
4330
  });
4324
4331
  if (!_appendResult) {
4325
4332
  _context21.next = 17;
@@ -4340,7 +4347,8 @@ export var OrderModule = /*#__PURE__*/function (_BaseModule) {
4340
4347
  return _context21.abrupt("return", tempOrder.products);
4341
4348
  case 24:
4342
4349
  appendResult = this.appendProductLineToTempOrder(tempOrder, product, booking, {
4343
- insertAtIndex: insertAtIndex
4350
+ insertAtIndex: insertAtIndex,
4351
+ disableMerge: options === null || options === void 0 ? void 0 : options.disableMerge
4344
4352
  });
4345
4353
  if (!appendResult) {
4346
4354
  _context21.next = 28;
@@ -5512,7 +5520,6 @@ export var OrderModule = /*#__PURE__*/function (_BaseModule) {
5512
5520
  includePaymentStatus: !isOnlineStorePlatform,
5513
5521
  enhance: enhancePayload
5514
5522
  });
5515
- console.log('[Order.runSubmitTempOrder.payload]', payload);
5516
5523
  if (params !== null && params !== void 0 && params.syncMode) {
5517
5524
  payload.sync_mode = true;
5518
5525
  }
@@ -5520,10 +5527,10 @@ export var OrderModule = /*#__PURE__*/function (_BaseModule) {
5520
5527
  if (!payload.created_at) {
5521
5528
  payload.created_at = dayjs().format('YYYY-MM-DD HH:mm:ss');
5522
5529
  }
5523
- _context36.next = 28;
5530
+ _context36.next = 27;
5524
5531
  return this.saveDraft();
5525
- case 28:
5526
- _context36.prev = 28;
5532
+ case 27:
5533
+ _context36.prev = 27;
5527
5534
  this.logInfo('submitTempOrder calling sales checkout', {
5528
5535
  orderId: payload.order_id,
5529
5536
  externalSaleNumber: payload.external_sale_number,
@@ -5533,26 +5540,26 @@ export var OrderModule = /*#__PURE__*/function (_BaseModule) {
5533
5540
  smallTicketDataFlag: payload.small_ticket_data_flag,
5534
5541
  syncMode: payload.sync_mode
5535
5542
  });
5536
- _context36.next = 32;
5543
+ _context36.next = 31;
5537
5544
  return this.submitSalesOrder({
5538
5545
  query: payload
5539
5546
  });
5540
- case 32:
5547
+ case 31:
5541
5548
  result = _context36.sent;
5542
- _context36.next = 45;
5549
+ _context36.next = 44;
5543
5550
  break;
5544
- case 35:
5545
- _context36.prev = 35;
5546
- _context36.t2 = _context36["catch"](28);
5551
+ case 34:
5552
+ _context36.prev = 34;
5553
+ _context36.t2 = _context36["catch"](27);
5547
5554
  backendErrorResponse = this.extractSubmitErrorResponse(_context36.t2);
5548
5555
  if (!backendErrorResponse) {
5549
- _context36.next = 42;
5556
+ _context36.next = 41;
5550
5557
  break;
5551
5558
  }
5552
5559
  this.store.syncState = 'failed';
5553
5560
  this.logSubmitBackendRejected(backendErrorResponse, payload);
5554
5561
  return _context36.abrupt("return", backendErrorResponse);
5555
- case 42:
5562
+ case 41:
5556
5563
  this.store.syncState = 'failed';
5557
5564
  this.logError('submitTempOrder failed', {
5558
5565
  error: _context36.t2 instanceof Error ? _context36.t2.message : String(_context36.t2),
@@ -5562,15 +5569,15 @@ export var OrderModule = /*#__PURE__*/function (_BaseModule) {
5562
5569
  paymentsCount: ((_payload$payments2 = payload.payments) === null || _payload$payments2 === void 0 ? void 0 : _payload$payments2.length) || 0
5563
5570
  });
5564
5571
  throw _context36.t2;
5565
- case 45:
5572
+ case 44:
5566
5573
  if (!this.isSubmitResponseRejected(result)) {
5567
- _context36.next = 49;
5574
+ _context36.next = 48;
5568
5575
  break;
5569
5576
  }
5570
5577
  this.store.syncState = 'failed';
5571
5578
  this.logSubmitBackendRejected(result, payload);
5572
5579
  return _context36.abrupt("return", result);
5573
- case 49:
5580
+ case 48:
5574
5581
  submittedOrderId = this.extractOrderIdFromSubmitResult(result);
5575
5582
  this.logInfo('runSubmitTempOrder: 提交成功', {
5576
5583
  submittedOrderId: submittedOrderId,
@@ -5580,29 +5587,29 @@ export var OrderModule = /*#__PURE__*/function (_BaseModule) {
5580
5587
  })
5581
5588
  });
5582
5589
  if (!(submittedOrderId !== null && submittedOrderId !== undefined)) {
5583
- _context36.next = 58;
5590
+ _context36.next = 57;
5584
5591
  break;
5585
5592
  }
5586
5593
  tempOrder.order_id = submittedOrderId;
5587
5594
  resultRecord = result;
5588
- _context36.next = 56;
5595
+ _context36.next = 55;
5589
5596
  return this.markLocalOrderSynced(submittedOrderId, (resultRecord === null || resultRecord === void 0 ? void 0 : resultRecord.data) || resultRecord || {});
5590
- case 56:
5591
- _context36.next = 59;
5597
+ case 55:
5598
+ _context36.next = 58;
5592
5599
  break;
5593
- case 58:
5600
+ case 57:
5594
5601
  if (this.isLocalPendingSubmitResult(result)) {
5595
5602
  this.store.syncState = 'local';
5596
5603
  } else {
5597
5604
  this.store.syncState = 'submitted';
5598
5605
  }
5599
- case 59:
5606
+ case 58:
5600
5607
  return _context36.abrupt("return", result);
5601
- case 60:
5608
+ case 59:
5602
5609
  case "end":
5603
5610
  return _context36.stop();
5604
5611
  }
5605
- }, _callee33, this, [[28, 35]]);
5612
+ }, _callee33, this, [[27, 34]]);
5606
5613
  }));
5607
5614
  function runSubmitTempOrder(_x39) {
5608
5615
  return _runSubmitTempOrder.apply(this, arguments);
@@ -6030,8 +6037,8 @@ export var OrderModule = /*#__PURE__*/function (_BaseModule) {
6030
6037
  key: "createOrderByCheckout",
6031
6038
  value: (function () {
6032
6039
  var _createOrderByCheckout = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee39(params) {
6033
- var _params$payments, _params$bookings2, _params$relation_prod2, _params$payments2, _params$payments3, _params$bookings3, _params$relation_prod3, _params$payments4;
6034
- var onlineStorePaymentCodeList, _orderData$payments, _orderData$bookings, _orderData$relation_p, _orderData$payments2, _orderData$payments3, _orderData$bookings2, _orderData$relation_p2, _orderData$payments4, _orderData$payments5, _response$data, orderData, response;
6040
+ var _params$payments, _params$bookings2, _params$relation_prod2, _params$payments2, _params$payments3;
6041
+ var onlineStorePaymentCodeList, _orderData$payments, _orderData$bookings, _orderData$relation_p, _orderData$payments2, _orderData$payments3, orderData, response;
6035
6042
  return _regeneratorRuntime().wrap(function _callee39$(_context42) {
6036
6043
  while (1) switch (_context42.prev = _context42.next) {
6037
6044
  case 0:
@@ -6058,16 +6065,7 @@ export var OrderModule = /*#__PURE__*/function (_BaseModule) {
6058
6065
  return p.code;
6059
6066
  })) || []
6060
6067
  });
6061
- console.log('[Order] createOrderByCheckout 开始创建订单:', {
6062
- type: params.type,
6063
- platform: params.platform,
6064
- is_deposit: params.is_deposit,
6065
- customer_id: params.customer_id,
6066
- bookingsCount: ((_params$bookings3 = params.bookings) === null || _params$bookings3 === void 0 ? void 0 : _params$bookings3.length) || 0,
6067
- relationProductsCount: ((_params$relation_prod3 = params.relation_products) === null || _params$relation_prod3 === void 0 ? void 0 : _params$relation_prod3.length) || 0,
6068
- paymentsCount: ((_params$payments4 = params.payments) === null || _params$payments4 === void 0 ? void 0 : _params$payments4.length) || 0
6069
- });
6070
- _context42.prev = 4;
6068
+ _context42.prev = 3;
6071
6069
  // 构建订单数据,设置默认值并允许 params 覆盖
6072
6070
  orderData = _objectSpread({
6073
6071
  sales_channel: 'my_pisel',
@@ -6089,20 +6087,6 @@ export var OrderModule = /*#__PURE__*/function (_BaseModule) {
6089
6087
  if (!params.order_id && !orderData.schedule_date) {
6090
6088
  orderData.schedule_date = dayjs().format('YYYY-MM-DD HH:mm:ss');
6091
6089
  }
6092
- console.log('[Order] 调用后端接口创建订单:', {
6093
- url: '/shop/order/checkout',
6094
- orderType: orderData.type,
6095
- platform: orderData.platform,
6096
- isDeposit: orderData.is_deposit,
6097
- customerId: orderData.customer_id,
6098
- bookingsCount: ((_orderData$bookings = orderData.bookings) === null || _orderData$bookings === void 0 ? void 0 : _orderData$bookings.length) || 0,
6099
- relationProductsCount: ((_orderData$relation_p = orderData.relation_products) === null || _orderData$relation_p === void 0 ? void 0 : _orderData$relation_p.length) || 0,
6100
- paymentsCount: ((_orderData$payments2 = orderData.payments) === null || _orderData$payments2 === void 0 ? void 0 : _orderData$payments2.length) || 0,
6101
- paymentsMethods: ((_orderData$payments3 = orderData.payments) === null || _orderData$payments3 === void 0 ? void 0 : _orderData$payments3.map(function (p) {
6102
- return p.code;
6103
- })) || []
6104
- });
6105
-
6106
6090
  // 记录接口调用详情
6107
6091
  this.logInfo('Calling backend checkout API', {
6108
6092
  url: '/shop/order/checkout',
@@ -6111,10 +6095,10 @@ export var OrderModule = /*#__PURE__*/function (_BaseModule) {
6111
6095
  isDeposit: orderData.is_deposit,
6112
6096
  customerId: orderData.customer_id,
6113
6097
  depositAmount: orderData.deposit_amount,
6114
- bookingsCount: ((_orderData$bookings2 = orderData.bookings) === null || _orderData$bookings2 === void 0 ? void 0 : _orderData$bookings2.length) || 0,
6115
- relationProductsCount: ((_orderData$relation_p2 = orderData.relation_products) === null || _orderData$relation_p2 === void 0 ? void 0 : _orderData$relation_p2.length) || 0,
6116
- paymentsCount: ((_orderData$payments4 = orderData.payments) === null || _orderData$payments4 === void 0 ? void 0 : _orderData$payments4.length) || 0,
6117
- paymentMethods: ((_orderData$payments5 = orderData.payments) === null || _orderData$payments5 === void 0 ? void 0 : _orderData$payments5.map(function (p) {
6098
+ bookingsCount: ((_orderData$bookings = orderData.bookings) === null || _orderData$bookings === void 0 ? void 0 : _orderData$bookings.length) || 0,
6099
+ relationProductsCount: ((_orderData$relation_p = orderData.relation_products) === null || _orderData$relation_p === void 0 ? void 0 : _orderData$relation_p.length) || 0,
6100
+ paymentsCount: ((_orderData$payments2 = orderData.payments) === null || _orderData$payments2 === void 0 ? void 0 : _orderData$payments2.length) || 0,
6101
+ paymentMethods: ((_orderData$payments3 = orderData.payments) === null || _orderData$payments3 === void 0 ? void 0 : _orderData$payments3.map(function (p) {
6118
6102
  return {
6119
6103
  code: p.code,
6120
6104
  amount: p.amount,
@@ -6129,34 +6113,30 @@ export var OrderModule = /*#__PURE__*/function (_BaseModule) {
6129
6113
  hasOrderId: !!orderData.order_id,
6130
6114
  smallTicketDataFlag: orderData.small_ticket_data_flag
6131
6115
  });
6132
- _context42.next = 12;
6116
+ _context42.next = 10;
6133
6117
  return this.request.post('/order/checkout', orderData, {
6134
6118
  osServer: true,
6135
6119
  customToast: function customToast() {}
6136
6120
  });
6137
- case 12:
6121
+ case 10:
6138
6122
  response = _context42.sent;
6139
6123
  this.logInfo('Order API called successfully', {
6140
6124
  response: response
6141
6125
  });
6142
- console.log('[Order] 订单创建成功,后端响应:', {
6143
- success: !!response,
6144
- hasOrderId: !!(response !== null && response !== void 0 && (_response$data = response.data) !== null && _response$data !== void 0 && _response$data.order_id || response !== null && response !== void 0 && response.order_id)
6145
- });
6146
6126
  return _context42.abrupt("return", response);
6147
- case 18:
6148
- _context42.prev = 18;
6149
- _context42.t0 = _context42["catch"](4);
6127
+ case 15:
6128
+ _context42.prev = 15;
6129
+ _context42.t0 = _context42["catch"](3);
6150
6130
  console.error('[Order] createOrderByCheckout 创建订单失败:', _context42.t0);
6151
6131
  this.logInfo('Order API called failed', {
6152
6132
  error: _context42.t0 instanceof Error ? _context42.t0.message : String(_context42.t0)
6153
6133
  });
6154
6134
  throw _context42.t0;
6155
- case 23:
6135
+ case 20:
6156
6136
  case "end":
6157
6137
  return _context42.stop();
6158
6138
  }
6159
- }, _callee39, this, [[4, 18]]);
6139
+ }, _callee39, this, [[3, 15]]);
6160
6140
  }));
6161
6141
  function createOrderByCheckout(_x46) {
6162
6142
  return _createOrderByCheckout.apply(this, arguments);
@@ -6287,7 +6267,7 @@ export var OrderModule = /*#__PURE__*/function (_BaseModule) {
6287
6267
  value: (function () {
6288
6268
  var _hydrateTempOrderFromRecord = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee43(record, options) {
6289
6269
  var _sourceRaw$_extend, _this$store$discount26;
6290
- var sourceRaw, duplicateProductIdentityRepair, duplicateIdentityReadySource, identityReadySource, normalizedCollections, raw, hasIdentityChanges, identityLogMetadata, hasIdentityWarnings, isSessionStorageHydrate, nextTempOrder, _this$store$discount24, _this$store$discount25, restoredSessionDiscounts, nextExtend, sourceLastOrderInfo, isDraftOrder, syntheticIdentityOptions, rawSummary, summarySurcharges, hadSyntheticDraftOrderId, hydratedEditDiscounts, currentDiscounts, currentScanDiscounts, hydratedDiscountIds, retainedScanDiscounts, nextDiscounts, shouldSkipEmptyDiscountSync, _this$store$discount27, _this$store$discount28;
6270
+ var sourceRaw, duplicateProductIdentityRepair, duplicateIdentityReadySource, identityReadySource, normalizedCollections, raw, hasIdentityChanges, identityLogMetadata, hasIdentityWarnings, isSessionStorageHydrate, isMergedSalesDetailHydrate, nextTempOrder, _this$store$discount24, _this$store$discount25, restoredSessionDiscounts, nextExtend, sourceLastOrderInfo, isDraftOrder, syntheticIdentityOptions, rawSummary, summarySurcharges, hadSyntheticDraftOrderId, hydratedEditDiscounts, currentDiscounts, currentScanDiscounts, hydratedDiscountIds, retainedScanDiscounts, nextDiscounts, shouldSkipEmptyDiscountSync, _this$store$discount27, _this$store$discount28;
6291
6271
  return _regeneratorRuntime().wrap(function _callee43$(_context46) {
6292
6272
  while (1) switch (_context46.prev = _context46.next) {
6293
6273
  case 0:
@@ -6322,12 +6302,14 @@ export var OrderModule = /*#__PURE__*/function (_BaseModule) {
6322
6302
  }
6323
6303
  }
6324
6304
  isSessionStorageHydrate = (options === null || options === void 0 ? void 0 : options.source) === 'sessionStorage';
6305
+ isMergedSalesDetailHydrate = (options === null || options === void 0 ? void 0 : options.source) === 'mergedSalesDetail';
6325
6306
  nextTempOrder = this.normalizeTempOrderForRuntime(raw, {
6326
- makeEditMark: !isSessionStorageHydrate
6307
+ // merge 前已只给远端商品补标记;这里不能把本地未提交商品一并变成 saved item。
6308
+ makeEditMark: !isSessionStorageHydrate && !isMergedSalesDetailHydrate
6327
6309
  });
6328
6310
  this.store.tempOrder = nextTempOrder;
6329
6311
  if (!isSessionStorageHydrate) {
6330
- _context46.next = 29;
6312
+ _context46.next = 30;
6331
6313
  break;
6332
6314
  }
6333
6315
  // 会话快照是未提交购物车,不应获得编辑订单的 saved/edit 标记与服务端基线。
@@ -6343,24 +6325,24 @@ export var OrderModule = /*#__PURE__*/function (_BaseModule) {
6343
6325
  nextTempOrder.discount_list = restoredSessionDiscounts;
6344
6326
  this.store.summary = createEmptySummary();
6345
6327
  this.store.lastOrderInfo = undefined;
6346
- _context46.next = 22;
6328
+ _context46.next = 23;
6347
6329
  return (_this$store$discount24 = this.store.discount) === null || _this$store$discount24 === void 0 ? void 0 : _this$store$discount24.setOriginalDiscountList(cloneDeep(restoredSessionDiscounts));
6348
- case 22:
6349
- _context46.next = 24;
6330
+ case 23:
6331
+ _context46.next = 25;
6350
6332
  return (_this$store$discount25 = this.store.discount) === null || _this$store$discount25 === void 0 ? void 0 : _this$store$discount25.setDiscountList(cloneDeep(restoredSessionDiscounts));
6351
- case 24:
6333
+ case 25:
6352
6334
  if (!(options !== null && options !== void 0 && options.recalcOnHydrate)) {
6353
- _context46.next = 27;
6335
+ _context46.next = 28;
6354
6336
  break;
6355
6337
  }
6356
- _context46.next = 27;
6338
+ _context46.next = 28;
6357
6339
  return this.recalculateSummary({
6358
6340
  createIfMissing: false
6359
6341
  });
6360
- case 27:
6342
+ case 28:
6361
6343
  this.persistTempOrder();
6362
6344
  return _context46.abrupt("return", nextTempOrder);
6363
- case 29:
6345
+ case 30:
6364
6346
  // Server list compatibility may synthesize order_id from external_sale_number; tempOrder must not.
6365
6347
  sourceLastOrderInfo = sourceRaw.lastOrderInfo || sourceRaw;
6366
6348
  isDraftOrder = Number(nextTempOrder.is_draft_order || 0) === 1;
@@ -6376,7 +6358,7 @@ export var OrderModule = /*#__PURE__*/function (_BaseModule) {
6376
6358
  surcharges: summarySurcharges
6377
6359
  });
6378
6360
  nextTempOrder._extend = _objectSpread(_objectSpread({}, nextTempOrder._extend || {}), {}, {
6379
- originalSalesSnapshot: {
6361
+ originalSalesSnapshot: _objectSpread({
6380
6362
  summary: cloneDeep(this.store.summary),
6381
6363
  products: cloneDeep(nextTempOrder.products || []),
6382
6364
  bookings: cloneDeep(nextTempOrder.bookings || []),
@@ -6384,7 +6366,9 @@ export var OrderModule = /*#__PURE__*/function (_BaseModule) {
6384
6366
  surcharges: cloneDeep(nextTempOrder.surcharges || []),
6385
6367
  shop_discount: nextTempOrder.shop_discount || '0.00',
6386
6368
  productFingerprint: this.buildOrderProductsFingerprint(nextTempOrder.products || [])
6387
- }
6369
+ }, isMergedSalesDetailHydrate ? {
6370
+ requiresFullSummaryRecalculation: true
6371
+ } : {})
6388
6372
  });
6389
6373
  this.store.lastOrderInfo = this.withoutSyntheticDraftOrderIdForRuntime(sourceLastOrderInfo, syntheticIdentityOptions);
6390
6374
  hadSyntheticDraftOrderId = this.isSyntheticDraftOrderIdForRuntime(raw, syntheticIdentityOptions) || this.isSyntheticDraftOrderIdForRuntime(sourceLastOrderInfo, syntheticIdentityOptions);
@@ -6405,28 +6389,28 @@ export var OrderModule = /*#__PURE__*/function (_BaseModule) {
6405
6389
  nextDiscounts = [].concat(_toConsumableArray(hydratedEditDiscounts), _toConsumableArray(retainedScanDiscounts));
6406
6390
  shouldSkipEmptyDiscountSync = nextDiscounts.length === 0 && currentDiscounts.length === 0;
6407
6391
  if (shouldSkipEmptyDiscountSync) {
6408
- _context46.next = 52;
6392
+ _context46.next = 53;
6409
6393
  break;
6410
6394
  }
6411
6395
  OrderModule.populateSavedAmounts(nextTempOrder.products, nextDiscounts);
6412
- _context46.next = 50;
6396
+ _context46.next = 51;
6413
6397
  return (_this$store$discount27 = this.store.discount) === null || _this$store$discount27 === void 0 ? void 0 : _this$store$discount27.setOriginalDiscountList(nextDiscounts);
6414
- case 50:
6415
- _context46.next = 52;
6398
+ case 51:
6399
+ _context46.next = 53;
6416
6400
  return (_this$store$discount28 = this.store.discount) === null || _this$store$discount28 === void 0 ? void 0 : _this$store$discount28.setDiscountList(nextDiscounts);
6417
- case 52:
6401
+ case 53:
6418
6402
  if (!(options !== null && options !== void 0 && options.recalcOnHydrate)) {
6419
- _context46.next = 55;
6403
+ _context46.next = 56;
6420
6404
  break;
6421
6405
  }
6422
- _context46.next = 55;
6406
+ _context46.next = 56;
6423
6407
  return this.recalculateSummary({
6424
6408
  createIfMissing: false
6425
6409
  });
6426
- case 55:
6410
+ case 56:
6427
6411
  this.persistTempOrder();
6428
6412
  return _context46.abrupt("return", nextTempOrder);
6429
- case 57:
6413
+ case 58:
6430
6414
  case "end":
6431
6415
  return _context46.stop();
6432
6416
  }
@@ -189,6 +189,8 @@ export interface OrderLocalizedText {
189
189
  export interface OrderProduct extends OrderProductIdentity {
190
190
  order_detail_id: number | null;
191
191
  num: number;
192
+ /** Product 或当前 Variant 的生产编码 */
193
+ production_code?: string;
192
194
  bundle_edit?: number;
193
195
  product_sku: OrderProductSku;
194
196
  gift_card?: number;
@@ -332,6 +334,8 @@ export type AddProductBookingInput = Record<string, any>;
332
334
  */
333
335
  export interface AddProductToOrderOptions {
334
336
  insertAfterProductUid?: string;
337
+ /** 跳过同商品/规格匹配,始终新增购物车行。 */
338
+ disableMerge?: boolean;
335
339
  }
336
340
  /**
337
341
  * 删除商品后的可选位置保持策略。
@@ -827,7 +831,7 @@ export interface OrderModuleAPI {
827
831
  saveDraft: () => Promise<void>;
828
832
  hydrateTempOrderFromRecord: (record: Record<string, any>, options?: {
829
833
  recalcOnHydrate?: boolean;
830
- source?: 'salesDetail' | 'sessionStorage';
834
+ source?: 'salesDetail' | 'mergedSalesDetail' | 'sessionStorage';
831
835
  }) => Promise<OrderTempOrder>;
832
836
  syncPaymentsToOrder: <T = any>(params: SyncPaymentsToOrderParams) => Promise<SyncPaymentsToOrderResult<T>>;
833
837
  getSalesOrderByLookup: (params: SalesOrderLookupParams) => Promise<any>;
@@ -873,6 +873,7 @@ function formatSubmitBundleItems(bundle) {
873
873
  return {
874
874
  is_charge_tax: formatOptions.virtualSettlementMode ? 0 : (_rawBundle$is_charge_ = rawBundle.is_charge_tax) !== null && _rawBundle$is_charge_ !== void 0 ? _rawBundle$is_charge_ : 0,
875
875
  bundle_variant_id: (_rawBundle$bundle_var = rawBundle.bundle_variant_id) !== null && _rawBundle$bundle_var !== void 0 ? _rawBundle$bundle_var : 0,
876
+ production_code: rawBundle.production_code,
876
877
  num: num,
877
878
  quantity: toBundleNumber((_rawBundle$quantity = rawBundle.quantity) !== null && _rawBundle$quantity !== void 0 ? _rawBundle$quantity : rawBundle.num, num),
878
879
  extension_id: (_rawBundle$extension_ = rawBundle.extension_id) !== null && _rawBundle$extension_ !== void 0 ? _rawBundle$extension_ : 0,
@@ -1155,7 +1156,12 @@ export function buildSubmitPayload(params) {
1155
1156
  var _tempOrder$bookings;
1156
1157
  // 如果外部没有传递 types,根据订单里当前是否有 bookings 来决定是 appointment_booking 还是 virtual
1157
1158
  if (tempOrder !== null && tempOrder !== void 0 && (_tempOrder$bookings = tempOrder.bookings) !== null && _tempOrder$bookings !== void 0 && _tempOrder$bookings.length) {
1158
- submitType = 'appointment_booking';
1159
+ // 260807 如果 biz 是堂食,type 使用table-order
1160
+ if (businessCode === 'dine_in') {
1161
+ submitType = 'table-order';
1162
+ } else {
1163
+ submitType = 'appointment_booking';
1164
+ }
1159
1165
  } else {
1160
1166
  submitType = 'virtual';
1161
1167
  }