@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.
- package/dist/modules/Order/utils.d.ts +3 -1
- package/dist/modules/Order/utils.js +17 -3
- package/dist/modules/Product/index.d.ts +1 -1
- package/dist/modules/Product/types.d.ts +5 -0
- package/dist/modules/Rules/index.js +30 -19
- package/dist/solution/BaseSales/index.d.ts +1 -0
- package/dist/solution/BaseSales/index.js +298 -209
- package/dist/solution/BaseSales/types.d.ts +3 -0
- package/dist/solution/BaseSales/utils/posDurationPricing.d.ts +21 -0
- package/dist/solution/BaseSales/utils/posDurationPricing.js +174 -0
- package/dist/solution/BaseSales/utils/transformBaseProductToOrderProduct.d.ts +2 -0
- package/dist/solution/BaseSales/utils/transformBaseProductToOrderProduct.js +8 -8
- package/dist/solution/BookingByStep/index.d.ts +2 -2
- package/dist/solution/UnifiedBookingSales/index.js +34 -16
- package/lib/modules/Order/utils.d.ts +3 -1
- package/lib/modules/Order/utils.js +18 -2
- package/lib/modules/Product/index.d.ts +1 -1
- package/lib/modules/Product/types.d.ts +5 -0
- package/lib/modules/Rules/index.js +19 -9
- package/lib/solution/BaseSales/index.d.ts +1 -0
- package/lib/solution/BaseSales/index.js +95 -36
- package/lib/solution/BaseSales/types.d.ts +3 -0
- package/lib/solution/BaseSales/utils/posDurationPricing.d.ts +21 -0
- package/lib/solution/BaseSales/utils/posDurationPricing.js +133 -0
- package/lib/solution/BaseSales/utils/transformBaseProductToOrderProduct.d.ts +2 -0
- package/lib/solution/BaseSales/utils/transformBaseProductToOrderProduct.js +1 -1
- package/lib/solution/BookingByStep/index.d.ts +2 -2
- package/lib/solution/UnifiedBookingSales/index.js +23 -1
- package/package.json +1 -1
- package/dist/apis/picoding.d.ts.map +0 -1
- package/dist/core/index.d.ts.map +0 -1
- package/dist/effects/index.d.ts.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/inventory/index.d.ts.map +0 -1
- package/dist/model/index.d.ts.map +0 -1
- package/dist/model/strategy/adapter/dataVariant/adapter.d.ts.map +0 -1
- package/dist/model/strategy/adapter/dataVariant/evaluator.d.ts.map +0 -1
- package/dist/model/strategy/adapter/dataVariant/examples.d.ts.map +0 -1
- package/dist/model/strategy/adapter/dataVariant/index.d.ts.map +0 -1
- package/dist/model/strategy/adapter/dataVariant/type.d.ts.map +0 -1
- package/dist/model/strategy/adapter/index.d.ts.map +0 -1
- package/dist/model/strategy/adapter/itemRule/adapter.d.ts.map +0 -1
- package/dist/model/strategy/adapter/itemRule/evaluator.d.ts.map +0 -1
- package/dist/model/strategy/adapter/itemRule/examples.d.ts.map +0 -1
- package/dist/model/strategy/adapter/itemRule/index.d.ts.map +0 -1
- package/dist/model/strategy/adapter/itemRule/type.d.ts.map +0 -1
- package/dist/model/strategy/adapter/promotion/adapter.d.ts.map +0 -1
- package/dist/model/strategy/adapter/promotion/evaluator.d.ts.map +0 -1
- package/dist/model/strategy/adapter/promotion/examples.d.ts.map +0 -1
- package/dist/model/strategy/adapter/promotion/index.d.ts.map +0 -1
- package/dist/model/strategy/adapter/promotion/type.d.ts.map +0 -1
- package/dist/model/strategy/adapter/type.d.ts.map +0 -1
- package/dist/model/strategy/adapter/walletPass/evaluator.d.ts.map +0 -1
- package/dist/model/strategy/adapter/walletPass/example.d.ts.map +0 -1
- package/dist/model/strategy/adapter/walletPass/index.d.ts.map +0 -1
- package/dist/model/strategy/adapter/walletPass/locales.d.ts.map +0 -1
- package/dist/model/strategy/adapter/walletPass/type.d.ts.map +0 -1
- package/dist/model/strategy/adapter/walletPass/utils.d.ts.map +0 -1
- package/dist/model/strategy/engine.d.ts.map +0 -1
- package/dist/model/strategy/index.d.ts.map +0 -1
- package/dist/model/strategy/strategy-example.d.ts.map +0 -1
- package/dist/model/strategy/type.d.ts.map +0 -1
- package/dist/modules/Account/index.d.ts.map +0 -1
- package/dist/modules/Account/types.d.ts.map +0 -1
- package/dist/modules/AccountList/index.d.ts.map +0 -1
- package/dist/modules/AccountList/types.d.ts.map +0 -1
- package/dist/modules/AccountList/utils.d.ts.map +0 -1
- package/dist/modules/BaseModule.d.ts.map +0 -1
- package/dist/modules/BookingContext/index.d.ts.map +0 -1
- package/dist/modules/BookingContext/types.d.ts.map +0 -1
- package/dist/modules/BookingContext/utils/buildCacheItemFromOrderLine.d.ts.map +0 -1
- package/dist/modules/BookingContext/utils/buildNormalProductCacheItemFromOrderLine.d.ts.map +0 -1
- package/dist/modules/BookingContext/utils/cacheItemToBookingInput.d.ts.map +0 -1
- package/dist/modules/BookingContext/utils/flexible.d.ts.map +0 -1
- package/dist/modules/BookingContext/utils/formatResourceList.d.ts.map +0 -1
- package/dist/modules/BookingContext/utils/index.d.ts.map +0 -1
- package/dist/modules/BookingContext/utils/noResource.d.ts.map +0 -1
- package/dist/modules/BookingContext/utils/orderLineDisplay.d.ts.map +0 -1
- package/dist/modules/BookingContext/utils/productExtend.d.ts.map +0 -1
- package/dist/modules/BookingContext/utils/resourceErrors.d.ts.map +0 -1
- package/dist/modules/BookingContext/utils/resourceSelection.d.ts.map +0 -1
- package/dist/modules/BookingContext/utils/resources.d.ts.map +0 -1
- package/dist/modules/BookingContext/utils/serviceTimes.d.ts.map +0 -1
- package/dist/modules/BookingContext/utils/timeSlices.d.ts.map +0 -1
- package/dist/modules/BusinessAvailability/index.d.ts.map +0 -1
- package/dist/modules/Cart/index.d.ts.map +0 -1
- package/dist/modules/Cart/types.d.ts.map +0 -1
- package/dist/modules/Cart/utils/cartAccount.d.ts.map +0 -1
- package/dist/modules/Cart/utils/cartDate.d.ts.map +0 -1
- package/dist/modules/Cart/utils/cartDiscount.d.ts.map +0 -1
- package/dist/modules/Cart/utils/cartNote.d.ts.map +0 -1
- package/dist/modules/Cart/utils/cartProduct.d.ts.map +0 -1
- package/dist/modules/Cart/utils/cartRelationForms.d.ts.map +0 -1
- package/dist/modules/Cart/utils/cartResource.d.ts.map +0 -1
- package/dist/modules/Cart/utils/changePrice.d.ts.map +0 -1
- package/dist/modules/Cart/utils/index.d.ts.map +0 -1
- package/dist/modules/Customer/constants.d.ts.map +0 -1
- package/dist/modules/Customer/index.d.ts.map +0 -1
- package/dist/modules/Customer/types.d.ts.map +0 -1
- package/dist/modules/Date/index.d.ts.map +0 -1
- package/dist/modules/Date/types.d.ts.map +0 -1
- package/dist/modules/Date/utils.d.ts.map +0 -1
- package/dist/modules/Discount/availability.d.ts.map +0 -1
- package/dist/modules/Discount/entitlementPass.d.ts.map +0 -1
- package/dist/modules/Discount/index.d.ts.map +0 -1
- package/dist/modules/Discount/types.d.ts.map +0 -1
- package/dist/modules/FulfillmentTiming/index.d.ts.map +0 -1
- package/dist/modules/FulfillmentTiming/types.d.ts.map +0 -1
- package/dist/modules/Guests/index.d.ts.map +0 -1
- package/dist/modules/Guests/types.d.ts.map +0 -1
- package/dist/modules/Holder/index.d.ts.map +0 -1
- package/dist/modules/Holder/types.d.ts.map +0 -1
- package/dist/modules/Holder/utils.d.ts.map +0 -1
- package/dist/modules/OpenData/contactInfo.d.ts.map +0 -1
- package/dist/modules/OpenData/index.d.ts.map +0 -1
- package/dist/modules/OpenData/salesSettings.d.ts.map +0 -1
- package/dist/modules/OpenData/types.d.ts.map +0 -1
- package/dist/modules/OpenData/utils.d.ts.map +0 -1
- package/dist/modules/Order/holderRelations.d.ts.map +0 -1
- package/dist/modules/Order/index.d.ts.map +0 -1
- package/dist/modules/Order/localEftposState.d.ts.map +0 -1
- package/dist/modules/Order/payment-utils.d.ts.map +0 -1
- package/dist/modules/Order/pickupTiming.d.ts.map +0 -1
- package/dist/modules/Order/salesNotes.d.ts.map +0 -1
- package/dist/modules/Order/types.d.ts.map +0 -1
- package/dist/modules/Order/utils/bundleDiscountHydration.d.ts.map +0 -1
- package/dist/modules/Order/utils/discountProductLineIdentity.d.ts.map +0 -1
- package/dist/modules/Order/utils/manualProductDiscount.d.ts.map +0 -1
- package/dist/modules/Order/utils/orderCollectionIdentity.d.ts.map +0 -1
- package/dist/modules/Order/utils/productVoucherGroups.d.ts.map +0 -1
- package/dist/modules/Order/utils/virtualSettlement.d.ts.map +0 -1
- package/dist/modules/Order/utils/weighedProduct.d.ts.map +0 -1
- package/dist/modules/Order/utils.d.ts.map +0 -1
- package/dist/modules/Payment/cash.d.ts.map +0 -1
- package/dist/modules/Payment/cashRecommendationAlgorithm.d.ts.map +0 -1
- package/dist/modules/Payment/eftpos.d.ts.map +0 -1
- package/dist/modules/Payment/index.d.ts.map +0 -1
- package/dist/modules/Payment/mx51.d.ts.map +0 -1
- package/dist/modules/Payment/types.d.ts.map +0 -1
- package/dist/modules/Payment/utils.d.ts.map +0 -1
- package/dist/modules/Payment/walletpass.d.ts.map +0 -1
- package/dist/modules/Product/index.d.ts.map +0 -1
- package/dist/modules/Product/types.d.ts.map +0 -1
- package/dist/modules/Product/utils.d.ts.map +0 -1
- package/dist/modules/ProductList/clientDataVariants.d.ts.map +0 -1
- package/dist/modules/ProductList/index.d.ts.map +0 -1
- package/dist/modules/ProductList/types.d.ts.map +0 -1
- package/dist/modules/Quotation/index.d.ts.map +0 -1
- package/dist/modules/Quotation/types.d.ts.map +0 -1
- package/dist/modules/Resource/index.d.ts.map +0 -1
- package/dist/modules/Resource/types.d.ts.map +0 -1
- package/dist/modules/Resource/utils.d.ts.map +0 -1
- package/dist/modules/ResourcePlanner/index.d.ts.map +0 -1
- package/dist/modules/ResourcePlanner/localClock.d.ts.map +0 -1
- package/dist/modules/ResourcePlanner/planner.d.ts.map +0 -1
- package/dist/modules/ResourcePlanner/types.d.ts.map +0 -1
- package/dist/modules/Rules/index.d.ts.map +0 -1
- package/dist/modules/Rules/promotionSelection.d.ts.map +0 -1
- package/dist/modules/Rules/types.d.ts.map +0 -1
- package/dist/modules/SalesSummary/index.d.ts.map +0 -1
- package/dist/modules/SalesSummary/types.d.ts.map +0 -1
- package/dist/modules/SalesSummary/utils.d.ts.map +0 -1
- package/dist/modules/ScanOrderLogger/index.d.ts.map +0 -1
- package/dist/modules/ScanOrderLogger/providers/feishu.d.ts.map +0 -1
- package/dist/modules/ScanOrderLogger/providers/grafana.d.ts.map +0 -1
- package/dist/modules/ScanOrderLogger/types.d.ts.map +0 -1
- package/dist/modules/Schedule/getDateIsInSchedule.d.ts.map +0 -1
- package/dist/modules/Schedule/index.d.ts.map +0 -1
- package/dist/modules/Schedule/type.d.ts.map +0 -1
- package/dist/modules/Schedule/types.d.ts.map +0 -1
- package/dist/modules/Schedule/utils.d.ts.map +0 -1
- package/dist/modules/Step/index.d.ts.map +0 -1
- package/dist/modules/Step/tyeps.d.ts.map +0 -1
- package/dist/modules/Summary/index.d.ts.map +0 -1
- package/dist/modules/Summary/types.d.ts.map +0 -1
- package/dist/modules/Summary/utils.d.ts.map +0 -1
- package/dist/modules/SurchargeList/index.d.ts.map +0 -1
- package/dist/modules/SurchargeList/types.d.ts.map +0 -1
- package/dist/modules/index.d.ts.map +0 -1
- package/dist/plugins/app.d.ts.map +0 -1
- package/dist/plugins/index.d.ts.map +0 -1
- package/dist/plugins/request.d.ts.map +0 -1
- package/dist/plugins/shopStore.d.ts.map +0 -1
- package/dist/plugins/user.d.ts.map +0 -1
- package/dist/plugins/window.d.ts.map +0 -1
- package/dist/server/index.d.ts.map +0 -1
- package/dist/server/modules/floor-plan/index.d.ts.map +0 -1
- package/dist/server/modules/floor-plan/types.d.ts.map +0 -1
- package/dist/server/modules/form/index.d.ts.map +0 -1
- package/dist/server/modules/form/types.d.ts.map +0 -1
- package/dist/server/modules/index.d.ts.map +0 -1
- package/dist/server/modules/menu/index.d.ts.map +0 -1
- package/dist/server/modules/menu/types.d.ts.map +0 -1
- package/dist/server/modules/order/index.d.ts.map +0 -1
- package/dist/server/modules/order/types.d.ts.map +0 -1
- package/dist/server/modules/order/utils/filterBookings.d.ts.map +0 -1
- package/dist/server/modules/order/utils/filterOrders.d.ts.map +0 -1
- package/dist/server/modules/payment/index.d.ts.map +0 -1
- package/dist/server/modules/payment/types.d.ts.map +0 -1
- package/dist/server/modules/products/index.d.ts.map +0 -1
- package/dist/server/modules/products/replication.d.ts.map +0 -1
- package/dist/server/modules/products/types.d.ts.map +0 -1
- package/dist/server/modules/quotation/index.d.ts.map +0 -1
- package/dist/server/modules/quotation/types.d.ts.map +0 -1
- package/dist/server/modules/resource/index.d.ts.map +0 -1
- package/dist/server/modules/resource/types.d.ts.map +0 -1
- package/dist/server/modules/schedule/index.d.ts.map +0 -1
- package/dist/server/modules/schedule/types.d.ts.map +0 -1
- package/dist/server/modules/schedule/utils.d.ts.map +0 -1
- package/dist/server/types.d.ts.map +0 -1
- package/dist/server/utils/index.d.ts.map +0 -1
- package/dist/server/utils/product.d.ts.map +0 -1
- package/dist/server/utils/schedule.d.ts.map +0 -1
- package/dist/server/utils/small-ticket.d.ts.map +0 -1
- package/dist/server/utils/time.d.ts.map +0 -1
- package/dist/shared/payment/loadPaymentMethods.d.ts.map +0 -1
- package/dist/shared/receipt/customerInvoiceLanguages.d.ts.map +0 -1
- package/dist/shared/receipt/loadCustomerInvoiceLayout.d.ts.map +0 -1
- package/dist/shared/receipt/small-ticket.d.ts.map +0 -1
- package/dist/shared/receipt/templateVisibility.d.ts.map +0 -1
- package/dist/shared/sales/loadSalesOrderSnapshot.d.ts.map +0 -1
- package/dist/solution/BaseSales/fulfillmentItemRules.d.ts.map +0 -1
- package/dist/solution/BaseSales/index.d.ts.map +0 -1
- package/dist/solution/BaseSales/pickupTiming.d.ts.map +0 -1
- package/dist/solution/BaseSales/types.d.ts.map +0 -1
- package/dist/solution/BaseSales/utils/cartPromotion.d.ts.map +0 -1
- package/dist/solution/BaseSales/utils/parseSalesResponse.d.ts.map +0 -1
- package/dist/solution/BaseSales/utils/quotationPrice.d.ts.map +0 -1
- package/dist/solution/BaseSales/utils/transformBaseProductToOrderProduct.d.ts.map +0 -1
- package/dist/solution/BaseSales/utils.d.ts.map +0 -1
- package/dist/solution/BookingByStep/index.d.ts.map +0 -1
- package/dist/solution/BookingByStep/types.d.ts.map +0 -1
- package/dist/solution/BookingByStep/utils/capacity.d.ts.map +0 -1
- package/dist/solution/BookingByStep/utils/products.d.ts.map +0 -1
- package/dist/solution/BookingByStep/utils/resources.d.ts.map +0 -1
- package/dist/solution/BookingByStep/utils/stock.d.ts.map +0 -1
- package/dist/solution/BookingByStep/utils/timeslots.d.ts.map +0 -1
- package/dist/solution/BookingTicket/index.d.ts.map +0 -1
- package/dist/solution/BookingTicket/types.d.ts.map +0 -1
- package/dist/solution/BookingTicket/utils/addProductDecision.d.ts.map +0 -1
- package/dist/solution/BookingTicket/utils/addTimeAvailability.d.ts.map +0 -1
- package/dist/solution/BookingTicket/utils/bookingStatus.d.ts.map +0 -1
- package/dist/solution/BookingTicket/utils/cartView.d.ts.map +0 -1
- package/dist/solution/BookingTicket/utils/exampleData.d.ts.map +0 -1
- package/dist/solution/BookingTicket/utils/orderCustomer.d.ts.map +0 -1
- package/dist/solution/BookingTicket/utils/resolveBestAddTimePlan.d.ts.map +0 -1
- package/dist/solution/BookingTicket/utils/scan/applyGlobalScan.d.ts.map +0 -1
- package/dist/solution/BookingTicket/utils/scan/applyProductVoucherCollectionScan.d.ts.map +0 -1
- package/dist/solution/BookingTicket/utils/scan/cloudSearch.d.ts.map +0 -1
- package/dist/solution/BookingTicket/utils/scan/formatGlobalScan.d.ts.map +0 -1
- package/dist/solution/BookingTicket/utils/scan/handleScan.d.ts.map +0 -1
- package/dist/solution/BookingTicket/utils/scan/index.d.ts.map +0 -1
- package/dist/solution/BookingTicket/utils/scan/scanCache.d.ts.map +0 -1
- package/dist/solution/BookingTicket/utils/scan/scanProductValues.d.ts.map +0 -1
- package/dist/solution/BookingTicket/utils/sessionCatalogStale.d.ts.map +0 -1
- package/dist/solution/BookingTicket/utils/weighingProductSku.d.ts.map +0 -1
- package/dist/solution/BuyTickets/index.d.ts.map +0 -1
- package/dist/solution/BuyTickets/types.d.ts.map +0 -1
- package/dist/solution/Checkout/index.d.ts.map +0 -1
- package/dist/solution/Checkout/types.d.ts.map +0 -1
- package/dist/solution/Checkout/utils/index.d.ts.map +0 -1
- package/dist/solution/OrderInvoicePreview/index.d.ts.map +0 -1
- package/dist/solution/PlaceOrder/index.d.ts.map +0 -1
- package/dist/solution/RegisterAndLogin/config.d.ts.map +0 -1
- package/dist/solution/RegisterAndLogin/index.d.ts.map +0 -1
- package/dist/solution/RegisterAndLogin/types.d.ts.map +0 -1
- package/dist/solution/RegisterAndLogin/utils.d.ts.map +0 -1
- package/dist/solution/Sales/index.d.ts.map +0 -1
- package/dist/solution/Sales/types.d.ts.map +0 -1
- package/dist/solution/ScanOrder/index.d.ts.map +0 -1
- package/dist/solution/ScanOrder/menuAvailability.d.ts.map +0 -1
- package/dist/solution/ScanOrder/types.d.ts.map +0 -1
- package/dist/solution/ScanOrder/utils.d.ts.map +0 -1
- package/dist/solution/ShopDiscount/index.d.ts.map +0 -1
- package/dist/solution/ShopDiscount/types.d.ts.map +0 -1
- package/dist/solution/ShopDiscount/utils.d.ts.map +0 -1
- package/dist/solution/UnifiedBookingSales/businessAvailability.d.ts.map +0 -1
- package/dist/solution/UnifiedBookingSales/index.d.ts.map +0 -1
- package/dist/solution/UnifiedBookingSales/remoteOccupancyCache.d.ts.map +0 -1
- package/dist/solution/UnifiedBookingSales/salesSettings.d.ts.map +0 -1
- package/dist/solution/UnifiedBookingSales/types.d.ts.map +0 -1
- package/dist/solution/VenueBooking/index.d.ts.map +0 -1
- package/dist/solution/VenueBooking/types.d.ts.map +0 -1
- package/dist/solution/VenueBooking/utils/dateSummary.d.ts.map +0 -1
- package/dist/solution/VenueBooking/utils/resource.d.ts.map +0 -1
- package/dist/solution/VenueBooking/utils/slotMerge.d.ts.map +0 -1
- package/dist/solution/VenueBooking/utils/smartPricing.d.ts.map +0 -1
- package/dist/solution/VenueBooking/utils/timeSlot.d.ts.map +0 -1
- package/dist/solution/VenueBooking/utils.d.ts.map +0 -1
- package/dist/solution/index.d.ts.map +0 -1
- package/dist/store/createStore.d.ts.map +0 -1
- package/dist/types/index.d.ts.map +0 -1
- package/dist/utils/os-private-payload.d.ts.map +0 -1
- package/dist/utils/payment-number.d.ts.map +0 -1
- package/dist/utils/platform.d.ts.map +0 -1
- package/dist/utils/task.d.ts.map +0 -1
- 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
|
|
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
|
|
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
|
-
|
|
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(): "
|
|
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$
|
|
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$
|
|
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
|
|
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$
|
|
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$
|
|
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$
|
|
1483
|
+
var _discount$config7;
|
|
1473
1484
|
// 如果策略检查后没有config,说明不可用
|
|
1474
|
-
if (discount.config === undefined || !(discount !== null && discount !== void 0 && (_discount$
|
|
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$
|
|
1497
|
-
var maxUsagePerOrder = (_discount$
|
|
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$
|
|
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$
|
|
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;
|