@unchainedshop/core 4.0.0-rc.15 → 4.0.0-rc.17
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/lib/bulk-importer/createBulkImporter.d.ts +84 -0
- package/lib/bulk-importer/createBulkImporter.d.ts.map +1 -0
- package/lib/bulk-importer/createBulkImporter.js +142 -0
- package/lib/bulk-importer/createBulkImporter.js.map +1 -0
- package/lib/bulk-importer/handlers/assortment/create.d.ts +565 -0
- package/lib/bulk-importer/handlers/assortment/create.d.ts.map +1 -0
- package/lib/bulk-importer/handlers/assortment/create.js +89 -0
- package/lib/bulk-importer/handlers/assortment/create.js.map +1 -0
- package/lib/bulk-importer/handlers/assortment/index.d.ts +4 -0
- package/lib/bulk-importer/handlers/assortment/index.d.ts.map +1 -0
- package/lib/bulk-importer/handlers/assortment/index.js +4 -0
- package/lib/bulk-importer/handlers/assortment/index.js.map +1 -0
- package/lib/bulk-importer/handlers/assortment/remove.d.ts +30 -0
- package/lib/bulk-importer/handlers/assortment/remove.d.ts.map +1 -0
- package/lib/bulk-importer/handlers/assortment/remove.js +18 -0
- package/lib/bulk-importer/handlers/assortment/remove.js.map +1 -0
- package/lib/bulk-importer/handlers/assortment/update.d.ts +566 -0
- package/lib/bulk-importer/handlers/assortment/update.d.ts.map +1 -0
- package/lib/bulk-importer/handlers/assortment/update.js +98 -0
- package/lib/bulk-importer/handlers/assortment/update.js.map +1 -0
- package/lib/bulk-importer/handlers/assortment/upsertAssortmentChildren.d.ts +29 -0
- package/lib/bulk-importer/handlers/assortment/upsertAssortmentChildren.d.ts.map +1 -0
- package/lib/bulk-importer/handlers/assortment/upsertAssortmentChildren.js +45 -0
- package/lib/bulk-importer/handlers/assortment/upsertAssortmentChildren.js.map +1 -0
- package/lib/bulk-importer/handlers/assortment/upsertAssortmentFilters.d.ts +29 -0
- package/lib/bulk-importer/handlers/assortment/upsertAssortmentFilters.d.ts.map +1 -0
- package/lib/bulk-importer/handlers/assortment/upsertAssortmentFilters.js +41 -0
- package/lib/bulk-importer/handlers/assortment/upsertAssortmentFilters.js.map +1 -0
- package/lib/bulk-importer/handlers/assortment/upsertAssortmentProducts.d.ts +29 -0
- package/lib/bulk-importer/handlers/assortment/upsertAssortmentProducts.d.ts.map +1 -0
- package/lib/bulk-importer/handlers/assortment/upsertAssortmentProducts.js +46 -0
- package/lib/bulk-importer/handlers/assortment/upsertAssortmentProducts.js.map +1 -0
- package/lib/bulk-importer/handlers/assortment/upsertMedia.d.ts +76 -0
- package/lib/bulk-importer/handlers/assortment/upsertMedia.d.ts.map +1 -0
- package/lib/bulk-importer/handlers/assortment/upsertMedia.js +53 -0
- package/lib/bulk-importer/handlers/assortment/upsertMedia.js.map +1 -0
- package/lib/bulk-importer/handlers/filter/create.d.ts +138 -0
- package/lib/bulk-importer/handlers/filter/create.d.ts.map +1 -0
- package/lib/bulk-importer/handlers/filter/create.js +80 -0
- package/lib/bulk-importer/handlers/filter/create.js.map +1 -0
- package/lib/bulk-importer/handlers/filter/index.d.ts +4 -0
- package/lib/bulk-importer/handlers/filter/index.d.ts.map +1 -0
- package/lib/bulk-importer/handlers/filter/index.js +4 -0
- package/lib/bulk-importer/handlers/filter/index.js.map +1 -0
- package/lib/bulk-importer/handlers/filter/remove.d.ts +20 -0
- package/lib/bulk-importer/handlers/filter/remove.d.ts.map +1 -0
- package/lib/bulk-importer/handlers/filter/remove.js +18 -0
- package/lib/bulk-importer/handlers/filter/remove.js.map +1 -0
- package/lib/bulk-importer/handlers/filter/update.d.ts +138 -0
- package/lib/bulk-importer/handlers/filter/update.d.ts.map +1 -0
- package/lib/bulk-importer/handlers/filter/update.js +70 -0
- package/lib/bulk-importer/handlers/filter/update.js.map +1 -0
- package/lib/bulk-importer/handlers/product/create.d.ts +1330 -0
- package/lib/bulk-importer/handlers/product/create.d.ts.map +1 -0
- package/lib/bulk-importer/handlers/product/create.js +132 -0
- package/lib/bulk-importer/handlers/product/create.js.map +1 -0
- package/lib/bulk-importer/handlers/product/index.d.ts +4 -0
- package/lib/bulk-importer/handlers/product/index.d.ts.map +1 -0
- package/lib/bulk-importer/handlers/product/index.js +4 -0
- package/lib/bulk-importer/handlers/product/index.js.map +1 -0
- package/lib/bulk-importer/handlers/product/remove.d.ts +32 -0
- package/lib/bulk-importer/handlers/product/remove.d.ts.map +1 -0
- package/lib/bulk-importer/handlers/product/remove.js +18 -0
- package/lib/bulk-importer/handlers/product/remove.js.map +1 -0
- package/lib/bulk-importer/handlers/product/transformSpecificationToProductStructure.d.ts +280 -0
- package/lib/bulk-importer/handlers/product/transformSpecificationToProductStructure.d.ts.map +1 -0
- package/lib/bulk-importer/handlers/product/transformSpecificationToProductStructure.js +77 -0
- package/lib/bulk-importer/handlers/product/transformSpecificationToProductStructure.js.map +1 -0
- package/lib/bulk-importer/handlers/product/update.d.ts +1330 -0
- package/lib/bulk-importer/handlers/product/update.d.ts.map +1 -0
- package/lib/bulk-importer/handlers/product/update.js +132 -0
- package/lib/bulk-importer/handlers/product/update.js.map +1 -0
- package/lib/bulk-importer/handlers/product/upsertMedia.d.ts +75 -0
- package/lib/bulk-importer/handlers/product/upsertMedia.d.ts.map +1 -0
- package/lib/bulk-importer/handlers/product/upsertMedia.js +59 -0
- package/lib/bulk-importer/handlers/product/upsertMedia.js.map +1 -0
- package/lib/bulk-importer/handlers/product/upsertVariations.d.ts +79 -0
- package/lib/bulk-importer/handlers/product/upsertVariations.d.ts.map +1 -0
- package/lib/bulk-importer/handlers/product/upsertVariations.js +72 -0
- package/lib/bulk-importer/handlers/product/upsertVariations.js.map +1 -0
- package/lib/bulk-importer/handlers/utils/convertTagsToLowerCase.d.ts +3 -0
- package/lib/bulk-importer/handlers/utils/convertTagsToLowerCase.d.ts.map +1 -0
- package/lib/bulk-importer/handlers/utils/convertTagsToLowerCase.js +6 -0
- package/lib/bulk-importer/handlers/utils/convertTagsToLowerCase.js.map +1 -0
- package/lib/bulk-importer/handlers/utils/event-schema.d.ts +21 -0
- package/lib/bulk-importer/handlers/utils/event-schema.d.ts.map +1 -0
- package/lib/bulk-importer/handlers/utils/event-schema.js +64 -0
- package/lib/bulk-importer/handlers/utils/event-schema.js.map +1 -0
- package/lib/bulk-importer/index.d.ts +4 -0
- package/lib/bulk-importer/index.d.ts.map +1 -0
- package/lib/bulk-importer/index.js +4 -0
- package/lib/bulk-importer/index.js.map +1 -0
- package/lib/bulk-importer/upsertAsset.d.ts +28 -0
- package/lib/bulk-importer/upsertAsset.d.ts.map +1 -0
- package/lib/bulk-importer/upsertAsset.js +41 -0
- package/lib/bulk-importer/upsertAsset.js.map +1 -0
- package/lib/core-index.d.ts +8 -6
- package/lib/core-index.d.ts.map +1 -1
- package/lib/core-index.js +4 -1
- package/lib/core-index.js.map +1 -1
- package/lib/directors/BaseDiscountAdapter.d.ts +4 -4
- package/lib/directors/BaseDiscountAdapter.d.ts.map +1 -1
- package/lib/directors/BaseDiscountAdapter.js +1 -1
- package/lib/directors/BaseDiscountAdapter.js.map +1 -1
- package/lib/directors/BaseDiscountDirector.d.ts +1 -1
- package/lib/directors/BaseDiscountDirector.d.ts.map +1 -1
- package/lib/directors/BaseDiscountDirector.js +1 -1
- package/lib/directors/BaseDiscountDirector.js.map +1 -1
- package/lib/directors/BasePricingAdapter.d.ts +2 -2
- package/lib/directors/BasePricingAdapter.d.ts.map +1 -1
- package/lib/directors/BasePricingDirector.d.ts.map +1 -1
- package/lib/directors/BasePricingDirector.js +3 -3
- package/lib/directors/BasePricingDirector.js.map +1 -1
- package/lib/directors/BasePricingSheet.js.map +1 -1
- package/lib/directors/BaseWorker.js +1 -1
- package/lib/directors/BaseWorker.js.map +1 -1
- package/lib/directors/DeliveryAdapter.d.ts +3 -3
- package/lib/directors/DeliveryAdapter.d.ts.map +1 -1
- package/lib/directors/DeliveryDirector.d.ts +3 -3
- package/lib/directors/DeliveryDirector.d.ts.map +1 -1
- package/lib/directors/DeliveryDirector.js +29 -16
- package/lib/directors/DeliveryDirector.js.map +1 -1
- package/lib/directors/DeliveryPricingAdapter.d.ts +1 -1
- package/lib/directors/DeliveryPricingAdapter.d.ts.map +1 -1
- package/lib/directors/DeliveryPricingDirector.d.ts.map +1 -1
- package/lib/directors/DeliveryPricingDirector.js +3 -4
- package/lib/directors/DeliveryPricingDirector.js.map +1 -1
- package/lib/directors/DeliveryPricingSheet.d.ts.map +1 -1
- package/lib/directors/DeliveryPricingSheet.js +2 -1
- package/lib/directors/DeliveryPricingSheet.js.map +1 -1
- package/lib/directors/EnrollmentAdapter.d.ts +7 -4
- package/lib/directors/EnrollmentAdapter.d.ts.map +1 -1
- package/lib/directors/EnrollmentAdapter.js +1 -4
- package/lib/directors/EnrollmentAdapter.js.map +1 -1
- package/lib/directors/EnrollmentDirector.d.ts +1 -1
- package/lib/directors/EnrollmentDirector.d.ts.map +1 -1
- package/lib/directors/EnrollmentDirector.js +1 -5
- package/lib/directors/EnrollmentDirector.js.map +1 -1
- package/lib/directors/FilterAdapter.d.ts +3 -3
- package/lib/directors/FilterAdapter.d.ts.map +1 -1
- package/lib/directors/FilterDirector.d.ts +1 -1
- package/lib/directors/FilterDirector.d.ts.map +1 -1
- package/lib/directors/FilterDirector.js +1 -1
- package/lib/directors/FilterDirector.js.map +1 -1
- package/lib/directors/MessagingDirector.d.ts +1 -1
- package/lib/directors/OrderDiscountAdapter.d.ts +1 -1
- package/lib/directors/OrderDiscountAdapter.d.ts.map +1 -1
- package/lib/directors/OrderDiscountAdapter.js.map +1 -1
- package/lib/directors/OrderPricingAdapter.d.ts +2 -2
- package/lib/directors/OrderPricingAdapter.d.ts.map +1 -1
- package/lib/directors/OrderPricingDirector.d.ts +2 -2
- package/lib/directors/OrderPricingDirector.d.ts.map +1 -1
- package/lib/directors/OrderPricingDirector.js +1 -1
- package/lib/directors/OrderPricingDirector.js.map +1 -1
- package/lib/directors/OrderPricingSheet.d.ts.map +1 -1
- package/lib/directors/OrderPricingSheet.js +2 -1
- package/lib/directors/OrderPricingSheet.js.map +1 -1
- package/lib/directors/PaymentAdapter.d.ts +2 -2
- package/lib/directors/PaymentAdapter.d.ts.map +1 -1
- package/lib/directors/PaymentDirector.d.ts +4 -4
- package/lib/directors/PaymentDirector.d.ts.map +1 -1
- package/lib/directors/PaymentDirector.js +24 -6
- package/lib/directors/PaymentDirector.js.map +1 -1
- package/lib/directors/PaymentPricingAdapter.d.ts +2 -2
- package/lib/directors/PaymentPricingAdapter.d.ts.map +1 -1
- package/lib/directors/PaymentPricingDirector.d.ts +1 -1
- package/lib/directors/PaymentPricingDirector.d.ts.map +1 -1
- package/lib/directors/PaymentPricingDirector.js +3 -5
- package/lib/directors/PaymentPricingDirector.js.map +1 -1
- package/lib/directors/PaymentPricingSheet.d.ts.map +1 -1
- package/lib/directors/PaymentPricingSheet.js +2 -1
- package/lib/directors/PaymentPricingSheet.js.map +1 -1
- package/lib/directors/ProductDiscountAdapter.d.ts +1 -1
- package/lib/directors/ProductDiscountAdapter.d.ts.map +1 -1
- package/lib/directors/ProductDiscountAdapter.js.map +1 -1
- package/lib/directors/ProductDiscountConfiguration.d.ts +1 -1
- package/lib/directors/ProductDiscountConfiguration.d.ts.map +1 -1
- package/lib/directors/ProductPricingAdapter.d.ts +1 -1
- package/lib/directors/ProductPricingAdapter.d.ts.map +1 -1
- package/lib/directors/ProductPricingDirector.d.ts +2 -2
- package/lib/directors/ProductPricingDirector.d.ts.map +1 -1
- package/lib/directors/ProductPricingDirector.js +3 -3
- package/lib/directors/ProductPricingDirector.js.map +1 -1
- package/lib/directors/ProductPricingSheet.d.ts +2 -2
- package/lib/directors/ProductPricingSheet.d.ts.map +1 -1
- package/lib/directors/ProductPricingSheet.js +2 -1
- package/lib/directors/ProductPricingSheet.js.map +1 -1
- package/lib/directors/QuotationAdapter.d.ts +2 -2
- package/lib/directors/QuotationAdapter.d.ts.map +1 -1
- package/lib/directors/QuotationDirector.js +2 -2
- package/lib/directors/WarehousingAdapter.d.ts +3 -4
- package/lib/directors/WarehousingAdapter.d.ts.map +1 -1
- package/lib/directors/WarehousingAdapter.js.map +1 -1
- package/lib/directors/WarehousingDirector.d.ts +5 -5
- package/lib/directors/WarehousingDirector.d.ts.map +1 -1
- package/lib/directors/WarehousingDirector.js +10 -13
- package/lib/directors/WarehousingDirector.js.map +1 -1
- package/lib/directors/WorkerAdapter.d.ts +3 -2
- package/lib/directors/WorkerAdapter.d.ts.map +1 -1
- package/lib/directors/WorkerAdapter.js +1 -1
- package/lib/directors/WorkerAdapter.js.map +1 -1
- package/lib/directors/WorkerDirector.d.ts +2 -2
- package/lib/directors/WorkerDirector.d.ts.map +1 -1
- package/lib/directors/WorkerDirector.js +2 -3
- package/lib/directors/WorkerDirector.js.map +1 -1
- package/lib/modules.d.ts +1 -1
- package/lib/modules.d.ts.map +1 -1
- package/lib/modules.js +1 -0
- package/lib/modules.js.map +1 -1
- package/lib/services/activateEnrollment.d.ts.map +1 -1
- package/lib/services/activateEnrollment.js +8 -12
- package/lib/services/activateEnrollment.js.map +1 -1
- package/lib/services/addMessage.d.ts +4 -0
- package/lib/services/addMessage.d.ts.map +1 -0
- package/lib/services/addMessage.js +15 -0
- package/lib/services/addMessage.js.map +1 -0
- package/lib/services/calculateDiscountTotal.js +2 -2
- package/lib/services/calculateDiscountTotal.js.map +1 -1
- package/lib/services/checkoutOrder.d.ts +1 -1
- package/lib/services/checkoutOrder.d.ts.map +1 -1
- package/lib/services/checkoutOrder.js +9 -3
- package/lib/services/checkoutOrder.js.map +1 -1
- package/lib/services/confirmOrder.d.ts +1 -1
- package/lib/services/confirmOrder.d.ts.map +1 -1
- package/lib/services/createDownloadStream.d.ts +1 -1
- package/lib/services/createDownloadStream.d.ts.map +1 -1
- package/lib/services/createDownloadStream.js +2 -0
- package/lib/services/createDownloadStream.js.map +1 -1
- package/lib/services/createEnrollmentFromCheckout.d.ts.map +1 -1
- package/lib/services/createEnrollmentFromCheckout.js +2 -2
- package/lib/services/createEnrollmentFromCheckout.js.map +1 -1
- package/lib/services/createManualOrderDiscount.d.ts +2 -2
- package/lib/services/createManualOrderDiscount.d.ts.map +1 -1
- package/lib/services/createSignedURL.d.ts.map +1 -1
- package/lib/services/createSignedURL.js +2 -0
- package/lib/services/createSignedURL.js.map +1 -1
- package/lib/services/deleteUser.d.ts +1 -1
- package/lib/services/deleteUser.d.ts.map +1 -1
- package/lib/services/deleteUser.js +4 -2
- package/lib/services/deleteUser.js.map +1 -1
- package/lib/services/discountedEntities.js.map +1 -1
- package/lib/services/findOrInitCart.d.ts +1 -2
- package/lib/services/findOrInitCart.d.ts.map +1 -1
- package/lib/services/findOrInitCart.js.map +1 -1
- package/lib/services/fullfillQuotation.d.ts +1 -1
- package/lib/services/fullfillQuotation.d.ts.map +1 -1
- package/lib/services/fullfillQuotation.js.map +1 -1
- package/lib/services/generateOrderFromEnrollment.d.ts +7 -0
- package/lib/services/generateOrderFromEnrollment.d.ts.map +1 -0
- package/lib/services/generateOrderFromEnrollment.js +34 -0
- package/lib/services/generateOrderFromEnrollment.js.map +1 -0
- package/lib/services/index.d.ts +6 -0
- package/lib/services/index.d.ts.map +1 -1
- package/lib/services/index.js +6 -0
- package/lib/services/index.js.map +1 -1
- package/lib/services/initCartProviders.js.map +1 -1
- package/lib/services/initializeEnrollment.d.ts +1 -1
- package/lib/services/initializeEnrollment.d.ts.map +1 -1
- package/lib/services/initializeEnrollment.js +11 -12
- package/lib/services/initializeEnrollment.js.map +1 -1
- package/lib/services/linkFileService.d.ts +1 -1
- package/lib/services/linkFileService.d.ts.map +1 -1
- package/lib/services/linkFileService.js +3 -1
- package/lib/services/linkFileService.js.map +1 -1
- package/lib/services/loadFilterOptions.d.ts +2 -2
- package/lib/services/loadFilterOptions.d.ts.map +1 -1
- package/lib/services/migrateOrderCart.d.ts +1 -1
- package/lib/services/migrateOrderCart.d.ts.map +1 -1
- package/lib/services/nextUserCart.d.ts +1 -1
- package/lib/services/nextUserCart.d.ts.map +1 -1
- package/lib/services/nextUserCart.js +1 -1
- package/lib/services/nextUserCart.js.map +1 -1
- package/lib/services/processEnrollment.d.ts.map +1 -1
- package/lib/services/processEnrollment.js +13 -5
- package/lib/services/processEnrollment.js.map +1 -1
- package/lib/services/processOrder.d.ts.map +1 -1
- package/lib/services/processOrder.js +26 -30
- package/lib/services/processOrder.js.map +1 -1
- package/lib/services/processQuotation.d.ts.map +1 -1
- package/lib/services/processQuotation.js +10 -14
- package/lib/services/processQuotation.js.map +1 -1
- package/lib/services/proposeQuotation.d.ts +1 -1
- package/lib/services/proposeQuotation.d.ts.map +1 -1
- package/lib/services/proposeQuotation.js +2 -2
- package/lib/services/proposeQuotation.js.map +1 -1
- package/lib/services/registerPaymentCredentials.d.ts +1 -2
- package/lib/services/registerPaymentCredentials.d.ts.map +1 -1
- package/lib/services/registerPaymentCredentials.js +4 -6
- package/lib/services/registerPaymentCredentials.js.map +1 -1
- package/lib/services/rejectOrder.d.ts +1 -1
- package/lib/services/rejectOrder.d.ts.map +1 -1
- package/lib/services/rejectQuotation.d.ts +1 -1
- package/lib/services/rejectQuotation.d.ts.map +1 -1
- package/lib/services/rejectQuotation.js +2 -2
- package/lib/services/rejectQuotation.js.map +1 -1
- package/lib/services/removeFiles.js +2 -2
- package/lib/services/removeFiles.js.map +1 -1
- package/lib/services/removeProduct.js +3 -3
- package/lib/services/removeProduct.js.map +1 -1
- package/lib/services/searchAssortments.js +1 -1
- package/lib/services/searchAssortments.js.map +1 -1
- package/lib/services/searchProducts.js +1 -1
- package/lib/services/searchProducts.js.map +1 -1
- package/lib/services/simulateProductDispatching.d.ts +1 -1
- package/lib/services/simulateProductDispatching.d.ts.map +1 -1
- package/lib/services/simulateProductInventory.d.ts +1 -1
- package/lib/services/simulateProductInventory.d.ts.map +1 -1
- package/lib/services/simulateProductInventory.js.map +1 -1
- package/lib/services/simulateProductPricing.d.ts +7 -4
- package/lib/services/simulateProductPricing.d.ts.map +1 -1
- package/lib/services/simulateProductPricing.js.map +1 -1
- package/lib/services/terminateEnrollment.d.ts.map +1 -1
- package/lib/services/terminateEnrollment.js +5 -9
- package/lib/services/terminateEnrollment.js.map +1 -1
- package/lib/services/updateCalculation.d.ts +2 -1
- package/lib/services/updateCalculation.d.ts.map +1 -1
- package/lib/services/updateCalculation.js +16 -10
- package/lib/services/updateCalculation.js.map +1 -1
- package/lib/services/updateScheduling.d.ts +1 -1
- package/lib/services/updateScheduling.d.ts.map +1 -1
- package/lib/services/updateScheduling.js +7 -11
- package/lib/services/updateScheduling.js.map +1 -1
- package/lib/services/updateUserAvatarAfterUpload.d.ts +1 -1
- package/lib/services/updateUserAvatarAfterUpload.d.ts.map +1 -1
- package/lib/services/updateUserAvatarAfterUpload.js.map +1 -1
- package/lib/services/uploadFileFromStream.d.ts.map +1 -1
- package/lib/services/uploadFileFromStream.js +4 -1
- package/lib/services/uploadFileFromStream.js.map +1 -1
- package/lib/services/uploadFileFromURL.d.ts +1 -2
- package/lib/services/uploadFileFromURL.d.ts.map +1 -1
- package/lib/services/uploadFileFromURL.js.map +1 -1
- package/lib/services/validateOrder.d.ts +1 -1
- package/lib/services/validateOrder.d.ts.map +1 -1
- package/lib/services/validateOrder.js +17 -24
- package/lib/services/validateOrder.js.map +1 -1
- package/lib/services/verifyQuotation.d.ts +1 -1
- package/lib/services/verifyQuotation.d.ts.map +1 -1
- package/lib/services/verifyQuotation.js +2 -2
- package/lib/services/verifyQuotation.js.map +1 -1
- package/package.json +21 -20
- package/src/bulk-importer/createBulkImporter.ts +205 -0
- package/src/bulk-importer/handlers/assortment/create.ts +118 -0
- package/src/bulk-importer/handlers/assortment/index.ts +3 -0
- package/src/bulk-importer/handlers/assortment/remove.ts +26 -0
- package/src/bulk-importer/handlers/assortment/update.ts +133 -0
- package/src/bulk-importer/handlers/assortment/upsertAssortmentChildren.ts +77 -0
- package/src/bulk-importer/handlers/assortment/upsertAssortmentFilters.ts +70 -0
- package/src/bulk-importer/handlers/assortment/upsertAssortmentProducts.ts +76 -0
- package/src/bulk-importer/handlers/assortment/upsertMedia.ts +76 -0
- package/src/bulk-importer/handlers/filter/create.ts +104 -0
- package/src/bulk-importer/handlers/filter/index.ts +3 -0
- package/src/bulk-importer/handlers/filter/remove.ts +25 -0
- package/src/bulk-importer/handlers/filter/update.ts +94 -0
- package/src/bulk-importer/handlers/product/create.ts +170 -0
- package/src/bulk-importer/handlers/product/index.ts +3 -0
- package/src/bulk-importer/handlers/product/remove.ts +27 -0
- package/src/bulk-importer/handlers/product/update.ts +175 -0
- package/src/bulk-importer/handlers/product/upsertMedia.ts +81 -0
- package/src/bulk-importer/handlers/product/upsertVariations.ts +110 -0
- package/src/bulk-importer/handlers/utils/convertTagsToLowerCase.ts +4 -0
- package/src/bulk-importer/index.ts +3 -0
- package/src/bulk-importer/upsertAsset.ts +50 -0
- package/src/core-index.ts +9 -6
- package/src/directors/BaseDiscountAdapter.test.ts +1 -1
- package/src/directors/BaseDiscountAdapter.ts +5 -5
- package/src/directors/BaseDiscountDirector.ts +2 -2
- package/src/directors/BasePricingAdapter.ts +2 -2
- package/src/directors/BasePricingDirector.ts +47 -44
- package/src/directors/BasePricingSheet.ts +1 -1
- package/src/directors/BaseWorker.ts +1 -1
- package/src/directors/DeliveryAdapter.ts +3 -3
- package/src/directors/DeliveryDirector.ts +33 -23
- package/src/directors/DeliveryPricingAdapter.ts +1 -1
- package/src/directors/DeliveryPricingDirector.ts +5 -6
- package/src/directors/DeliveryPricingSheet.ts +3 -2
- package/src/directors/EnrollmentAdapter.ts +9 -6
- package/src/directors/EnrollmentDirector.ts +9 -8
- package/src/directors/FilterAdapter.ts +3 -3
- package/src/directors/FilterDirector.ts +5 -5
- package/src/directors/OrderDiscountAdapter.ts +2 -2
- package/src/directors/OrderPricingAdapter.ts +2 -2
- package/src/directors/OrderPricingDirector.ts +3 -3
- package/src/directors/OrderPricingSheet.ts +3 -2
- package/src/directors/PaymentAdapter.ts +2 -2
- package/src/directors/PaymentDirector.ts +34 -10
- package/src/directors/PaymentPricingAdapter.ts +2 -2
- package/src/directors/PaymentPricingDirector.ts +6 -8
- package/src/directors/PaymentPricingSheet.ts +3 -2
- package/src/directors/ProductDiscountAdapter.ts +2 -2
- package/src/directors/ProductDiscountConfiguration.ts +1 -1
- package/src/directors/ProductPricingAdapter.ts +1 -1
- package/src/directors/ProductPricingDirector.ts +7 -7
- package/src/directors/ProductPricingSheet.ts +4 -3
- package/src/directors/QuotationAdapter.ts +2 -2
- package/src/directors/QuotationDirector.ts +2 -2
- package/src/directors/WarehousingAdapter.ts +3 -4
- package/src/directors/WarehousingDirector.ts +20 -23
- package/src/directors/WorkerAdapter.ts +9 -4
- package/src/directors/WorkerDirector.ts +5 -6
- package/src/modules.ts +2 -1
- package/src/services/activateEnrollment.ts +9 -13
- package/src/services/addMessage.ts +20 -0
- package/src/services/calculateDiscountTotal.ts +4 -4
- package/src/services/checkoutOrder.ts +9 -4
- package/src/services/createDownloadStream.ts +1 -0
- package/src/services/createEnrollmentFromCheckout.ts +22 -20
- package/src/services/createManualOrderDiscount.ts +2 -2
- package/src/services/createSignedURL.ts +1 -0
- package/src/services/deleteUser.ts +7 -2
- package/src/services/discountedEntities.ts +6 -6
- package/src/services/findOrInitCart.ts +1 -2
- package/src/services/fullfillQuotation.ts +1 -1
- package/src/services/generateOrderFromEnrollment.ts +54 -0
- package/src/services/index.ts +8 -0
- package/src/services/initCartProviders.ts +2 -2
- package/src/services/initializeEnrollment.ts +16 -13
- package/src/services/linkFileService.ts +3 -1
- package/src/services/nextUserCart.ts +1 -1
- package/src/services/processEnrollment.ts +18 -6
- package/src/services/processOrder.ts +33 -36
- package/src/services/processQuotation.ts +10 -14
- package/src/services/proposeQuotation.ts +2 -2
- package/src/services/registerPaymentCredentials.ts +6 -8
- package/src/services/rejectQuotation.ts +2 -2
- package/src/services/removeFiles.ts +2 -2
- package/src/services/removeProduct.ts +3 -3
- package/src/services/searchAssortments.ts +1 -1
- package/src/services/searchProducts.ts +1 -1
- package/src/services/simulateProductDispatching.ts +1 -1
- package/src/services/simulateProductInventory.ts +7 -3
- package/src/services/simulateProductPricing.ts +6 -3
- package/src/services/terminateEnrollment.ts +5 -9
- package/src/services/updateCalculation.ts +33 -18
- package/src/services/updateScheduling.ts +19 -20
- package/src/services/updateUserAvatarAfterUpload.ts +4 -1
- package/src/services/uploadFileFromStream.ts +3 -1
- package/src/services/uploadFileFromURL.ts +2 -2
- package/src/services/validateOrder.ts +34 -38
- package/src/services/verifyQuotation.ts +2 -2
- package/lib/factory/registerProductDiscoverabilityFilter copy.d.ts +0 -5
- package/lib/factory/registerProductDiscoverabilityFilter copy.d.ts.map +0 -1
- package/lib/factory/registerProductDiscoverabilityFilter copy.js +0 -28
- package/lib/factory/registerProductDiscoverabilityFilter copy.js.map +0 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Modules } from '../modules.js';
|
|
2
2
|
import { supportedWarehousingProvidersService } from './supportedWarehousingProviders.js';
|
|
3
3
|
import { Product } from '@unchainedshop/core-products';
|
|
4
|
-
import {
|
|
4
|
+
import { WarehousingDirector } from '../directors/WarehousingDirector.js';
|
|
5
5
|
import { WarehousingContext } from '../directors/WarehousingAdapter.js';
|
|
6
6
|
import { WarehousingProvider } from '@unchainedshop/core-warehousing';
|
|
7
7
|
|
|
@@ -18,7 +18,11 @@ export async function simulateProductInventoryService(
|
|
|
18
18
|
const deliveryProviders = await this.delivery.allProviders();
|
|
19
19
|
|
|
20
20
|
return deliveryProviders.reduce<
|
|
21
|
-
Promise<
|
|
21
|
+
Promise<
|
|
22
|
+
(WarehousingContext & { quantity?: number } & {
|
|
23
|
+
warehousingProvider: WarehousingProvider;
|
|
24
|
+
})[]
|
|
25
|
+
>
|
|
22
26
|
>(async (oldResult, deliveryProvider) => {
|
|
23
27
|
const result = await oldResult;
|
|
24
28
|
|
|
@@ -31,7 +35,7 @@ export async function simulateProductInventoryService(
|
|
|
31
35
|
|
|
32
36
|
const mappedWarehousingProviders = await Promise.all(
|
|
33
37
|
warehousingProviders.map(async (warehousingProvider) => {
|
|
34
|
-
const warehousingContext
|
|
38
|
+
const warehousingContext = {
|
|
35
39
|
deliveryProvider,
|
|
36
40
|
product,
|
|
37
41
|
referenceDate,
|
|
@@ -2,16 +2,19 @@ import { Product, ProductConfiguration } from '@unchainedshop/core-products';
|
|
|
2
2
|
import { ProductPricingDirector } from '../core-index.js';
|
|
3
3
|
import { User } from '@unchainedshop/core-users';
|
|
4
4
|
import { Modules } from '../modules.js';
|
|
5
|
+
import { Order, OrderDiscount } from '@unchainedshop/core-orders';
|
|
5
6
|
|
|
6
7
|
export async function simulateProductPricingService(
|
|
7
8
|
this: Modules,
|
|
8
9
|
pricingContext: {
|
|
9
|
-
product: Product;
|
|
10
|
-
user: User;
|
|
11
|
-
countryCode: string;
|
|
12
10
|
currencyCode: string;
|
|
11
|
+
countryCode: string;
|
|
13
12
|
quantity: number;
|
|
13
|
+
discounts: OrderDiscount[];
|
|
14
|
+
order?: Order;
|
|
15
|
+
product: Product;
|
|
14
16
|
configuration?: ProductConfiguration[];
|
|
17
|
+
user?: User;
|
|
15
18
|
},
|
|
16
19
|
) {
|
|
17
20
|
const calculated = await ProductPricingDirector.rebuildCalculation(pricingContext, { modules: this });
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Enrollment, EnrollmentStatus } from '@unchainedshop/core-enrollments';
|
|
2
2
|
import { processEnrollmentService } from './processEnrollment.js';
|
|
3
|
+
import { addMessageService } from './addMessage.js';
|
|
3
4
|
|
|
4
5
|
export async function terminateEnrollmentService(enrollment: Enrollment) {
|
|
5
6
|
if (enrollment.status === EnrollmentStatus.TERMINATED) return enrollment;
|
|
@@ -14,15 +15,10 @@ export async function terminateEnrollmentService(enrollment: Enrollment) {
|
|
|
14
15
|
const user = await this.users.findUserById(enrollment.userId);
|
|
15
16
|
const locale = this.users.userLocale(user);
|
|
16
17
|
|
|
17
|
-
await
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
reason: 'status_change',
|
|
22
|
-
locale: locale.baseName,
|
|
23
|
-
template: 'ENROLLMENT_STATUS',
|
|
24
|
-
enrollmentId: updatedEnrollment._id,
|
|
25
|
-
},
|
|
18
|
+
await addMessageService.bind(this)('ENROLLMENT_STATUS', {
|
|
19
|
+
reason: 'status_change',
|
|
20
|
+
locale: locale.baseName,
|
|
21
|
+
enrollmentId: updatedEnrollment._id,
|
|
26
22
|
});
|
|
27
23
|
|
|
28
24
|
return updatedEnrollment;
|
|
@@ -1,4 +1,10 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {
|
|
2
|
+
OrderDelivery,
|
|
3
|
+
OrderDiscountTrigger,
|
|
4
|
+
OrderPayment,
|
|
5
|
+
Order,
|
|
6
|
+
OrderPosition,
|
|
7
|
+
} from '@unchainedshop/core-orders';
|
|
2
8
|
import { initCartProvidersService } from './initCartProviders.js';
|
|
3
9
|
import { Modules } from '../modules.js';
|
|
4
10
|
import { updateSchedulingService } from './updateScheduling.js';
|
|
@@ -12,6 +18,7 @@ import {
|
|
|
12
18
|
|
|
13
19
|
export async function updateCalculationService(this: Modules, orderId: string) {
|
|
14
20
|
let order = await this.orders.findOrder({ orderId });
|
|
21
|
+
if (!order) throw new Error('Order not found');
|
|
15
22
|
|
|
16
23
|
// Don't recalculate orders, only carts
|
|
17
24
|
if (order.status !== null) return order;
|
|
@@ -27,15 +34,17 @@ export async function updateCalculationService(this: Modules, orderId: string) {
|
|
|
27
34
|
const Adapter = OrderDiscountDirector.getAdapter(orderDiscount.discountKey);
|
|
28
35
|
if (!Adapter) return null;
|
|
29
36
|
const adapter = await Adapter.actions({
|
|
30
|
-
context: { order
|
|
37
|
+
context: { order: order!, orderDiscount, code: orderDiscount.code, modules: this },
|
|
31
38
|
});
|
|
32
39
|
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
40
|
+
let isValid = false;
|
|
41
|
+
if (orderDiscount.trigger === OrderDiscountTrigger.SYSTEM) {
|
|
42
|
+
isValid = await adapter.isValidForSystemTriggering();
|
|
43
|
+
} else if (orderDiscount.trigger === OrderDiscountTrigger.USER && orderDiscount.code) {
|
|
44
|
+
isValid = await adapter.isValidForCodeTriggering({
|
|
45
|
+
code: orderDiscount.code,
|
|
46
|
+
});
|
|
47
|
+
}
|
|
39
48
|
|
|
40
49
|
if (!isValid) {
|
|
41
50
|
if (orderDiscount.trigger === OrderDiscountTrigger.USER) {
|
|
@@ -52,14 +61,14 @@ export async function updateCalculationService(this: Modules, orderId: string) {
|
|
|
52
61
|
});
|
|
53
62
|
|
|
54
63
|
const currentDiscountKeys = cleanedDiscounts.map(({ discountKey }) => discountKey);
|
|
55
|
-
const director = await OrderDiscountDirector.actions({ order
|
|
64
|
+
const director = await OrderDiscountDirector.actions({ order }, { modules: this });
|
|
56
65
|
const systemDiscounts = await director.findSystemDiscounts();
|
|
57
66
|
await Promise.all(
|
|
58
67
|
systemDiscounts
|
|
59
68
|
.filter((key) => currentDiscountKeys.indexOf(key) === -1)
|
|
60
69
|
.map(async (discountKey) =>
|
|
61
70
|
this.orders.discounts.create({
|
|
62
|
-
orderId: order
|
|
71
|
+
orderId: order!._id,
|
|
63
72
|
discountKey,
|
|
64
73
|
trigger: OrderDiscountTrigger.SYSTEM,
|
|
65
74
|
}),
|
|
@@ -73,18 +82,21 @@ export async function updateCalculationService(this: Modules, orderId: string) {
|
|
|
73
82
|
orderPositions.map(async (orderPosition) => {
|
|
74
83
|
const positionCalculation = await ProductPricingDirector.rebuildCalculation(
|
|
75
84
|
{
|
|
76
|
-
currencyCode: order
|
|
85
|
+
currencyCode: order!.currencyCode,
|
|
77
86
|
quantity: orderPosition.quantity,
|
|
78
87
|
item: orderPosition,
|
|
79
88
|
},
|
|
80
89
|
{ modules: this },
|
|
81
90
|
);
|
|
82
|
-
return this.orders.positions.updateCalculation(
|
|
91
|
+
return (await this.orders.positions.updateCalculation(
|
|
92
|
+
orderPosition._id,
|
|
93
|
+
positionCalculation,
|
|
94
|
+
)) as OrderPosition;
|
|
83
95
|
}),
|
|
84
96
|
);
|
|
85
97
|
|
|
86
98
|
let orderDelivery = await this.orders.deliveries.findDelivery({
|
|
87
|
-
orderDeliveryId: order.deliveryId
|
|
99
|
+
orderDeliveryId: order.deliveryId!,
|
|
88
100
|
});
|
|
89
101
|
if (orderDelivery) {
|
|
90
102
|
const deliveryCalculation = await DeliveryPricingDirector.rebuildCalculation(
|
|
@@ -94,13 +106,13 @@ export async function updateCalculationService(this: Modules, orderId: string) {
|
|
|
94
106
|
},
|
|
95
107
|
{ modules: this },
|
|
96
108
|
);
|
|
97
|
-
orderDelivery = await this.orders.deliveries.updateCalculation(
|
|
109
|
+
orderDelivery = (await this.orders.deliveries.updateCalculation(
|
|
98
110
|
orderDelivery._id,
|
|
99
111
|
deliveryCalculation,
|
|
100
|
-
);
|
|
112
|
+
)) as OrderDelivery;
|
|
101
113
|
}
|
|
102
114
|
let orderPayment = await this.orders.payments.findOrderPayment({
|
|
103
|
-
orderPaymentId: order.paymentId
|
|
115
|
+
orderPaymentId: order.paymentId!,
|
|
104
116
|
});
|
|
105
117
|
if (orderPayment) {
|
|
106
118
|
const paymentCalculation = await PaymentPricingDirector.rebuildCalculation(
|
|
@@ -110,7 +122,10 @@ export async function updateCalculationService(this: Modules, orderId: string) {
|
|
|
110
122
|
},
|
|
111
123
|
{ modules: this },
|
|
112
124
|
);
|
|
113
|
-
orderPayment = await this.orders.payments.updateCalculation(
|
|
125
|
+
orderPayment = (await this.orders.payments.updateCalculation(
|
|
126
|
+
orderPayment._id,
|
|
127
|
+
paymentCalculation,
|
|
128
|
+
)) as OrderPayment;
|
|
114
129
|
}
|
|
115
130
|
|
|
116
131
|
orderPositions = await updateSchedulingService.bind(this)({
|
|
@@ -125,7 +140,7 @@ export async function updateCalculationService(this: Modules, orderId: string) {
|
|
|
125
140
|
);
|
|
126
141
|
|
|
127
142
|
if (JSON.stringify(order.calculation) !== JSON.stringify(calculation)) {
|
|
128
|
-
order = await this.orders.updateCalculationSheet(orderId, calculation);
|
|
143
|
+
order = (await this.orders.updateCalculationSheet(orderId, calculation)) as Order;
|
|
129
144
|
}
|
|
130
145
|
|
|
131
146
|
/*
|
|
@@ -2,6 +2,7 @@ import { Order, OrderDelivery, OrderPosition } from '@unchainedshop/core-orders'
|
|
|
2
2
|
import { WarehousingDirector } from '../directors/index.js';
|
|
3
3
|
import { Modules } from '../modules.js';
|
|
4
4
|
import { supportedWarehousingProvidersService } from './supportedWarehousingProviders.js';
|
|
5
|
+
import { Product } from '@unchainedshop/core-products';
|
|
5
6
|
|
|
6
7
|
export async function updateSchedulingService(
|
|
7
8
|
this: Modules,
|
|
@@ -9,7 +10,7 @@ export async function updateSchedulingService(
|
|
|
9
10
|
orderPositions,
|
|
10
11
|
order,
|
|
11
12
|
orderDelivery,
|
|
12
|
-
}: { orderPositions: OrderPosition[]; order: Order; orderDelivery: OrderDelivery },
|
|
13
|
+
}: { orderPositions: OrderPosition[]; order: Order; orderDelivery: OrderDelivery | null },
|
|
13
14
|
) {
|
|
14
15
|
const deliveryProvider =
|
|
15
16
|
orderDelivery &&
|
|
@@ -17,14 +18,14 @@ export async function updateSchedulingService(
|
|
|
17
18
|
deliveryProviderId: orderDelivery.deliveryProviderId,
|
|
18
19
|
}));
|
|
19
20
|
|
|
21
|
+
if (!deliveryProvider) return [];
|
|
22
|
+
|
|
20
23
|
return (await Promise.all(
|
|
21
24
|
orderPositions.map(async (orderPosition) => {
|
|
22
25
|
// scheduling (store in db for auditing)
|
|
23
|
-
const product = await this.products.findProduct({
|
|
26
|
+
const product = (await this.products.findProduct({
|
|
24
27
|
productId: orderPosition.productId,
|
|
25
|
-
});
|
|
26
|
-
|
|
27
|
-
const { countryCode, userId } = order;
|
|
28
|
+
})) as Product;
|
|
28
29
|
|
|
29
30
|
const scheduling = await Promise.all(
|
|
30
31
|
(
|
|
@@ -33,22 +34,20 @@ export async function updateSchedulingService(
|
|
|
33
34
|
deliveryProvider,
|
|
34
35
|
})
|
|
35
36
|
).map(async (warehousingProvider) => {
|
|
36
|
-
const
|
|
37
|
+
const director = await WarehousingDirector.actions(
|
|
37
38
|
warehousingProvider,
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
modules: this,
|
|
51
|
-
});
|
|
39
|
+
{
|
|
40
|
+
deliveryProvider,
|
|
41
|
+
product,
|
|
42
|
+
orderPosition,
|
|
43
|
+
order,
|
|
44
|
+
referenceDate: order.ordered,
|
|
45
|
+
quantity: orderPosition.quantity,
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
modules: this,
|
|
49
|
+
},
|
|
50
|
+
);
|
|
52
51
|
const dispatch = await director.estimatedDispatch();
|
|
53
52
|
|
|
54
53
|
return {
|
|
@@ -5,7 +5,10 @@ import { createLogger } from '@unchainedshop/logger';
|
|
|
5
5
|
|
|
6
6
|
const logger = createLogger('unchained:core');
|
|
7
7
|
|
|
8
|
-
export async function updateUserAvatarAfterUploadService(
|
|
8
|
+
export async function updateUserAvatarAfterUploadService(
|
|
9
|
+
this: Modules,
|
|
10
|
+
{ file }: { file: Pick<File, '_id' | 'path' | 'meta'> },
|
|
11
|
+
) {
|
|
9
12
|
const { userId } = file.meta as { userId: string };
|
|
10
13
|
|
|
11
14
|
const files = await this.files.findFiles({
|
|
@@ -21,5 +21,7 @@ export async function uploadFileFromStreamService(
|
|
|
21
21
|
);
|
|
22
22
|
const fileData = getFileFromFileData(uploadFileData, meta);
|
|
23
23
|
const fileId = await this.files.create(fileData);
|
|
24
|
-
|
|
24
|
+
const file = await this.files.findFile({ fileId });
|
|
25
|
+
if (!file) throw new Error('File not found after upload');
|
|
26
|
+
return file;
|
|
25
27
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { getFileFromFileData, getFileAdapter
|
|
1
|
+
import { getFileFromFileData, getFileAdapter } from '@unchainedshop/core-files';
|
|
2
2
|
import { Modules } from '../modules.js';
|
|
3
3
|
|
|
4
4
|
export async function uploadFileFromURLService(
|
|
@@ -17,7 +17,7 @@ export async function uploadFileFromURLService(
|
|
|
17
17
|
};
|
|
18
18
|
meta?: any;
|
|
19
19
|
},
|
|
20
|
-
)
|
|
20
|
+
) {
|
|
21
21
|
const fileUploadAdapter = getFileAdapter();
|
|
22
22
|
|
|
23
23
|
const uploadFileData = await fileUploadAdapter.uploadFileFromURL(directoryName, fileInput, {
|
|
@@ -2,52 +2,48 @@ import { Order, ordersSettings } from '@unchainedshop/core-orders';
|
|
|
2
2
|
import { Modules } from '../modules.js';
|
|
3
3
|
|
|
4
4
|
export async function validateOrderService(this: Modules, order: Order) {
|
|
5
|
-
|
|
6
|
-
if (!order.
|
|
7
|
-
if (
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
5
|
+
if (!order.contact) throw new Error('Contact data not provided');
|
|
6
|
+
if (!order.billingAddress) throw new Error('Billing address not provided');
|
|
7
|
+
if (
|
|
8
|
+
!order.deliveryId ||
|
|
9
|
+
!(await this.orders.deliveries.findDelivery({ orderDeliveryId: order.deliveryId }))
|
|
10
|
+
)
|
|
11
|
+
throw new Error('No delivery provider selected');
|
|
12
|
+
if (
|
|
13
|
+
!order.paymentId ||
|
|
14
|
+
!(await this.orders.payments.findOrderPayment({ orderPaymentId: order.paymentId }))
|
|
15
|
+
)
|
|
16
|
+
throw new Error('No payment provider selected');
|
|
12
17
|
|
|
13
18
|
const orderPositions = await this.orders.positions.findOrderPositions({ orderId: order._id });
|
|
14
19
|
if (orderPositions.length === 0) {
|
|
15
20
|
const NoItemsError = new Error('No items to checkout');
|
|
16
21
|
NoItemsError.name = 'NoItemsError';
|
|
17
|
-
|
|
22
|
+
throw NoItemsError;
|
|
18
23
|
}
|
|
19
|
-
await Promise.all(
|
|
20
|
-
orderPositions.map(async (orderPosition) => {
|
|
21
|
-
const product = await this.products.findProduct({
|
|
22
|
-
productId: orderPosition.productId,
|
|
23
|
-
});
|
|
24
24
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
product,
|
|
30
|
-
configuration: orderPosition.configuration,
|
|
31
|
-
quantityDiff: 0,
|
|
32
|
-
},
|
|
33
|
-
{ modules: this },
|
|
34
|
-
);
|
|
35
|
-
} catch (e) {
|
|
36
|
-
errors.push(e);
|
|
37
|
-
}
|
|
25
|
+
for (const orderPosition of orderPositions) {
|
|
26
|
+
const product = await this.products.findProduct({
|
|
27
|
+
productId: orderPosition.productId,
|
|
28
|
+
});
|
|
38
29
|
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
);
|
|
30
|
+
await ordersSettings.validateOrderPosition(
|
|
31
|
+
{
|
|
32
|
+
order,
|
|
33
|
+
product,
|
|
34
|
+
configuration: orderPosition.configuration,
|
|
35
|
+
quantityDiff: 0,
|
|
36
|
+
},
|
|
37
|
+
{ modules: this },
|
|
38
|
+
);
|
|
49
39
|
|
|
50
|
-
|
|
51
|
-
|
|
40
|
+
const quotation =
|
|
41
|
+
orderPosition.quotationId &&
|
|
42
|
+
(await this.quotations.findQuotation({
|
|
43
|
+
quotationId: orderPosition.quotationId,
|
|
44
|
+
}));
|
|
45
|
+
if (quotation && !this.quotations.isProposalValid(quotation)) {
|
|
46
|
+
throw new Error('Quotation expired or fullfiled, please request a new offer');
|
|
47
|
+
}
|
|
52
48
|
}
|
|
53
49
|
}
|
|
@@ -9,10 +9,10 @@ export async function verifyQuotationService(
|
|
|
9
9
|
) {
|
|
10
10
|
if (quotation.status !== QuotationStatus.REQUESTED) return quotation;
|
|
11
11
|
|
|
12
|
-
const updatedQuotation = await this.quotations.updateStatus(quotation._id, {
|
|
12
|
+
const updatedQuotation = (await this.quotations.updateStatus(quotation._id, {
|
|
13
13
|
status: QuotationStatus.PROCESSING,
|
|
14
14
|
info: 'verified elligibility manually',
|
|
15
|
-
});
|
|
15
|
+
})) as Quotation;
|
|
16
16
|
|
|
17
17
|
return await processQuotationService.bind(this)(updatedQuotation, { quotationContext });
|
|
18
18
|
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"registerProductDiscoverabilityFilter copy.d.ts","sourceRoot":"","sources":["../../src/factory/registerProductDiscoverabilityFilter copy.ts"],"names":[],"mappings":"AAGA,MAAM,CAAC,OAAO,UAAU,oCAAoC,CAAC,EAC3D,UAAc,EACd,cAAyB,GAC1B,EAAE;IACD,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB,QA2BA"}
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { randomBytes } from 'crypto';
|
|
2
|
-
import { FilterAdapter, FilterDirector } from '../core-index.js';
|
|
3
|
-
export default function registerProductDiscoverabilityFilter({ orderIndex = 0, hiddenTagValue = 'hidden', }) {
|
|
4
|
-
FilterDirector.registerAdapter({
|
|
5
|
-
...FilterAdapter,
|
|
6
|
-
key: `shop.unchained.filters.product-discoverability-${randomBytes(4).toString('hex')}`,
|
|
7
|
-
label: 'Product Discoverability Filter',
|
|
8
|
-
version: '1.0.0',
|
|
9
|
-
orderIndex,
|
|
10
|
-
actions: (params) => {
|
|
11
|
-
return {
|
|
12
|
-
...FilterAdapter.actions(params),
|
|
13
|
-
transformProductSelector: async (lastSelector, options) => {
|
|
14
|
-
const { key } = options || {};
|
|
15
|
-
if (!key) {
|
|
16
|
-
const newSelector = { ...lastSelector };
|
|
17
|
-
if (!newSelector.$and)
|
|
18
|
-
newSelector.$and = [];
|
|
19
|
-
newSelector.$and.push({ tags: { $ne: hiddenTagValue } });
|
|
20
|
-
return newSelector;
|
|
21
|
-
}
|
|
22
|
-
return lastSelector;
|
|
23
|
-
},
|
|
24
|
-
};
|
|
25
|
-
},
|
|
26
|
-
});
|
|
27
|
-
}
|
|
28
|
-
//# sourceMappingURL=registerProductDiscoverabilityFilter%20copy.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"registerProductDiscoverabilityFilter copy.js","sourceRoot":"","sources":["../../src/factory/registerProductDiscoverabilityFilter copy.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,QAAQ,CAAC;AACrC,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAEjE,MAAM,CAAC,OAAO,UAAU,oCAAoC,CAAC,EAC3D,UAAU,GAAG,CAAC,EACd,cAAc,GAAG,QAAQ,GAI1B;IACC,cAAc,CAAC,eAAe,CAAC;QAC7B,GAAG,aAAa;QAEhB,GAAG,EAAE,kDAAkD,WAAW,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE;QACvF,KAAK,EAAE,gCAAgC;QACvC,OAAO,EAAE,OAAO;QAChB,UAAU;QAEV,OAAO,EAAE,CAAC,MAAM,EAAE,EAAE;YAClB,OAAO;gBACL,GAAG,aAAa,CAAC,OAAO,CAAC,MAAM,CAAC;gBAEhC,wBAAwB,EAAE,KAAK,EAAE,YAAY,EAAE,OAAO,EAAE,EAAE;oBACxD,MAAM,EAAE,GAAG,EAAE,GAAG,OAAO,IAAI,EAAE,CAAC;oBAE9B,IAAI,CAAC,GAAG,EAAE,CAAC;wBACT,MAAM,WAAW,GAAG,EAAE,GAAG,YAAY,EAAE,CAAC;wBACxC,IAAI,CAAC,WAAW,CAAC,IAAI;4BAAE,WAAW,CAAC,IAAI,GAAG,EAAE,CAAC;wBAC7C,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,EAAE,GAAG,EAAE,cAAc,EAAE,EAAE,CAAC,CAAC;wBACzD,OAAO,WAAW,CAAC;oBACrB,CAAC;oBACD,OAAO,YAAY,CAAC;gBACtB,CAAC;aACF,CAAC;QACJ,CAAC;KACF,CAAC,CAAC;AACL,CAAC"}
|