@medusajs/medusa 1.3.8 → 1.3.9
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/.turbo/turbo-build.log +1 -1
- package/CHANGELOG.md +6 -0
- package/dist/api/routes/admin/apps/authorize-app.d.ts +1 -1
- package/dist/api/routes/admin/apps/authorize-app.js +1 -1
- package/dist/api/routes/admin/apps/list.d.ts +1 -1
- package/dist/api/routes/admin/apps/list.js +1 -1
- package/dist/api/routes/admin/auth/create-session.d.ts +1 -1
- package/dist/api/routes/admin/auth/create-session.js +1 -1
- package/dist/api/routes/admin/auth/delete-session.d.ts +1 -1
- package/dist/api/routes/admin/auth/delete-session.js +1 -1
- package/dist/api/routes/admin/auth/get-session.d.ts +1 -1
- package/dist/api/routes/admin/auth/get-session.js +1 -1
- package/dist/api/routes/admin/batch/cancel-batch-job.d.ts +1 -1
- package/dist/api/routes/admin/batch/cancel-batch-job.js +1 -1
- package/dist/api/routes/admin/batch/confirm-batch-job.d.ts +1 -1
- package/dist/api/routes/admin/batch/confirm-batch-job.js +1 -1
- package/dist/api/routes/admin/batch/get-batch-job.d.ts +1 -1
- package/dist/api/routes/admin/batch/get-batch-job.js +1 -1
- package/dist/api/routes/admin/collections/add-products.d.ts +1 -1
- package/dist/api/routes/admin/collections/add-products.js +1 -1
- package/dist/api/routes/admin/collections/create-collection.d.ts +1 -1
- package/dist/api/routes/admin/collections/create-collection.js +1 -1
- package/dist/api/routes/admin/collections/delete-collection.d.ts +1 -1
- package/dist/api/routes/admin/collections/delete-collection.js +1 -1
- package/dist/api/routes/admin/collections/get-collection.d.ts +1 -1
- package/dist/api/routes/admin/collections/get-collection.js +1 -1
- package/dist/api/routes/admin/collections/list-collections.d.ts +1 -1
- package/dist/api/routes/admin/collections/list-collections.js +1 -1
- package/dist/api/routes/admin/collections/remove-products.d.ts +1 -1
- package/dist/api/routes/admin/collections/remove-products.js +1 -1
- package/dist/api/routes/admin/collections/update-collection.d.ts +1 -1
- package/dist/api/routes/admin/collections/update-collection.js +1 -1
- package/dist/api/routes/admin/currencies/index.d.ts +12 -0
- package/dist/api/routes/admin/currencies/index.js +49 -0
- package/dist/api/routes/admin/currencies/index.js.map +1 -0
- package/dist/api/routes/admin/currencies/list-currencies.d.ts +45 -0
- package/dist/api/routes/admin/currencies/list-currencies.js +164 -0
- package/dist/api/routes/admin/currencies/list-currencies.js.map +1 -0
- package/dist/api/routes/admin/currencies/update-currency.d.ts +35 -0
- package/dist/api/routes/admin/currencies/update-currency.js +112 -0
- package/dist/api/routes/admin/currencies/update-currency.js.map +1 -0
- package/dist/api/routes/admin/currency/index.d.ts +4 -0
- package/dist/api/routes/admin/currency/index.js +49 -0
- package/dist/api/routes/admin/currency/index.js.map +1 -0
- package/dist/api/routes/admin/currency/list-currencies.d.ts +45 -0
- package/dist/api/routes/admin/currency/list-currencies.js +164 -0
- package/dist/api/routes/admin/currency/list-currencies.js.map +1 -0
- package/dist/api/routes/admin/currency/update-currency.d.ts +35 -0
- package/dist/api/routes/admin/currency/update-currency.js +112 -0
- package/dist/api/routes/admin/currency/update-currency.js.map +1 -0
- package/dist/api/routes/admin/customer-groups/add-customers-batch.d.ts +1 -1
- package/dist/api/routes/admin/customer-groups/add-customers-batch.js +1 -1
- package/dist/api/routes/admin/customer-groups/create-customer-group.d.ts +1 -1
- package/dist/api/routes/admin/customer-groups/create-customer-group.js +1 -1
- package/dist/api/routes/admin/customer-groups/delete-customer-group.d.ts +1 -1
- package/dist/api/routes/admin/customer-groups/delete-customer-group.js +1 -1
- package/dist/api/routes/admin/customer-groups/delete-customers-batch.d.ts +1 -1
- package/dist/api/routes/admin/customer-groups/delete-customers-batch.js +1 -1
- package/dist/api/routes/admin/customer-groups/get-customer-group.d.ts +1 -1
- package/dist/api/routes/admin/customer-groups/get-customer-group.js +1 -1
- package/dist/api/routes/admin/customer-groups/list-customer-groups.d.ts +1 -1
- package/dist/api/routes/admin/customer-groups/list-customer-groups.js +1 -1
- package/dist/api/routes/admin/customer-groups/update-customer-group.d.ts +1 -1
- package/dist/api/routes/admin/customer-groups/update-customer-group.js +1 -1
- package/dist/api/routes/admin/customers/get-customer.d.ts +1 -1
- package/dist/api/routes/admin/customers/get-customer.js +1 -1
- package/dist/api/routes/admin/discounts/add-region.d.ts +1 -1
- package/dist/api/routes/admin/discounts/add-region.js +1 -1
- package/dist/api/routes/admin/discounts/create-condition.d.ts +1 -1
- package/dist/api/routes/admin/discounts/create-condition.js +1 -1
- package/dist/api/routes/admin/discounts/create-dynamic-code.d.ts +2 -2
- package/dist/api/routes/admin/discounts/create-dynamic-code.js +2 -2
- package/dist/api/routes/admin/discounts/delete-condition.d.ts +1 -1
- package/dist/api/routes/admin/discounts/delete-condition.js +1 -1
- package/dist/api/routes/admin/discounts/delete-dynamic-code.d.ts +1 -1
- package/dist/api/routes/admin/discounts/delete-dynamic-code.js +1 -1
- package/dist/api/routes/admin/discounts/get-condition.d.ts +1 -1
- package/dist/api/routes/admin/discounts/get-condition.js +1 -1
- package/dist/api/routes/admin/discounts/get-discount-by-code.d.ts +1 -1
- package/dist/api/routes/admin/discounts/get-discount-by-code.js +1 -1
- package/dist/api/routes/admin/discounts/get-discount.d.ts +1 -1
- package/dist/api/routes/admin/discounts/get-discount.js +1 -1
- package/dist/api/routes/admin/discounts/remove-region.d.ts +1 -1
- package/dist/api/routes/admin/discounts/remove-region.js +1 -1
- package/dist/api/routes/admin/discounts/update-condition.d.ts +1 -1
- package/dist/api/routes/admin/discounts/update-condition.js +1 -1
- package/dist/api/routes/admin/draft-orders/create-line-item.d.ts +1 -1
- package/dist/api/routes/admin/draft-orders/create-line-item.js +1 -1
- package/dist/api/routes/admin/draft-orders/get-draft-order.d.ts +1 -1
- package/dist/api/routes/admin/draft-orders/get-draft-order.js +1 -1
- package/dist/api/routes/admin/draft-orders/register-payment.d.ts +1 -1
- package/dist/api/routes/admin/draft-orders/register-payment.js +1 -1
- package/dist/api/routes/admin/draft-orders/update-draft-order.d.ts +1 -1
- package/dist/api/routes/admin/draft-orders/update-draft-order.js +1 -1
- package/dist/api/routes/admin/draft-orders/update-line-item.d.ts +1 -1
- package/dist/api/routes/admin/draft-orders/update-line-item.js +1 -1
- package/dist/api/routes/admin/gift-cards/get-gift-card.d.ts +1 -1
- package/dist/api/routes/admin/gift-cards/get-gift-card.js +1 -1
- package/dist/api/routes/admin/invites/list-invites.d.ts +1 -1
- package/dist/api/routes/admin/invites/list-invites.js +1 -1
- package/dist/api/routes/admin/notes/delete-note.d.ts +1 -1
- package/dist/api/routes/admin/notes/delete-note.js +1 -1
- package/dist/api/routes/admin/notes/get-note.d.ts +1 -1
- package/dist/api/routes/admin/notes/get-note.js +1 -1
- package/dist/api/routes/admin/notes/update-note.d.ts +1 -1
- package/dist/api/routes/admin/notes/update-note.js +1 -1
- package/dist/api/routes/admin/orders/archive-order.d.ts +1 -1
- package/dist/api/routes/admin/orders/archive-order.js +1 -1
- package/dist/api/routes/admin/orders/cancel-claim.d.ts +1 -1
- package/dist/api/routes/admin/orders/cancel-claim.js +1 -1
- package/dist/api/routes/admin/orders/cancel-fulfillment-claim.d.ts +2 -2
- package/dist/api/routes/admin/orders/cancel-fulfillment-claim.js +2 -2
- package/dist/api/routes/admin/orders/cancel-fulfillment-swap.d.ts +2 -2
- package/dist/api/routes/admin/orders/cancel-fulfillment-swap.js +2 -2
- package/dist/api/routes/admin/orders/cancel-fulfillment.d.ts +1 -1
- package/dist/api/routes/admin/orders/cancel-fulfillment.js +1 -1
- package/dist/api/routes/admin/orders/capture-payment.d.ts +1 -1
- package/dist/api/routes/admin/orders/capture-payment.js +1 -1
- package/dist/api/routes/admin/orders/fulfill-claim.d.ts +1 -1
- package/dist/api/routes/admin/orders/fulfill-claim.js +1 -1
- package/dist/api/routes/admin/orders/fulfill-swap.d.ts +1 -1
- package/dist/api/routes/admin/orders/fulfill-swap.js +1 -1
- package/dist/api/routes/admin/orders/get-order.d.ts +1 -1
- package/dist/api/routes/admin/orders/get-order.js +1 -1
- package/dist/api/routes/admin/orders/process-swap-payment.d.ts +1 -1
- package/dist/api/routes/admin/orders/process-swap-payment.js +1 -1
- package/dist/api/routes/admin/orders/update-order.d.ts +1 -1
- package/dist/api/routes/admin/orders/update-order.js +1 -1
- package/dist/api/routes/admin/price-lists/add-prices-batch.d.ts +1 -1
- package/dist/api/routes/admin/price-lists/add-prices-batch.js +1 -1
- package/dist/api/routes/admin/price-lists/create-price-list.d.ts +1 -1
- package/dist/api/routes/admin/price-lists/create-price-list.js +1 -1
- package/dist/api/routes/admin/price-lists/delete-prices-batch.d.ts +1 -1
- package/dist/api/routes/admin/price-lists/delete-prices-batch.js +1 -1
- package/dist/api/routes/admin/price-lists/delete-product-prices.d.ts +1 -1
- package/dist/api/routes/admin/price-lists/delete-product-prices.js +1 -1
- package/dist/api/routes/admin/price-lists/delete-variant-prices.d.ts +1 -1
- package/dist/api/routes/admin/price-lists/delete-variant-prices.js +1 -1
- package/dist/api/routes/admin/price-lists/get-price-list.d.ts +1 -1
- package/dist/api/routes/admin/price-lists/get-price-list.js +1 -1
- package/dist/api/routes/admin/price-lists/list-price-list-products.d.ts +1 -1
- package/dist/api/routes/admin/price-lists/list-price-list-products.js +1 -1
- package/dist/api/routes/admin/products/get-product.d.ts +1 -1
- package/dist/api/routes/admin/products/get-product.js +1 -1
- package/dist/api/routes/admin/products/list-products.d.ts +1 -1
- package/dist/api/routes/admin/products/list-products.js +1 -1
- package/dist/api/routes/admin/products/list-tag-usage-count.d.ts +1 -1
- package/dist/api/routes/admin/products/list-tag-usage-count.js +1 -1
- package/dist/api/routes/admin/products/list-variants.d.ts +1 -1
- package/dist/api/routes/admin/products/list-variants.js +1 -1
- package/dist/api/routes/admin/products/set-metadata.d.ts +1 -1
- package/dist/api/routes/admin/products/set-metadata.js +1 -1
- package/dist/api/routes/admin/products/update-option.d.ts +1 -1
- package/dist/api/routes/admin/products/update-option.js +1 -1
- package/dist/api/routes/admin/regions/get-fulfillment-options.d.ts +1 -1
- package/dist/api/routes/admin/regions/get-fulfillment-options.js +1 -1
- package/dist/api/routes/admin/regions/get-region.d.ts +1 -1
- package/dist/api/routes/admin/regions/get-region.js +1 -1
- package/dist/api/routes/admin/regions/remove-country.d.ts +1 -1
- package/dist/api/routes/admin/regions/remove-country.js +1 -1
- package/dist/api/routes/admin/regions/remove-fulfillment-provider.d.ts +1 -1
- package/dist/api/routes/admin/regions/remove-fulfillment-provider.js +1 -1
- package/dist/api/routes/admin/regions/remove-payment-provider.d.ts +1 -1
- package/dist/api/routes/admin/regions/remove-payment-provider.js +1 -1
- package/dist/api/routes/admin/return-reasons/delete-reason.d.ts +1 -1
- package/dist/api/routes/admin/return-reasons/delete-reason.js +1 -1
- package/dist/api/routes/admin/return-reasons/get-reason.d.ts +1 -1
- package/dist/api/routes/admin/return-reasons/get-reason.js +1 -1
- package/dist/api/routes/admin/sales-channels/add-product-batch.d.ts +1 -1
- package/dist/api/routes/admin/sales-channels/add-product-batch.js +1 -1
- package/dist/api/routes/admin/sales-channels/delete-products-batch.d.ts +1 -1
- package/dist/api/routes/admin/sales-channels/delete-products-batch.js +1 -1
- package/dist/api/routes/admin/sales-channels/delete-sales-channel.d.ts +1 -1
- package/dist/api/routes/admin/sales-channels/delete-sales-channel.js +1 -1
- package/dist/api/routes/admin/sales-channels/get-sales-channel.d.ts +1 -1
- package/dist/api/routes/admin/sales-channels/get-sales-channel.js +1 -1
- package/dist/api/routes/admin/sales-channels/list-sales-channels.d.ts +1 -1
- package/dist/api/routes/admin/sales-channels/list-sales-channels.js +1 -1
- package/dist/api/routes/admin/shipping-options/get-shipping-option.d.ts +1 -1
- package/dist/api/routes/admin/shipping-options/get-shipping-option.js +1 -1
- package/dist/api/routes/admin/shipping-profiles/get-shipping-profile.d.ts +1 -1
- package/dist/api/routes/admin/shipping-profiles/get-shipping-profile.js +1 -1
- package/dist/api/routes/admin/shipping-profiles/update-shipping-profile.d.ts +1 -1
- package/dist/api/routes/admin/shipping-profiles/update-shipping-profile.js +1 -1
- package/dist/api/routes/admin/store/get-store.d.ts +1 -1
- package/dist/api/routes/admin/store/get-store.js +1 -1
- package/dist/api/routes/admin/store/list-payment-providers.d.ts +1 -1
- package/dist/api/routes/admin/store/list-payment-providers.js +1 -1
- package/dist/api/routes/admin/store/list-tax-providers.d.ts +1 -1
- package/dist/api/routes/admin/store/list-tax-providers.js +1 -1
- package/dist/api/routes/admin/store/remove-currency.d.ts +1 -1
- package/dist/api/routes/admin/store/remove-currency.js +1 -1
- package/dist/api/routes/admin/store/update-store.d.ts +1 -1
- package/dist/api/routes/admin/store/update-store.js +1 -1
- package/dist/api/routes/admin/swaps/get-swap.d.ts +1 -1
- package/dist/api/routes/admin/swaps/get-swap.js +1 -1
- package/dist/api/routes/admin/tax-rates/add-to-product-types.d.ts +1 -1
- package/dist/api/routes/admin/tax-rates/add-to-product-types.js +1 -1
- package/dist/api/routes/admin/tax-rates/add-to-products.d.ts +1 -1
- package/dist/api/routes/admin/tax-rates/add-to-products.js +1 -1
- package/dist/api/routes/admin/tax-rates/add-to-shipping-options.d.ts +1 -1
- package/dist/api/routes/admin/tax-rates/add-to-shipping-options.js +1 -1
- package/dist/api/routes/admin/tax-rates/get-tax-rate.d.ts +1 -1
- package/dist/api/routes/admin/tax-rates/get-tax-rate.js +1 -1
- package/dist/api/routes/admin/tax-rates/remove-from-product-types.d.ts +1 -1
- package/dist/api/routes/admin/tax-rates/remove-from-product-types.js +1 -1
- package/dist/api/routes/admin/tax-rates/remove-from-products.d.ts +1 -1
- package/dist/api/routes/admin/tax-rates/remove-from-products.js +1 -1
- package/dist/api/routes/admin/tax-rates/remove-from-shipping-options.d.ts +2 -2
- package/dist/api/routes/admin/tax-rates/remove-from-shipping-options.js +2 -2
- package/dist/api/routes/admin/uploads/create-upload.d.ts +1 -1
- package/dist/api/routes/admin/uploads/create-upload.js +1 -1
- package/dist/api/routes/admin/uploads/delete-upload.d.ts +1 -1
- package/dist/api/routes/admin/uploads/delete-upload.js +1 -1
- package/dist/api/routes/admin/uploads/get-download-url.d.ts +1 -1
- package/dist/api/routes/admin/uploads/get-download-url.js +1 -1
- package/dist/api/routes/admin/users/get-user.d.ts +1 -1
- package/dist/api/routes/admin/users/get-user.js +1 -1
- package/dist/api/routes/admin/users/list-users.d.ts +1 -1
- package/dist/api/routes/admin/users/list-users.js +1 -1
- package/dist/api/routes/admin/users/reset-password-token.d.ts +1 -1
- package/dist/api/routes/admin/users/reset-password-token.js +1 -1
- package/dist/api/routes/admin/users/reset-password.d.ts +1 -1
- package/dist/api/routes/admin/users/reset-password.js +1 -1
- package/dist/api/routes/admin/variants/list-variants.d.ts +1 -1
- package/dist/api/routes/admin/variants/list-variants.js +1 -1
- package/dist/api/routes/store/auth/create-session.d.ts +1 -1
- package/dist/api/routes/store/auth/create-session.js +1 -1
- package/dist/api/routes/store/auth/delete-session.d.ts +1 -1
- package/dist/api/routes/store/auth/delete-session.js +1 -1
- package/dist/api/routes/store/auth/exists.d.ts +1 -1
- package/dist/api/routes/store/auth/exists.js +1 -1
- package/dist/api/routes/store/auth/get-session.d.ts +1 -1
- package/dist/api/routes/store/auth/get-session.js +1 -1
- package/dist/api/routes/store/carts/create-cart.js +60 -40
- package/dist/api/routes/store/carts/create-cart.js.map +1 -1
- package/dist/api/routes/store/carts/create-payment-sessions.d.ts +1 -1
- package/dist/api/routes/store/carts/create-payment-sessions.js +1 -1
- package/dist/api/routes/store/carts/delete-discount.d.ts +1 -1
- package/dist/api/routes/store/carts/delete-discount.js +1 -1
- package/dist/api/routes/store/carts/get-cart.d.ts +1 -1
- package/dist/api/routes/store/carts/get-cart.js +1 -1
- package/dist/api/routes/store/collections/get-collection.d.ts +1 -1
- package/dist/api/routes/store/collections/get-collection.js +1 -1
- package/dist/api/routes/store/collections/list-collections.d.ts +1 -1
- package/dist/api/routes/store/collections/list-collections.js +1 -1
- package/dist/api/routes/store/customers/get-customer.d.ts +1 -1
- package/dist/api/routes/store/customers/get-customer.js +1 -1
- package/dist/api/routes/store/customers/get-payment-methods.d.ts +1 -1
- package/dist/api/routes/store/customers/get-payment-methods.js +1 -1
- package/dist/api/routes/store/customers/list-orders.d.ts +1 -1
- package/dist/api/routes/store/customers/list-orders.js +1 -1
- package/dist/api/routes/store/customers/reset-password-token.d.ts +1 -1
- package/dist/api/routes/store/customers/reset-password-token.js +1 -1
- package/dist/api/routes/store/customers/reset-password.d.ts +1 -1
- package/dist/api/routes/store/customers/reset-password.js +1 -1
- package/dist/api/routes/store/customers/update-customer.d.ts +1 -1
- package/dist/api/routes/store/customers/update-customer.js +1 -1
- package/dist/api/routes/store/gift-cards/get-gift-card.d.ts +1 -1
- package/dist/api/routes/store/gift-cards/get-gift-card.js +1 -1
- package/dist/api/routes/store/orders/get-order-by-cart.d.ts +1 -1
- package/dist/api/routes/store/orders/get-order-by-cart.js +1 -1
- package/dist/api/routes/store/orders/get-order.d.ts +1 -1
- package/dist/api/routes/store/orders/get-order.js +1 -1
- package/dist/api/routes/store/products/get-product.d.ts +1 -1
- package/dist/api/routes/store/products/get-product.js +1 -1
- package/dist/api/routes/store/regions/get-region.d.ts +1 -1
- package/dist/api/routes/store/regions/get-region.js +1 -1
- package/dist/api/routes/store/return-reasons/get-reason.d.ts +1 -1
- package/dist/api/routes/store/return-reasons/get-reason.js +1 -1
- package/dist/api/routes/store/shipping-options/list-options.d.ts +1 -1
- package/dist/api/routes/store/shipping-options/list-options.js +1 -1
- package/dist/api/routes/store/shipping-options/list-shipping-options.d.ts +1 -1
- package/dist/api/routes/store/shipping-options/list-shipping-options.js +1 -1
- package/dist/api/routes/store/swaps/get-swap-by-cart.d.ts +1 -1
- package/dist/api/routes/store/swaps/get-swap-by-cart.js +1 -1
- package/dist/api/routes/store/variants/get-variant.d.ts +1 -1
- package/dist/api/routes/store/variants/get-variant.js +1 -1
- package/dist/api/routes/store/variants/list-variants.d.ts +1 -1
- package/dist/api/routes/store/variants/list-variants.js +1 -1
- package/dist/loaders/feature-flags/tax-inclusive-pricing.d.ts +3 -0
- package/dist/loaders/feature-flags/tax-inclusive-pricing.js +10 -0
- package/dist/loaders/feature-flags/tax-inclusive-pricing.js.map +1 -0
- package/dist/migrations/1659501357661-tax_inclusive_pricing.d.ts +7 -0
- package/dist/migrations/1659501357661-tax_inclusive_pricing.js +106 -0
- package/dist/migrations/1659501357661-tax_inclusive_pricing.js.map +1 -0
- package/dist/services/currency.d.ts +51 -0
- package/dist/services/currency.js +174 -0
- package/dist/services/currency.js.map +1 -0
- package/dist/types/currency.d.ts +3 -0
- package/dist/types/currency.js +3 -0
- package/dist/types/currency.js.map +1 -0
- package/dist/utils/calculate-price-tax-amount.d.ts +13 -0
- package/dist/utils/calculate-price-tax-amount.js +20 -0
- package/dist/utils/calculate-price-tax-amount.js.map +1 -0
- package/dist/utils/csv-cell-content-formatter.d.ts +2 -0
- package/dist/utils/csv-cell-content-formatter.js +22 -0
- package/dist/utils/csv-cell-content-formatter.js.map +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
var TaxInclusivePricingFeatureFlag = {
|
|
4
|
+
key: "tax_inclusive_pricing",
|
|
5
|
+
default_val: false,
|
|
6
|
+
env_key: "MEDUSA_FF_TAX_INCLUSIVE_PRICING",
|
|
7
|
+
description: "[WIP] Enable tax inclusive pricing",
|
|
8
|
+
};
|
|
9
|
+
exports.default = TaxInclusivePricingFeatureFlag;
|
|
10
|
+
//# sourceMappingURL=tax-inclusive-pricing.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tax-inclusive-pricing.js","sourceRoot":"","sources":["../../../src/loaders/feature-flags/tax-inclusive-pricing.ts"],"names":[],"mappings":";;AAEA,IAAM,8BAA8B,GAAiB;IACnD,GAAG,EAAE,uBAAuB;IAC5B,WAAW,EAAE,KAAK;IAClB,OAAO,EAAE,iCAAiC;IAC1C,WAAW,EAAE,oCAAoC;CAClD,CAAA;AAED,kBAAe,8BAA8B,CAAA"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { MigrationInterface, QueryRunner } from "typeorm";
|
|
2
|
+
export declare const featureFlag: string;
|
|
3
|
+
export declare class test1659501357661 implements MigrationInterface {
|
|
4
|
+
name: string;
|
|
5
|
+
up(queryRunner: QueryRunner): Promise<void>;
|
|
6
|
+
down(queryRunner: QueryRunner): Promise<void>;
|
|
7
|
+
}
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
12
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
13
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
14
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
15
|
+
function step(op) {
|
|
16
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
17
|
+
while (_) try {
|
|
18
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
19
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
20
|
+
switch (op[0]) {
|
|
21
|
+
case 0: case 1: t = op; break;
|
|
22
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
23
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
24
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
25
|
+
default:
|
|
26
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
27
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
28
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
29
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
30
|
+
if (t[2]) _.ops.pop();
|
|
31
|
+
_.trys.pop(); continue;
|
|
32
|
+
}
|
|
33
|
+
op = body.call(thisArg, _);
|
|
34
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
35
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
39
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
40
|
+
};
|
|
41
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
42
|
+
exports.test1659501357661 = exports.featureFlag = void 0;
|
|
43
|
+
var tax_inclusive_pricing_1 = __importDefault(require("../loaders/feature-flags/tax-inclusive-pricing"));
|
|
44
|
+
exports.featureFlag = tax_inclusive_pricing_1.default.key;
|
|
45
|
+
var test1659501357661 = /** @class */ (function () {
|
|
46
|
+
function test1659501357661() {
|
|
47
|
+
this.name = "test1659501357661";
|
|
48
|
+
}
|
|
49
|
+
test1659501357661.prototype.up = function (queryRunner) {
|
|
50
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
51
|
+
return __generator(this, function (_a) {
|
|
52
|
+
switch (_a.label) {
|
|
53
|
+
case 0: return [4 /*yield*/, queryRunner.query("ALTER TABLE \"currency\" ADD \"includes_tax\" boolean NOT NULL DEFAULT false")];
|
|
54
|
+
case 1:
|
|
55
|
+
_a.sent();
|
|
56
|
+
return [4 /*yield*/, queryRunner.query("ALTER TABLE \"region\" ADD \"includes_tax\" boolean NOT NULL DEFAULT false")];
|
|
57
|
+
case 2:
|
|
58
|
+
_a.sent();
|
|
59
|
+
return [4 /*yield*/, queryRunner.query("ALTER TABLE \"shipping_option\" ADD \"includes_tax\" boolean NOT NULL DEFAULT false")];
|
|
60
|
+
case 3:
|
|
61
|
+
_a.sent();
|
|
62
|
+
return [4 /*yield*/, queryRunner.query("ALTER TABLE \"price_list\" ADD \"includes_tax\" boolean NOT NULL DEFAULT false")];
|
|
63
|
+
case 4:
|
|
64
|
+
_a.sent();
|
|
65
|
+
return [4 /*yield*/, queryRunner.query("ALTER TABLE \"shipping_method\" ADD \"includes_tax\" boolean NOT NULL DEFAULT false")];
|
|
66
|
+
case 5:
|
|
67
|
+
_a.sent();
|
|
68
|
+
return [4 /*yield*/, queryRunner.query("ALTER TABLE \"line_item\" ADD \"includes_tax\" boolean NOT NULL DEFAULT false")];
|
|
69
|
+
case 6:
|
|
70
|
+
_a.sent();
|
|
71
|
+
return [2 /*return*/];
|
|
72
|
+
}
|
|
73
|
+
});
|
|
74
|
+
});
|
|
75
|
+
};
|
|
76
|
+
test1659501357661.prototype.down = function (queryRunner) {
|
|
77
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
78
|
+
return __generator(this, function (_a) {
|
|
79
|
+
switch (_a.label) {
|
|
80
|
+
case 0: return [4 /*yield*/, queryRunner.query("ALTER TABLE \"line_item\" DROP COLUMN \"includes_tax\"")];
|
|
81
|
+
case 1:
|
|
82
|
+
_a.sent();
|
|
83
|
+
return [4 /*yield*/, queryRunner.query("ALTER TABLE \"shipping_method\" DROP COLUMN \"includes_tax\"")];
|
|
84
|
+
case 2:
|
|
85
|
+
_a.sent();
|
|
86
|
+
return [4 /*yield*/, queryRunner.query("ALTER TABLE \"price_list\" DROP COLUMN \"includes_tax\"")];
|
|
87
|
+
case 3:
|
|
88
|
+
_a.sent();
|
|
89
|
+
return [4 /*yield*/, queryRunner.query("ALTER TABLE \"shipping_option\" DROP COLUMN \"includes_tax\"")];
|
|
90
|
+
case 4:
|
|
91
|
+
_a.sent();
|
|
92
|
+
return [4 /*yield*/, queryRunner.query("ALTER TABLE \"region\" DROP COLUMN \"includes_tax\"")];
|
|
93
|
+
case 5:
|
|
94
|
+
_a.sent();
|
|
95
|
+
return [4 /*yield*/, queryRunner.query("ALTER TABLE \"currency\" DROP COLUMN \"includes_tax\"")];
|
|
96
|
+
case 6:
|
|
97
|
+
_a.sent();
|
|
98
|
+
return [2 /*return*/];
|
|
99
|
+
}
|
|
100
|
+
});
|
|
101
|
+
});
|
|
102
|
+
};
|
|
103
|
+
return test1659501357661;
|
|
104
|
+
}());
|
|
105
|
+
exports.test1659501357661 = test1659501357661;
|
|
106
|
+
//# sourceMappingURL=1659501357661-tax_inclusive_pricing.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"1659501357661-tax_inclusive_pricing.js","sourceRoot":"","sources":["../../src/migrations/1659501357661-tax_inclusive_pricing.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,yGAAoF;AAEvE,QAAA,WAAW,GAAG,+BAAuB,CAAC,GAAG,CAAA;AAEtD;IAAA;QACE,SAAI,GAAG,mBAAmB,CAAA;IAuC5B,CAAC;IArCc,8BAAE,GAAf,UAAgB,WAAwB;;;;4BACtC,qBAAM,WAAW,CAAC,KAAK,CACrB,8EAA0E,CAC3E,EAAA;;wBAFD,SAEC,CAAA;wBACD,qBAAM,WAAW,CAAC,KAAK,CACrB,4EAAwE,CACzE,EAAA;;wBAFD,SAEC,CAAA;wBACD,qBAAM,WAAW,CAAC,KAAK,CACrB,qFAAiF,CAClF,EAAA;;wBAFD,SAEC,CAAA;wBACD,qBAAM,WAAW,CAAC,KAAK,CACrB,gFAA4E,CAC7E,EAAA;;wBAFD,SAEC,CAAA;wBACD,qBAAM,WAAW,CAAC,KAAK,CACrB,qFAAiF,CAClF,EAAA;;wBAFD,SAEC,CAAA;wBACD,qBAAM,WAAW,CAAC,KAAK,CACrB,+EAA2E,CAC5E,EAAA;;wBAFD,SAEC,CAAA;;;;;KACF;IAEY,gCAAI,GAAjB,UAAkB,WAAwB;;;;4BACxC,qBAAM,WAAW,CAAC,KAAK,CACrB,wDAAoD,CACrD,EAAA;;wBAFD,SAEC,CAAA;wBACD,qBAAM,WAAW,CAAC,KAAK,CACrB,8DAA0D,CAC3D,EAAA;;wBAFD,SAEC,CAAA;wBACD,qBAAM,WAAW,CAAC,KAAK,CACrB,yDAAqD,CACtD,EAAA;;wBAFD,SAEC,CAAA;wBACD,qBAAM,WAAW,CAAC,KAAK,CACrB,8DAA0D,CAC3D,EAAA;;wBAFD,SAEC,CAAA;wBACD,qBAAM,WAAW,CAAC,KAAK,CAAC,qDAAiD,CAAC,EAAA;;wBAA1E,SAA0E,CAAA;wBAC1E,qBAAM,WAAW,CAAC,KAAK,CAAC,uDAAmD,CAAC,EAAA;;wBAA5E,SAA4E,CAAA;;;;;KAC7E;IACH,wBAAC;AAAD,CAAC,AAxCD,IAwCC;AAxCY,8CAAiB"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { EntityManager } from "typeorm";
|
|
2
|
+
import { TransactionBaseService } from "../interfaces";
|
|
3
|
+
import { Currency } from "../models";
|
|
4
|
+
import { CurrencyRepository } from "../repositories/currency";
|
|
5
|
+
import { FindConfig, Selector } from "../types/common";
|
|
6
|
+
import { UpdateCurrencyInput } from "../types/currency";
|
|
7
|
+
import { FlagRouter } from "../utils/flag-router";
|
|
8
|
+
import EventBusService from "./event-bus";
|
|
9
|
+
declare type InjectedDependencies = {
|
|
10
|
+
manager: EntityManager;
|
|
11
|
+
currencyRepository: typeof CurrencyRepository;
|
|
12
|
+
eventBusService: EventBusService;
|
|
13
|
+
featureFlagRouter: FlagRouter;
|
|
14
|
+
};
|
|
15
|
+
export default class CurrencyService extends TransactionBaseService {
|
|
16
|
+
static readonly Events: {
|
|
17
|
+
UPDATED: string;
|
|
18
|
+
};
|
|
19
|
+
protected manager_: EntityManager;
|
|
20
|
+
protected transactionManager_: EntityManager | undefined;
|
|
21
|
+
protected readonly currencyRepository_: typeof CurrencyRepository;
|
|
22
|
+
protected readonly eventBusService_: EventBusService;
|
|
23
|
+
protected readonly featureFlagRouter_: FlagRouter;
|
|
24
|
+
constructor({ manager, currencyRepository, eventBusService, featureFlagRouter, }: InjectedDependencies);
|
|
25
|
+
/**
|
|
26
|
+
* Return the currency
|
|
27
|
+
* @param code - The code of the currency that must be retrieve
|
|
28
|
+
* @return The currency
|
|
29
|
+
*/
|
|
30
|
+
retrieveByCode(code: string): Promise<Currency | never>;
|
|
31
|
+
/**
|
|
32
|
+
* Lists currencies based on the provided parameters and includes the count of
|
|
33
|
+
* currencies that match the query.
|
|
34
|
+
* @param selector - an object that defines rules to filter currencies
|
|
35
|
+
* by
|
|
36
|
+
* @param config - object that defines the scope for what should be
|
|
37
|
+
* returned
|
|
38
|
+
* @return an array containing the currencies as
|
|
39
|
+
* the first element and the total count of products that matches the query
|
|
40
|
+
* as the second element.
|
|
41
|
+
*/
|
|
42
|
+
listAndCount(selector: Selector<Currency>, config?: FindConfig<Currency>): Promise<[Currency[], number]>;
|
|
43
|
+
/**
|
|
44
|
+
* Update a currency
|
|
45
|
+
* @param code - The code of the currency to update
|
|
46
|
+
* @param data - The data that must be updated on the currency
|
|
47
|
+
* @return The updated currency
|
|
48
|
+
*/
|
|
49
|
+
update(code: string, data: UpdateCurrencyInput): Promise<Currency | undefined | never>;
|
|
50
|
+
}
|
|
51
|
+
export {};
|
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __extends = (this && this.__extends) || (function () {
|
|
3
|
+
var extendStatics = function (d, b) {
|
|
4
|
+
extendStatics = Object.setPrototypeOf ||
|
|
5
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
7
|
+
return extendStatics(d, b);
|
|
8
|
+
};
|
|
9
|
+
return function (d, b) {
|
|
10
|
+
if (typeof b !== "function" && b !== null)
|
|
11
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
12
|
+
extendStatics(d, b);
|
|
13
|
+
function __() { this.constructor = d; }
|
|
14
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
15
|
+
};
|
|
16
|
+
})();
|
|
17
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
18
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
19
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
20
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
21
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
22
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
23
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
24
|
+
});
|
|
25
|
+
};
|
|
26
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
27
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
28
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
29
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
30
|
+
function step(op) {
|
|
31
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
32
|
+
while (_) try {
|
|
33
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
34
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
35
|
+
switch (op[0]) {
|
|
36
|
+
case 0: case 1: t = op; break;
|
|
37
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
38
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
39
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
40
|
+
default:
|
|
41
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
42
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
43
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
44
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
45
|
+
if (t[2]) _.ops.pop();
|
|
46
|
+
_.trys.pop(); continue;
|
|
47
|
+
}
|
|
48
|
+
op = body.call(thisArg, _);
|
|
49
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
50
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
51
|
+
}
|
|
52
|
+
};
|
|
53
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
54
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
55
|
+
};
|
|
56
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
57
|
+
var medusa_core_utils_1 = require("medusa-core-utils");
|
|
58
|
+
var interfaces_1 = require("../interfaces");
|
|
59
|
+
var tax_inclusive_pricing_1 = __importDefault(require("../loaders/feature-flags/tax-inclusive-pricing"));
|
|
60
|
+
var utils_1 = require("../utils");
|
|
61
|
+
var CurrencyService = /** @class */ (function (_super) {
|
|
62
|
+
__extends(CurrencyService, _super);
|
|
63
|
+
function CurrencyService(_a) {
|
|
64
|
+
var manager = _a.manager, currencyRepository = _a.currencyRepository, eventBusService = _a.eventBusService, featureFlagRouter = _a.featureFlagRouter;
|
|
65
|
+
var _this = _super.call(this, { manager: manager }) || this;
|
|
66
|
+
_this.manager_ = manager;
|
|
67
|
+
_this.currencyRepository_ = currencyRepository;
|
|
68
|
+
_this.eventBusService_ = eventBusService;
|
|
69
|
+
_this.featureFlagRouter_ = featureFlagRouter;
|
|
70
|
+
return _this;
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* Return the currency
|
|
74
|
+
* @param code - The code of the currency that must be retrieve
|
|
75
|
+
* @return The currency
|
|
76
|
+
*/
|
|
77
|
+
CurrencyService.prototype.retrieveByCode = function (code) {
|
|
78
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
79
|
+
var currencyRepo, currency;
|
|
80
|
+
return __generator(this, function (_a) {
|
|
81
|
+
switch (_a.label) {
|
|
82
|
+
case 0:
|
|
83
|
+
currencyRepo = this.manager_.getCustomRepository(this.currencyRepository_);
|
|
84
|
+
code = code.toLowerCase();
|
|
85
|
+
return [4 /*yield*/, currencyRepo.findOne({
|
|
86
|
+
where: { code: code },
|
|
87
|
+
})];
|
|
88
|
+
case 1:
|
|
89
|
+
currency = _a.sent();
|
|
90
|
+
if (!currency) {
|
|
91
|
+
throw new medusa_core_utils_1.MedusaError(medusa_core_utils_1.MedusaError.Types.NOT_FOUND, "Currency with code: ".concat(code, " was not found"));
|
|
92
|
+
}
|
|
93
|
+
return [2 /*return*/, currency];
|
|
94
|
+
}
|
|
95
|
+
});
|
|
96
|
+
});
|
|
97
|
+
};
|
|
98
|
+
/**
|
|
99
|
+
* Lists currencies based on the provided parameters and includes the count of
|
|
100
|
+
* currencies that match the query.
|
|
101
|
+
* @param selector - an object that defines rules to filter currencies
|
|
102
|
+
* by
|
|
103
|
+
* @param config - object that defines the scope for what should be
|
|
104
|
+
* returned
|
|
105
|
+
* @return an array containing the currencies as
|
|
106
|
+
* the first element and the total count of products that matches the query
|
|
107
|
+
* as the second element.
|
|
108
|
+
*/
|
|
109
|
+
CurrencyService.prototype.listAndCount = function (selector, config) {
|
|
110
|
+
if (config === void 0) { config = {
|
|
111
|
+
skip: 0,
|
|
112
|
+
take: 20,
|
|
113
|
+
}; }
|
|
114
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
115
|
+
var productRepo, query;
|
|
116
|
+
return __generator(this, function (_a) {
|
|
117
|
+
switch (_a.label) {
|
|
118
|
+
case 0:
|
|
119
|
+
productRepo = this.manager_.getCustomRepository(this.currencyRepository_);
|
|
120
|
+
query = (0, utils_1.buildQuery)(selector, config);
|
|
121
|
+
return [4 /*yield*/, productRepo.findAndCount(query)];
|
|
122
|
+
case 1: return [2 /*return*/, _a.sent()];
|
|
123
|
+
}
|
|
124
|
+
});
|
|
125
|
+
});
|
|
126
|
+
};
|
|
127
|
+
/**
|
|
128
|
+
* Update a currency
|
|
129
|
+
* @param code - The code of the currency to update
|
|
130
|
+
* @param data - The data that must be updated on the currency
|
|
131
|
+
* @return The updated currency
|
|
132
|
+
*/
|
|
133
|
+
CurrencyService.prototype.update = function (code, data) {
|
|
134
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
135
|
+
var _this = this;
|
|
136
|
+
return __generator(this, function (_a) {
|
|
137
|
+
switch (_a.label) {
|
|
138
|
+
case 0: return [4 /*yield*/, this.atomicPhase_(function (transactionManager) { return __awaiter(_this, void 0, void 0, function () {
|
|
139
|
+
var currency, currencyRepo;
|
|
140
|
+
return __generator(this, function (_a) {
|
|
141
|
+
switch (_a.label) {
|
|
142
|
+
case 0: return [4 /*yield*/, this.retrieveByCode(code)];
|
|
143
|
+
case 1:
|
|
144
|
+
currency = _a.sent();
|
|
145
|
+
if (this.featureFlagRouter_.isFeatureEnabled(tax_inclusive_pricing_1.default.key)) {
|
|
146
|
+
if (typeof data.includes_tax !== "undefined") {
|
|
147
|
+
currency.includes_tax = data.includes_tax;
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
currencyRepo = transactionManager.getCustomRepository(this.currencyRepository_);
|
|
151
|
+
return [4 /*yield*/, currencyRepo.save(currency)];
|
|
152
|
+
case 2:
|
|
153
|
+
_a.sent();
|
|
154
|
+
return [4 /*yield*/, this.eventBusService_.emit(CurrencyService.Events.UPDATED, {
|
|
155
|
+
code: code,
|
|
156
|
+
})];
|
|
157
|
+
case 3:
|
|
158
|
+
_a.sent();
|
|
159
|
+
return [2 /*return*/, currency];
|
|
160
|
+
}
|
|
161
|
+
});
|
|
162
|
+
}); })];
|
|
163
|
+
case 1: return [2 /*return*/, _a.sent()];
|
|
164
|
+
}
|
|
165
|
+
});
|
|
166
|
+
});
|
|
167
|
+
};
|
|
168
|
+
CurrencyService.Events = {
|
|
169
|
+
UPDATED: "currency.updated",
|
|
170
|
+
};
|
|
171
|
+
return CurrencyService;
|
|
172
|
+
}(interfaces_1.TransactionBaseService));
|
|
173
|
+
exports.default = CurrencyService;
|
|
174
|
+
//# sourceMappingURL=currency.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"currency.js","sourceRoot":"","sources":["../../src/services/currency.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,uDAA+C;AAE/C,4CAAsD;AACtD,yGAA2F;AAK3F,kCAAqC;AAWrC;IAA6C,mCAAsB;IAYjE,yBAAY,EAKW;YAJrB,OAAO,aAAA,EACP,kBAAkB,wBAAA,EAClB,eAAe,qBAAA,EACf,iBAAiB,uBAAA;QAJnB,YAME,kBAAM,EAAE,OAAO,SAAA,EAAE,CAAC,SAKnB;QAJC,KAAI,CAAC,QAAQ,GAAG,OAAO,CAAA;QACvB,KAAI,CAAC,mBAAmB,GAAG,kBAAkB,CAAA;QAC7C,KAAI,CAAC,gBAAgB,GAAG,eAAe,CAAA;QACvC,KAAI,CAAC,kBAAkB,GAAG,iBAAiB,CAAA;;IAC7C,CAAC;IAED;;;;OAIG;IACG,wCAAc,GAApB,UAAqB,IAAY;;;;;;wBACzB,YAAY,GAAG,IAAI,CAAC,QAAQ,CAAC,mBAAmB,CACpD,IAAI,CAAC,mBAAmB,CACzB,CAAA;wBAED,IAAI,GAAG,IAAI,CAAC,WAAW,EAAE,CAAA;wBACR,qBAAM,YAAY,CAAC,OAAO,CAAC;gCAC1C,KAAK,EAAE,EAAE,IAAI,MAAA,EAAE;6BAChB,CAAC,EAAA;;wBAFI,QAAQ,GAAG,SAEf;wBAEF,IAAI,CAAC,QAAQ,EAAE;4BACb,MAAM,IAAI,+BAAW,CACnB,+BAAW,CAAC,KAAK,CAAC,SAAS,EAC3B,8BAAuB,IAAI,mBAAgB,CAC5C,CAAA;yBACF;wBAED,sBAAO,QAAQ,EAAA;;;;KAChB;IAED;;;;;;;;;;OAUG;IACG,sCAAY,GAAlB,UACE,QAA4B,EAC5B,MAGC;QAHD,uBAAA,EAAA;YACE,IAAI,EAAE,CAAC;YACP,IAAI,EAAE,EAAE;SACT;;;;;;wBAEK,WAAW,GAAG,IAAI,CAAC,QAAQ,CAAC,mBAAmB,CACnD,IAAI,CAAC,mBAAmB,CACzB,CAAA;wBAEK,KAAK,GAAG,IAAA,kBAAU,EAAC,QAAQ,EAAE,MAAM,CAAC,CAAA;wBAEnC,qBAAM,WAAW,CAAC,YAAY,CAAC,KAAK,CAAC,EAAA;4BAA5C,sBAAO,SAAqC,EAAA;;;;KAC7C;IAED;;;;;OAKG;IACG,gCAAM,GAAZ,UACE,IAAY,EACZ,IAAyB;;;;;4BAElB,qBAAM,IAAI,CAAC,YAAY,CAAC,UAAO,kBAAkB;;;;4CACrC,qBAAM,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,EAAA;;wCAA1C,QAAQ,GAAG,SAA+B;wCAEhD,IACE,IAAI,CAAC,kBAAkB,CAAC,gBAAgB,CACtC,+BAA8B,CAAC,GAAG,CACnC,EACD;4CACA,IAAI,OAAO,IAAI,CAAC,YAAY,KAAK,WAAW,EAAE;gDAC5C,QAAQ,CAAC,YAAY,GAAG,IAAI,CAAC,YAAY,CAAA;6CAC1C;yCACF;wCAEK,YAAY,GAAG,kBAAkB,CAAC,mBAAmB,CACzD,IAAI,CAAC,mBAAmB,CACzB,CAAA;wCACD,qBAAM,YAAY,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAA;;wCAAjC,SAAiC,CAAA;wCAEjC,qBAAM,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,eAAe,CAAC,MAAM,CAAC,OAAO,EAAE;gDAC/D,IAAI,MAAA;6CACL,CAAC,EAAA;;wCAFF,SAEE,CAAA;wCAEF,sBAAO,QAAQ,EAAA;;;6BAChB,CAAC,EAAA;4BAvBF,sBAAO,SAuBL,EAAA;;;;KACH;IA9Ge,sBAAM,GAAG;QACvB,OAAO,EAAE,kBAAkB;KAC5B,CAAA;IA6GH,sBAAC;CAAA,AAhHD,CAA6C,mCAAsB,GAgHlE;kBAhHoB,eAAe"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"currency.js","sourceRoot":"","sources":["../../src/types/currency.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Return the tax amount that
|
|
3
|
+
* - is includes in the price if it is tax inclusive
|
|
4
|
+
* - will be applied on to the price if it is tax exclusive
|
|
5
|
+
* @param price
|
|
6
|
+
* @param includesTax
|
|
7
|
+
* @param taxRate
|
|
8
|
+
*/
|
|
9
|
+
export declare function calculatePriceTaxAmount({ price, includesTax, taxRate, }: {
|
|
10
|
+
price: number;
|
|
11
|
+
includesTax?: boolean;
|
|
12
|
+
taxRate: number;
|
|
13
|
+
}): number;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.calculatePriceTaxAmount = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Return the tax amount that
|
|
6
|
+
* - is includes in the price if it is tax inclusive
|
|
7
|
+
* - will be applied on to the price if it is tax exclusive
|
|
8
|
+
* @param price
|
|
9
|
+
* @param includesTax
|
|
10
|
+
* @param taxRate
|
|
11
|
+
*/
|
|
12
|
+
function calculatePriceTaxAmount(_a) {
|
|
13
|
+
var price = _a.price, includesTax = _a.includesTax, taxRate = _a.taxRate;
|
|
14
|
+
if (includesTax) {
|
|
15
|
+
return (taxRate * price) / (1 + taxRate);
|
|
16
|
+
}
|
|
17
|
+
return price * taxRate;
|
|
18
|
+
}
|
|
19
|
+
exports.calculatePriceTaxAmount = calculatePriceTaxAmount;
|
|
20
|
+
//# sourceMappingURL=calculate-price-tax-amount.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"calculate-price-tax-amount.js","sourceRoot":"","sources":["../../src/utils/calculate-price-tax-amount.ts"],"names":[],"mappings":";;;AAAA;;;;;;;GAOG;AACH,SAAgB,uBAAuB,CAAC,EAQvC;QAPC,KAAK,WAAA,EACL,WAAW,iBAAA,EACX,OAAO,aAAA;IAMP,IAAI,WAAW,EAAE;QACf,OAAO,CAAC,OAAO,GAAG,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,OAAO,CAAC,CAAA;KACzC;IAED,OAAO,KAAK,GAAG,OAAO,CAAA;AACxB,CAAC;AAdD,0DAcC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.csvRevertCellContentFormatter = exports.csvCellContentFormatter = void 0;
|
|
4
|
+
function csvCellContentFormatter(str) {
|
|
5
|
+
var newLineRegexp = new RegExp(/\n/g);
|
|
6
|
+
var doubleQuoteRegexp = new RegExp(/"/g);
|
|
7
|
+
var hasNewLineChar = !!str.match(newLineRegexp);
|
|
8
|
+
if (!hasNewLineChar) {
|
|
9
|
+
return str;
|
|
10
|
+
}
|
|
11
|
+
var formatterStr = str.replace(doubleQuoteRegexp, '""');
|
|
12
|
+
return "\"".concat(formatterStr, "\"");
|
|
13
|
+
}
|
|
14
|
+
exports.csvCellContentFormatter = csvCellContentFormatter;
|
|
15
|
+
function csvRevertCellContentFormatter(str) {
|
|
16
|
+
if (str.startsWith('"')) {
|
|
17
|
+
str = str.substring(1, str.length - 1);
|
|
18
|
+
}
|
|
19
|
+
return str;
|
|
20
|
+
}
|
|
21
|
+
exports.csvRevertCellContentFormatter = csvRevertCellContentFormatter;
|
|
22
|
+
//# sourceMappingURL=csv-cell-content-formatter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"csv-cell-content-formatter.js","sourceRoot":"","sources":["../../src/utils/csv-cell-content-formatter.ts"],"names":[],"mappings":";;;AAAA,SAAgB,uBAAuB,CAAC,GAAW;IACjD,IAAM,aAAa,GAAG,IAAI,MAAM,CAAC,KAAK,CAAC,CAAA;IACvC,IAAM,iBAAiB,GAAG,IAAI,MAAM,CAAC,IAAI,CAAC,CAAA;IAE1C,IAAM,cAAc,GAAG,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,aAAa,CAAC,CAAA;IACjD,IAAI,CAAC,cAAc,EAAE;QACnB,OAAO,GAAG,CAAA;KACX;IAED,IAAM,YAAY,GAAG,GAAG,CAAC,OAAO,CAAC,iBAAiB,EAAE,IAAI,CAAC,CAAA;IAEzD,OAAO,YAAI,YAAY,OAAG,CAAA;AAC5B,CAAC;AAZD,0DAYC;AAED,SAAgB,6BAA6B,CAAC,GAAW;IACvD,IAAI,GAAG,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE;QACvB,GAAG,GAAG,GAAG,CAAC,SAAS,CAAC,CAAC,EAAE,GAAG,CAAC,MAAM,GAAG,CAAC,CAAC,CAAA;KACvC;IACD,OAAO,GAAG,CAAA;AACZ,CAAC;AALD,sEAKC"}
|