@pisell/pisellos 2.2.310 → 2.2.312-vm.0
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/apis/picoding.d.ts.map +1 -0
- package/dist/core/index.d.ts.map +1 -0
- package/dist/effects/index.d.ts.map +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +1 -0
- package/dist/inventory/index.d.ts +92 -0
- package/dist/inventory/index.d.ts.map +1 -0
- package/dist/inventory/index.js +509 -0
- package/dist/model/index.d.ts.map +1 -0
- package/dist/model/strategy/adapter/dataVariant/adapter.d.ts.map +1 -0
- package/dist/model/strategy/adapter/dataVariant/evaluator.d.ts.map +1 -0
- package/dist/model/strategy/adapter/dataVariant/examples.d.ts.map +1 -0
- package/dist/model/strategy/adapter/dataVariant/index.d.ts.map +1 -0
- package/dist/model/strategy/adapter/dataVariant/type.d.ts.map +1 -0
- package/dist/model/strategy/adapter/index.d.ts.map +1 -0
- package/dist/model/strategy/adapter/itemRule/adapter.d.ts.map +1 -0
- package/dist/model/strategy/adapter/itemRule/evaluator.d.ts.map +1 -0
- package/dist/model/strategy/adapter/itemRule/examples.d.ts.map +1 -0
- package/dist/model/strategy/adapter/itemRule/index.d.ts.map +1 -0
- package/dist/model/strategy/adapter/itemRule/type.d.ts.map +1 -0
- package/dist/model/strategy/adapter/promotion/adapter.d.ts.map +1 -0
- package/dist/model/strategy/adapter/promotion/evaluator.d.ts.map +1 -0
- package/dist/model/strategy/adapter/promotion/examples.d.ts.map +1 -0
- package/dist/model/strategy/adapter/promotion/index.d.ts.map +1 -0
- package/dist/model/strategy/adapter/promotion/index.js +0 -9
- package/dist/model/strategy/adapter/promotion/type.d.ts.map +1 -0
- package/dist/model/strategy/adapter/type.d.ts.map +1 -0
- package/dist/model/strategy/adapter/walletPass/evaluator.d.ts.map +1 -0
- package/dist/model/strategy/adapter/walletPass/example.d.ts.map +1 -0
- package/dist/model/strategy/adapter/walletPass/index.d.ts.map +1 -0
- package/dist/model/strategy/adapter/walletPass/locales.d.ts.map +1 -0
- package/dist/model/strategy/adapter/walletPass/type.d.ts.map +1 -0
- package/dist/model/strategy/adapter/walletPass/utils.d.ts.map +1 -0
- package/dist/model/strategy/engine.d.ts.map +1 -0
- package/dist/model/strategy/index.d.ts.map +1 -0
- package/dist/model/strategy/strategy-example.d.ts.map +1 -0
- package/dist/model/strategy/type.d.ts.map +1 -0
- package/dist/modules/Account/index.d.ts.map +1 -0
- package/dist/modules/Account/types.d.ts.map +1 -0
- package/dist/modules/AccountList/index.d.ts.map +1 -0
- package/dist/modules/AccountList/types.d.ts.map +1 -0
- package/dist/modules/AccountList/utils.d.ts.map +1 -0
- package/dist/modules/BaseModule.d.ts.map +1 -0
- package/dist/modules/BookingContext/index.d.ts.map +1 -0
- package/dist/modules/BookingContext/types.d.ts.map +1 -0
- package/dist/modules/BookingContext/utils/buildCacheItemFromOrderLine.d.ts.map +1 -0
- package/dist/modules/BookingContext/utils/buildNormalProductCacheItemFromOrderLine.d.ts.map +1 -0
- package/dist/modules/BookingContext/utils/cacheItemToBookingInput.d.ts.map +1 -0
- package/dist/modules/BookingContext/utils/flexible.d.ts.map +1 -0
- package/dist/modules/BookingContext/utils/formatResourceList.d.ts.map +1 -0
- package/dist/modules/BookingContext/utils/index.d.ts.map +1 -0
- package/dist/modules/BookingContext/utils/noResource.d.ts.map +1 -0
- package/dist/modules/BookingContext/utils/orderLineDisplay.d.ts.map +1 -0
- package/dist/modules/BookingContext/utils/productExtend.d.ts.map +1 -0
- package/dist/modules/BookingContext/utils/resourceErrors.d.ts.map +1 -0
- package/dist/modules/BookingContext/utils/resourceSelection.d.ts.map +1 -0
- package/dist/modules/BookingContext/utils/resources.d.ts.map +1 -0
- package/dist/modules/BookingContext/utils/serviceTimes.d.ts.map +1 -0
- package/dist/modules/BookingContext/utils/timeSlices.d.ts.map +1 -0
- package/dist/modules/Cart/index.d.ts.map +1 -0
- package/dist/modules/Cart/types.d.ts.map +1 -0
- package/dist/modules/Cart/utils/cartAccount.d.ts.map +1 -0
- package/dist/modules/Cart/utils/cartDate.d.ts.map +1 -0
- package/dist/modules/Cart/utils/cartDiscount.d.ts.map +1 -0
- package/dist/modules/Cart/utils/cartNote.d.ts.map +1 -0
- package/dist/modules/Cart/utils/cartProduct.d.ts.map +1 -0
- package/dist/modules/Cart/utils/cartRelationForms.d.ts.map +1 -0
- package/dist/modules/Cart/utils/cartResource.d.ts.map +1 -0
- package/dist/modules/Cart/utils/changePrice.d.ts.map +1 -0
- package/dist/modules/Cart/utils/index.d.ts.map +1 -0
- package/dist/modules/Customer/constants.d.ts.map +1 -0
- package/dist/modules/Customer/index.d.ts.map +1 -0
- package/dist/modules/Customer/types.d.ts.map +1 -0
- package/dist/modules/Date/index.d.ts.map +1 -0
- package/dist/modules/Date/types.d.ts.map +1 -0
- package/dist/modules/Date/utils.d.ts.map +1 -0
- package/dist/modules/Discount/availability.d.ts.map +1 -0
- package/dist/modules/Discount/entitlementPass.d.ts.map +1 -0
- package/dist/modules/Discount/index.d.ts.map +1 -0
- package/dist/modules/Discount/index.js +1 -0
- package/dist/modules/Discount/types.d.ts.map +1 -0
- package/dist/modules/Guests/index.d.ts.map +1 -0
- package/dist/modules/Guests/types.d.ts.map +1 -0
- package/dist/modules/Holder/index.d.ts.map +1 -0
- package/dist/modules/Holder/types.d.ts.map +1 -0
- package/dist/modules/Holder/utils.d.ts.map +1 -0
- package/dist/modules/OpenData/index.d.ts.map +1 -0
- package/dist/modules/OpenData/types.d.ts.map +1 -0
- package/dist/modules/OpenData/utils.d.ts.map +1 -0
- package/dist/modules/Order/index.d.ts +25 -3
- package/dist/modules/Order/index.d.ts.map +1 -0
- package/dist/modules/Order/index.js +1647 -1211
- package/dist/modules/Order/payment-utils.d.ts.map +1 -0
- package/dist/modules/Order/salesNotes.d.ts.map +1 -0
- package/dist/modules/Order/types.d.ts +7 -0
- package/dist/modules/Order/types.d.ts.map +1 -0
- package/dist/modules/Order/utils/bundleDiscountHydration.d.ts.map +1 -0
- package/dist/modules/Order/utils/discountProductLineIdentity.d.ts.map +1 -0
- package/dist/modules/Order/utils/discountProductLineIdentity.js +2 -2
- package/dist/modules/Order/utils/manualProductDiscount.d.ts.map +1 -0
- package/dist/modules/Order/utils/orderCollectionIdentity.d.ts.map +1 -0
- package/dist/modules/Order/utils/productVoucherGroups.d.ts +15 -0
- package/dist/modules/Order/utils/productVoucherGroups.d.ts.map +1 -0
- package/dist/modules/Order/utils/productVoucherGroups.js +115 -0
- package/dist/modules/Order/utils/virtualSettlement.d.ts.map +1 -0
- package/dist/modules/Order/utils/weighedProduct.d.ts.map +1 -0
- package/dist/modules/Order/utils.d.ts +5 -3
- package/dist/modules/Order/utils.d.ts.map +1 -0
- package/dist/modules/Order/utils.js +32 -11
- package/dist/modules/Payment/cash.d.ts.map +1 -0
- package/dist/modules/Payment/cashRecommendationAlgorithm.d.ts.map +1 -0
- package/dist/modules/Payment/eftpos.d.ts.map +1 -0
- package/dist/modules/Payment/index.d.ts.map +1 -0
- package/dist/modules/Payment/mx51.d.ts.map +1 -0
- package/dist/modules/Payment/types.d.ts.map +1 -0
- package/dist/modules/Payment/utils.d.ts.map +1 -0
- package/dist/modules/Payment/walletpass.d.ts.map +1 -0
- package/dist/modules/Product/index.d.ts.map +1 -0
- package/dist/modules/Product/types.d.ts.map +1 -0
- package/dist/modules/Product/utils.d.ts.map +1 -0
- package/dist/modules/ProductList/clientDataVariants.d.ts.map +1 -0
- package/dist/modules/ProductList/index.d.ts.map +1 -0
- package/dist/modules/ProductList/index.js +33 -12
- package/dist/modules/ProductList/types.d.ts.map +1 -0
- package/dist/modules/Quotation/index.d.ts.map +1 -0
- package/dist/modules/Quotation/types.d.ts.map +1 -0
- package/dist/modules/Resource/index.d.ts.map +1 -0
- package/dist/modules/Resource/types.d.ts.map +1 -0
- package/dist/modules/Resource/utils.d.ts.map +1 -0
- package/dist/modules/ResourcePlanner/index.d.ts.map +1 -0
- package/dist/modules/ResourcePlanner/localClock.d.ts.map +1 -0
- package/dist/modules/ResourcePlanner/planner.d.ts.map +1 -0
- package/dist/modules/ResourcePlanner/types.d.ts.map +1 -0
- package/dist/modules/Rules/index.d.ts +2 -0
- package/dist/modules/Rules/index.d.ts.map +1 -0
- package/dist/modules/Rules/index.js +29 -21
- package/dist/modules/Rules/types.d.ts.map +1 -0
- package/dist/modules/SalesSummary/index.d.ts.map +1 -0
- package/dist/modules/SalesSummary/types.d.ts.map +1 -0
- package/dist/modules/SalesSummary/utils.d.ts.map +1 -0
- package/dist/modules/ScanOrderLogger/index.d.ts.map +1 -0
- package/dist/modules/ScanOrderLogger/providers/feishu.d.ts.map +1 -0
- package/dist/modules/ScanOrderLogger/providers/grafana.d.ts.map +1 -0
- package/dist/modules/ScanOrderLogger/types.d.ts.map +1 -0
- package/dist/modules/Schedule/getDateIsInSchedule.d.ts.map +1 -0
- package/dist/modules/Schedule/index.d.ts.map +1 -0
- package/dist/modules/Schedule/type.d.ts.map +1 -0
- package/dist/modules/Schedule/types.d.ts.map +1 -0
- package/dist/modules/Schedule/utils.d.ts.map +1 -0
- package/dist/modules/Step/index.d.ts.map +1 -0
- package/dist/modules/Step/tyeps.d.ts.map +1 -0
- package/dist/modules/Summary/index.d.ts.map +1 -0
- package/dist/modules/Summary/types.d.ts.map +1 -0
- package/dist/modules/Summary/utils.d.ts.map +1 -0
- package/dist/modules/SurchargeList/index.d.ts.map +1 -0
- package/dist/modules/SurchargeList/types.d.ts.map +1 -0
- package/dist/modules/index.d.ts.map +1 -0
- package/dist/plugins/app.d.ts.map +1 -0
- package/dist/plugins/index.d.ts.map +1 -0
- package/dist/plugins/request.d.ts.map +1 -0
- package/dist/plugins/shopStore.d.ts.map +1 -0
- package/dist/plugins/user.d.ts.map +1 -0
- package/dist/plugins/window.d.ts.map +1 -0
- package/dist/server/index.d.ts.map +1 -0
- package/dist/server/modules/floor-plan/index.d.ts.map +1 -0
- package/dist/server/modules/floor-plan/index.js +34 -3
- package/dist/server/modules/floor-plan/types.d.ts.map +1 -0
- package/dist/server/modules/index.d.ts.map +1 -0
- package/dist/server/modules/menu/index.d.ts.map +1 -0
- package/dist/server/modules/menu/types.d.ts.map +1 -0
- package/dist/server/modules/order/index.d.ts.map +1 -0
- package/dist/server/modules/order/types.d.ts.map +1 -0
- package/dist/server/modules/order/utils/filterBookings.d.ts.map +1 -0
- package/dist/server/modules/order/utils/filterOrders.d.ts.map +1 -0
- package/dist/server/modules/payment/index.d.ts.map +1 -0
- package/dist/server/modules/payment/types.d.ts.map +1 -0
- package/dist/server/modules/products/index.d.ts.map +1 -0
- package/dist/server/modules/products/types.d.ts.map +1 -0
- package/dist/server/modules/quotation/index.d.ts.map +1 -0
- package/dist/server/modules/quotation/types.d.ts.map +1 -0
- package/dist/server/modules/resource/index.d.ts.map +1 -0
- package/dist/server/modules/resource/types.d.ts.map +1 -0
- package/dist/server/modules/schedule/index.d.ts.map +1 -0
- package/dist/server/modules/schedule/types.d.ts.map +1 -0
- package/dist/server/modules/schedule/utils.d.ts.map +1 -0
- package/dist/server/types.d.ts.map +1 -0
- package/dist/server/utils/index.d.ts.map +1 -0
- package/dist/server/utils/product.d.ts.map +1 -0
- package/dist/server/utils/schedule.d.ts.map +1 -0
- package/dist/server/utils/small-ticket.d.ts.map +1 -0
- package/dist/server/utils/time.d.ts.map +1 -0
- package/dist/solution/BaseSales/index.d.ts +16 -1
- package/dist/solution/BaseSales/index.d.ts.map +1 -0
- package/dist/solution/BaseSales/index.js +1363 -1176
- package/dist/solution/BaseSales/types.d.ts.map +1 -0
- package/dist/solution/BaseSales/utils/cartPromotion.d.ts.map +1 -0
- package/dist/solution/BaseSales/utils/parseSalesResponse.d.ts.map +1 -0
- package/dist/solution/BaseSales/utils/quotationPrice.d.ts.map +1 -0
- package/dist/solution/BaseSales/utils/transformBaseProductToOrderProduct.d.ts.map +1 -0
- package/dist/solution/BaseSales/utils.d.ts.map +1 -0
- package/dist/solution/BookingByStep/index.d.ts +1 -1
- package/dist/solution/BookingByStep/index.d.ts.map +1 -0
- package/dist/solution/BookingByStep/types.d.ts.map +1 -0
- package/dist/solution/BookingByStep/utils/capacity.d.ts.map +1 -0
- package/dist/solution/BookingByStep/utils/products.d.ts.map +1 -0
- package/dist/solution/BookingByStep/utils/resources.d.ts.map +1 -0
- package/dist/solution/BookingByStep/utils/stock.d.ts.map +1 -0
- package/dist/solution/BookingByStep/utils/timeslots.d.ts.map +1 -0
- package/dist/solution/BookingTicket/index.d.ts +1 -1
- package/dist/solution/BookingTicket/index.d.ts.map +1 -0
- package/dist/solution/BookingTicket/index.js +198 -108
- package/dist/solution/BookingTicket/types.d.ts +14 -2
- package/dist/solution/BookingTicket/types.d.ts.map +1 -0
- package/dist/solution/BookingTicket/utils/addProductDecision.d.ts +1 -1
- package/dist/solution/BookingTicket/utils/addProductDecision.d.ts.map +1 -0
- package/dist/solution/BookingTicket/utils/addProductDecision.js +4 -3
- package/dist/solution/BookingTicket/utils/addTimeAvailability.d.ts.map +1 -0
- package/dist/solution/BookingTicket/utils/bookingStatus.d.ts.map +1 -0
- package/dist/solution/BookingTicket/utils/cartView.d.ts.map +1 -0
- package/dist/solution/BookingTicket/utils/exampleData.d.ts.map +1 -0
- package/dist/solution/BookingTicket/utils/orderCustomer.d.ts.map +1 -0
- package/dist/solution/BookingTicket/utils/resolveBestAddTimePlan.d.ts.map +1 -0
- package/dist/solution/BookingTicket/utils/scan/applyGlobalScan.d.ts.map +1 -0
- package/dist/solution/BookingTicket/utils/scan/applyGlobalScan.js +94 -58
- package/dist/solution/BookingTicket/utils/scan/applyProductVoucherCollectionScan.d.ts +10 -0
- package/dist/solution/BookingTicket/utils/scan/applyProductVoucherCollectionScan.d.ts.map +1 -0
- package/dist/solution/BookingTicket/utils/scan/applyProductVoucherCollectionScan.js +117 -0
- package/dist/solution/BookingTicket/utils/scan/cloudSearch.d.ts.map +1 -0
- package/dist/solution/BookingTicket/utils/scan/cloudSearch.js +1 -0
- package/dist/solution/BookingTicket/utils/scan/formatGlobalScan.d.ts.map +1 -0
- package/dist/solution/BookingTicket/utils/scan/handleScan.d.ts.map +1 -0
- package/dist/solution/BookingTicket/utils/scan/handleScan.js +2 -1
- package/dist/solution/BookingTicket/utils/scan/index.d.ts.map +1 -0
- package/dist/solution/BookingTicket/utils/scan/scanCache.d.ts.map +1 -0
- package/dist/solution/BookingTicket/utils/scan/scanProductValues.d.ts.map +1 -0
- package/dist/solution/BookingTicket/utils/sessionCatalogStale.d.ts.map +1 -0
- package/dist/solution/BookingTicket/utils/weighingProductSku.d.ts.map +1 -0
- package/dist/solution/BuyTickets/index.d.ts.map +1 -0
- package/dist/solution/BuyTickets/types.d.ts.map +1 -0
- package/dist/solution/Checkout/index.d.ts.map +1 -0
- package/dist/solution/Checkout/types.d.ts.map +1 -0
- package/dist/solution/Checkout/utils/index.d.ts.map +1 -0
- package/dist/solution/PlaceOrder/index.d.ts.map +1 -0
- package/dist/solution/RegisterAndLogin/config.d.ts.map +1 -0
- package/dist/solution/RegisterAndLogin/index.d.ts.map +1 -0
- package/dist/solution/RegisterAndLogin/types.d.ts.map +1 -0
- package/dist/solution/RegisterAndLogin/utils.d.ts.map +1 -0
- package/dist/solution/Sales/index.d.ts.map +1 -0
- package/dist/solution/Sales/types.d.ts.map +1 -0
- package/dist/solution/ScanOrder/index.d.ts.map +1 -0
- package/dist/solution/ScanOrder/types.d.ts.map +1 -0
- package/dist/solution/ScanOrder/utils.d.ts.map +1 -0
- package/dist/solution/ShopDiscount/index.d.ts.map +1 -0
- package/dist/solution/ShopDiscount/types.d.ts.map +1 -0
- package/dist/solution/ShopDiscount/utils.d.ts.map +1 -0
- package/dist/solution/UnifiedBookingSales/index.d.ts +1 -1
- package/dist/solution/UnifiedBookingSales/index.d.ts.map +1 -0
- package/dist/solution/UnifiedBookingSales/index.js +63 -43
- package/dist/solution/UnifiedBookingSales/remoteOccupancyCache.d.ts.map +1 -0
- package/dist/solution/UnifiedBookingSales/types.d.ts.map +1 -0
- package/dist/solution/VenueBooking/index.d.ts.map +1 -0
- package/dist/solution/VenueBooking/types.d.ts.map +1 -0
- package/dist/solution/VenueBooking/utils/dateSummary.d.ts.map +1 -0
- package/dist/solution/VenueBooking/utils/resource.d.ts.map +1 -0
- package/dist/solution/VenueBooking/utils/slotMerge.d.ts.map +1 -0
- package/dist/solution/VenueBooking/utils/timeSlot.d.ts.map +1 -0
- package/dist/solution/VenueBooking/utils.d.ts.map +1 -0
- package/dist/solution/index.d.ts.map +1 -0
- package/dist/store/createStore.d.ts.map +1 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/utils/os-private-payload.d.ts.map +1 -0
- package/dist/utils/payment-number.d.ts.map +1 -0
- package/dist/utils/platform.d.ts +2 -0
- package/dist/utils/platform.d.ts.map +1 -0
- package/dist/utils/platform.js +6 -0
- package/dist/utils/task.d.ts.map +1 -0
- package/dist/utils/watch.d.ts.map +1 -0
- package/lib/index.d.ts +1 -0
- package/lib/index.js +12 -0
- package/lib/inventory/index.d.ts +92 -0
- package/lib/inventory/index.js +287 -0
- package/lib/model/strategy/adapter/promotion/index.js +46 -1
- package/lib/modules/Discount/index.js +1 -0
- package/lib/modules/Order/index.d.ts +25 -3
- package/lib/modules/Order/index.js +145 -11
- package/lib/modules/Order/types.d.ts +7 -0
- package/lib/modules/Order/utils/discountProductLineIdentity.js +1 -1
- package/lib/modules/Order/utils/productVoucherGroups.d.ts +15 -0
- package/lib/modules/Order/utils/productVoucherGroups.js +64 -0
- package/lib/modules/Order/utils.d.ts +5 -3
- package/lib/modules/Order/utils.js +29 -10
- package/lib/modules/ProductList/index.js +15 -0
- package/lib/modules/Rules/index.d.ts +2 -0
- package/lib/modules/Rules/index.js +6 -0
- package/lib/server/modules/floor-plan/index.js +29 -1
- package/lib/solution/BaseSales/index.d.ts +16 -1
- package/lib/solution/BaseSales/index.js +89 -9
- package/lib/solution/BookingByStep/index.d.ts +1 -1
- package/lib/solution/BookingTicket/index.d.ts +1 -1
- package/lib/solution/BookingTicket/index.js +36 -2
- package/lib/solution/BookingTicket/types.d.ts +14 -2
- package/lib/solution/BookingTicket/utils/addProductDecision.d.ts +1 -1
- package/lib/solution/BookingTicket/utils/addProductDecision.js +4 -3
- package/lib/solution/BookingTicket/utils/scan/applyGlobalScan.js +14 -2
- package/lib/solution/BookingTicket/utils/scan/applyProductVoucherCollectionScan.d.ts +10 -0
- package/lib/solution/BookingTicket/utils/scan/applyProductVoucherCollectionScan.js +71 -0
- package/lib/solution/BookingTicket/utils/scan/cloudSearch.js +1 -0
- package/lib/solution/BookingTicket/utils/scan/handleScan.js +2 -1
- package/lib/solution/UnifiedBookingSales/index.d.ts +1 -1
- package/lib/solution/UnifiedBookingSales/index.js +14 -3
- package/lib/utils/platform.d.ts +2 -0
- package/lib/utils/platform.js +7 -0
- package/package.json +4 -2
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/solution/VenueBooking/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,kBAAkB,EAClB,iBAAiB,EACjB,SAAS,EACT,gBAAgB,EAChB,2BAA2B,EAC3B,sCAAsC,EACtC,2BAA2B,EAC3B,mBAAmB,EACnB,gBAAgB,EAChB,aAAa,EACb,eAAe,EACf,oBAAoB,EACpB,oBAAoB,EACpB,uBAAuB,EACvB,+BAA+B,EAC/B,sBAAsB,EACtB,yBAAyB,EACzB,sCAAsC,EACtC,uBAAuB,EACvB,eAAe,EACf,qBAAqB,GACtB,MAAM,oBAAoB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/solution/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,iBAAiB,CAAC;AAChC,cAAc,iBAAiB,CAAC;AAChC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,oBAAoB,CAAC;AACnC,cAAc,YAAY,CAAC;AAC3B,cAAc,SAAS,CAAC;AACxB,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,uBAAuB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"createStore.d.ts","sourceRoot":"","sources":["../../src/store/createStore.ts"],"names":[],"mappings":"AAQA,wBAAgB,WAAW,CAAC,CAAC,SAAS,MAAM,EAC1C,YAAY,EAAE,CAAC,EACf,UAAU,EAAE,MAAM,EAClB,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,KAAK,IAAI,GAC5C;IAAE,KAAK,EAAE,CAAC,CAAA;CAAE,CAiCd"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAGH,MAAM,WAAW,MAAM;IACrB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC;IACvC,OAAO,CAAC,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC;IACrC,eAAe,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,MAAM,GAAG,IAAI,CAAC;CAClD;AAGD,MAAM,WAAW,aAAa;IAC5B,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;CACzB;AAGD,MAAM,WAAW,MAAM;IACrB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,CACV,IAAI,EAAE,UAAU,EAChB,OAAO,EAAE,aAAa,KACnB,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC;IAC1B;;;;;OAKG;IACH,iBAAiB,CAAC,EAAE,CAClB,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CA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AE,MAAM,CAAC;QAAC,OAAO,CAAC,EAAE,aAAa,CAAA;KAAE,CAAC,CAAC;IAC7D,OAAO,CAAC,EAAE,KAAK,CAAC;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,OAAO,CAAC,EAAE,aAAa,CAAA;KAAE,CAAC,CAAC;IAC7D,OAAO,CAAC,EAAE,eAAe,CAAC;IAC1B,gBAAgB;IAChB,MAAM,CAAC,EAAE,aAAa,CAAC;CACxB;AAED,MAAM,WAAW,uBAAuB;IACtC,YAAY,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;IACxC,oBAAoB,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;CACjD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"os-private-payload.d.ts","sourceRoot":"","sources":["../../src/utils/os-private-payload.ts"],"names":[],"mappings":"AAIA;;;GAGG;AACH,wBAAgB,2BAA2B,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,GAAG,CAAC,CASzD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"payment-number.d.ts","sourceRoot":"","sources":["../../src/utils/payment-number.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,0BAA0B,GAAG,CAAC,GAAG,EAAE,MAAM,KAAK,OAAO,CAAC;AAUlE;;GAEG;AACH,wBAAgB,4CAA4C,CAC1D,UAAU,EAAE,0BAA0B,GACrC,MAAM,CASR;AAED;;GAEG;AACH,wBAAsB,gCAAgC,CACpD,UAAU,EAAE,0BAA0B,GACrC,OAAO,CAAC,MAAM,CAAC,CAejB"}
|
package/dist/utils/platform.d.ts
CHANGED
|
@@ -6,3 +6,5 @@ export declare function normalizeRuntimePlatform(platform: unknown): string;
|
|
|
6
6
|
* PC and H5 are authenticated-customer clients rather than staff terminals.
|
|
7
7
|
*/
|
|
8
8
|
export declare function isCustomerUserPlatform(platform: unknown): boolean;
|
|
9
|
+
/** Kiosk and vending retain distinct channels but share self-service checkout behavior. */
|
|
10
|
+
export declare function isSelfServicePlatform(platform: unknown): boolean;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"platform.d.ts","sourceRoot":"","sources":["../../src/utils/platform.ts"],"names":[],"mappings":"AAGA;;GAEG;AACH,wBAAgB,wBAAwB,CAAC,QAAQ,EAAE,OAAO,GAAG,MAAM,CAElE;AAED;;GAEG;AACH,wBAAgB,sBAAsB,CAAC,QAAQ,EAAE,OAAO,GAAG,OAAO,CAEjE;AAED,2FAA2F;AAC3F,wBAAgB,qBAAqB,CAAC,QAAQ,EAAE,OAAO,GAAG,OAAO,CAEhE"}
|
package/dist/utils/platform.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
var CUSTOMER_USER_PLATFORMS = new Set(['pc', 'h5']);
|
|
2
|
+
var SELF_SERVICE_PLATFORMS = new Set(['kiosk', 'vending']);
|
|
2
3
|
|
|
3
4
|
/**
|
|
4
5
|
* Normalize the runtime platform passed through solution/module otherParams.
|
|
@@ -12,4 +13,9 @@ export function normalizeRuntimePlatform(platform) {
|
|
|
12
13
|
*/
|
|
13
14
|
export function isCustomerUserPlatform(platform) {
|
|
14
15
|
return CUSTOMER_USER_PLATFORMS.has(normalizeRuntimePlatform(platform));
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
/** Kiosk and vending retain distinct channels but share self-service checkout behavior. */
|
|
19
|
+
export function isSelfServicePlatform(platform) {
|
|
20
|
+
return SELF_SERVICE_PLATFORMS.has(normalizeRuntimePlatform(platform));
|
|
15
21
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"task.d.ts","sourceRoot":"","sources":["../../src/utils/task.ts"],"names":[],"mappings":"AAAA,KAAK,MAAM,GAAG,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,OAAO,CAAC,GAAG,CAAC,CAAC;AAC/C,KAAK,IAAI,GAAG;IACV,IAAI,EAAE,MAA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AAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,IAAI;IActD;;;OAGG;IACH,0BAA0B,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI;IAKlD;;;OAGG;IACH,wBAAwB,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI;IAQhD;;;;;OAKG;IACH,WAAW,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,cAAc,GAAG,IAAI;IAc1D;;;;OAIG;IACH,OAAO,CAAC,QAAQ,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,GAAG,EAAE,GAAG,IAAI;IA2B/C;;;;;OAKG;IACH,iBAAiB,CAAC,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,GAAG,EAAE,GAAG,IAAI;IAQ3E;;;;OAIG;IACH,qBAAqB,CAAC,QAAQ,EAAE,MAAM,GAAG,cAAc,CAAC,KAAK,CAAC,GAAG,SAAS;IAW1E;;;;OAIG;IACH,UAAU,CAAC,QAAQ,EAAE,MAAM;IAO3B;;OAEG;IACH,cAAc,IAAI,IAAI;IAOtB;;;;OAIG;IACH,kBAAkB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM;IAOzC;;;;OAIG;IACH,cAAc,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO;IAKtC;;;;;OAKG;IACH,IAAI,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,cAAc,GAAG,sBAAsB;CActE;AAGD,QAAA,MAAM,KAAK,OAAc,CAAC;AAE1B,eAAe,KAAK,CAAC"}
|
package/lib/index.d.ts
CHANGED
package/lib/index.js
CHANGED
|
@@ -73,6 +73,18 @@ Object.keys(_model).forEach(function (key) {
|
|
|
73
73
|
}
|
|
74
74
|
});
|
|
75
75
|
});
|
|
76
|
+
var _inventory = require("./inventory");
|
|
77
|
+
Object.keys(_inventory).forEach(function (key) {
|
|
78
|
+
if (key === "default" || key === "__esModule") return;
|
|
79
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
80
|
+
if (key in exports && exports[key] === _inventory[key]) return;
|
|
81
|
+
Object.defineProperty(exports, key, {
|
|
82
|
+
enumerable: true,
|
|
83
|
+
get: function () {
|
|
84
|
+
return _inventory[key];
|
|
85
|
+
}
|
|
86
|
+
});
|
|
87
|
+
});
|
|
76
88
|
var _core = _interopRequireWildcard(require("./core"));
|
|
77
89
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
78
90
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
/** Optional, instance-scoped sales inventory. Never stored in ProductData or order payloads. */
|
|
2
|
+
export type InventoryRecord = Record<string, any>;
|
|
3
|
+
export type InventoryRefreshReason = 'catalog-entry' | 'detail-open' | 'checkout' | 'manual';
|
|
4
|
+
export interface InventoryAvailability {
|
|
5
|
+
status: 'ready' | 'loading' | 'stale' | 'error' | 'unmapped';
|
|
6
|
+
quantity?: number;
|
|
7
|
+
message?: string;
|
|
8
|
+
}
|
|
9
|
+
export interface InventorySelectionAvailability {
|
|
10
|
+
availability: InventoryAvailability;
|
|
11
|
+
/** Stock remaining after other cart lines using the same inventory key. */
|
|
12
|
+
availableQuantity: number;
|
|
13
|
+
/** The existing line can still be reduced when stock is unavailable. */
|
|
14
|
+
retainedQuantity: number;
|
|
15
|
+
maxQuantity: number;
|
|
16
|
+
}
|
|
17
|
+
export interface InventorySource {
|
|
18
|
+
readonly scopeKey: string;
|
|
19
|
+
assertCurrent(): void;
|
|
20
|
+
keyOf(product: InventoryRecord, variant?: InventoryRecord): string | undefined;
|
|
21
|
+
read(context: {
|
|
22
|
+
reason: InventoryRefreshReason;
|
|
23
|
+
signal: AbortSignal;
|
|
24
|
+
}): Promise<ReadonlyMap<string, {
|
|
25
|
+
quantity: number | null;
|
|
26
|
+
message?: string;
|
|
27
|
+
}>>;
|
|
28
|
+
message(reason: 'unavailable' | 'unmapped' | 'insufficient', values?: {
|
|
29
|
+
key: string;
|
|
30
|
+
quantity: number;
|
|
31
|
+
}): string;
|
|
32
|
+
}
|
|
33
|
+
export interface CheckoutInventoryLine {
|
|
34
|
+
readonly lineId: string;
|
|
35
|
+
readonly productId: string | number;
|
|
36
|
+
readonly variantId: string | number;
|
|
37
|
+
readonly quantity: number;
|
|
38
|
+
readonly inventoryKey: string;
|
|
39
|
+
}
|
|
40
|
+
export interface CheckoutRuntimeSnapshot {
|
|
41
|
+
readonly scopeKey: string;
|
|
42
|
+
readonly revision: number;
|
|
43
|
+
readonly lines: readonly CheckoutInventoryLine[];
|
|
44
|
+
}
|
|
45
|
+
export interface SalesCheckoutHooks {
|
|
46
|
+
beforeCheckout?(context: {
|
|
47
|
+
items: readonly InventoryRecord[];
|
|
48
|
+
signal?: AbortSignal;
|
|
49
|
+
}): Promise<void>;
|
|
50
|
+
}
|
|
51
|
+
export declare const salesGuardError: (message: string) => Error & {
|
|
52
|
+
code: string;
|
|
53
|
+
};
|
|
54
|
+
export declare class InventoryController {
|
|
55
|
+
private readonly source;
|
|
56
|
+
readonly identity: symbol;
|
|
57
|
+
readonly scopeKey: string;
|
|
58
|
+
private entries;
|
|
59
|
+
private lastQuantities;
|
|
60
|
+
private products;
|
|
61
|
+
private keys;
|
|
62
|
+
private catalogProducts;
|
|
63
|
+
private listeners;
|
|
64
|
+
private revision;
|
|
65
|
+
private state;
|
|
66
|
+
private pending?;
|
|
67
|
+
private disposed;
|
|
68
|
+
constructor(source: InventorySource);
|
|
69
|
+
getRevision: () => number;
|
|
70
|
+
subscribe: (listener: () => void) => () => void;
|
|
71
|
+
private publish;
|
|
72
|
+
private assertCurrent;
|
|
73
|
+
activate(): void;
|
|
74
|
+
dispose(): void;
|
|
75
|
+
invalidate(): void;
|
|
76
|
+
/** Catalog replaces identities; partial detail only merges its variants, never its prices. */
|
|
77
|
+
registerProducts(products: readonly InventoryRecord[], complete?: boolean): void;
|
|
78
|
+
/** Consumers share I/O; cancelling one detail does not cancel another consumer. */
|
|
79
|
+
refresh(context: {
|
|
80
|
+
reason: InventoryRefreshReason;
|
|
81
|
+
signal?: AbortSignal;
|
|
82
|
+
force?: boolean;
|
|
83
|
+
}): Promise<void>;
|
|
84
|
+
availabilityForKey(key?: string): InventoryAvailability;
|
|
85
|
+
availability(product: InventoryRecord, variantId?: string | number): InventoryAvailability;
|
|
86
|
+
private keyForLine;
|
|
87
|
+
/** Advisory UI limit only. The serialized cart guard remains authoritative. */
|
|
88
|
+
selectionAvailability(product: InventoryRecord, variantId: string | number, items: readonly InventoryRecord[], editingItem?: InventoryRecord): InventorySelectionAvailability;
|
|
89
|
+
private totals;
|
|
90
|
+
validate(proposed: readonly InventoryRecord[], current?: readonly InventoryRecord[], allowReductions?: boolean): void;
|
|
91
|
+
freezeCheckout(items: readonly InventoryRecord[]): CheckoutRuntimeSnapshot;
|
|
92
|
+
}
|
|
@@ -0,0 +1,287 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.salesGuardError = exports.InventoryController = void 0;
|
|
7
|
+
/** Optional, instance-scoped sales inventory. Never stored in ProductData or order payloads. */
|
|
8
|
+
|
|
9
|
+
const salesGuardError = message => Object.assign(new Error(message), {
|
|
10
|
+
code: 'SALES_GUARD_REJECTED'
|
|
11
|
+
});
|
|
12
|
+
exports.salesGuardError = salesGuardError;
|
|
13
|
+
const cancelled = () => Object.assign(new Error('Inventory request cancelled'), {
|
|
14
|
+
name: 'AbortError'
|
|
15
|
+
});
|
|
16
|
+
const variantIdentity = (productId, variantId) => JSON.stringify([String(productId), String(variantId ?? 0)]);
|
|
17
|
+
class InventoryController {
|
|
18
|
+
identity = Symbol('sales-inventory-instance');
|
|
19
|
+
scopeKey;
|
|
20
|
+
entries = new Map();
|
|
21
|
+
lastQuantities = new Map();
|
|
22
|
+
products = new Map();
|
|
23
|
+
keys = new Map();
|
|
24
|
+
catalogProducts = new Map();
|
|
25
|
+
listeners = new Set();
|
|
26
|
+
revision = 0;
|
|
27
|
+
state = 'stale';
|
|
28
|
+
pending;
|
|
29
|
+
disposed = false;
|
|
30
|
+
constructor(source) {
|
|
31
|
+
this.source = source;
|
|
32
|
+
this.scopeKey = source.scopeKey;
|
|
33
|
+
}
|
|
34
|
+
getRevision = () => this.revision;
|
|
35
|
+
subscribe = listener => {
|
|
36
|
+
this.listeners.add(listener);
|
|
37
|
+
return () => {
|
|
38
|
+
this.listeners.delete(listener);
|
|
39
|
+
};
|
|
40
|
+
};
|
|
41
|
+
publish() {
|
|
42
|
+
this.revision += 1;
|
|
43
|
+
this.listeners.forEach(listener => {
|
|
44
|
+
try {
|
|
45
|
+
listener();
|
|
46
|
+
} catch {/* A view cannot interrupt a stock update. */}
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
assertCurrent(signal) {
|
|
50
|
+
if (this.disposed || signal?.aborted) throw cancelled();
|
|
51
|
+
this.source.assertCurrent();
|
|
52
|
+
}
|
|
53
|
+
activate() {
|
|
54
|
+
this.disposed = false;
|
|
55
|
+
}
|
|
56
|
+
dispose() {
|
|
57
|
+
this.disposed = true;
|
|
58
|
+
this.invalidate();
|
|
59
|
+
}
|
|
60
|
+
invalidate() {
|
|
61
|
+
this.pending?.controller.abort();
|
|
62
|
+
this.pending = undefined;
|
|
63
|
+
this.state = 'stale';
|
|
64
|
+
this.publish();
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
/** Catalog replaces identities; partial detail only merges its variants, never its prices. */
|
|
68
|
+
registerProducts(products, complete = false) {
|
|
69
|
+
this.assertCurrent();
|
|
70
|
+
let changed = false;
|
|
71
|
+
for (const product of products) {
|
|
72
|
+
const id = String(product.id ?? product.product_id);
|
|
73
|
+
if (complete && this.catalogProducts.get(id) === product) continue;
|
|
74
|
+
if (complete) this.catalogProducts.set(id, product);
|
|
75
|
+
const previous = this.products.get(id);
|
|
76
|
+
if (complete) for (const variantId of previous?.keys() || []) this.keys.delete(variantIdentity(id, variantId));
|
|
77
|
+
const variants = complete ? new Map() : new Map(previous);
|
|
78
|
+
const list = product.variant?.length ? product.variant : [{
|
|
79
|
+
id: 0,
|
|
80
|
+
code: product.code
|
|
81
|
+
}];
|
|
82
|
+
for (const variant of list) {
|
|
83
|
+
const variantId = String(variant.id ?? variant.product_variant_id ?? 0);
|
|
84
|
+
const key = this.source.keyOf(product, variant) ?? previous?.get(variantId);
|
|
85
|
+
variants.set(variantId, key);
|
|
86
|
+
this.keys.set(variantIdentity(id, variantId), key);
|
|
87
|
+
}
|
|
88
|
+
if (!previous || previous.size !== variants.size || [...variants].some(([id, key]) => previous.get(id) !== key)) changed = true;
|
|
89
|
+
this.products.set(id, variants);
|
|
90
|
+
}
|
|
91
|
+
if (changed) this.publish();
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
/** Consumers share I/O; cancelling one detail does not cancel another consumer. */
|
|
95
|
+
async refresh(context) {
|
|
96
|
+
this.assertCurrent(context.signal);
|
|
97
|
+
if (context.force) this.invalidate();
|
|
98
|
+
let read = this.pending;
|
|
99
|
+
if (!read) {
|
|
100
|
+
read = {
|
|
101
|
+
controller: new AbortController(),
|
|
102
|
+
consumers: 0,
|
|
103
|
+
promise: Promise.resolve()
|
|
104
|
+
};
|
|
105
|
+
const current = read;
|
|
106
|
+
this.pending = current;
|
|
107
|
+
this.state = 'loading';
|
|
108
|
+
this.publish();
|
|
109
|
+
current.promise = (async () => {
|
|
110
|
+
try {
|
|
111
|
+
const entries = await this.source.read({
|
|
112
|
+
reason: context.reason,
|
|
113
|
+
signal: current.controller.signal
|
|
114
|
+
});
|
|
115
|
+
this.assertCurrent(current.controller.signal);
|
|
116
|
+
if (this.pending !== current) throw cancelled();
|
|
117
|
+
this.entries = entries;
|
|
118
|
+
for (const [key, stock] of entries) if (stock.quantity !== null && Number.isSafeInteger(stock.quantity) && stock.quantity >= 0) this.lastQuantities.set(key, stock.quantity);
|
|
119
|
+
this.state = 'ready';
|
|
120
|
+
} catch (error) {
|
|
121
|
+
if (this.pending !== current || current.controller.signal.aborted) throw cancelled();
|
|
122
|
+
this.state = 'error';
|
|
123
|
+
throw error;
|
|
124
|
+
} finally {
|
|
125
|
+
if (this.pending === current) {
|
|
126
|
+
this.pending = undefined;
|
|
127
|
+
this.publish();
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
})();
|
|
131
|
+
}
|
|
132
|
+
read.consumers += 1;
|
|
133
|
+
try {
|
|
134
|
+
if (!context.signal) await read.promise;else await new Promise((resolve, reject) => {
|
|
135
|
+
const signal = context.signal;
|
|
136
|
+
const abort = () => reject(cancelled());
|
|
137
|
+
signal.addEventListener('abort', abort, {
|
|
138
|
+
once: true
|
|
139
|
+
});
|
|
140
|
+
read.promise.then(resolve, reject).finally(() => signal.removeEventListener('abort', abort));
|
|
141
|
+
if (signal.aborted) abort();
|
|
142
|
+
});
|
|
143
|
+
this.assertCurrent(context.signal);
|
|
144
|
+
} finally {
|
|
145
|
+
read.consumers -= 1;
|
|
146
|
+
if (this.pending === read && read.consumers === 0) this.invalidate();
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
availabilityForKey(key) {
|
|
150
|
+
const stock = key ? this.entries.get(key) : undefined;
|
|
151
|
+
const quantity = key ? this.lastQuantities.get(key) : undefined;
|
|
152
|
+
if (this.state !== 'ready') return {
|
|
153
|
+
status: this.state,
|
|
154
|
+
quantity,
|
|
155
|
+
message: this.source.message('unavailable')
|
|
156
|
+
};
|
|
157
|
+
if (!stock) return {
|
|
158
|
+
status: 'unmapped',
|
|
159
|
+
quantity,
|
|
160
|
+
message: this.source.message('unmapped')
|
|
161
|
+
};
|
|
162
|
+
if (stock.quantity === null || !Number.isSafeInteger(stock.quantity) || stock.quantity < 0) return {
|
|
163
|
+
status: 'error',
|
|
164
|
+
quantity,
|
|
165
|
+
message: stock.message || this.source.message('unavailable')
|
|
166
|
+
};
|
|
167
|
+
return {
|
|
168
|
+
status: 'ready',
|
|
169
|
+
quantity: stock.quantity
|
|
170
|
+
};
|
|
171
|
+
}
|
|
172
|
+
availability(product, variantId) {
|
|
173
|
+
const id = product.id ?? product.product_id;
|
|
174
|
+
if (variantId !== undefined && variantId !== null) return this.availabilityForKey(this.keys.get(variantIdentity(id, variantId)));
|
|
175
|
+
const keys = [...new Set(this.products.get(String(id))?.values() || [])];
|
|
176
|
+
const states = keys.map(key => this.availabilityForKey(key));
|
|
177
|
+
if (!states.length) return this.availabilityForKey();
|
|
178
|
+
// Unmapped variants are not offered by this source. Exclude even their last
|
|
179
|
+
// known quantities, while preserving errors on variants that are configured.
|
|
180
|
+
const mappedStates = states.filter(entry => entry.status !== 'unmapped');
|
|
181
|
+
if (!mappedStates.length) return {
|
|
182
|
+
status: 'unmapped',
|
|
183
|
+
message: this.source.message('unmapped')
|
|
184
|
+
};
|
|
185
|
+
const quantity = mappedStates.every(entry => entry.quantity !== undefined) ? mappedStates.reduce((sum, entry) => sum + entry.quantity, 0) : undefined;
|
|
186
|
+
const failed = mappedStates.find(entry => entry.status !== 'ready');
|
|
187
|
+
if (quantity !== undefined && !Number.isSafeInteger(quantity)) return {
|
|
188
|
+
status: 'error',
|
|
189
|
+
message: this.source.message('unavailable')
|
|
190
|
+
};
|
|
191
|
+
return {
|
|
192
|
+
status: failed?.status || 'ready',
|
|
193
|
+
quantity,
|
|
194
|
+
message: failed?.message
|
|
195
|
+
};
|
|
196
|
+
}
|
|
197
|
+
keyForLine(item) {
|
|
198
|
+
return this.keys.get(variantIdentity(item.product_id, item.product_variant_id ?? item.product_sku?.product_variant_id));
|
|
199
|
+
}
|
|
200
|
+
/** Advisory UI limit only. The serialized cart guard remains authoritative. */
|
|
201
|
+
selectionAvailability(product, variantId, items, editingItem) {
|
|
202
|
+
const identity = variantIdentity(product.id ?? product.product_id, variantId);
|
|
203
|
+
const key = this.keys.get(identity);
|
|
204
|
+
let availability = this.availabilityForKey(key);
|
|
205
|
+
let reserved = 0;
|
|
206
|
+
let retainedQuantity = 0;
|
|
207
|
+
for (const item of items) {
|
|
208
|
+
const matches = key ? this.keyForLine(item) === key : variantIdentity(item.product_id, item.product_variant_id ?? item.product_sku?.product_variant_id) === identity;
|
|
209
|
+
if (!matches) continue;
|
|
210
|
+
const count = Number(item.num ?? item.quantity);
|
|
211
|
+
if (!Number.isSafeInteger(count) || count < 0) {
|
|
212
|
+
availability = {
|
|
213
|
+
...availability,
|
|
214
|
+
status: 'error',
|
|
215
|
+
message: this.source.message('unavailable')
|
|
216
|
+
};
|
|
217
|
+
continue;
|
|
218
|
+
}
|
|
219
|
+
if (item === editingItem) retainedQuantity = count;else reserved += count;
|
|
220
|
+
}
|
|
221
|
+
if (!Number.isSafeInteger(reserved)) {
|
|
222
|
+
availability = {
|
|
223
|
+
...availability,
|
|
224
|
+
status: 'error',
|
|
225
|
+
message: this.source.message('unavailable')
|
|
226
|
+
};
|
|
227
|
+
}
|
|
228
|
+
const availableQuantity = availability.status === 'ready' ? Math.max(0, availability.quantity - reserved) : 0;
|
|
229
|
+
return {
|
|
230
|
+
availability,
|
|
231
|
+
availableQuantity,
|
|
232
|
+
retainedQuantity,
|
|
233
|
+
maxQuantity: Math.max(availableQuantity, retainedQuantity)
|
|
234
|
+
};
|
|
235
|
+
}
|
|
236
|
+
totals(items) {
|
|
237
|
+
const totals = new Map();
|
|
238
|
+
for (const item of items) {
|
|
239
|
+
const key = this.keyForLine(item);
|
|
240
|
+
const identity = key ? JSON.stringify(['inventory', key]) : variantIdentity(item.product_id, item.product_variant_id);
|
|
241
|
+
const quantity = Number(item.num ?? item.quantity);
|
|
242
|
+
if (!Number.isSafeInteger(quantity) || quantity < 0) throw salesGuardError(this.source.message('unavailable'));
|
|
243
|
+
if (!quantity) continue;
|
|
244
|
+
const total = (totals.get(identity)?.quantity || 0) + quantity;
|
|
245
|
+
if (!Number.isSafeInteger(total)) throw salesGuardError(this.source.message('unavailable'));
|
|
246
|
+
totals.set(identity, {
|
|
247
|
+
key,
|
|
248
|
+
quantity: total
|
|
249
|
+
});
|
|
250
|
+
}
|
|
251
|
+
return totals;
|
|
252
|
+
}
|
|
253
|
+
validate(proposed, current = [], allowReductions = true) {
|
|
254
|
+
this.assertCurrent();
|
|
255
|
+
const previous = this.totals(current);
|
|
256
|
+
for (const [identity, {
|
|
257
|
+
key,
|
|
258
|
+
quantity
|
|
259
|
+
}] of this.totals(proposed)) {
|
|
260
|
+
if (allowReductions && quantity <= (previous.get(identity)?.quantity || 0)) continue;
|
|
261
|
+
const stock = this.availabilityForKey(key);
|
|
262
|
+
if (stock.status !== 'ready') throw salesGuardError(stock.message || this.source.message('unavailable'));
|
|
263
|
+
if (quantity > stock.quantity) throw salesGuardError(this.source.message('insufficient', {
|
|
264
|
+
key: key,
|
|
265
|
+
quantity: stock.quantity
|
|
266
|
+
}));
|
|
267
|
+
}
|
|
268
|
+
}
|
|
269
|
+
freezeCheckout(items) {
|
|
270
|
+
if (!items.length || items.some(item => Number(item.num ?? item.quantity) <= 0)) {
|
|
271
|
+
throw salesGuardError(this.source.message('unavailable'));
|
|
272
|
+
}
|
|
273
|
+
this.validate(items, [], false);
|
|
274
|
+
return Object.freeze({
|
|
275
|
+
scopeKey: this.scopeKey,
|
|
276
|
+
revision: this.revision,
|
|
277
|
+
lines: Object.freeze(items.map((item, index) => Object.freeze({
|
|
278
|
+
lineId: String(item.metadata?.unique_identification_number ?? item.unique_identification_number ?? item.order_detail_id ?? index),
|
|
279
|
+
productId: item.product_id,
|
|
280
|
+
variantId: item.product_variant_id ?? item.product_sku?.product_variant_id ?? 0,
|
|
281
|
+
quantity: Number(item.num ?? item.quantity),
|
|
282
|
+
inventoryKey: this.keyForLine(item)
|
|
283
|
+
})))
|
|
284
|
+
});
|
|
285
|
+
}
|
|
286
|
+
}
|
|
287
|
+
exports.InventoryController = InventoryController;
|
|
@@ -1 +1,46 @@
|
|
|
1
|
-
"use strict";
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
Object.defineProperty(exports, "BUY_X_GET_Y_FREE_STRATEGY", {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: function () {
|
|
9
|
+
return _examples.BUY_X_GET_Y_FREE_STRATEGY;
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
Object.defineProperty(exports, "ITEM_REWARD_STRATEGY", {
|
|
13
|
+
enumerable: true,
|
|
14
|
+
get: function () {
|
|
15
|
+
return _examples.ITEM_REWARD_STRATEGY;
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
Object.defineProperty(exports, "PromotionAdapter", {
|
|
19
|
+
enumerable: true,
|
|
20
|
+
get: function () {
|
|
21
|
+
return _adapter.PromotionAdapter;
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
Object.defineProperty(exports, "PromotionEvaluator", {
|
|
25
|
+
enumerable: true,
|
|
26
|
+
get: function () {
|
|
27
|
+
return _evaluator.PromotionEvaluator;
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
Object.defineProperty(exports, "X_ITEMS_FOR_Y_PRICE_STRATEGY", {
|
|
31
|
+
enumerable: true,
|
|
32
|
+
get: function () {
|
|
33
|
+
return _examples.X_ITEMS_FOR_Y_PRICE_STRATEGY;
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
Object.defineProperty(exports, "default", {
|
|
37
|
+
enumerable: true,
|
|
38
|
+
get: function () {
|
|
39
|
+
return _adapter.default;
|
|
40
|
+
}
|
|
41
|
+
});
|
|
42
|
+
var _evaluator = require("./evaluator");
|
|
43
|
+
var _adapter = _interopRequireWildcard(require("./adapter"));
|
|
44
|
+
var _examples = require("./examples");
|
|
45
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
46
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
@@ -141,6 +141,7 @@ class DiscountModule extends _BaseModule.BaseModule {
|
|
|
141
141
|
} = options || {};
|
|
142
142
|
const result = await this.request.get(`/machinecode/batch-search`, {
|
|
143
143
|
code,
|
|
144
|
+
resolve_ticket_order: 1,
|
|
144
145
|
translate_flag: 1,
|
|
145
146
|
tags: ['entitlement_pass', 'good_pass', 'product_discount_card'],
|
|
146
147
|
// available: 1,
|
|
@@ -3,7 +3,8 @@ import { BaseModule } from '../BaseModule';
|
|
|
3
3
|
import { OrderModuleAPI, CommitOrderParams, UpdateOrderBookingParams, UpdateOrderProductParams, UpdateOrderProductQuantityParams, CancelOrderParams, ChangeBookingStatusParams, CheckoutOrderParams } from './types';
|
|
4
4
|
import { CartItem } from '../Cart/types';
|
|
5
5
|
import { type SubmitPayloadEnhancer } from './utils';
|
|
6
|
-
import
|
|
6
|
+
import { type ProductVoucherGroup } from './utils/productVoucherGroups';
|
|
7
|
+
import type { OrderAmountSnapshot, AddProductBookingInput, AddProductToOrderOptions, OrderIdentitySnapshot, OrderPaymentSource, OrderSnapshot, OrderSyncState, SyncPaymentsToOrderParams, SyncPaymentsToOrderResult, SubmitSalesOrderParams, OrderProduct, OrderProductIdentity, OrderSummary, OrderTempOrder, OrderPaymentData, OrderPaymentUpdateOptions, OrderPaymentUpdateResult, SendCustomerPayLinkParams, UpdateTempOrderCustomerInput, OrderCustomerPatch, OrderCustomerView, OrderHooksConfig, ReplaceTempOrderOptions, OrderPromotionEvaluator, OrderGiftSelectResolver, OrderUnfulfilledPromotion, OrderLastGiftActions, RemoveProductsFromOrderOptions, SalesNote, SalesNotesMutationSnapshot, SetSalesNoteInput, PickupReferenceMode, PointCardSnapshotMergeContext, PointCardSnapshotItem, ShopServiceData, ShopServiceType } from './types';
|
|
7
8
|
import type { ICustomer } from '../AccountList/types';
|
|
8
9
|
import type { Discount } from '../Discount/types';
|
|
9
10
|
import { UnavailableReason } from '../Rules/types';
|
|
@@ -28,6 +29,12 @@ export declare class OrderModule extends BaseModule implements Module, OrderModu
|
|
|
28
29
|
private rulesHooksOverride?;
|
|
29
30
|
private moduleHooksOverride?;
|
|
30
31
|
private orderHooks?;
|
|
32
|
+
private cartCommandQueue;
|
|
33
|
+
private queueCartCommand;
|
|
34
|
+
/** Use the exact Order normalizers/merge rules on a private draft, not a second projection. */
|
|
35
|
+
private beginCartMutation;
|
|
36
|
+
/** Serializes checkout preparation with local cart commands; hydration remains outside this guard. */
|
|
37
|
+
prepareCheckout<T>(prepare: (items: OrderProduct[]) => Promise<T>): Promise<T>;
|
|
31
38
|
private otherParams?;
|
|
32
39
|
/** 评估器引用;由 SalesSdkProvider 注入,未注入时 applyPromotion 静默跳过 */
|
|
33
40
|
private promotionEvaluator;
|
|
@@ -65,7 +72,11 @@ export declare class OrderModule extends BaseModule implements Module, OrderModu
|
|
|
65
72
|
* @example
|
|
66
73
|
* orderModule.updateOtherParams({ cacheId: 'cache-2', channel: 'pos' });
|
|
67
74
|
*/
|
|
68
|
-
updateOtherParams(params: Record<string, any
|
|
75
|
+
updateOtherParams(params: Record<string, any>, options?: {
|
|
76
|
+
hooks?: OrderHooksConfig;
|
|
77
|
+
changedParams?: Record<string, any>;
|
|
78
|
+
cover?: boolean;
|
|
79
|
+
}): void;
|
|
69
80
|
/** PC/H5 属于在线店铺;其它或缺失平台统一沿用 POS 行为。 */
|
|
70
81
|
isOnlineStorePlatform(): boolean;
|
|
71
82
|
/**
|
|
@@ -81,6 +92,8 @@ export declare class OrderModule extends BaseModule implements Module, OrderModu
|
|
|
81
92
|
*/
|
|
82
93
|
private logError;
|
|
83
94
|
private registerDiscountModules;
|
|
95
|
+
setProductVoucherGroups(groups: ProductVoucherGroup[]): void;
|
|
96
|
+
validateProductVoucherSelection(): void;
|
|
84
97
|
private createDefaultRulesHooks;
|
|
85
98
|
/**
|
|
86
99
|
* Stable across notifyTempOrderChanged's immutable copy, but changes when a
|
|
@@ -99,7 +112,9 @@ export declare class OrderModule extends BaseModule implements Module, OrderModu
|
|
|
99
112
|
getCustomerWalletPrepareConfigEpoch(): number;
|
|
100
113
|
private syncScannedDiscountsToOriginalDiscountList;
|
|
101
114
|
private ensureEditDiscountConfigForProductChange;
|
|
102
|
-
scanCode(code: string, customerId?: number
|
|
115
|
+
scanCode(code: string, customerId?: number, options?: {
|
|
116
|
+
productVouchersOnly?: boolean;
|
|
117
|
+
}): Promise<{
|
|
103
118
|
isAvailable: boolean;
|
|
104
119
|
isAccepted?: boolean;
|
|
105
120
|
discountList: Discount[];
|
|
@@ -475,6 +490,7 @@ export declare class OrderModule extends BaseModule implements Module, OrderModu
|
|
|
475
490
|
* // → tempOrder.products 新增 3 行,每行 num=1,bookings 3 条
|
|
476
491
|
*/
|
|
477
492
|
addProductToOrder(product: Partial<OrderProduct> & OrderProductIdentity, booking?: AddProductBookingInput, options?: AddProductToOrderOptions): Promise<OrderProduct[]>;
|
|
493
|
+
private addProductToOrderDraft;
|
|
478
494
|
/**
|
|
479
495
|
* 批量添加商品行,所有行追加完成后只触发一次促销、折扣、summary 重算与持久化。
|
|
480
496
|
*
|
|
@@ -490,6 +506,7 @@ export declare class OrderModule extends BaseModule implements Module, OrderModu
|
|
|
490
506
|
}>, options?: {
|
|
491
507
|
skipEditDiscountConfigRefresh?: boolean;
|
|
492
508
|
}): Promise<OrderProduct[]>;
|
|
509
|
+
private addProductsToOrderDraft;
|
|
493
510
|
private getFullCoveragePassDiscounts;
|
|
494
511
|
private hasEntitlementPassDiscount;
|
|
495
512
|
private hasGoodPassDiscount;
|
|
@@ -500,8 +517,11 @@ export declare class OrderModule extends BaseModule implements Module, OrderModu
|
|
|
500
517
|
private preservePersistedBundlePriceFields;
|
|
501
518
|
private applyOrderProductUpdateToTempOrder;
|
|
502
519
|
updateOrderProduct(params: UpdateOrderProductParams): Promise<OrderProduct[]>;
|
|
520
|
+
private updateOrderProductDraft;
|
|
503
521
|
updateOrderProducts(paramsList: UpdateOrderProductParams[]): Promise<OrderProduct[]>;
|
|
522
|
+
private updateOrderProductsDraft;
|
|
504
523
|
updateOrderProductQuantity(params: UpdateOrderProductQuantityParams): Promise<OrderProduct[]>;
|
|
524
|
+
private updateOrderProductQuantityDraft;
|
|
505
525
|
updateOrderBooking(params: UpdateOrderBookingParams): any[];
|
|
506
526
|
/**
|
|
507
527
|
* 商品行写路径收尾:促销 → 折扣 → 清洗 → summary → 持久化。
|
|
@@ -518,12 +538,14 @@ export declare class OrderModule extends BaseModule implements Module, OrderModu
|
|
|
518
538
|
* await order.removeProductsFromOrder([identityA, identityB]);
|
|
519
539
|
*/
|
|
520
540
|
removeProductsFromOrder(identities: OrderProductIdentity[], options?: RemoveProductsFromOrderOptions): Promise<OrderProduct[]>;
|
|
541
|
+
private removeProductsFromOrderDraft;
|
|
521
542
|
removeProductFromOrder(identity: OrderProductIdentity, options?: RemoveProductsFromOrderOptions): Promise<OrderProduct[]>;
|
|
522
543
|
/**
|
|
523
544
|
* 仅清空购物车行(products / bookings),不重置整单。
|
|
524
545
|
* 普通整单 note 保持不变;以商品行为主体的 Sales Notes 同步删除。
|
|
525
546
|
*/
|
|
526
547
|
clearOrderCartLines(): Promise<OrderTempOrder>;
|
|
548
|
+
private clearOrderCartLinesDraft;
|
|
527
549
|
/**
|
|
528
550
|
* 切换购物车结算单位时清理所有会影响新币种的订单状态,但保留当前客户。
|
|
529
551
|
*/
|