@pisell/pisellos 0.0.567 → 0.0.569
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/core/index.js +6 -9
- package/dist/model/strategy/adapter/promotion/evaluator.js +3 -2
- package/dist/model/strategy/adapter/walletPass/evaluator.js +0 -2
- package/dist/model/strategy/adapter/walletPass/example.js +3 -26
- package/dist/model/strategy/adapter/walletPass/utils.js +7 -7
- package/dist/model/strategy/strategy-example.js +5 -19
- package/dist/modules/BaseModule.d.ts +2 -2
- package/dist/modules/BaseModule.js +4 -4
- package/dist/modules/BookingContext/index.d.ts +48 -0
- package/dist/modules/BookingContext/index.js +566 -0
- package/dist/modules/BookingContext/types.d.ts +102 -0
- package/dist/modules/BookingContext/types.js +51 -0
- package/dist/modules/BookingContext/utils/buildCacheItemFromOrderLine.d.ts +16 -0
- package/dist/modules/BookingContext/utils/buildCacheItemFromOrderLine.js +302 -0
- package/dist/modules/BookingContext/utils/buildNormalProductCacheItemFromOrderLine.d.ts +8 -0
- package/dist/modules/BookingContext/utils/buildNormalProductCacheItemFromOrderLine.js +149 -0
- package/dist/modules/BookingContext/utils/cacheItemToBookingInput.d.ts +76 -0
- package/dist/modules/BookingContext/utils/cacheItemToBookingInput.js +249 -0
- package/dist/modules/BookingContext/utils/flexible.d.ts +28 -0
- package/dist/modules/BookingContext/utils/flexible.js +56 -0
- package/dist/modules/BookingContext/utils/formatResourceList.d.ts +8 -0
- package/dist/modules/BookingContext/utils/formatResourceList.js +38 -0
- package/dist/modules/BookingContext/utils/index.d.ts +11 -0
- package/dist/modules/BookingContext/utils/index.js +11 -0
- package/dist/modules/BookingContext/utils/noResource.d.ts +13 -0
- package/dist/modules/BookingContext/utils/noResource.js +77 -0
- package/dist/modules/BookingContext/utils/orderLineDisplay.d.ts +1 -0
- package/dist/modules/BookingContext/utils/orderLineDisplay.js +36 -0
- package/dist/modules/BookingContext/utils/productExtend.d.ts +72 -0
- package/dist/modules/BookingContext/utils/productExtend.js +339 -0
- package/dist/modules/BookingContext/utils/resourceErrors.d.ts +41 -0
- package/dist/modules/BookingContext/utils/resourceErrors.js +74 -0
- package/dist/modules/BookingContext/utils/resourceSelection.d.ts +7 -0
- package/dist/modules/BookingContext/utils/resourceSelection.js +24 -0
- package/dist/modules/BookingContext/utils/resources.d.ts +80 -0
- package/dist/modules/BookingContext/utils/resources.js +486 -0
- package/dist/modules/BookingContext/utils/serviceTimes.d.ts +55 -0
- package/dist/modules/BookingContext/utils/serviceTimes.js +151 -0
- package/dist/modules/BookingContext/utils/timeSlices.d.ts +42 -0
- package/dist/modules/BookingContext/utils/timeSlices.js +100 -0
- package/dist/modules/Cart/index.js +0 -3
- package/dist/modules/Cart/utils/cartProduct.js +26 -6
- package/dist/modules/Cart/utils/changePrice.js +27 -20
- package/dist/modules/Customer/index.d.ts +20 -0
- package/dist/modules/Customer/index.js +172 -83
- package/dist/modules/Customer/types.d.ts +2 -0
- package/dist/modules/Date/index.js +1 -5
- package/dist/modules/Discount/index.d.ts +2 -1
- package/dist/modules/Discount/index.js +37 -12
- package/dist/modules/Discount/types.d.ts +1 -0
- package/dist/modules/OpenData/index.d.ts +8 -0
- package/dist/modules/OpenData/index.js +35 -17
- package/dist/modules/Order/index.d.ts +449 -24
- package/dist/modules/Order/index.js +5437 -608
- package/dist/modules/Order/types.d.ts +693 -88
- package/dist/modules/Order/types.js +68 -1
- package/dist/modules/Order/utils/bundleDiscountHydration.d.ts +5 -0
- package/dist/modules/Order/utils/bundleDiscountHydration.js +144 -0
- package/dist/modules/Order/utils/manualProductDiscount.d.ts +106 -0
- package/dist/modules/Order/utils/manualProductDiscount.js +210 -0
- package/dist/modules/Order/utils/orderCollectionIdentity.d.ts +53 -0
- package/dist/modules/Order/utils/orderCollectionIdentity.js +405 -0
- package/dist/modules/Order/utils.d.ts +167 -18
- package/dist/modules/Order/utils.js +960 -165
- package/dist/modules/Payment/index.d.ts +10 -9
- package/dist/modules/Payment/index.js +508 -874
- package/dist/modules/Payment/types.d.ts +40 -16
- package/dist/modules/Payment/utils.d.ts +1 -1
- package/dist/modules/Payment/utils.js +4 -3
- package/dist/modules/Payment/walletpass.js +48 -34
- package/dist/modules/Product/types.d.ts +29 -7
- package/dist/modules/ProductList/index.d.ts +17 -13
- package/dist/modules/ProductList/index.js +184 -74
- package/dist/modules/ProductList/types.d.ts +17 -0
- package/dist/modules/Quotation/index.d.ts +22 -2
- package/dist/modules/Quotation/index.js +108 -42
- package/dist/modules/Quotation/types.d.ts +19 -0
- package/dist/modules/ResourcePlanner/index.d.ts +24 -0
- package/dist/modules/ResourcePlanner/index.js +181 -0
- package/dist/modules/ResourcePlanner/planner.d.ts +14 -0
- package/dist/modules/ResourcePlanner/planner.js +1069 -0
- package/dist/modules/ResourcePlanner/types.d.ts +227 -0
- package/dist/modules/ResourcePlanner/types.js +1 -0
- package/dist/modules/Rules/index.d.ts +8 -10
- package/dist/modules/Rules/index.js +219 -114
- package/dist/modules/Rules/types.d.ts +14 -3
- package/dist/modules/SalesSummary/index.d.ts +23 -26
- package/dist/modules/SalesSummary/index.js +152 -46
- package/dist/modules/SalesSummary/types.d.ts +9 -1
- package/dist/modules/SalesSummary/utils.d.ts +3 -22
- package/dist/modules/SalesSummary/utils.js +803 -163
- package/dist/modules/Schedule/getDateIsInSchedule.js +14 -7
- package/dist/modules/Schedule/index.d.ts +18 -5
- package/dist/modules/Schedule/index.js +78 -24
- package/dist/modules/Schedule/types.d.ts +2 -0
- package/dist/modules/Schedule/utils.js +0 -1
- package/dist/modules/Step/index.js +0 -1
- package/dist/modules/Summary/index.js +4 -3
- package/dist/modules/SurchargeList/index.d.ts +18 -0
- package/dist/modules/SurchargeList/index.js +185 -0
- package/dist/modules/SurchargeList/types.d.ts +15 -0
- package/dist/modules/SurchargeList/types.js +1 -0
- package/dist/modules/index.d.ts +3 -0
- package/dist/modules/index.js +4 -1
- package/dist/plugins/app.d.ts +2 -0
- package/dist/plugins/request.d.ts +1 -0
- package/dist/plugins/request.js +1 -4
- package/dist/plugins/window.js +2 -6
- package/dist/server/index.d.ts +462 -8
- package/dist/server/index.js +6137 -714
- package/dist/server/modules/floor-plan/index.d.ts +39 -0
- package/dist/server/modules/floor-plan/index.js +595 -0
- package/dist/server/modules/floor-plan/types.d.ts +43 -0
- package/dist/server/modules/floor-plan/types.js +13 -0
- package/dist/server/modules/index.d.ts +7 -2
- package/dist/server/modules/index.js +6 -0
- package/dist/server/modules/menu/index.js +32 -41
- package/dist/server/modules/order/index.d.ts +207 -14
- package/dist/server/modules/order/index.js +2326 -379
- package/dist/server/modules/order/types.d.ts +76 -5
- package/dist/server/modules/order/types.js +14 -1
- package/dist/server/modules/order/utils/filterBookings.d.ts +7 -1
- package/dist/server/modules/order/utils/filterBookings.js +118 -11
- package/dist/server/modules/order/utils/filterOrders.js +242 -14
- package/dist/server/modules/payment/index.d.ts +28 -0
- package/dist/server/modules/payment/index.js +305 -0
- package/dist/server/modules/payment/types.d.ts +9 -0
- package/dist/server/modules/payment/types.js +1 -0
- package/dist/server/modules/products/index.d.ts +105 -14
- package/dist/server/modules/products/index.js +1397 -540
- package/dist/server/modules/products/types.d.ts +34 -1
- package/dist/server/modules/products/types.js +4 -0
- package/dist/server/modules/quotation/index.d.ts +39 -0
- package/dist/server/modules/quotation/index.js +289 -86
- package/dist/server/modules/resource/index.d.ts +2 -3
- package/dist/server/modules/resource/index.js +105 -84
- package/dist/server/modules/schedule/index.d.ts +6 -4
- package/dist/server/modules/schedule/index.js +137 -114
- package/dist/server/test.json +713 -0
- package/dist/server/types.d.ts +2 -0
- package/dist/server/utils/product.js +2 -3
- package/dist/server/utils/small-ticket.d.ts +71 -0
- package/dist/server/utils/small-ticket.js +963 -0
- package/dist/solution/BaseSales/index.d.ts +378 -0
- package/dist/solution/BaseSales/index.js +4006 -0
- package/dist/solution/BaseSales/types.d.ts +394 -0
- package/dist/solution/BaseSales/types.js +40 -0
- package/dist/solution/BaseSales/utils/cartPromotion.d.ts +287 -0
- package/dist/solution/BaseSales/utils/cartPromotion.js +1450 -0
- package/dist/solution/BaseSales/utils/parseSalesResponse.d.ts +144 -0
- package/dist/solution/BaseSales/utils/parseSalesResponse.js +157 -0
- package/dist/solution/BaseSales/utils/quotationPrice.d.ts +18 -0
- package/dist/solution/BaseSales/utils/quotationPrice.js +250 -0
- package/dist/solution/BaseSales/utils/transformBaseProductToOrderProduct.d.ts +63 -0
- package/dist/solution/BaseSales/utils/transformBaseProductToOrderProduct.js +218 -0
- package/dist/solution/BaseSales/utils.d.ts +40 -0
- package/dist/solution/BaseSales/utils.js +263 -0
- package/dist/solution/BookingByStep/index.js +7 -59
- package/dist/solution/BookingByStep/utils/capacity.js +1 -11
- package/dist/solution/BookingByStep/utils/resources.js +1 -3
- package/dist/solution/BookingByStep/utils/timeslots.js +2 -43
- package/dist/solution/BookingTicket/index.d.ts +393 -24
- package/dist/solution/BookingTicket/index.js +2506 -445
- package/dist/solution/BookingTicket/types.d.ts +191 -6
- package/dist/solution/BookingTicket/types.js +83 -10
- package/dist/solution/BookingTicket/utils/addProductDecision.d.ts +117 -0
- package/dist/solution/BookingTicket/utils/addProductDecision.js +346 -0
- package/dist/solution/BookingTicket/utils/addTimeAvailability.d.ts +35 -0
- package/dist/solution/BookingTicket/utils/addTimeAvailability.js +95 -0
- package/dist/solution/BookingTicket/utils/bookingStatus.d.ts +77 -0
- package/dist/solution/BookingTicket/utils/bookingStatus.js +136 -0
- package/dist/solution/BookingTicket/utils/cartView.d.ts +29 -0
- package/dist/solution/BookingTicket/utils/cartView.js +209 -0
- package/dist/solution/BookingTicket/utils/exampleData.d.ts +123 -0
- package/dist/solution/BookingTicket/utils/exampleData.js +183 -0
- package/dist/solution/BookingTicket/utils/orderCustomer.d.ts +4 -0
- package/dist/solution/BookingTicket/utils/orderCustomer.js +31 -0
- package/dist/solution/BookingTicket/utils/resolveBestAddTimePlan.d.ts +185 -0
- package/dist/solution/BookingTicket/utils/resolveBestAddTimePlan.js +438 -0
- package/dist/solution/BookingTicket/utils/scan/applyGlobalScan.d.ts +36 -0
- package/dist/solution/BookingTicket/utils/scan/applyGlobalScan.js +400 -0
- package/dist/solution/BookingTicket/utils/scan/cloudSearch.d.ts +4 -0
- package/dist/solution/BookingTicket/utils/scan/cloudSearch.js +41 -1
- package/dist/solution/BookingTicket/utils/scan/formatGlobalScan.d.ts +32 -0
- package/dist/solution/BookingTicket/utils/scan/formatGlobalScan.js +56 -0
- package/dist/solution/BookingTicket/utils/scan/handleScan.d.ts +3 -1
- package/dist/solution/BookingTicket/utils/scan/handleScan.js +36 -34
- package/dist/solution/BookingTicket/utils/scan/index.d.ts +5 -0
- package/dist/solution/BookingTicket/utils/scan/index.js +26 -18
- package/dist/solution/BookingTicket/utils/scan/scanProductValues.d.ts +21 -0
- package/dist/solution/BookingTicket/utils/scan/scanProductValues.js +150 -0
- package/dist/solution/BookingTicket/utils/sessionCatalogStale.d.ts +23 -0
- package/dist/solution/BookingTicket/utils/sessionCatalogStale.js +78 -0
- package/dist/solution/BuyTickets/index.js +9 -12
- package/dist/solution/Checkout/index.d.ts +1 -0
- package/dist/solution/Checkout/index.js +199 -277
- package/dist/solution/Checkout/utils/index.js +8 -20
- package/dist/solution/RegisterAndLogin/config.js +2 -10
- package/dist/solution/RegisterAndLogin/index.js +30 -76
- package/dist/solution/Sales/index.d.ts +50 -5
- package/dist/solution/Sales/index.js +484 -92
- package/dist/solution/Sales/types.d.ts +26 -2
- package/dist/solution/ScanOrder/index.d.ts +27 -21
- package/dist/solution/ScanOrder/index.js +509 -454
- package/dist/solution/ScanOrder/types.d.ts +33 -11
- package/dist/solution/ScanOrder/types.js +4 -5
- package/dist/solution/ScanOrder/utils.d.ts +4 -1
- package/dist/solution/ScanOrder/utils.js +109 -34
- package/dist/solution/ShopDiscount/index.js +6 -11
- package/dist/solution/UnifiedBookingSales/index.d.ts +183 -0
- package/dist/solution/UnifiedBookingSales/index.js +1871 -0
- package/dist/solution/UnifiedBookingSales/types.d.ts +143 -0
- package/dist/solution/UnifiedBookingSales/types.js +11 -0
- package/dist/solution/VenueBooking/index.d.ts +34 -20
- package/dist/solution/VenueBooking/index.js +630 -505
- package/dist/solution/VenueBooking/sales-section-4-annotated.json +0 -2
- package/dist/solution/VenueBooking/utils/slotMerge.d.ts +6 -0
- package/dist/solution/VenueBooking/utils/slotMerge.js +9 -3
- package/dist/solution/index.d.ts +2 -0
- package/dist/solution/index.js +3 -1
- package/dist/types/index.d.ts +11 -1
- package/dist/utils/task.js +15 -18
- package/dist/utils/watch.js +0 -1
- package/lib/apis/picoding.js +2 -0
- package/lib/core/index.js +130 -131
- package/lib/effects/index.js +46 -57
- package/lib/index.js +92 -53
- package/lib/model/index.js +14 -21
- package/lib/model/strategy/adapter/dataVariant/adapter.js +38 -50
- package/lib/model/strategy/adapter/dataVariant/evaluator.js +162 -236
- package/lib/model/strategy/adapter/dataVariant/examples.js +229 -237
- package/lib/model/strategy/adapter/dataVariant/index.js +39 -34
- package/lib/model/strategy/adapter/dataVariant/type.js +57 -28
- package/lib/model/strategy/adapter/index.js +100 -64
- package/lib/model/strategy/adapter/itemRule/adapter.js +156 -144
- package/lib/model/strategy/adapter/itemRule/evaluator.js +36 -48
- package/lib/model/strategy/adapter/itemRule/examples.js +295 -225
- package/lib/model/strategy/adapter/itemRule/index.js +83 -57
- package/lib/model/strategy/adapter/itemRule/type.js +97 -36
- package/lib/model/strategy/adapter/promotion/adapter.js +84 -63
- package/lib/model/strategy/adapter/promotion/evaluator.js +383 -232
- package/lib/model/strategy/adapter/promotion/examples.js +139 -159
- package/lib/model/strategy/adapter/promotion/index.js +1 -49
- package/lib/model/strategy/adapter/promotion/type.js +199 -35
- package/lib/model/strategy/adapter/type.js +4 -16
- package/lib/model/strategy/adapter/walletPass/evaluator.js +180 -152
- package/lib/model/strategy/adapter/walletPass/example.js +217 -190
- package/lib/model/strategy/adapter/walletPass/index.js +75 -51
- package/lib/model/strategy/adapter/walletPass/locales.js +36 -58
- package/lib/model/strategy/adapter/walletPass/type.js +4 -16
- package/lib/model/strategy/adapter/walletPass/utils.js +654 -402
- package/lib/model/strategy/engine.js +270 -168
- package/lib/model/strategy/index.js +49 -34
- package/lib/model/strategy/strategy-example.js +243 -239
- package/lib/model/strategy/type.js +100 -40
- package/lib/modules/Account/index.js +39 -53
- package/lib/modules/Account/types.js +20 -33
- package/lib/modules/AccountList/index.js +116 -154
- package/lib/modules/AccountList/types.js +30 -31
- package/lib/modules/AccountList/utils.js +18 -30
- package/lib/modules/BaseModule.d.ts +2 -2
- package/lib/modules/BaseModule.js +26 -49
- package/lib/modules/BookingContext/index.d.ts +48 -0
- package/lib/modules/BookingContext/index.js +390 -0
- package/lib/modules/BookingContext/types.d.ts +102 -0
- package/lib/modules/BookingContext/types.js +48 -0
- package/lib/modules/BookingContext/utils/buildCacheItemFromOrderLine.d.ts +16 -0
- package/lib/modules/BookingContext/utils/buildCacheItemFromOrderLine.js +286 -0
- package/lib/modules/BookingContext/utils/buildNormalProductCacheItemFromOrderLine.d.ts +8 -0
- package/lib/modules/BookingContext/utils/buildNormalProductCacheItemFromOrderLine.js +148 -0
- package/lib/modules/BookingContext/utils/cacheItemToBookingInput.d.ts +76 -0
- package/lib/modules/BookingContext/utils/cacheItemToBookingInput.js +242 -0
- package/lib/modules/BookingContext/utils/flexible.d.ts +28 -0
- package/lib/modules/BookingContext/utils/flexible.js +63 -0
- package/lib/modules/BookingContext/utils/formatResourceList.d.ts +8 -0
- package/lib/modules/BookingContext/utils/formatResourceList.js +35 -0
- package/lib/modules/BookingContext/utils/index.d.ts +11 -0
- package/lib/modules/BookingContext/utils/index.js +126 -0
- package/lib/modules/BookingContext/utils/noResource.d.ts +13 -0
- package/lib/modules/BookingContext/utils/noResource.js +78 -0
- package/lib/modules/BookingContext/utils/orderLineDisplay.d.ts +1 -0
- package/lib/modules/BookingContext/utils/orderLineDisplay.js +29 -0
- package/lib/modules/BookingContext/utils/productExtend.d.ts +72 -0
- package/lib/modules/BookingContext/utils/productExtend.js +330 -0
- package/lib/modules/BookingContext/utils/resourceErrors.d.ts +41 -0
- package/lib/modules/BookingContext/utils/resourceErrors.js +80 -0
- package/lib/modules/BookingContext/utils/resourceSelection.d.ts +7 -0
- package/lib/modules/BookingContext/utils/resourceSelection.js +24 -0
- package/lib/modules/BookingContext/utils/resources.d.ts +80 -0
- package/lib/modules/BookingContext/utils/resources.js +419 -0
- package/lib/modules/BookingContext/utils/serviceTimes.d.ts +55 -0
- package/lib/modules/BookingContext/utils/serviceTimes.js +161 -0
- package/lib/modules/BookingContext/utils/timeSlices.d.ts +42 -0
- package/lib/modules/BookingContext/utils/timeSlices.js +114 -0
- package/lib/modules/Cart/index.js +170 -124
- package/lib/modules/Cart/types.js +46 -51
- package/lib/modules/Cart/utils/cartAccount.js +40 -39
- package/lib/modules/Cart/utils/cartDate.js +56 -61
- package/lib/modules/Cart/utils/cartDiscount.js +28 -33
- package/lib/modules/Cart/utils/cartNote.js +27 -32
- package/lib/modules/Cart/utils/cartProduct.js +331 -244
- package/lib/modules/Cart/utils/cartRelationForms.js +29 -35
- package/lib/modules/Cart/utils/cartResource.js +72 -78
- package/lib/modules/Cart/utils/changePrice.js +37 -67
- package/lib/modules/Cart/utils/index.js +106 -48
- package/lib/modules/Customer/constants.js +13 -34
- package/lib/modules/Customer/index.d.ts +20 -0
- package/lib/modules/Customer/index.js +270 -154
- package/lib/modules/Customer/types.d.ts +2 -0
- package/lib/modules/Customer/types.js +38 -35
- package/lib/modules/Date/index.js +116 -115
- package/lib/modules/Date/types.js +16 -28
- package/lib/modules/Date/utils.js +174 -123
- package/lib/modules/Discount/index.d.ts +2 -1
- package/lib/modules/Discount/index.js +133 -113
- package/lib/modules/Discount/types.d.ts +1 -0
- package/lib/modules/Discount/types.js +9 -31
- package/lib/modules/Guests/index.js +30 -56
- package/lib/modules/Guests/types.js +23 -33
- package/lib/modules/Holder/index.js +209 -189
- package/lib/modules/Holder/types.js +4 -16
- package/lib/modules/Holder/utils.js +20 -49
- package/lib/modules/OpenData/index.d.ts +8 -0
- package/lib/modules/OpenData/index.js +81 -74
- package/lib/modules/OpenData/types.js +4 -16
- package/lib/modules/OpenData/utils.js +44 -78
- package/lib/modules/Order/index.d.ts +449 -24
- package/lib/modules/Order/index.js +3834 -489
- package/lib/modules/Order/types.d.ts +693 -88
- package/lib/modules/Order/types.js +78 -33
- package/lib/modules/Order/utils/bundleDiscountHydration.d.ts +5 -0
- package/lib/modules/Order/utils/bundleDiscountHydration.js +106 -0
- package/lib/modules/Order/utils/manualProductDiscount.d.ts +106 -0
- package/lib/modules/Order/utils/manualProductDiscount.js +207 -0
- package/lib/modules/Order/utils/orderCollectionIdentity.d.ts +53 -0
- package/lib/modules/Order/utils/orderCollectionIdentity.js +353 -0
- package/lib/modules/Order/utils.d.ts +167 -18
- package/lib/modules/Order/utils.js +1247 -345
- package/lib/modules/Payment/cash.js +20 -33
- package/lib/modules/Payment/cashRecommendationAlgorithm.js +145 -76
- package/lib/modules/Payment/eftpos.js +16 -30
- package/lib/modules/Payment/index.d.ts +10 -9
- package/lib/modules/Payment/index.js +542 -502
- package/lib/modules/Payment/mx51.js +1 -0
- package/lib/modules/Payment/types.d.ts +40 -16
- package/lib/modules/Payment/types.js +216 -107
- package/lib/modules/Payment/utils.d.ts +1 -1
- package/lib/modules/Payment/utils.js +53 -49
- package/lib/modules/Payment/walletpass.js +231 -203
- package/lib/modules/Product/index.js +51 -46
- package/lib/modules/Product/types.d.ts +29 -7
- package/lib/modules/Product/types.js +4 -16
- package/lib/modules/Product/utils.js +32 -33
- package/lib/modules/ProductList/index.d.ts +17 -13
- package/lib/modules/ProductList/index.js +160 -118
- package/lib/modules/ProductList/types.d.ts +17 -0
- package/lib/modules/ProductList/types.js +9 -31
- package/lib/modules/Quotation/index.d.ts +22 -2
- package/lib/modules/Quotation/index.js +123 -89
- package/lib/modules/Quotation/types.d.ts +19 -0
- package/lib/modules/Quotation/types.js +4 -16
- package/lib/modules/Resource/index.js +27 -59
- package/lib/modules/Resource/types.js +22 -32
- package/lib/modules/Resource/utils.js +30 -38
- package/lib/modules/ResourcePlanner/index.d.ts +24 -0
- package/lib/modules/ResourcePlanner/index.js +147 -0
- package/lib/modules/ResourcePlanner/planner.d.ts +14 -0
- package/lib/modules/ResourcePlanner/planner.js +895 -0
- package/lib/modules/ResourcePlanner/types.d.ts +227 -0
- package/lib/modules/ResourcePlanner/types.js +5 -0
- package/lib/modules/Rules/index.d.ts +8 -10
- package/lib/modules/Rules/index.js +1286 -894
- package/lib/modules/Rules/types.d.ts +14 -3
- package/lib/modules/Rules/types.js +17 -40
- package/lib/modules/SalesSummary/index.d.ts +23 -26
- package/lib/modules/SalesSummary/index.js +130 -71
- package/lib/modules/SalesSummary/types.d.ts +9 -1
- package/lib/modules/SalesSummary/types.js +4 -16
- package/lib/modules/SalesSummary/utils.d.ts +3 -22
- package/lib/modules/SalesSummary/utils.js +738 -250
- package/lib/modules/ScanOrderLogger/index.js +59 -79
- package/lib/modules/ScanOrderLogger/providers/feishu.js +54 -78
- package/lib/modules/ScanOrderLogger/providers/grafana.js +13 -36
- package/lib/modules/ScanOrderLogger/types.js +4 -16
- package/lib/modules/Schedule/getDateIsInSchedule.js +345 -171
- package/lib/modules/Schedule/index.d.ts +18 -5
- package/lib/modules/Schedule/index.js +139 -114
- package/lib/modules/Schedule/type.js +4 -16
- package/lib/modules/Schedule/types.d.ts +2 -0
- package/lib/modules/Schedule/types.js +4 -16
- package/lib/modules/Schedule/utils.js +433 -291
- package/lib/modules/Step/index.js +40 -52
- package/lib/modules/Step/tyeps.js +4 -16
- package/lib/modules/Summary/index.js +66 -70
- package/lib/modules/Summary/types.js +4 -16
- package/lib/modules/Summary/utils.js +782 -429
- package/lib/modules/SurchargeList/index.d.ts +18 -0
- package/lib/modules/SurchargeList/index.js +95 -0
- package/lib/modules/SurchargeList/types.d.ts +15 -0
- package/lib/modules/SurchargeList/types.js +5 -0
- package/lib/modules/index.d.ts +3 -0
- package/lib/modules/index.js +245 -57
- package/lib/plugins/app.d.ts +2 -0
- package/lib/plugins/app.js +4 -16
- package/lib/plugins/index.js +36 -25
- package/lib/plugins/request.d.ts +1 -0
- package/lib/plugins/request.js +137 -126
- package/lib/plugins/shopStore.js +4 -16
- package/lib/plugins/user.js +4 -16
- package/lib/plugins/window.js +171 -179
- package/lib/server/index.d.ts +462 -8
- package/lib/server/index.js +4668 -713
- package/lib/server/modules/floor-plan/index.d.ts +39 -0
- package/lib/server/modules/floor-plan/index.js +306 -0
- package/lib/server/modules/floor-plan/types.d.ts +43 -0
- package/lib/server/modules/floor-plan/types.js +19 -0
- package/lib/server/modules/index.d.ts +7 -2
- package/lib/server/modules/index.js +106 -59
- package/lib/server/modules/menu/index.js +146 -122
- package/lib/server/modules/menu/types.js +18 -31
- package/lib/server/modules/order/index.d.ts +207 -14
- package/lib/server/modules/order/index.js +1463 -316
- package/lib/server/modules/order/types.d.ts +76 -5
- package/lib/server/modules/order/types.js +117 -32
- package/lib/server/modules/order/utils/filterBookings.d.ts +7 -1
- package/lib/server/modules/order/utils/filterBookings.js +288 -146
- package/lib/server/modules/order/utils/filterOrders.js +318 -64
- package/lib/server/modules/payment/index.d.ts +28 -0
- package/lib/server/modules/payment/index.js +168 -0
- package/lib/server/modules/payment/types.d.ts +9 -0
- package/lib/server/modules/payment/types.js +5 -0
- package/lib/server/modules/products/index.d.ts +105 -14
- package/lib/server/modules/products/index.js +969 -383
- package/lib/server/modules/products/types.d.ts +34 -1
- package/lib/server/modules/products/types.js +44 -34
- package/lib/server/modules/quotation/index.d.ts +39 -0
- package/lib/server/modules/quotation/index.js +220 -77
- package/lib/server/modules/quotation/types.js +21 -31
- package/lib/server/modules/resource/index.d.ts +2 -3
- package/lib/server/modules/resource/index.js +269 -214
- package/lib/server/modules/resource/types.js +42 -33
- package/lib/server/modules/schedule/index.d.ts +6 -4
- package/lib/server/modules/schedule/index.js +158 -132
- package/lib/server/modules/schedule/types.js +14 -21
- package/lib/server/modules/schedule/utils.js +334 -163
- package/lib/server/test.json +713 -0
- package/lib/server/types.d.ts +2 -0
- package/lib/server/types.js +4 -16
- package/lib/server/utils/index.js +25 -23
- package/lib/server/utils/product.js +197 -140
- package/lib/server/utils/schedule.js +34 -41
- package/lib/server/utils/small-ticket.d.ts +71 -0
- package/lib/server/utils/small-ticket.js +926 -0
- package/lib/server/utils/time.js +40 -49
- package/lib/solution/BaseSales/index.d.ts +378 -0
- package/lib/solution/BaseSales/index.js +2367 -0
- package/lib/solution/BaseSales/types.d.ts +394 -0
- package/lib/solution/BaseSales/types.js +47 -0
- package/lib/solution/BaseSales/utils/cartPromotion.d.ts +287 -0
- package/lib/solution/BaseSales/utils/cartPromotion.js +1155 -0
- package/lib/solution/BaseSales/utils/parseSalesResponse.d.ts +144 -0
- package/lib/solution/BaseSales/utils/parseSalesResponse.js +140 -0
- package/lib/solution/BaseSales/utils/quotationPrice.d.ts +18 -0
- package/lib/solution/BaseSales/utils/quotationPrice.js +231 -0
- package/lib/solution/BaseSales/utils/transformBaseProductToOrderProduct.d.ts +63 -0
- package/lib/solution/BaseSales/utils/transformBaseProductToOrderProduct.js +215 -0
- package/lib/solution/BaseSales/utils.d.ts +40 -0
- package/lib/solution/BaseSales/utils.js +259 -0
- package/lib/solution/BookingByStep/index.js +1530 -1343
- package/lib/solution/BookingByStep/types.js +40 -99
- package/lib/solution/BookingByStep/utils/capacity.js +192 -160
- package/lib/solution/BookingByStep/utils/products.js +42 -52
- package/lib/solution/BookingByStep/utils/resources.js +527 -330
- package/lib/solution/BookingByStep/utils/stock.js +65 -44
- package/lib/solution/BookingByStep/utils/timeslots.js +129 -131
- package/lib/solution/BookingTicket/index.d.ts +393 -24
- package/lib/solution/BookingTicket/index.js +1459 -160
- package/lib/solution/BookingTicket/types.d.ts +191 -6
- package/lib/solution/BookingTicket/types.js +101 -66
- package/lib/solution/BookingTicket/utils/addProductDecision.d.ts +117 -0
- package/lib/solution/BookingTicket/utils/addProductDecision.js +353 -0
- package/lib/solution/BookingTicket/utils/addTimeAvailability.d.ts +35 -0
- package/lib/solution/BookingTicket/utils/addTimeAvailability.js +94 -0
- package/lib/solution/BookingTicket/utils/bookingStatus.d.ts +77 -0
- package/lib/solution/BookingTicket/utils/bookingStatus.js +136 -0
- package/lib/solution/BookingTicket/utils/cartView.d.ts +29 -0
- package/lib/solution/BookingTicket/utils/cartView.js +200 -0
- package/lib/solution/BookingTicket/utils/exampleData.d.ts +123 -0
- package/lib/solution/BookingTicket/utils/exampleData.js +185 -0
- package/lib/solution/BookingTicket/utils/orderCustomer.d.ts +4 -0
- package/lib/solution/BookingTicket/utils/orderCustomer.js +35 -0
- package/lib/solution/BookingTicket/utils/resolveBestAddTimePlan.d.ts +185 -0
- package/lib/solution/BookingTicket/utils/resolveBestAddTimePlan.js +387 -0
- package/lib/solution/BookingTicket/utils/scan/applyGlobalScan.d.ts +36 -0
- package/lib/solution/BookingTicket/utils/scan/applyGlobalScan.js +220 -0
- package/lib/solution/BookingTicket/utils/scan/cloudSearch.d.ts +4 -0
- package/lib/solution/BookingTicket/utils/scan/cloudSearch.js +85 -80
- package/lib/solution/BookingTicket/utils/scan/formatGlobalScan.d.ts +32 -0
- package/lib/solution/BookingTicket/utils/scan/formatGlobalScan.js +64 -0
- package/lib/solution/BookingTicket/utils/scan/handleScan.d.ts +3 -1
- package/lib/solution/BookingTicket/utils/scan/handleScan.js +84 -80
- package/lib/solution/BookingTicket/utils/scan/index.d.ts +5 -0
- package/lib/solution/BookingTicket/utils/scan/index.js +103 -95
- package/lib/solution/BookingTicket/utils/scan/scanCache.js +90 -43
- package/lib/solution/BookingTicket/utils/scan/scanProductValues.d.ts +21 -0
- package/lib/solution/BookingTicket/utils/scan/scanProductValues.js +115 -0
- package/lib/solution/BookingTicket/utils/sessionCatalogStale.d.ts +23 -0
- package/lib/solution/BookingTicket/utils/sessionCatalogStale.js +83 -0
- package/lib/solution/BuyTickets/index.js +67 -70
- package/lib/solution/BuyTickets/types.js +22 -38
- package/lib/solution/Checkout/index.d.ts +1 -0
- package/lib/solution/Checkout/index.js +1461 -1169
- package/lib/solution/Checkout/types.js +91 -61
- package/lib/solution/Checkout/utils/index.js +228 -159
- package/lib/solution/PlaceOrder/index.js +55 -0
- package/lib/solution/RegisterAndLogin/config.js +495 -470
- package/lib/solution/RegisterAndLogin/index.js +633 -630
- package/lib/solution/RegisterAndLogin/types.js +189 -76
- package/lib/solution/RegisterAndLogin/utils.js +183 -125
- package/lib/solution/Sales/index.d.ts +50 -5
- package/lib/solution/Sales/index.js +495 -220
- package/lib/solution/Sales/types.d.ts +26 -2
- package/lib/solution/Sales/types.js +27 -33
- package/lib/solution/ScanOrder/index.d.ts +27 -21
- package/lib/solution/ScanOrder/index.js +908 -904
- package/lib/solution/ScanOrder/types.d.ts +33 -11
- package/lib/solution/ScanOrder/types.js +33 -34
- package/lib/solution/ScanOrder/utils.d.ts +4 -1
- package/lib/solution/ScanOrder/utils.js +457 -344
- package/lib/solution/ShopDiscount/index.js +230 -236
- package/lib/solution/ShopDiscount/types.js +15 -37
- package/lib/solution/ShopDiscount/utils.js +309 -172
- package/lib/solution/UnifiedBookingSales/index.d.ts +183 -0
- package/lib/solution/UnifiedBookingSales/index.js +1050 -0
- package/lib/solution/UnifiedBookingSales/types.d.ts +143 -0
- package/lib/solution/UnifiedBookingSales/types.js +14 -0
- package/lib/solution/VenueBooking/index.d.ts +34 -20
- package/lib/solution/VenueBooking/index.js +982 -950
- package/lib/solution/VenueBooking/sales-section-4-annotated.json +0 -2
- package/lib/solution/VenueBooking/types.js +20 -40
- package/lib/solution/VenueBooking/utils/dateSummary.js +22 -54
- package/lib/solution/VenueBooking/utils/resource.js +31 -54
- package/lib/solution/VenueBooking/utils/slotMerge.d.ts +6 -0
- package/lib/solution/VenueBooking/utils/slotMerge.js +96 -108
- package/lib/solution/VenueBooking/utils/smartPricing.js +112 -100
- package/lib/solution/VenueBooking/utils/timeSlot.js +133 -132
- package/lib/solution/VenueBooking/utils.js +130 -67
- package/lib/solution/index.d.ts +2 -0
- package/lib/solution/index.js +124 -37
- package/lib/store/createStore.js +32 -29
- package/lib/types/index.d.ts +11 -1
- package/lib/types/index.js +4 -16
- package/lib/utils/task.js +36 -36
- package/lib/utils/watch.js +81 -47
- package/package.json +2 -1
- package/dist/solution/Checkout/appointmentDemo.json +0 -1
- package/lib/solution/Checkout/appointmentDemo.json +0 -1
|
@@ -31,15 +31,20 @@ export interface ScanOrderOrderProductIdentity {
|
|
|
31
31
|
product_id: number | null;
|
|
32
32
|
product_variant_id: number;
|
|
33
33
|
identity_key?: string;
|
|
34
|
+
unique_identification_number?: string;
|
|
34
35
|
/** 参与合并/匹配;与 remove 通配语义见 isSkuOnlyDeleteIdentity */
|
|
35
|
-
|
|
36
|
+
product_sku?: ScanOrderProductSku;
|
|
36
37
|
product_bundle?: any[];
|
|
37
38
|
shop_id?: number | string;
|
|
38
39
|
}
|
|
40
|
+
export interface ScanOrderProductSku {
|
|
41
|
+
option: any[];
|
|
42
|
+
[key: string]: any;
|
|
43
|
+
}
|
|
39
44
|
export interface ScanOrderOrderProduct extends ScanOrderOrderProductIdentity {
|
|
40
45
|
order_detail_id: number | null;
|
|
41
46
|
num: number;
|
|
42
|
-
|
|
47
|
+
product_sku: ScanOrderProductSku;
|
|
43
48
|
/**
|
|
44
49
|
* 券后 **行 composite 单价** = `metadata.main_product_selling_price`
|
|
45
50
|
* + Σ((bundle.bundle_selling_price ?? bundle.price) × (bundle.num ?? 1))
|
|
@@ -61,6 +66,8 @@ export interface ScanOrderOrderProduct extends ScanOrderOrderProductIdentity {
|
|
|
61
66
|
is_charge_tax: number;
|
|
62
67
|
discount_list: any[];
|
|
63
68
|
product_bundle: any[];
|
|
69
|
+
/** 关联 booking.metadata.unique_identification_number */
|
|
70
|
+
booking_uid?: string;
|
|
64
71
|
/**
|
|
65
72
|
* 行级扩展 metadata。价格相关的权威字段:
|
|
66
73
|
*
|
|
@@ -76,19 +83,19 @@ export interface ScanOrderOrderProduct extends ScanOrderOrderProductIdentity {
|
|
|
76
83
|
metadata: Record<string, any>;
|
|
77
84
|
/** 商品行备注(如顾客对单品的特殊要求) */
|
|
78
85
|
note?: string;
|
|
86
|
+
/** @deprecated UI/SDK 运行态数据迁移到 tempOrder._extend */
|
|
79
87
|
_origin?: Record<string, any>;
|
|
80
88
|
}
|
|
81
89
|
/**
|
|
82
90
|
* 出站 payload 版本的商品行。
|
|
83
91
|
*
|
|
84
92
|
* 与 tempOrder 内部 `ScanOrderOrderProduct` 的字段差异:
|
|
85
|
-
* - `
|
|
86
|
-
*
|
|
87
|
-
* (后端 checkout 协议;丢弃 `price` 等运行时辅助字段)。
|
|
93
|
+
* - `product_sku.option[*]`:内部直接维护统一 Sales 协议字段;
|
|
94
|
+
* 提交时仅规范 `add_price`,保留传入/恢复得到的展示字段。
|
|
88
95
|
* - `product_bundle[*].option[*]`:同上重命名规则。
|
|
89
96
|
*
|
|
90
|
-
* 运行时(UI
|
|
91
|
-
*
|
|
97
|
+
* 运行时(UI 显示、加购合并、指纹、持久化)与提交边界统一消费字段名
|
|
98
|
+
* `option_group_item_id`,保持 tempOrder 与后端协议一致。
|
|
92
99
|
*/
|
|
93
100
|
export interface ScanOrderSubmitProduct extends Omit<ScanOrderOrderProduct, '_origin' | 'identity_key'> {
|
|
94
101
|
/**
|
|
@@ -109,6 +116,7 @@ export interface ScanOrderSummary {
|
|
|
109
116
|
shipping_tax_fee: string;
|
|
110
117
|
tax_fee: string;
|
|
111
118
|
surcharge_fee: string;
|
|
119
|
+
surcharges: any[];
|
|
112
120
|
discount_amount: string;
|
|
113
121
|
deposit_amount: string;
|
|
114
122
|
deposit?: {
|
|
@@ -118,6 +126,9 @@ export interface ScanOrderSummary {
|
|
|
118
126
|
};
|
|
119
127
|
expect_amount: string;
|
|
120
128
|
total_amount: string;
|
|
129
|
+
total_refund_amount: string;
|
|
130
|
+
customer_paid_amount: string;
|
|
131
|
+
order_paid_amount: string;
|
|
121
132
|
amount_gap: string;
|
|
122
133
|
rounding_amount: string;
|
|
123
134
|
pay_service_charge_amount: string;
|
|
@@ -130,11 +141,15 @@ export interface ScanOrderSummary {
|
|
|
130
141
|
*/
|
|
131
142
|
export interface ScanOrderTempOrder {
|
|
132
143
|
order_id: number | null;
|
|
144
|
+
/** @deprecated 资源运行态迁移到 ScanOrder store;仅旧缓存兼容 */
|
|
133
145
|
relation_id?: string;
|
|
146
|
+
/** @deprecated 资源运行态迁移到 ScanOrder store;仅旧缓存兼容 */
|
|
134
147
|
table_form_id?: string;
|
|
148
|
+
/** @deprecated 资源运行态迁移到 ScanOrder store;仅旧缓存兼容 */
|
|
135
149
|
resource_id?: string;
|
|
136
150
|
order_number: string;
|
|
137
151
|
shop_order_number: string;
|
|
152
|
+
shop_full_order_number: string;
|
|
138
153
|
type: string;
|
|
139
154
|
business_code: string;
|
|
140
155
|
platform: string;
|
|
@@ -164,6 +179,7 @@ export interface ScanOrderTempOrder {
|
|
|
164
179
|
table_number?: Record<string, any>;
|
|
165
180
|
schedule_date: string;
|
|
166
181
|
created_at: string;
|
|
182
|
+
request_unique_idempotency_token?: string;
|
|
167
183
|
products: ScanOrderOrderProduct[];
|
|
168
184
|
bookings: any[];
|
|
169
185
|
payments: any[];
|
|
@@ -171,14 +187,20 @@ export interface ScanOrderTempOrder {
|
|
|
171
187
|
discount_list: any[];
|
|
172
188
|
relation_forms: any[];
|
|
173
189
|
contacts: any[];
|
|
174
|
-
contacts_info: any
|
|
190
|
+
contacts_info: Record<string, any> | null;
|
|
175
191
|
holder: Record<string, any> | null;
|
|
176
|
-
summary: ScanOrderSummary;
|
|
177
192
|
metadata: Record<string, any>;
|
|
193
|
+
_extend?: {
|
|
194
|
+
productsByUid?: Record<string, Record<string, any>>;
|
|
195
|
+
[key: string]: any;
|
|
196
|
+
};
|
|
197
|
+
/** @deprecated summary 是 OrderState 派生状态,不属于可提交 tempOrder */
|
|
198
|
+
summary?: ScanOrderSummary;
|
|
199
|
+
/** @deprecated lastOrderInfo 迁移到 OrderState 同层级 */
|
|
178
200
|
lastOrderInfo?: Record<string, any>;
|
|
179
201
|
}
|
|
180
|
-
export interface ScanOrderSubmitPayload extends Omit<ScanOrderTempOrder, 'platform' | 'products' | '
|
|
181
|
-
platform:
|
|
202
|
+
export interface ScanOrderSubmitPayload extends Omit<ScanOrderTempOrder, 'platform' | 'products' | 'summary' | 'surcharges'> {
|
|
203
|
+
platform: string;
|
|
182
204
|
request_unique_idempotency_token?: string;
|
|
183
205
|
form_record_ids?: Array<{
|
|
184
206
|
form_id: number | string;
|
|
@@ -14,13 +14,12 @@ export var ScanOrderHooks = /*#__PURE__*/function (ScanOrderHooks) {
|
|
|
14
14
|
* 出站 payload 版本的商品行。
|
|
15
15
|
*
|
|
16
16
|
* 与 tempOrder 内部 `ScanOrderOrderProduct` 的字段差异:
|
|
17
|
-
* - `
|
|
18
|
-
*
|
|
19
|
-
* (后端 checkout 协议;丢弃 `price` 等运行时辅助字段)。
|
|
17
|
+
* - `product_sku.option[*]`:内部直接维护统一 Sales 协议字段;
|
|
18
|
+
* 提交时仅规范 `add_price`,保留传入/恢复得到的展示字段。
|
|
20
19
|
* - `product_bundle[*].option[*]`:同上重命名规则。
|
|
21
20
|
*
|
|
22
|
-
* 运行时(UI
|
|
23
|
-
*
|
|
21
|
+
* 运行时(UI 显示、加购合并、指纹、持久化)与提交边界统一消费字段名
|
|
22
|
+
* `option_group_item_id`,保持 tempOrder 与后端协议一致。
|
|
24
23
|
*/
|
|
25
24
|
|
|
26
25
|
/**
|
|
@@ -2,6 +2,7 @@ import { ScanOrderOrderProduct, ScanOrderOrderProductIdentity, ScanOrderResource
|
|
|
2
2
|
import type { CartItemSummary, ItemRuleBusinessData, PaxInfo, QuantityLimitResult } from '../../model/strategy/adapter/itemRule';
|
|
3
3
|
import type { StrategyConfig } from '../../model/strategy/type';
|
|
4
4
|
import type { ProductData } from '../../modules/Product/types';
|
|
5
|
+
import type { OrderSubmitProduct } from '../../modules/Order/types';
|
|
5
6
|
/**
|
|
6
7
|
* 构建金额全为 0 的空 summary。
|
|
7
8
|
* 作为尚未计算金额时的兜底默认值,避免下游因 undefined 报错。
|
|
@@ -42,6 +43,8 @@ export declare function toNonNegativeNumber(value: unknown): number;
|
|
|
42
43
|
export declare function toNonNegativeInt(value: unknown): number;
|
|
43
44
|
export declare function toPriceString(value: unknown, fallback?: string): string;
|
|
44
45
|
export declare function buildProductKey(productId: number, productVariantId: number): string;
|
|
46
|
+
/** 加餐接口只提交本次新增商品,过滤掉首单预约占位规则行。 */
|
|
47
|
+
export declare function filterProductsForScanOrderMore<T extends OrderSubmitProduct>(products?: T[]): T[];
|
|
45
48
|
export declare function getTopLevelProductId(product: Record<string, any>): number | null;
|
|
46
49
|
export declare function getTopLevelVariantId(product: Record<string, any>): number | null;
|
|
47
50
|
export declare function buildQuantityLimitIndex(limits: QuantityLimitResult[]): {
|
|
@@ -88,7 +91,7 @@ export declare function attachItemRuleLimitsToTopLevelProducts<T>(productList: T
|
|
|
88
91
|
export declare function buildProductLineFingerprint(productOptionItem?: unknown, productBundle?: unknown): string;
|
|
89
92
|
/**
|
|
90
93
|
* removeProductFromOrder 仅传 SKU 时的通配 identity(对象上未声明选项键)。
|
|
91
|
-
* 与显式 `
|
|
94
|
+
* 与显式 `product_sku: { option: [] }` 区分:后者只匹配「无选项」行。
|
|
92
95
|
*/
|
|
93
96
|
export declare function isSkuOnlyDeleteIdentity(x: ScanOrderOrderProductIdentity): boolean;
|
|
94
97
|
/**
|
|
@@ -13,7 +13,8 @@ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o =
|
|
|
13
13
|
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
14
14
|
import dayjs from 'dayjs';
|
|
15
15
|
import Decimal from 'decimal.js';
|
|
16
|
-
import { composeLinePrice, createUuidV4, sumOptionUnitPrice } from "../../modules/Order/utils";
|
|
16
|
+
import { composeLinePrice, createUuidV4, ensureProductSku, getBundleSellingMagnitude, getProductSkuOptions, normalizeProductSkuOptions, resolveManualOverrideLineOriginalPrice, sumOptionUnitPrice } from "../../modules/Order/utils";
|
|
17
|
+
import { ensureManualProductDiscountList } from "../../modules/Order/utils/manualProductDiscount";
|
|
17
18
|
|
|
18
19
|
/**
|
|
19
20
|
* 构建金额全为 0 的空 summary。
|
|
@@ -30,10 +31,14 @@ export function createEmptySummary() {
|
|
|
30
31
|
shipping_tax_fee: '0.00',
|
|
31
32
|
tax_fee: '0.00',
|
|
32
33
|
surcharge_fee: '0.00',
|
|
34
|
+
surcharges: [],
|
|
33
35
|
discount_amount: '0.00',
|
|
34
36
|
deposit_amount: '0.00',
|
|
35
37
|
expect_amount: '0.00',
|
|
36
38
|
total_amount: '0.00',
|
|
39
|
+
total_refund_amount: '0.00',
|
|
40
|
+
customer_paid_amount: '0.00',
|
|
41
|
+
order_paid_amount: '0.00',
|
|
37
42
|
amount_gap: '0.00',
|
|
38
43
|
rounding_amount: '0.00',
|
|
39
44
|
pay_service_charge_amount: '0.00'
|
|
@@ -149,6 +154,15 @@ export function toPriceString(value) {
|
|
|
149
154
|
export function buildProductKey(productId, productVariantId) {
|
|
150
155
|
return "".concat(productId, "_").concat(productVariantId);
|
|
151
156
|
}
|
|
157
|
+
|
|
158
|
+
/** 加餐接口只提交本次新增商品,过滤掉首单预约占位规则行。 */
|
|
159
|
+
export function filterProductsForScanOrderMore() {
|
|
160
|
+
var products = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
161
|
+
return products.filter(function (product) {
|
|
162
|
+
var _product$metadata;
|
|
163
|
+
return ((_product$metadata = product.metadata) === null || _product$metadata === void 0 ? void 0 : _product$metadata.is_rule) !== true;
|
|
164
|
+
});
|
|
165
|
+
}
|
|
152
166
|
export function getTopLevelProductId(product) {
|
|
153
167
|
var _product$product_id;
|
|
154
168
|
var rawProductId = (_product$product_id = product.product_id) !== null && _product$product_id !== void 0 ? _product$product_id : product.id;
|
|
@@ -376,16 +390,16 @@ export function attachItemRuleLimitsToTopLevelProducts(productList, limits) {
|
|
|
376
390
|
export function buildProductLineFingerprint(productOptionItem, productBundle) {
|
|
377
391
|
var optArr = Array.isArray(productOptionItem) ? productOptionItem : [];
|
|
378
392
|
var normalizedOpts = optArr.map(function (item) {
|
|
379
|
-
var _item$
|
|
393
|
+
var _ref, _item$add_price;
|
|
380
394
|
return {
|
|
381
|
-
|
|
395
|
+
option_group_item_id: Number(item === null || item === void 0 ? void 0 : item.option_group_item_id) || 0,
|
|
382
396
|
option_group_id: Number(item === null || item === void 0 ? void 0 : item.option_group_id) || 0,
|
|
383
397
|
num: typeof (item === null || item === void 0 ? void 0 : item.num) === 'number' && !Number.isNaN(item.num) ? Math.max(1, Math.floor(item.num)) : 1,
|
|
384
|
-
price: String((_item$
|
|
398
|
+
price: String((_ref = (_item$add_price = item === null || item === void 0 ? void 0 : item.add_price) !== null && _item$add_price !== void 0 ? _item$add_price : item === null || item === void 0 ? void 0 : item.price) !== null && _ref !== void 0 ? _ref : '')
|
|
385
399
|
};
|
|
386
400
|
}).sort(function (p, q) {
|
|
387
|
-
if (p.
|
|
388
|
-
return p.
|
|
401
|
+
if (p.option_group_item_id !== q.option_group_item_id) {
|
|
402
|
+
return p.option_group_item_id - q.option_group_item_id;
|
|
389
403
|
}
|
|
390
404
|
if (p.option_group_id !== q.option_group_id) return p.option_group_id - q.option_group_id;
|
|
391
405
|
if (p.num !== q.num) return p.num - q.num;
|
|
@@ -393,9 +407,9 @@ export function buildProductLineFingerprint(productOptionItem, productBundle) {
|
|
|
393
407
|
});
|
|
394
408
|
var bundleArr = Array.isArray(productBundle) ? productBundle : [];
|
|
395
409
|
var normalizedBundles = bundleArr.map(function (item) {
|
|
396
|
-
var
|
|
410
|
+
var _ref2, _item$bundle_id;
|
|
397
411
|
return {
|
|
398
|
-
bundle_id: Number((
|
|
412
|
+
bundle_id: Number((_ref2 = (_item$bundle_id = item === null || item === void 0 ? void 0 : item.bundle_id) !== null && _item$bundle_id !== void 0 ? _item$bundle_id : item === null || item === void 0 ? void 0 : item.id) !== null && _ref2 !== void 0 ? _ref2 : 0) || 0,
|
|
399
413
|
product_id: Number(item === null || item === void 0 ? void 0 : item.product_id) || 0,
|
|
400
414
|
num: typeof (item === null || item === void 0 ? void 0 : item.num) === 'number' && !Number.isNaN(item.num) ? Math.max(1, Math.floor(item.num)) : 1
|
|
401
415
|
};
|
|
@@ -409,15 +423,15 @@ export function buildProductLineFingerprint(productOptionItem, productBundle) {
|
|
|
409
423
|
|
|
410
424
|
/**
|
|
411
425
|
* removeProductFromOrder 仅传 SKU 时的通配 identity(对象上未声明选项键)。
|
|
412
|
-
* 与显式 `
|
|
426
|
+
* 与显式 `product_sku: { option: [] }` 区分:后者只匹配「无选项」行。
|
|
413
427
|
*/
|
|
414
428
|
export function isSkuOnlyDeleteIdentity(x) {
|
|
415
|
-
if (x.identity_key) return false;
|
|
416
|
-
return !('
|
|
429
|
+
if (x.unique_identification_number || x.identity_key) return false;
|
|
430
|
+
return !('product_sku' in x) && !('product_bundle' in x);
|
|
417
431
|
}
|
|
418
432
|
function fingerprintForIdentityWithOptionKeys(x) {
|
|
419
433
|
var row = x;
|
|
420
|
-
var opts = '
|
|
434
|
+
var opts = 'product_sku' in row ? getProductSkuOptions(row) : [];
|
|
421
435
|
var buds = 'product_bundle' in row ? Array.isArray(row.product_bundle) ? row.product_bundle : [] : [];
|
|
422
436
|
return buildProductLineFingerprint(opts, buds);
|
|
423
437
|
}
|
|
@@ -433,10 +447,13 @@ function fingerprintForIdentityWithOptionKeys(x) {
|
|
|
433
447
|
* 忽略线侧 identity_key,按内容语义匹配。这给「行已 opaque、调用方却想按 SKU 通配 / 选项指纹删除」留兼容入口。
|
|
434
448
|
*/
|
|
435
449
|
export function isIdentityMatch(a, b) {
|
|
450
|
+
var _ref3, _metadata$unique_iden, _metadata2, _ref4, _metadata$unique_iden2, _metadata3;
|
|
436
451
|
if (a.product_id !== b.product_id || a.product_variant_id !== b.product_variant_id) return false;
|
|
437
|
-
var
|
|
438
|
-
var
|
|
439
|
-
|
|
452
|
+
var aUid = (_ref3 = (_metadata$unique_iden = (_metadata2 = a.metadata) === null || _metadata2 === void 0 ? void 0 : _metadata2.unique_identification_number) !== null && _metadata$unique_iden !== void 0 ? _metadata$unique_iden : a.unique_identification_number) !== null && _ref3 !== void 0 ? _ref3 : a.identity_key;
|
|
453
|
+
var bUid = (_ref4 = (_metadata$unique_iden2 = (_metadata3 = b.metadata) === null || _metadata3 === void 0 ? void 0 : _metadata3.unique_identification_number) !== null && _metadata$unique_iden2 !== void 0 ? _metadata$unique_iden2 : b.unique_identification_number) !== null && _ref4 !== void 0 ? _ref4 : b.identity_key;
|
|
454
|
+
var aHasKey = typeof aUid === 'string' && aUid.length > 0;
|
|
455
|
+
var bHasKey = typeof bUid === 'string' && bUid.length > 0;
|
|
456
|
+
if (aHasKey && bHasKey) return aUid === bUid;
|
|
440
457
|
if (isSkuOnlyDeleteIdentity(a) || isSkuOnlyDeleteIdentity(b)) return true;
|
|
441
458
|
return fingerprintForIdentityWithOptionKeys(a) === fingerprintForIdentityWithOptionKeys(b);
|
|
442
459
|
}
|
|
@@ -474,23 +491,67 @@ export function getProductIdentityIndex(products, identity) {
|
|
|
474
491
|
* - 因此多次 normalize 不会重复叠加 option/bundle。
|
|
475
492
|
*/
|
|
476
493
|
export function normalizeOrderProduct(product) {
|
|
477
|
-
var _metadata$origin, _variantList$find, _product$is_charge_ta;
|
|
494
|
+
var _product$metadata2, _metadata$origin, _product$product_sku, _metadata$origin2, _variantList$find, _product$is_charge_ta;
|
|
478
495
|
var metadata = _objectSpread({}, product.metadata || {});
|
|
479
496
|
// 不透明 identity 契约:每条订单行必须带 identity_key。
|
|
480
497
|
// 调用方未传时由 SDK 自动生成 UUID,后续 update/remove 只做严格比对,避免猜测合成 key。
|
|
481
|
-
var resolvedIdentityKey = product.identity_key && String(product.identity_key).length > 0 ? String(product.identity_key) : createUuidV4();
|
|
482
|
-
|
|
483
|
-
|
|
498
|
+
var resolvedIdentityKey = (_product$metadata2 = product.metadata) !== null && _product$metadata2 !== void 0 && _product$metadata2.unique_identification_number ? String(product.metadata.unique_identification_number) : product.unique_identification_number && String(product.unique_identification_number).length > 0 ? String(product.unique_identification_number) : product.identity_key && String(product.identity_key).length > 0 ? String(product.identity_key) : createUuidV4();
|
|
499
|
+
metadata.unique_identification_number = resolvedIdentityKey;
|
|
500
|
+
var priceOverride = metadata.price_override;
|
|
501
|
+
var originOtherBundle = (_metadata$origin = metadata.origin) === null || _metadata$origin === void 0 || (_metadata$origin = _metadata$origin._extend) === null || _metadata$origin === void 0 || (_metadata$origin = _metadata$origin.other) === null || _metadata$origin === void 0 ? void 0 : _metadata$origin.bundle;
|
|
502
|
+
var bundleInput = product.product_bundle || [];
|
|
503
|
+
if (priceOverride !== undefined && priceOverride !== null && priceOverride !== '' && Array.isArray(originOtherBundle) && originOtherBundle.length > 0) {
|
|
504
|
+
var priceById = new Map();
|
|
505
|
+
originOtherBundle.forEach(function (item) {
|
|
506
|
+
var _item$price;
|
|
507
|
+
if ((item === null || item === void 0 ? void 0 : item.id) == null) return;
|
|
508
|
+
var unit = (_item$price = item.price) !== null && _item$price !== void 0 ? _item$price : item.bundle_selling_price;
|
|
509
|
+
if (unit === undefined || unit === null) return;
|
|
510
|
+
priceById.set(String(item.id), String(unit));
|
|
511
|
+
});
|
|
512
|
+
var base = Array.isArray(bundleInput) && bundleInput.length > 0 ? bundleInput : originOtherBundle;
|
|
513
|
+
bundleInput = base.map(function (item) {
|
|
514
|
+
var unit = priceById.get(String(item === null || item === void 0 ? void 0 : item.id));
|
|
515
|
+
if (unit === undefined) return item;
|
|
516
|
+
return _objectSpread(_objectSpread({}, item), {}, {
|
|
517
|
+
price: unit,
|
|
518
|
+
bundle_selling_price: unit
|
|
519
|
+
});
|
|
520
|
+
});
|
|
484
521
|
}
|
|
485
|
-
var normalizedBundle =
|
|
486
|
-
var
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
//
|
|
522
|
+
var normalizedBundle = bundleInput.map(function (item) {
|
|
523
|
+
var _item$price2, _item$bundle_id2, _item$bundle_product_, _item$bundle_group_id, _ref5, _ref6, _item$price3, _ref7, _item$price_type, _ref8, _item$price_type_ext;
|
|
524
|
+
var magnitudeSource = _objectSpread(_objectSpread({}, item), {}, {
|
|
525
|
+
// 计算 markdown 净额时,只把真实毛价交给 helper;若只有 bundle_selling_price,
|
|
526
|
+
// helper 会按历史净额兜底,避免 option 二次扣减。
|
|
527
|
+
price: (_item$price2 = item.price) !== null && _item$price2 !== void 0 ? _item$price2 : item.custom_price
|
|
528
|
+
});
|
|
529
|
+
var normalizedItem = _objectSpread(_objectSpread({}, item), {}, {
|
|
530
|
+
bundle_id: (_item$bundle_id2 = item.bundle_id) !== null && _item$bundle_id2 !== void 0 ? _item$bundle_id2 : item.id,
|
|
531
|
+
bundle_product_id: (_item$bundle_product_ = item.bundle_product_id) !== null && _item$bundle_product_ !== void 0 ? _item$bundle_product_ : item._bundle_product_id,
|
|
532
|
+
bundle_group_id: (_item$bundle_group_id = item.bundle_group_id) !== null && _item$bundle_group_id !== void 0 ? _item$bundle_group_id : item.group_id,
|
|
533
|
+
// price 保留毛价(markdown 仍为 5),由 price_type 决定符号。
|
|
534
|
+
price: (_ref5 = (_ref6 = (_item$price3 = item.price) !== null && _item$price3 !== void 0 ? _item$price3 : item.custom_price) !== null && _ref6 !== void 0 ? _ref6 : item.bundle_selling_price) !== null && _ref5 !== void 0 ? _ref5 : '0.00',
|
|
535
|
+
price_type: (_ref7 = (_item$price_type = item.price_type) !== null && _item$price_type !== void 0 ? _item$price_type : item.custom_price_type) !== null && _ref7 !== void 0 ? _ref7 : '',
|
|
536
|
+
price_type_ext: (_ref8 = (_item$price_type_ext = item.price_type_ext) !== null && _item$price_type_ext !== void 0 ? _item$price_type_ext : item.custom_price_type_ext) !== null && _ref8 !== void 0 ? _ref8 : ''
|
|
490
537
|
});
|
|
538
|
+
// bundle_selling_price 落「正净额」:markdown = |price| − Σoptions;markup/原价维持原值。
|
|
539
|
+
normalizedItem.bundle_selling_price = getBundleSellingMagnitude(magnitudeSource).toFixed(2);
|
|
540
|
+
if (normalizedItem.price_type === 'markdown' && (normalizedItem.price_type_ext === '' || normalizedItem.price_type_ext === undefined || normalizedItem.price_type_ext === null)) {
|
|
541
|
+
var _normalizedItem$custo;
|
|
542
|
+
normalizedItem.custom_price = (_normalizedItem$custo = normalizedItem.custom_price) !== null && _normalizedItem$custo !== void 0 ? _normalizedItem$custo : normalizedItem.price;
|
|
543
|
+
normalizedItem.price = normalizedItem.bundle_selling_price;
|
|
544
|
+
}
|
|
545
|
+
if ((normalizedItem.price_type === 'markdown' || normalizedItem.price_type === 'markup') && (normalizedItem.price_type_ext === '' || normalizedItem.price_type_ext === undefined || normalizedItem.price_type_ext === null)) {
|
|
546
|
+
delete normalizedItem.original_total;
|
|
547
|
+
}
|
|
548
|
+
return normalizedItem;
|
|
491
549
|
});
|
|
492
|
-
var normalizedOptions = product.
|
|
550
|
+
var normalizedOptions = normalizeProductSkuOptions((_product$product_sku = product.product_sku) === null || _product$product_sku === void 0 ? void 0 : _product$product_sku.option);
|
|
493
551
|
var optionSum = sumOptionUnitPrice(normalizedOptions);
|
|
552
|
+
var productSku = _objectSpread(_objectSpread({}, ensureProductSku(product)), {}, {
|
|
553
|
+
option: normalizedOptions
|
|
554
|
+
});
|
|
494
555
|
|
|
495
556
|
// 1) 解析 source_product_price。
|
|
496
557
|
// 优先级:
|
|
@@ -502,11 +563,11 @@ export function normalizeOrderProduct(product) {
|
|
|
502
563
|
// 6) 入参 selling_price(最末兜底,新添加路径 caller 只给 selling_price)
|
|
503
564
|
var isV2 = metadata.price_schema_version === 2 || metadata.price_schema_version === '2';
|
|
504
565
|
var variantId = Number(product.product_variant_id || 0);
|
|
505
|
-
var variantList = variantId ? metadata === null || metadata === void 0 || (_metadata$
|
|
566
|
+
var variantList = variantId ? metadata === null || metadata === void 0 || (_metadata$origin2 = metadata.origin) === null || _metadata$origin2 === void 0 ? void 0 : _metadata$origin2.variant : null;
|
|
506
567
|
var variantPrice = Array.isArray(variantList) ? (_variantList$find = variantList.find(function (v) {
|
|
507
568
|
return Number(v === null || v === void 0 ? void 0 : v.id) === variantId;
|
|
508
569
|
})) === null || _variantList$find === void 0 ? void 0 : _variantList$find.price : undefined;
|
|
509
|
-
var resolvedSource = function (_product$_origin, _product$_origin2,
|
|
570
|
+
var resolvedSource = function (_product$_origin, _product$_origin2, _ref9, _product$original_pri) {
|
|
510
571
|
if (metadata.source_product_price !== undefined) {
|
|
511
572
|
return String(metadata.source_product_price);
|
|
512
573
|
}
|
|
@@ -524,7 +585,7 @@ export function normalizeOrderProduct(product) {
|
|
|
524
585
|
if (!isV2 && metadata.main_product_original_price !== undefined) {
|
|
525
586
|
return String(metadata.main_product_original_price);
|
|
526
587
|
}
|
|
527
|
-
return (
|
|
588
|
+
return (_ref9 = (_product$original_pri = product.original_price) !== null && _product$original_pri !== void 0 ? _product$original_pri : product.selling_price) !== null && _ref9 !== void 0 ? _ref9 : '0.00';
|
|
528
589
|
}();
|
|
529
590
|
|
|
530
591
|
// 2) 派生 main_product_original_price(含 option、不含折扣)
|
|
@@ -572,22 +633,36 @@ export function normalizeOrderProduct(product) {
|
|
|
572
633
|
bundle: normalizedBundle,
|
|
573
634
|
useOriginalBundle: true
|
|
574
635
|
});
|
|
636
|
+
var finalOriginalPrice = resolveManualOverrideLineOriginalPrice({
|
|
637
|
+
num: product.num,
|
|
638
|
+
metadata: metadata,
|
|
639
|
+
lineOriginalPrice: product.original_price
|
|
640
|
+
}, composedOriginalPrice);
|
|
641
|
+
var hasManualProductDiscount = (product.discount_list || []).some(function (item) {
|
|
642
|
+
return (item === null || item === void 0 ? void 0 : item.type) === 'product';
|
|
643
|
+
});
|
|
644
|
+
var manualOriginalPrice = hasManualProductDiscount && product.original_price != null ? String(product.original_price) : finalOriginalPrice;
|
|
645
|
+
var discountList = ensureManualProductDiscountList({
|
|
646
|
+
discountList: product.discount_list,
|
|
647
|
+
metadata: metadata,
|
|
648
|
+
originalPrice: manualOriginalPrice,
|
|
649
|
+
sellingPrice: composedSellingPrice,
|
|
650
|
+
quantity: getSafeProductNum(product.num)
|
|
651
|
+
});
|
|
575
652
|
return {
|
|
576
653
|
order_detail_id: product.order_detail_id || null,
|
|
577
654
|
product_id: product.product_id,
|
|
578
655
|
num: getSafeProductNum(product.num),
|
|
579
656
|
product_variant_id: product.product_variant_id,
|
|
580
|
-
|
|
581
|
-
product_option_item: normalizedOptions,
|
|
657
|
+
product_sku: productSku,
|
|
582
658
|
selling_price: composedSellingPrice,
|
|
583
|
-
original_price:
|
|
659
|
+
original_price: manualOriginalPrice,
|
|
584
660
|
tax_fee: product.tax_fee || '0.00',
|
|
585
661
|
is_charge_tax: (_product$is_charge_ta = product.is_charge_tax) !== null && _product$is_charge_ta !== void 0 ? _product$is_charge_ta : 0,
|
|
586
|
-
discount_list:
|
|
662
|
+
discount_list: discountList,
|
|
587
663
|
product_bundle: normalizedBundle,
|
|
588
664
|
metadata: metadata,
|
|
589
|
-
note: product.note != null ? String(product.note) : ''
|
|
590
|
-
_origin: product._origin
|
|
665
|
+
note: product.note != null ? String(product.note) : ''
|
|
591
666
|
};
|
|
592
667
|
}
|
|
593
668
|
|
|
@@ -76,8 +76,6 @@ export var ShopDiscountImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
76
76
|
this.options = options;
|
|
77
77
|
this.store = _objectSpread(_objectSpread({}, this.store), options.store || {});
|
|
78
78
|
this.hooks = (_options$otherParams = options.otherParams) === null || _options$otherParams === void 0 || (_options$otherParams = _options$otherParams.rules) === null || _options$otherParams === void 0 ? void 0 : _options$otherParams.hooks;
|
|
79
|
-
console.log('[ShopDiscount] 初始化完成');
|
|
80
|
-
|
|
81
79
|
// 获取依赖的插件
|
|
82
80
|
this.initializePlugins();
|
|
83
81
|
|
|
@@ -86,7 +84,7 @@ export var ShopDiscountImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
86
84
|
|
|
87
85
|
// 注册事件监听
|
|
88
86
|
this.registerEventListeners();
|
|
89
|
-
case
|
|
87
|
+
case 7:
|
|
90
88
|
case "end":
|
|
91
89
|
return _context.stop();
|
|
92
90
|
}
|
|
@@ -113,8 +111,6 @@ export var ShopDiscountImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
113
111
|
_context2.next = 7;
|
|
114
112
|
return this.core.effects.emit("".concat(this.name, ":onDestroy"), {});
|
|
115
113
|
case 7:
|
|
116
|
-
console.log('[ShopDiscount] 已销毁');
|
|
117
|
-
case 8:
|
|
118
114
|
case "end":
|
|
119
115
|
return _context2.stop();
|
|
120
116
|
}
|
|
@@ -137,8 +133,7 @@ export var ShopDiscountImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
137
133
|
this.store.customer = null;
|
|
138
134
|
(_this$store$discount2 = this.store.discount) === null || _this$store$discount2 === void 0 || _this$store$discount2.clear();
|
|
139
135
|
(_this$store$rules2 = this.store.rules) === null || _this$store$rules2 === void 0 || _this$store$rules2.clear();
|
|
140
|
-
|
|
141
|
-
case 5:
|
|
136
|
+
case 4:
|
|
142
137
|
case "end":
|
|
143
138
|
return _context3.stop();
|
|
144
139
|
}
|
|
@@ -534,7 +529,7 @@ export var ShopDiscountImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
534
529
|
this.setDiscountList(newDiscountList || []);
|
|
535
530
|
this.store.originalDiscountList = newDiscountList || [];
|
|
536
531
|
this.setProductList(newProductList || []);
|
|
537
|
-
if (!(this.isWalkIn() && resultDiscountList.length && ((_this$options$otherPa6 = this.options.otherParams) === null || _this$options$otherPa6 === void 0 ? void 0 : _this$options$otherPa6.platform) === 'shop')) {
|
|
532
|
+
if (!(this.isWalkIn() && resultDiscountList.length && ((_this$options$otherPa6 = this.options.otherParams) === null || _this$options$otherPa6 === void 0 ? void 0 : _this$options$otherPa6.platform) === 'shop' && !((resultDiscountList[0].customer_id || 1) === 1))) {
|
|
538
533
|
_context6.next = 25;
|
|
539
534
|
break;
|
|
540
535
|
}
|
|
@@ -800,7 +795,7 @@ export var ShopDiscountImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
800
795
|
key: "loadPrepareConfig",
|
|
801
796
|
value: function () {
|
|
802
797
|
var _loadPrepareConfig = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee10(params) {
|
|
803
|
-
var _this$getCustomer2, _this$store$discount8, _this$getDiscountList, _this$store$discount9, _this$store$productLi2, orderId, customerId,
|
|
798
|
+
var _this$getCustomer2, _this$store$discount8, _this$getDiscountList, _this$store$discount9, _this$store$productLi2, orderId, customerId, prepareConfigResult, goodPassList, scanDiscount, scanDiscountIds, newGoodPassList, newDiscountList, filteredDiscountList, _result3;
|
|
804
799
|
return _regeneratorRuntime().wrap(function _callee10$(_context10) {
|
|
805
800
|
while (1) switch (_context10.prev = _context10.next) {
|
|
806
801
|
case 0:
|
|
@@ -821,8 +816,8 @@ export var ShopDiscountImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
821
816
|
order_id: orderId
|
|
822
817
|
} : {}));
|
|
823
818
|
case 5:
|
|
824
|
-
|
|
825
|
-
goodPassList = (
|
|
819
|
+
prepareConfigResult = _context10.sent;
|
|
820
|
+
goodPassList = (prepareConfigResult === null || prepareConfigResult === void 0 ? void 0 : prepareConfigResult.discountList) || [];
|
|
826
821
|
scanDiscount = (_this$getDiscountList = this.getDiscountList()) === null || _this$getDiscountList === void 0 ? void 0 : _this$getDiscountList.filter(function (item) {
|
|
827
822
|
return item.isScan;
|
|
828
823
|
}); // goodPassList 里可能有 scanDiscount 重合的部分,goodPassList 需要剔除
|