@medusajs/medusa 1.2.2-dev.47 → 1.3.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/CHANGELOG.md +48 -0
- package/dist/api/index.d.ts +1 -0
- package/dist/api/index.js +1 -0
- package/dist/api/index.js.map +1 -1
- package/dist/api/middlewares/error-handler.js +1 -1
- package/dist/api/routes/admin/auth/create-session.js +5 -5
- package/dist/api/routes/admin/auth/create-session.js.map +1 -1
- package/dist/api/routes/admin/customer-groups/get-customer-group-customers.d.ts +20 -0
- package/dist/api/routes/admin/customer-groups/get-customer-group-customers.js +76 -0
- package/dist/api/routes/admin/customer-groups/get-customer-group-customers.js.map +1 -0
- package/dist/api/routes/admin/customer-groups/index.js +1 -0
- package/dist/api/routes/admin/customer-groups/index.js.map +1 -1
- package/dist/api/routes/admin/customer-groups/list-customer-groups.js +2 -2
- package/dist/api/routes/admin/customer-groups/list-customer-groups.js.map +1 -1
- package/dist/api/routes/admin/customers/index.js +1 -1
- package/dist/api/routes/admin/customers/index.js.map +1 -1
- package/dist/api/routes/admin/customers/list-customers.js +1 -0
- package/dist/api/routes/admin/customers/list-customers.js.map +1 -1
- package/dist/api/routes/admin/discounts/create-discount.d.ts +11 -2
- package/dist/api/routes/admin/discounts/create-discount.js +66 -12
- package/dist/api/routes/admin/discounts/create-discount.js.map +1 -1
- package/dist/api/routes/admin/discounts/create-dynamic-code.d.ts +1 -0
- package/dist/api/routes/admin/discounts/create-dynamic-code.js +4 -1
- package/dist/api/routes/admin/discounts/create-dynamic-code.js.map +1 -1
- package/dist/api/routes/admin/discounts/delete-dynamic-code.js +3 -1
- package/dist/api/routes/admin/discounts/delete-dynamic-code.js.map +1 -1
- package/dist/api/routes/admin/discounts/get-discount.d.ts +7 -0
- package/dist/api/routes/admin/discounts/get-discount.js +43 -9
- package/dist/api/routes/admin/discounts/get-discount.js.map +1 -1
- package/dist/api/routes/admin/discounts/index.d.ts +1 -3
- package/dist/api/routes/admin/discounts/index.js +1 -6
- package/dist/api/routes/admin/discounts/index.js.map +1 -1
- package/dist/api/routes/admin/discounts/list-discounts.d.ts +2 -6
- package/dist/api/routes/admin/discounts/list-discounts.js +15 -28
- package/dist/api/routes/admin/discounts/list-discounts.js.map +1 -1
- package/dist/api/routes/admin/discounts/update-discount.d.ts +12 -2
- package/dist/api/routes/admin/discounts/update-discount.js +70 -15
- package/dist/api/routes/admin/discounts/update-discount.js.map +1 -1
- package/dist/api/routes/admin/draft-orders/create-draft-order.d.ts +3 -3
- package/dist/api/routes/admin/draft-orders/create-draft-order.js.map +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.map +1 -1
- package/dist/api/routes/admin/draft-orders/index.js +7 -1
- package/dist/api/routes/admin/draft-orders/index.js.map +1 -1
- package/dist/api/routes/admin/draft-orders/register-payment.js +0 -1
- package/dist/api/routes/admin/draft-orders/register-payment.js.map +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.map +1 -1
- package/dist/api/routes/admin/index.js +21 -19
- package/dist/api/routes/admin/index.js.map +1 -1
- package/dist/api/routes/admin/notifications/index.js.map +1 -1
- package/dist/api/routes/admin/notifications/list-notifications.js.map +1 -1
- package/dist/api/routes/admin/notifications/resend-notification.js.map +1 -1
- package/dist/api/routes/admin/orders/add-shipping-method.d.ts +1 -1
- package/dist/api/routes/admin/orders/add-shipping-method.js.map +1 -1
- package/dist/api/routes/admin/orders/create-order.js.map +1 -1
- package/dist/api/routes/admin/orders/create-swap.js +7 -3
- package/dist/api/routes/admin/orders/create-swap.js.map +1 -1
- package/dist/api/routes/admin/orders/index.d.ts +1 -1
- package/dist/api/routes/admin/orders/index.js +1 -3
- package/dist/api/routes/admin/orders/index.js.map +1 -1
- package/dist/api/routes/admin/orders/list-orders.js.map +1 -1
- package/dist/api/routes/admin/orders/update-order.js.map +1 -1
- package/dist/api/routes/admin/price-lists/add-prices-batch.d.ts +70 -0
- package/dist/api/routes/admin/{orders/receive-swap.js → price-lists/add-prices-batch.js} +77 -78
- package/dist/api/routes/admin/price-lists/add-prices-batch.js.map +1 -0
- package/dist/api/routes/admin/price-lists/create-price-list.d.ts +87 -0
- package/dist/api/routes/admin/price-lists/create-price-list.js +193 -0
- package/dist/api/routes/admin/price-lists/create-price-list.js.map +1 -0
- package/dist/api/routes/admin/price-lists/delete-price-list.d.ts +28 -0
- package/dist/api/routes/admin/{discounts/remove-valid-product.js → price-lists/delete-price-list.js} +27 -25
- package/dist/api/routes/admin/price-lists/delete-price-list.js.map +1 -0
- package/dist/api/routes/admin/price-lists/delete-prices-batch.d.ts +43 -0
- package/dist/api/routes/{store/carts/update-payment-method.js → admin/price-lists/delete-prices-batch.js} +42 -46
- package/dist/api/routes/admin/price-lists/delete-prices-batch.js.map +1 -0
- package/dist/api/routes/admin/price-lists/get-price-list.d.ts +22 -0
- package/dist/api/routes/admin/{discounts/add-valid-product.js → price-lists/get-price-list.js} +20 -24
- package/dist/api/routes/admin/price-lists/get-price-list.js.map +1 -0
- package/dist/api/routes/admin/price-lists/index.d.ts +28 -0
- package/dist/api/routes/admin/price-lists/index.js +55 -0
- package/dist/api/routes/admin/price-lists/index.js.map +1 -0
- package/dist/api/routes/admin/price-lists/list-price-list-products.d.ts +74 -0
- package/dist/api/routes/admin/price-lists/list-price-list-products.js +246 -0
- package/dist/api/routes/admin/price-lists/list-price-list-products.js.map +1 -0
- package/dist/api/routes/admin/price-lists/list-price-lists.d.ts +38 -0
- package/dist/api/routes/admin/price-lists/list-price-lists.js +197 -0
- package/dist/api/routes/admin/price-lists/list-price-lists.js.map +1 -0
- package/dist/api/routes/admin/price-lists/update-price-list.d.ts +92 -0
- package/dist/api/routes/admin/price-lists/update-price-list.js +211 -0
- package/dist/api/routes/admin/price-lists/update-price-list.js.map +1 -0
- package/dist/api/routes/admin/products/create-product.d.ts +2 -7
- package/dist/api/routes/admin/products/create-product.js +2 -24
- package/dist/api/routes/admin/products/create-product.js.map +1 -1
- package/dist/api/routes/admin/products/create-variant.d.ts +7 -9
- package/dist/api/routes/admin/products/create-variant.js +7 -26
- package/dist/api/routes/admin/products/create-variant.js.map +1 -1
- package/dist/api/routes/admin/products/index.d.ts +1 -1
- package/dist/api/routes/admin/products/index.js +7 -1
- package/dist/api/routes/admin/products/index.js.map +1 -1
- package/dist/api/routes/admin/products/list-products.d.ts +2 -1
- package/dist/api/routes/admin/products/list-products.js +31 -65
- package/dist/api/routes/admin/products/list-products.js.map +1 -1
- package/dist/api/routes/admin/products/update-product.d.ts +2 -7
- package/dist/api/routes/admin/products/update-product.js +2 -24
- package/dist/api/routes/admin/products/update-product.js.map +1 -1
- package/dist/api/routes/admin/products/update-variant.d.ts +10 -9
- package/dist/api/routes/admin/products/update-variant.js +21 -33
- package/dist/api/routes/admin/products/update-variant.js.map +1 -1
- package/dist/api/routes/admin/regions/index.d.ts +1 -1
- package/dist/api/routes/admin/store/get-store.js.map +1 -1
- package/dist/api/routes/admin/swaps/index.js +3 -0
- package/dist/api/routes/admin/swaps/index.js.map +1 -1
- package/dist/api/routes/admin/tax-rates/list-tax-rates.js.map +1 -1
- package/dist/api/routes/admin/tax-rates/utils/get-query-config.d.ts +1 -1
- package/dist/api/routes/admin/tax-rates/utils/get-query-config.js +4 -2
- package/dist/api/routes/admin/tax-rates/utils/get-query-config.js.map +1 -1
- package/dist/api/routes/admin/uploads/index.d.ts +1 -1
- package/dist/api/routes/store/auth/create-session.js +4 -5
- package/dist/api/routes/store/auth/create-session.js.map +1 -1
- package/dist/api/routes/store/carts/create-cart.js +8 -5
- package/dist/api/routes/store/carts/create-cart.js.map +1 -1
- package/dist/api/routes/store/carts/create-line-item.d.ts +1 -1
- package/dist/api/routes/store/carts/create-line-item.js +9 -6
- package/dist/api/routes/store/carts/create-line-item.js.map +1 -1
- package/dist/api/routes/store/carts/index.d.ts +0 -1
- package/dist/api/routes/store/carts/index.js +1 -3
- package/dist/api/routes/store/carts/index.js.map +1 -1
- package/dist/api/routes/store/carts/update-cart.js +7 -7
- package/dist/api/routes/store/carts/update-cart.js.map +1 -1
- package/dist/api/routes/store/collections/list-collections.d.ts +3 -0
- package/dist/api/routes/store/collections/list-collections.js +33 -16
- package/dist/api/routes/store/collections/list-collections.js.map +1 -1
- package/dist/api/routes/store/customers/create-customer.js +3 -4
- package/dist/api/routes/store/customers/create-customer.js.map +1 -1
- package/dist/api/routes/store/orders/index.js +0 -2
- package/dist/api/routes/store/orders/index.js.map +1 -1
- package/dist/api/routes/store/products/get-product.js +17 -5
- package/dist/api/routes/store/products/get-product.js.map +1 -1
- package/dist/api/routes/store/products/index.d.ts +2 -2
- package/dist/api/routes/store/products/list-products.d.ts +5 -3
- package/dist/api/routes/store/products/list-products.js +60 -18
- package/dist/api/routes/store/products/list-products.js.map +1 -1
- package/dist/api/routes/store/products/search.d.ts +1 -1
- package/dist/api/routes/store/products/search.js.map +1 -1
- package/dist/api/routes/store/regions/list-regions.d.ts +3 -0
- package/dist/api/routes/store/regions/list-regions.js +22 -7
- package/dist/api/routes/store/regions/list-regions.js.map +1 -1
- package/dist/api/routes/store/shipping-options/list-options.js.map +1 -1
- package/dist/api/routes/store/swaps/create-swap.js +7 -3
- package/dist/api/routes/store/swaps/create-swap.js.map +1 -1
- package/dist/api/routes/store/variants/get-variant.js +17 -5
- package/dist/api/routes/store/variants/get-variant.js.map +1 -1
- package/dist/api/routes/store/variants/list-variants.d.ts +6 -1
- package/dist/api/routes/store/variants/list-variants.js +63 -10
- package/dist/api/routes/store/variants/list-variants.js.map +1 -1
- package/dist/commands/develop.js +1 -1
- package/dist/commands/develop.js.map +1 -1
- package/dist/controllers/customers/index.d.ts +1 -1
- package/dist/controllers/customers/list-customers.d.ts +1 -1
- package/dist/controllers/customers/list-customers.js +34 -37
- package/dist/controllers/customers/list-customers.js.map +1 -1
- package/dist/controllers/products/admin-list-products.d.ts +16 -0
- package/dist/controllers/products/admin-list-products.js +103 -0
- package/dist/controllers/products/admin-list-products.js.map +1 -0
- package/dist/helpers/test-request.js +15 -7
- package/dist/helpers/test-request.js.map +1 -1
- package/dist/index.d.ts +3 -58
- package/dist/index.js +3 -61
- package/dist/index.js.map +1 -1
- package/dist/interfaces/base-service.d.ts +66 -0
- package/dist/interfaces/base-service.js +378 -0
- package/dist/interfaces/base-service.js.map +1 -0
- package/dist/interfaces/index.d.ts +1 -0
- package/dist/interfaces/index.js +1 -0
- package/dist/interfaces/index.js.map +1 -1
- package/dist/interfaces/price-selection-strategy.d.ts +50 -0
- package/dist/interfaces/price-selection-strategy.js +34 -0
- package/dist/interfaces/price-selection-strategy.js.map +1 -0
- package/dist/interfaces/tax-service.d.ts +6 -0
- package/dist/interfaces/tax-service.js +31 -0
- package/dist/interfaces/tax-service.js.map +1 -1
- package/dist/loaders/api.d.ts +9 -5
- package/dist/loaders/api.js +2 -6
- package/dist/loaders/api.js.map +1 -1
- package/dist/loaders/config.d.ts +3 -0
- package/dist/loaders/config.js +47 -0
- package/dist/loaders/config.js.map +1 -0
- package/dist/loaders/database.d.ts +8 -4
- package/dist/loaders/database.js.map +1 -1
- package/dist/loaders/defaults.d.ts +4 -3
- package/dist/loaders/defaults.js +39 -31
- package/dist/loaders/defaults.js.map +1 -1
- package/dist/loaders/express.d.ts +7 -4
- package/dist/loaders/express.js +7 -5
- package/dist/loaders/express.js.map +1 -1
- package/dist/loaders/index.d.ts +13 -8
- package/dist/loaders/index.js +29 -54
- package/dist/loaders/index.js.map +1 -1
- package/dist/loaders/logger.d.ts +1 -0
- package/dist/loaders/logger.js.map +1 -1
- package/dist/loaders/models.d.ts +8 -3
- package/dist/loaders/models.js +19 -17
- package/dist/loaders/models.js.map +1 -1
- package/dist/loaders/passport.d.ts +7 -4
- package/dist/loaders/passport.js +23 -21
- package/dist/loaders/passport.js.map +1 -1
- package/dist/loaders/plugins.d.ts +18 -10
- package/dist/loaders/plugins.js +27 -24
- package/dist/loaders/plugins.js.map +1 -1
- package/dist/loaders/redis.d.ts +8 -5
- package/dist/loaders/redis.js +3 -3
- package/dist/loaders/redis.js.map +1 -1
- package/dist/loaders/repositories.d.ts +7 -3
- package/dist/loaders/repositories.js +1 -1
- package/dist/loaders/repositories.js.map +1 -1
- package/dist/loaders/search-index.d.ts +4 -3
- package/dist/loaders/search-index.js.map +1 -1
- package/dist/loaders/services.d.ts +10 -5
- package/dist/loaders/services.js.map +1 -1
- package/dist/loaders/strategies.d.ts +1 -1
- package/dist/loaders/subscribers.d.ts +7 -3
- package/dist/loaders/subscribers.js.map +1 -1
- package/dist/migrations/1646324713514-discount_conditions.d.ts +6 -0
- package/dist/migrations/1646324713514-discount_conditions.js +335 -0
- package/dist/migrations/1646324713514-discount_conditions.js.map +1 -0
- package/dist/migrations/1646915480108-update_money_amount_add_price_list.d.ts +6 -0
- package/dist/migrations/1646915480108-update_money_amount_add_price_list.js +143 -0
- package/dist/migrations/1646915480108-update_money_amount_add_price_list.js.map +1 -0
- package/dist/migrations/1648600574750-add_line_item_adjustments.d.ts +6 -0
- package/dist/migrations/1648600574750-add_line_item_adjustments.js +101 -0
- package/dist/migrations/1648600574750-add_line_item_adjustments.js.map +1 -0
- package/dist/migrations/1648641130007-tax_line_constraints.d.ts +6 -0
- package/dist/migrations/1648641130007-tax_line_constraints.js +77 -0
- package/dist/migrations/1648641130007-tax_line_constraints.js.map +1 -0
- package/dist/migrations/1649775522087-add_batch_job_model.d.ts +6 -0
- package/dist/migrations/1649775522087-add_batch_job_model.js +77 -0
- package/dist/migrations/1649775522087-add_batch_job_model.js.map +1 -0
- package/dist/models/batch-job.d.ts +58 -0
- package/dist/models/batch-job.js +119 -0
- package/dist/models/batch-job.js.map +1 -0
- package/dist/models/country.d.ts +1 -1
- package/dist/models/country.js +1 -1
- package/dist/models/country.js.map +1 -1
- package/dist/models/customer-group.d.ts +3 -1
- package/dist/models/customer-group.js +9 -13
- package/dist/models/customer-group.js.map +1 -1
- package/dist/models/discount-condition-customer-group.d.ts +39 -0
- package/dist/models/discount-condition-customer-group.js +84 -0
- package/dist/models/discount-condition-customer-group.js.map +1 -0
- package/dist/models/discount-condition-product-collection.d.ts +39 -0
- package/dist/models/discount-condition-product-collection.js +84 -0
- package/dist/models/discount-condition-product-collection.js.map +1 -0
- package/dist/models/discount-condition-product-tag.d.ts +39 -0
- package/dist/models/discount-condition-product-tag.js +84 -0
- package/dist/models/discount-condition-product-tag.js.map +1 -0
- package/dist/models/discount-condition-product-type.d.ts +39 -0
- package/dist/models/discount-condition-product-type.js +84 -0
- package/dist/models/discount-condition-product-type.js.map +1 -0
- package/dist/models/discount-condition-product.d.ts +39 -0
- package/dist/models/discount-condition-product.js +84 -0
- package/dist/models/discount-condition-product.js.map +1 -0
- package/dist/models/discount-condition.d.ts +68 -0
- package/dist/models/discount-condition.js +208 -0
- package/dist/models/discount-condition.js.map +1 -0
- package/dist/models/discount-rule.d.ts +5 -5
- package/dist/models/discount-rule.js +6 -17
- package/dist/models/discount-rule.js.map +1 -1
- package/dist/models/discount.js.map +1 -1
- package/dist/models/index.d.ts +66 -0
- package/dist/models/index.js +79 -0
- package/dist/models/index.js.map +1 -0
- package/dist/models/line-item-adjustment.d.ts +13 -0
- package/dist/models/line-item-adjustment.js +79 -0
- package/dist/models/line-item-adjustment.js.map +1 -0
- package/dist/models/line-item-tax-line.js +2 -1
- package/dist/models/line-item-tax-line.js.map +1 -1
- package/dist/models/line-item.d.ts +2 -0
- package/dist/models/line-item.js +5 -0
- package/dist/models/line-item.js.map +1 -1
- package/dist/models/money-amount.d.ts +10 -3
- package/dist/models/money-amount.js +25 -5
- package/dist/models/money-amount.js.map +1 -1
- package/dist/models/price-list.d.ts +57 -0
- package/dist/models/price-list.js +146 -0
- package/dist/models/price-list.js.map +1 -0
- package/dist/models/product-variant.js +9 -3
- package/dist/models/product-variant.js.map +1 -1
- package/dist/models/shipping-method-tax-line.js +2 -1
- package/dist/models/shipping-method-tax-line.js.map +1 -1
- package/dist/models/swap.d.ts +4 -4
- package/dist/models/swap.js +23 -23
- package/dist/models/swap.js.map +1 -1
- package/dist/repositories/cart.d.ts +2 -2
- package/dist/repositories/cart.js.map +1 -1
- package/dist/repositories/customer.d.ts +1 -0
- package/dist/repositories/customer.js +63 -0
- package/dist/repositories/customer.js.map +1 -1
- package/dist/repositories/discount-condition.d.ts +34 -0
- package/dist/repositories/discount-condition.js +384 -0
- package/dist/repositories/discount-condition.js.map +1 -0
- package/dist/repositories/line-item-adjustment.d.ts +4 -0
- package/dist/repositories/line-item-adjustment.js +38 -0
- package/dist/repositories/line-item-adjustment.js.map +1 -0
- package/dist/repositories/line-item-tax-line.d.ts +2 -0
- package/dist/repositories/line-item-tax-line.js +80 -0
- package/dist/repositories/line-item-tax-line.js.map +1 -1
- package/dist/repositories/line-item.js +1 -0
- package/dist/repositories/line-item.js.map +1 -1
- package/dist/repositories/money-amount.d.ts +7 -2
- package/dist/repositories/money-amount.js +149 -2
- package/dist/repositories/money-amount.js.map +1 -1
- package/dist/repositories/price-list.d.ts +4 -0
- package/dist/repositories/price-list.js +38 -0
- package/dist/repositories/price-list.js.map +1 -0
- package/dist/repositories/product.d.ts +3 -0
- package/dist/repositories/product.js +41 -19
- package/dist/repositories/product.js.map +1 -1
- package/dist/repositories/shipping-method-tax-line.d.ts +2 -0
- package/dist/repositories/shipping-method-tax-line.js +80 -0
- package/dist/repositories/shipping-method-tax-line.js.map +1 -1
- package/dist/scripts/discount-rule-migration.d.ts +4 -0
- package/dist/scripts/discount-rule-migration.js +177 -0
- package/dist/scripts/discount-rule-migration.js.map +1 -0
- package/dist/scripts/line-item-adjustment-migration.d.ts +4 -0
- package/dist/scripts/line-item-adjustment-migration.js +173 -0
- package/dist/scripts/line-item-adjustment-migration.js.map +1 -0
- package/dist/services/cart.d.ts +58 -47
- package/dist/services/cart.js +1306 -1391
- package/dist/services/cart.js.map +1 -1
- package/dist/services/customer.js +18 -18
- package/dist/services/customer.js.map +1 -1
- package/dist/services/discount.d.ts +50 -58
- package/dist/services/discount.js +365 -154
- package/dist/services/discount.js.map +1 -1
- package/dist/services/draft-order.js +1 -0
- package/dist/services/draft-order.js.map +1 -1
- package/dist/services/fulfillment-provider.js +23 -17
- package/dist/services/fulfillment-provider.js.map +1 -1
- package/dist/services/invite.d.ts +4 -2
- package/dist/services/invite.js +11 -9
- package/dist/services/invite.js.map +1 -1
- package/dist/services/line-item-adjustment.d.ts +87 -0
- package/dist/services/line-item-adjustment.js +436 -0
- package/dist/services/line-item-adjustment.js.map +1 -0
- package/dist/services/line-item.d.ts +48 -40
- package/dist/services/line-item.js +226 -193
- package/dist/services/line-item.js.map +1 -1
- package/dist/services/order.js +4 -4
- package/dist/services/order.js.map +1 -1
- package/dist/services/payment-provider.js +23 -17
- package/dist/services/payment-provider.js.map +1 -1
- package/dist/services/price-list.d.ts +86 -0
- package/dist/services/price-list.js +469 -0
- package/dist/services/price-list.js.map +1 -0
- package/dist/services/product-variant.d.ts +40 -16
- package/dist/services/product-variant.js +259 -109
- package/dist/services/product-variant.js.map +1 -1
- package/dist/services/product.d.ts +22 -4
- package/dist/services/product.js +239 -49
- package/dist/services/product.js.map +1 -1
- package/dist/services/region.js +8 -4
- package/dist/services/region.js.map +1 -1
- package/dist/services/return.js +0 -1
- package/dist/services/return.js.map +1 -1
- package/dist/services/shipping-option.d.ts +2 -2
- package/dist/services/shipping-option.js +7 -4
- package/dist/services/shipping-option.js.map +1 -1
- package/dist/services/swap.d.ts +4 -1
- package/dist/services/swap.js +29 -16
- package/dist/services/swap.js.map +1 -1
- package/dist/services/system-tax.d.ts +2 -3
- package/dist/services/system-tax.js +2 -2
- package/dist/services/system-tax.js.map +1 -1
- package/dist/services/tax-provider.d.ts +2 -0
- package/dist/services/tax-provider.js +96 -7
- package/dist/services/tax-provider.js.map +1 -1
- package/dist/services/tax-rate.d.ts +3 -3
- package/dist/services/tax-rate.js +1 -1
- package/dist/services/tax-rate.js.map +1 -1
- package/dist/services/totals.d.ts +9 -8
- package/dist/services/totals.js +41 -88
- package/dist/services/totals.js.map +1 -1
- package/dist/strategies/price-selection.d.ts +13 -0
- package/dist/strategies/price-selection.js +185 -0
- package/dist/strategies/price-selection.js.map +1 -0
- package/dist/subscribers/order.js +1 -7
- package/dist/subscribers/order.js.map +1 -1
- package/dist/types/batch-job.d.ts +6 -0
- package/dist/types/batch-job.js +11 -0
- package/dist/types/batch-job.js.map +1 -0
- package/dist/types/common.d.ts +1 -3
- package/dist/types/customers.d.ts +1 -0
- package/dist/types/customers.js +5 -0
- package/dist/types/customers.js.map +1 -1
- package/dist/types/discount.d.ts +69 -1
- package/dist/types/discount.js +129 -5
- package/dist/types/discount.js.map +1 -1
- package/dist/types/global.d.ts +34 -0
- package/dist/types/global.js +3 -0
- package/dist/types/global.js.map +1 -0
- package/dist/types/line-item-adjustment.d.ts +9 -0
- package/dist/types/line-item-adjustment.js +50 -0
- package/dist/types/line-item-adjustment.js.map +1 -0
- package/dist/types/price-list.d.ts +70 -0
- package/dist/types/price-list.js +152 -0
- package/dist/types/price-list.js.map +1 -0
- package/dist/types/price-selection.d.ts +5 -0
- package/dist/types/price-selection.js +35 -0
- package/dist/types/price-selection.js.map +1 -0
- package/dist/types/product-variant.d.ts +26 -3
- package/dist/types/product-variant.js +69 -5
- package/dist/types/product-variant.js.map +1 -1
- package/dist/types/product.d.ts +16 -0
- package/dist/types/product.js +86 -1
- package/dist/types/product.js.map +1 -1
- package/dist/types/validators/exactly-one.d.ts +6 -0
- package/dist/types/validators/exactly-one.js +37 -0
- package/dist/types/validators/exactly-one.js.map +1 -0
- package/dist/utils/date-helpers.d.ts +2 -0
- package/dist/utils/date-helpers.js +15 -0
- package/dist/utils/date-helpers.js.map +1 -0
- package/dist/utils/get-query-config.d.ts +11 -0
- package/dist/utils/get-query-config.js +88 -0
- package/dist/utils/get-query-config.js.map +1 -0
- package/package.json +7 -8
- package/dist/api/routes/admin/discounts/add-valid-product.d.ts +0 -23
- package/dist/api/routes/admin/discounts/add-valid-product.js.map +0 -1
- package/dist/api/routes/admin/discounts/remove-valid-product.d.ts +0 -23
- package/dist/api/routes/admin/discounts/remove-valid-product.js.map +0 -1
- package/dist/api/routes/admin/orders/receive-swap.d.ts +0 -46
- package/dist/api/routes/admin/orders/receive-swap.js.map +0 -1
- package/dist/api/routes/store/carts/update-payment-method.d.ts +0 -38
- package/dist/api/routes/store/carts/update-payment-method.js.map +0 -1
- package/dist/config/index.d.ts +0 -14
- package/dist/config/index.js +0 -40
- package/dist/config/index.js.map +0 -1
- package/dist/controllers/list-customers.d.ts +0 -0
- package/dist/controllers/list-customers.js +0 -1
- package/dist/controllers/list-customers.js.map +0 -1
- package/yarn-error.log +0 -6769
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.DiscountConditionProductCollection = void 0;
|
|
13
|
+
var typeorm_1 = require("typeorm");
|
|
14
|
+
var db_aware_column_1 = require("../utils/db-aware-column");
|
|
15
|
+
var discount_condition_1 = require("./discount-condition");
|
|
16
|
+
var product_collection_1 = require("./product-collection");
|
|
17
|
+
var DiscountConditionProductCollection = /** @class */ (function () {
|
|
18
|
+
function DiscountConditionProductCollection() {
|
|
19
|
+
}
|
|
20
|
+
__decorate([
|
|
21
|
+
(0, typeorm_1.PrimaryColumn)(),
|
|
22
|
+
__metadata("design:type", String)
|
|
23
|
+
], DiscountConditionProductCollection.prototype, "product_collection_id", void 0);
|
|
24
|
+
__decorate([
|
|
25
|
+
(0, typeorm_1.PrimaryColumn)(),
|
|
26
|
+
__metadata("design:type", String)
|
|
27
|
+
], DiscountConditionProductCollection.prototype, "condition_id", void 0);
|
|
28
|
+
__decorate([
|
|
29
|
+
(0, typeorm_1.ManyToOne)(function () { return product_collection_1.ProductCollection; }, { onDelete: "CASCADE" }),
|
|
30
|
+
(0, typeorm_1.JoinColumn)({ name: "product_collection_id" }),
|
|
31
|
+
__metadata("design:type", product_collection_1.ProductCollection)
|
|
32
|
+
], DiscountConditionProductCollection.prototype, "product_collection", void 0);
|
|
33
|
+
__decorate([
|
|
34
|
+
(0, typeorm_1.ManyToOne)(function () { return discount_condition_1.DiscountCondition; }, { onDelete: "CASCADE" }),
|
|
35
|
+
(0, typeorm_1.JoinColumn)({ name: "condition_id" }),
|
|
36
|
+
__metadata("design:type", discount_condition_1.DiscountCondition)
|
|
37
|
+
], DiscountConditionProductCollection.prototype, "discount_condition", void 0);
|
|
38
|
+
__decorate([
|
|
39
|
+
(0, typeorm_1.CreateDateColumn)({ type: (0, db_aware_column_1.resolveDbType)("timestamptz") }),
|
|
40
|
+
__metadata("design:type", Date)
|
|
41
|
+
], DiscountConditionProductCollection.prototype, "created_at", void 0);
|
|
42
|
+
__decorate([
|
|
43
|
+
(0, typeorm_1.UpdateDateColumn)({ type: (0, db_aware_column_1.resolveDbType)("timestamptz") }),
|
|
44
|
+
__metadata("design:type", Date)
|
|
45
|
+
], DiscountConditionProductCollection.prototype, "updated_at", void 0);
|
|
46
|
+
__decorate([
|
|
47
|
+
(0, db_aware_column_1.DbAwareColumn)({ type: "jsonb", nullable: true }),
|
|
48
|
+
__metadata("design:type", Object)
|
|
49
|
+
], DiscountConditionProductCollection.prototype, "metadata", void 0);
|
|
50
|
+
DiscountConditionProductCollection = __decorate([
|
|
51
|
+
(0, typeorm_1.Entity)()
|
|
52
|
+
], DiscountConditionProductCollection);
|
|
53
|
+
return DiscountConditionProductCollection;
|
|
54
|
+
}());
|
|
55
|
+
exports.DiscountConditionProductCollection = DiscountConditionProductCollection;
|
|
56
|
+
/**
|
|
57
|
+
* @schema discount_condition_product_collection
|
|
58
|
+
* title: "Product Collection Discount Condition"
|
|
59
|
+
* description: "Associates a discount condition with a product collection"
|
|
60
|
+
* x-resourceId: discount_condition_product_collection
|
|
61
|
+
* properties:
|
|
62
|
+
* product_collection_id:
|
|
63
|
+
* description: "The id of the Product Collection"
|
|
64
|
+
* type: string
|
|
65
|
+
* condition_id:
|
|
66
|
+
* description: "The id of the Discount Condition"
|
|
67
|
+
* type: string
|
|
68
|
+
* created_at:
|
|
69
|
+
* description: "The date with timezone at which the resource was created."
|
|
70
|
+
* type: string
|
|
71
|
+
* format: date-time
|
|
72
|
+
* updated_at:
|
|
73
|
+
* description: "The date with timezone at which the resource was last updated."
|
|
74
|
+
* type: string
|
|
75
|
+
* format: date-time
|
|
76
|
+
* deleted_at:
|
|
77
|
+
* description: "The date with timezone at which the resource was deleted."
|
|
78
|
+
* type: string
|
|
79
|
+
* format: date-time
|
|
80
|
+
* metadata:
|
|
81
|
+
* description: "An optional key-value map with additional information."
|
|
82
|
+
* type: object
|
|
83
|
+
*/
|
|
84
|
+
//# sourceMappingURL=discount-condition-product-collection.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"discount-condition-product-collection.js","sourceRoot":"","sources":["../../src/models/discount-condition-product-collection.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,mCAOgB;AAChB,4DAAuE;AACvE,2DAAwD;AACxD,2DAAwD;AAGxD;IAAA;IAuBA,CAAC;IArBC;QADC,IAAA,uBAAa,GAAE;;qFACa;IAG7B;QADC,IAAA,uBAAa,GAAE;;4EACI;IAIpB;QAFC,IAAA,mBAAS,EAAC,cAAM,OAAA,sCAAiB,EAAjB,CAAiB,EAAE,EAAE,QAAQ,EAAE,SAAS,EAAE,CAAC;QAC3D,IAAA,oBAAU,EAAC,EAAE,IAAI,EAAE,uBAAuB,EAAE,CAAC;kCACzB,sCAAiB;kFAAA;IAItC;QAFC,IAAA,mBAAS,EAAC,cAAM,OAAA,sCAAiB,EAAjB,CAAiB,EAAE,EAAE,QAAQ,EAAE,SAAS,EAAE,CAAC;QAC3D,IAAA,oBAAU,EAAC,EAAE,IAAI,EAAE,cAAc,EAAE,CAAC;kCAChB,sCAAiB;kFAAA;IAGtC;QADC,IAAA,0BAAgB,EAAC,EAAE,IAAI,EAAE,IAAA,+BAAa,EAAC,aAAa,CAAC,EAAE,CAAC;kCAC7C,IAAI;0EAAA;IAGhB;QADC,IAAA,0BAAgB,EAAC,EAAE,IAAI,EAAE,IAAA,+BAAa,EAAC,aAAa,CAAC,EAAE,CAAC;kCAC7C,IAAI;0EAAA;IAGhB;QADC,IAAA,+BAAa,EAAC,EAAE,IAAI,EAAE,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;wEACpC;IAtBF,kCAAkC;QAD9C,IAAA,gBAAM,GAAE;OACI,kCAAkC,CAuB9C;IAAD,yCAAC;CAAA,AAvBD,IAuBC;AAvBY,gFAAkC;AAyB/C;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { DiscountCondition } from "./discount-condition";
|
|
2
|
+
import { ProductTag } from "./product-tag";
|
|
3
|
+
export declare class DiscountConditionProductTag {
|
|
4
|
+
product_tag_id: string;
|
|
5
|
+
condition_id: string;
|
|
6
|
+
product_tag?: ProductTag;
|
|
7
|
+
discount_condition?: DiscountCondition;
|
|
8
|
+
created_at: Date;
|
|
9
|
+
updated_at: Date;
|
|
10
|
+
metadata: any;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* @schema discount_condition_product_tag
|
|
14
|
+
* title: "Product Tag Discount Condition"
|
|
15
|
+
* description: "Associates a discount condition with a product tag"
|
|
16
|
+
* x-resourceId: discount_condition_product_tag
|
|
17
|
+
* properties:
|
|
18
|
+
* product_tag_id:
|
|
19
|
+
* description: "The id of the Product Tag"
|
|
20
|
+
* type: string
|
|
21
|
+
* condition_id:
|
|
22
|
+
* description: "The id of the Discount Condition"
|
|
23
|
+
* type: string
|
|
24
|
+
* created_at:
|
|
25
|
+
* description: "The date with timezone at which the resource was created."
|
|
26
|
+
* type: string
|
|
27
|
+
* format: date-time
|
|
28
|
+
* updated_at:
|
|
29
|
+
* description: "The date with timezone at which the resource was last updated."
|
|
30
|
+
* type: string
|
|
31
|
+
* format: date-time
|
|
32
|
+
* deleted_at:
|
|
33
|
+
* description: "The date with timezone at which the resource was deleted."
|
|
34
|
+
* type: string
|
|
35
|
+
* format: date-time
|
|
36
|
+
* metadata:
|
|
37
|
+
* description: "An optional key-value map with additional information."
|
|
38
|
+
* type: object
|
|
39
|
+
*/
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.DiscountConditionProductTag = void 0;
|
|
13
|
+
var typeorm_1 = require("typeorm");
|
|
14
|
+
var db_aware_column_1 = require("../utils/db-aware-column");
|
|
15
|
+
var discount_condition_1 = require("./discount-condition");
|
|
16
|
+
var product_tag_1 = require("./product-tag");
|
|
17
|
+
var DiscountConditionProductTag = /** @class */ (function () {
|
|
18
|
+
function DiscountConditionProductTag() {
|
|
19
|
+
}
|
|
20
|
+
__decorate([
|
|
21
|
+
(0, typeorm_1.PrimaryColumn)(),
|
|
22
|
+
__metadata("design:type", String)
|
|
23
|
+
], DiscountConditionProductTag.prototype, "product_tag_id", void 0);
|
|
24
|
+
__decorate([
|
|
25
|
+
(0, typeorm_1.PrimaryColumn)(),
|
|
26
|
+
__metadata("design:type", String)
|
|
27
|
+
], DiscountConditionProductTag.prototype, "condition_id", void 0);
|
|
28
|
+
__decorate([
|
|
29
|
+
(0, typeorm_1.ManyToOne)(function () { return product_tag_1.ProductTag; }, { onDelete: "CASCADE" }),
|
|
30
|
+
(0, typeorm_1.JoinColumn)({ name: "product_tag_id" }),
|
|
31
|
+
__metadata("design:type", product_tag_1.ProductTag)
|
|
32
|
+
], DiscountConditionProductTag.prototype, "product_tag", void 0);
|
|
33
|
+
__decorate([
|
|
34
|
+
(0, typeorm_1.ManyToOne)(function () { return discount_condition_1.DiscountCondition; }, { onDelete: "CASCADE" }),
|
|
35
|
+
(0, typeorm_1.JoinColumn)({ name: "condition_id" }),
|
|
36
|
+
__metadata("design:type", discount_condition_1.DiscountCondition)
|
|
37
|
+
], DiscountConditionProductTag.prototype, "discount_condition", void 0);
|
|
38
|
+
__decorate([
|
|
39
|
+
(0, typeorm_1.CreateDateColumn)({ type: (0, db_aware_column_1.resolveDbType)("timestamptz") }),
|
|
40
|
+
__metadata("design:type", Date)
|
|
41
|
+
], DiscountConditionProductTag.prototype, "created_at", void 0);
|
|
42
|
+
__decorate([
|
|
43
|
+
(0, typeorm_1.UpdateDateColumn)({ type: (0, db_aware_column_1.resolveDbType)("timestamptz") }),
|
|
44
|
+
__metadata("design:type", Date)
|
|
45
|
+
], DiscountConditionProductTag.prototype, "updated_at", void 0);
|
|
46
|
+
__decorate([
|
|
47
|
+
(0, db_aware_column_1.DbAwareColumn)({ type: "jsonb", nullable: true }),
|
|
48
|
+
__metadata("design:type", Object)
|
|
49
|
+
], DiscountConditionProductTag.prototype, "metadata", void 0);
|
|
50
|
+
DiscountConditionProductTag = __decorate([
|
|
51
|
+
(0, typeorm_1.Entity)()
|
|
52
|
+
], DiscountConditionProductTag);
|
|
53
|
+
return DiscountConditionProductTag;
|
|
54
|
+
}());
|
|
55
|
+
exports.DiscountConditionProductTag = DiscountConditionProductTag;
|
|
56
|
+
/**
|
|
57
|
+
* @schema discount_condition_product_tag
|
|
58
|
+
* title: "Product Tag Discount Condition"
|
|
59
|
+
* description: "Associates a discount condition with a product tag"
|
|
60
|
+
* x-resourceId: discount_condition_product_tag
|
|
61
|
+
* properties:
|
|
62
|
+
* product_tag_id:
|
|
63
|
+
* description: "The id of the Product Tag"
|
|
64
|
+
* type: string
|
|
65
|
+
* condition_id:
|
|
66
|
+
* description: "The id of the Discount Condition"
|
|
67
|
+
* type: string
|
|
68
|
+
* created_at:
|
|
69
|
+
* description: "The date with timezone at which the resource was created."
|
|
70
|
+
* type: string
|
|
71
|
+
* format: date-time
|
|
72
|
+
* updated_at:
|
|
73
|
+
* description: "The date with timezone at which the resource was last updated."
|
|
74
|
+
* type: string
|
|
75
|
+
* format: date-time
|
|
76
|
+
* deleted_at:
|
|
77
|
+
* description: "The date with timezone at which the resource was deleted."
|
|
78
|
+
* type: string
|
|
79
|
+
* format: date-time
|
|
80
|
+
* metadata:
|
|
81
|
+
* description: "An optional key-value map with additional information."
|
|
82
|
+
* type: object
|
|
83
|
+
*/
|
|
84
|
+
//# sourceMappingURL=discount-condition-product-tag.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"discount-condition-product-tag.js","sourceRoot":"","sources":["../../src/models/discount-condition-product-tag.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,mCAOgB;AAChB,4DAAuE;AACvE,2DAAwD;AACxD,6CAA0C;AAG1C;IAAA;IAuBA,CAAC;IArBC;QADC,IAAA,uBAAa,GAAE;;uEACM;IAGtB;QADC,IAAA,uBAAa,GAAE;;qEACI;IAIpB;QAFC,IAAA,mBAAS,EAAC,cAAM,OAAA,wBAAU,EAAV,CAAU,EAAE,EAAE,QAAQ,EAAE,SAAS,EAAE,CAAC;QACpD,IAAA,oBAAU,EAAC,EAAE,IAAI,EAAE,gBAAgB,EAAE,CAAC;kCACzB,wBAAU;oEAAA;IAIxB;QAFC,IAAA,mBAAS,EAAC,cAAM,OAAA,sCAAiB,EAAjB,CAAiB,EAAE,EAAE,QAAQ,EAAE,SAAS,EAAE,CAAC;QAC3D,IAAA,oBAAU,EAAC,EAAE,IAAI,EAAE,cAAc,EAAE,CAAC;kCAChB,sCAAiB;2EAAA;IAGtC;QADC,IAAA,0BAAgB,EAAC,EAAE,IAAI,EAAE,IAAA,+BAAa,EAAC,aAAa,CAAC,EAAE,CAAC;kCAC7C,IAAI;mEAAA;IAGhB;QADC,IAAA,0BAAgB,EAAC,EAAE,IAAI,EAAE,IAAA,+BAAa,EAAC,aAAa,CAAC,EAAE,CAAC;kCAC7C,IAAI;mEAAA;IAGhB;QADC,IAAA,+BAAa,EAAC,EAAE,IAAI,EAAE,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;iEACpC;IAtBF,2BAA2B;QADvC,IAAA,gBAAM,GAAE;OACI,2BAA2B,CAuBvC;IAAD,kCAAC;CAAA,AAvBD,IAuBC;AAvBY,kEAA2B;AAyBxC;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { DiscountCondition } from "./discount-condition";
|
|
2
|
+
import { ProductType } from "./product-type";
|
|
3
|
+
export declare class DiscountConditionProductType {
|
|
4
|
+
product_type_id: string;
|
|
5
|
+
condition_id: string;
|
|
6
|
+
product_type?: ProductType;
|
|
7
|
+
discount_condition?: DiscountCondition;
|
|
8
|
+
created_at: Date;
|
|
9
|
+
updated_at: Date;
|
|
10
|
+
metadata: any;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* @schema discount_condition_product_type
|
|
14
|
+
* title: "Product Type Discount Condition"
|
|
15
|
+
* description: "Associates a discount condition with a product type"
|
|
16
|
+
* x-resourceId: discount_condition_product
|
|
17
|
+
* properties:
|
|
18
|
+
* product_type_id:
|
|
19
|
+
* description: "The id of the Product Type"
|
|
20
|
+
* type: string
|
|
21
|
+
* condition_id:
|
|
22
|
+
* description: "The id of the Discount Condition"
|
|
23
|
+
* type: string
|
|
24
|
+
* created_at:
|
|
25
|
+
* description: "The date with timezone at which the resource was created."
|
|
26
|
+
* type: string
|
|
27
|
+
* format: date-time
|
|
28
|
+
* updated_at:
|
|
29
|
+
* description: "The date with timezone at which the resource was last updated."
|
|
30
|
+
* type: string
|
|
31
|
+
* format: date-time
|
|
32
|
+
* deleted_at:
|
|
33
|
+
* description: "The date with timezone at which the resource was deleted."
|
|
34
|
+
* type: string
|
|
35
|
+
* format: date-time
|
|
36
|
+
* metadata:
|
|
37
|
+
* description: "An optional key-value map with additional information."
|
|
38
|
+
* type: object
|
|
39
|
+
*/
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.DiscountConditionProductType = void 0;
|
|
13
|
+
var typeorm_1 = require("typeorm");
|
|
14
|
+
var db_aware_column_1 = require("../utils/db-aware-column");
|
|
15
|
+
var discount_condition_1 = require("./discount-condition");
|
|
16
|
+
var product_type_1 = require("./product-type");
|
|
17
|
+
var DiscountConditionProductType = /** @class */ (function () {
|
|
18
|
+
function DiscountConditionProductType() {
|
|
19
|
+
}
|
|
20
|
+
__decorate([
|
|
21
|
+
(0, typeorm_1.PrimaryColumn)(),
|
|
22
|
+
__metadata("design:type", String)
|
|
23
|
+
], DiscountConditionProductType.prototype, "product_type_id", void 0);
|
|
24
|
+
__decorate([
|
|
25
|
+
(0, typeorm_1.PrimaryColumn)(),
|
|
26
|
+
__metadata("design:type", String)
|
|
27
|
+
], DiscountConditionProductType.prototype, "condition_id", void 0);
|
|
28
|
+
__decorate([
|
|
29
|
+
(0, typeorm_1.ManyToOne)(function () { return product_type_1.ProductType; }, { onDelete: "CASCADE" }),
|
|
30
|
+
(0, typeorm_1.JoinColumn)({ name: "product_type_id" }),
|
|
31
|
+
__metadata("design:type", product_type_1.ProductType)
|
|
32
|
+
], DiscountConditionProductType.prototype, "product_type", void 0);
|
|
33
|
+
__decorate([
|
|
34
|
+
(0, typeorm_1.ManyToOne)(function () { return discount_condition_1.DiscountCondition; }, { onDelete: "CASCADE" }),
|
|
35
|
+
(0, typeorm_1.JoinColumn)({ name: "condition_id" }),
|
|
36
|
+
__metadata("design:type", discount_condition_1.DiscountCondition)
|
|
37
|
+
], DiscountConditionProductType.prototype, "discount_condition", void 0);
|
|
38
|
+
__decorate([
|
|
39
|
+
(0, typeorm_1.CreateDateColumn)({ type: (0, db_aware_column_1.resolveDbType)("timestamptz") }),
|
|
40
|
+
__metadata("design:type", Date)
|
|
41
|
+
], DiscountConditionProductType.prototype, "created_at", void 0);
|
|
42
|
+
__decorate([
|
|
43
|
+
(0, typeorm_1.UpdateDateColumn)({ type: (0, db_aware_column_1.resolveDbType)("timestamptz") }),
|
|
44
|
+
__metadata("design:type", Date)
|
|
45
|
+
], DiscountConditionProductType.prototype, "updated_at", void 0);
|
|
46
|
+
__decorate([
|
|
47
|
+
(0, db_aware_column_1.DbAwareColumn)({ type: "jsonb", nullable: true }),
|
|
48
|
+
__metadata("design:type", Object)
|
|
49
|
+
], DiscountConditionProductType.prototype, "metadata", void 0);
|
|
50
|
+
DiscountConditionProductType = __decorate([
|
|
51
|
+
(0, typeorm_1.Entity)()
|
|
52
|
+
], DiscountConditionProductType);
|
|
53
|
+
return DiscountConditionProductType;
|
|
54
|
+
}());
|
|
55
|
+
exports.DiscountConditionProductType = DiscountConditionProductType;
|
|
56
|
+
/**
|
|
57
|
+
* @schema discount_condition_product_type
|
|
58
|
+
* title: "Product Type Discount Condition"
|
|
59
|
+
* description: "Associates a discount condition with a product type"
|
|
60
|
+
* x-resourceId: discount_condition_product
|
|
61
|
+
* properties:
|
|
62
|
+
* product_type_id:
|
|
63
|
+
* description: "The id of the Product Type"
|
|
64
|
+
* type: string
|
|
65
|
+
* condition_id:
|
|
66
|
+
* description: "The id of the Discount Condition"
|
|
67
|
+
* type: string
|
|
68
|
+
* created_at:
|
|
69
|
+
* description: "The date with timezone at which the resource was created."
|
|
70
|
+
* type: string
|
|
71
|
+
* format: date-time
|
|
72
|
+
* updated_at:
|
|
73
|
+
* description: "The date with timezone at which the resource was last updated."
|
|
74
|
+
* type: string
|
|
75
|
+
* format: date-time
|
|
76
|
+
* deleted_at:
|
|
77
|
+
* description: "The date with timezone at which the resource was deleted."
|
|
78
|
+
* type: string
|
|
79
|
+
* format: date-time
|
|
80
|
+
* metadata:
|
|
81
|
+
* description: "An optional key-value map with additional information."
|
|
82
|
+
* type: object
|
|
83
|
+
*/
|
|
84
|
+
//# sourceMappingURL=discount-condition-product-type.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"discount-condition-product-type.js","sourceRoot":"","sources":["../../src/models/discount-condition-product-type.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,mCAOgB;AAChB,4DAAuE;AACvE,2DAAwD;AACxD,+CAA4C;AAG5C;IAAA;IAuBA,CAAC;IArBC;QADC,IAAA,uBAAa,GAAE;;yEACO;IAGvB;QADC,IAAA,uBAAa,GAAE;;sEACI;IAIpB;QAFC,IAAA,mBAAS,EAAC,cAAM,OAAA,0BAAW,EAAX,CAAW,EAAE,EAAE,QAAQ,EAAE,SAAS,EAAE,CAAC;QACrD,IAAA,oBAAU,EAAC,EAAE,IAAI,EAAE,iBAAiB,EAAE,CAAC;kCACzB,0BAAW;sEAAA;IAI1B;QAFC,IAAA,mBAAS,EAAC,cAAM,OAAA,sCAAiB,EAAjB,CAAiB,EAAE,EAAE,QAAQ,EAAE,SAAS,EAAE,CAAC;QAC3D,IAAA,oBAAU,EAAC,EAAE,IAAI,EAAE,cAAc,EAAE,CAAC;kCAChB,sCAAiB;4EAAA;IAGtC;QADC,IAAA,0BAAgB,EAAC,EAAE,IAAI,EAAE,IAAA,+BAAa,EAAC,aAAa,CAAC,EAAE,CAAC;kCAC7C,IAAI;oEAAA;IAGhB;QADC,IAAA,0BAAgB,EAAC,EAAE,IAAI,EAAE,IAAA,+BAAa,EAAC,aAAa,CAAC,EAAE,CAAC;kCAC7C,IAAI;oEAAA;IAGhB;QADC,IAAA,+BAAa,EAAC,EAAE,IAAI,EAAE,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;kEACpC;IAtBF,4BAA4B;QADxC,IAAA,gBAAM,GAAE;OACI,4BAA4B,CAuBxC;IAAD,mCAAC;CAAA,AAvBD,IAuBC;AAvBY,oEAA4B;AAyBzC;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { DiscountCondition } from "./discount-condition";
|
|
2
|
+
import { Product } from "./product";
|
|
3
|
+
export declare class DiscountConditionProduct {
|
|
4
|
+
product_id: string;
|
|
5
|
+
condition_id: string;
|
|
6
|
+
product?: Product;
|
|
7
|
+
discount_condition?: DiscountCondition;
|
|
8
|
+
created_at: Date;
|
|
9
|
+
updated_at: Date;
|
|
10
|
+
metadata: any;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* @schema discount_condition_product
|
|
14
|
+
* title: "Product Discount Condition"
|
|
15
|
+
* description: "Associates a discount condition with a product"
|
|
16
|
+
* x-resourceId: discount_condition_product
|
|
17
|
+
* properties:
|
|
18
|
+
* product_id:
|
|
19
|
+
* description: "The id of the Product"
|
|
20
|
+
* type: string
|
|
21
|
+
* condition_id:
|
|
22
|
+
* description: "The id of the Discount Condition"
|
|
23
|
+
* type: string
|
|
24
|
+
* created_at:
|
|
25
|
+
* description: "The date with timezone at which the resource was created."
|
|
26
|
+
* type: string
|
|
27
|
+
* format: date-time
|
|
28
|
+
* updated_at:
|
|
29
|
+
* description: "The date with timezone at which the resource was last updated."
|
|
30
|
+
* type: string
|
|
31
|
+
* format: date-time
|
|
32
|
+
* deleted_at:
|
|
33
|
+
* description: "The date with timezone at which the resource was deleted."
|
|
34
|
+
* type: string
|
|
35
|
+
* format: date-time
|
|
36
|
+
* metadata:
|
|
37
|
+
* description: "An optional key-value map with additional information."
|
|
38
|
+
* type: object
|
|
39
|
+
*/
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.DiscountConditionProduct = void 0;
|
|
13
|
+
var typeorm_1 = require("typeorm");
|
|
14
|
+
var db_aware_column_1 = require("../utils/db-aware-column");
|
|
15
|
+
var discount_condition_1 = require("./discount-condition");
|
|
16
|
+
var product_1 = require("./product");
|
|
17
|
+
var DiscountConditionProduct = /** @class */ (function () {
|
|
18
|
+
function DiscountConditionProduct() {
|
|
19
|
+
}
|
|
20
|
+
__decorate([
|
|
21
|
+
(0, typeorm_1.PrimaryColumn)(),
|
|
22
|
+
__metadata("design:type", String)
|
|
23
|
+
], DiscountConditionProduct.prototype, "product_id", void 0);
|
|
24
|
+
__decorate([
|
|
25
|
+
(0, typeorm_1.PrimaryColumn)(),
|
|
26
|
+
__metadata("design:type", String)
|
|
27
|
+
], DiscountConditionProduct.prototype, "condition_id", void 0);
|
|
28
|
+
__decorate([
|
|
29
|
+
(0, typeorm_1.ManyToOne)(function () { return product_1.Product; }, { onDelete: "CASCADE" }),
|
|
30
|
+
(0, typeorm_1.JoinColumn)({ name: "product_id" }),
|
|
31
|
+
__metadata("design:type", product_1.Product)
|
|
32
|
+
], DiscountConditionProduct.prototype, "product", void 0);
|
|
33
|
+
__decorate([
|
|
34
|
+
(0, typeorm_1.ManyToOne)(function () { return discount_condition_1.DiscountCondition; }, { onDelete: "CASCADE" }),
|
|
35
|
+
(0, typeorm_1.JoinColumn)({ name: "condition_id" }),
|
|
36
|
+
__metadata("design:type", discount_condition_1.DiscountCondition)
|
|
37
|
+
], DiscountConditionProduct.prototype, "discount_condition", void 0);
|
|
38
|
+
__decorate([
|
|
39
|
+
(0, typeorm_1.CreateDateColumn)({ type: (0, db_aware_column_1.resolveDbType)("timestamptz") }),
|
|
40
|
+
__metadata("design:type", Date)
|
|
41
|
+
], DiscountConditionProduct.prototype, "created_at", void 0);
|
|
42
|
+
__decorate([
|
|
43
|
+
(0, typeorm_1.UpdateDateColumn)({ type: (0, db_aware_column_1.resolveDbType)("timestamptz") }),
|
|
44
|
+
__metadata("design:type", Date)
|
|
45
|
+
], DiscountConditionProduct.prototype, "updated_at", void 0);
|
|
46
|
+
__decorate([
|
|
47
|
+
(0, db_aware_column_1.DbAwareColumn)({ type: "jsonb", nullable: true }),
|
|
48
|
+
__metadata("design:type", Object)
|
|
49
|
+
], DiscountConditionProduct.prototype, "metadata", void 0);
|
|
50
|
+
DiscountConditionProduct = __decorate([
|
|
51
|
+
(0, typeorm_1.Entity)()
|
|
52
|
+
], DiscountConditionProduct);
|
|
53
|
+
return DiscountConditionProduct;
|
|
54
|
+
}());
|
|
55
|
+
exports.DiscountConditionProduct = DiscountConditionProduct;
|
|
56
|
+
/**
|
|
57
|
+
* @schema discount_condition_product
|
|
58
|
+
* title: "Product Discount Condition"
|
|
59
|
+
* description: "Associates a discount condition with a product"
|
|
60
|
+
* x-resourceId: discount_condition_product
|
|
61
|
+
* properties:
|
|
62
|
+
* product_id:
|
|
63
|
+
* description: "The id of the Product"
|
|
64
|
+
* type: string
|
|
65
|
+
* condition_id:
|
|
66
|
+
* description: "The id of the Discount Condition"
|
|
67
|
+
* type: string
|
|
68
|
+
* created_at:
|
|
69
|
+
* description: "The date with timezone at which the resource was created."
|
|
70
|
+
* type: string
|
|
71
|
+
* format: date-time
|
|
72
|
+
* updated_at:
|
|
73
|
+
* description: "The date with timezone at which the resource was last updated."
|
|
74
|
+
* type: string
|
|
75
|
+
* format: date-time
|
|
76
|
+
* deleted_at:
|
|
77
|
+
* description: "The date with timezone at which the resource was deleted."
|
|
78
|
+
* type: string
|
|
79
|
+
* format: date-time
|
|
80
|
+
* metadata:
|
|
81
|
+
* description: "An optional key-value map with additional information."
|
|
82
|
+
* type: object
|
|
83
|
+
*/
|
|
84
|
+
//# sourceMappingURL=discount-condition-product.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"discount-condition-product.js","sourceRoot":"","sources":["../../src/models/discount-condition-product.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,mCAOgB;AAChB,4DAAuE;AACvE,2DAAwD;AACxD,qCAAmC;AAGnC;IAAA;IAuBA,CAAC;IArBC;QADC,IAAA,uBAAa,GAAE;;gEACE;IAGlB;QADC,IAAA,uBAAa,GAAE;;kEACI;IAIpB;QAFC,IAAA,mBAAS,EAAC,cAAM,OAAA,iBAAO,EAAP,CAAO,EAAE,EAAE,QAAQ,EAAE,SAAS,EAAE,CAAC;QACjD,IAAA,oBAAU,EAAC,EAAE,IAAI,EAAE,YAAY,EAAE,CAAC;kCACzB,iBAAO;6DAAA;IAIjB;QAFC,IAAA,mBAAS,EAAC,cAAM,OAAA,sCAAiB,EAAjB,CAAiB,EAAE,EAAE,QAAQ,EAAE,SAAS,EAAE,CAAC;QAC3D,IAAA,oBAAU,EAAC,EAAE,IAAI,EAAE,cAAc,EAAE,CAAC;kCAChB,sCAAiB;wEAAA;IAGtC;QADC,IAAA,0BAAgB,EAAC,EAAE,IAAI,EAAE,IAAA,+BAAa,EAAC,aAAa,CAAC,EAAE,CAAC;kCAC7C,IAAI;gEAAA;IAGhB;QADC,IAAA,0BAAgB,EAAC,EAAE,IAAI,EAAE,IAAA,+BAAa,EAAC,aAAa,CAAC,EAAE,CAAC;kCAC7C,IAAI;gEAAA;IAGhB;QADC,IAAA,+BAAa,EAAC,EAAE,IAAI,EAAE,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;8DACpC;IAtBF,wBAAwB;QADpC,IAAA,gBAAM,GAAE;OACI,wBAAwB,CAuBpC;IAAD,+BAAC;CAAA,AAvBD,IAuBC;AAvBY,4DAAwB;AAyBrC;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG"}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { CustomerGroup } from "./customer-group";
|
|
2
|
+
import { DiscountRule } from "./discount-rule";
|
|
3
|
+
import { Product } from "./product";
|
|
4
|
+
import { ProductCollection } from "./product-collection";
|
|
5
|
+
import { ProductTag } from "./product-tag";
|
|
6
|
+
import { ProductType } from "./product-type";
|
|
7
|
+
export declare enum DiscountConditionType {
|
|
8
|
+
PRODUCTS = "products",
|
|
9
|
+
PRODUCT_TYPES = "product_types",
|
|
10
|
+
PRODUCT_COLLECTIONS = "product_collections",
|
|
11
|
+
PRODUCT_TAGS = "product_tags",
|
|
12
|
+
CUSTOMER_GROUPS = "customer_groups"
|
|
13
|
+
}
|
|
14
|
+
export declare enum DiscountConditionOperator {
|
|
15
|
+
IN = "in",
|
|
16
|
+
NOT_IN = "not_in"
|
|
17
|
+
}
|
|
18
|
+
export declare class DiscountCondition {
|
|
19
|
+
id: string;
|
|
20
|
+
type: DiscountConditionType;
|
|
21
|
+
operator: DiscountConditionOperator;
|
|
22
|
+
discount_rule_id: string;
|
|
23
|
+
discount_rule: DiscountRule;
|
|
24
|
+
products: Product[];
|
|
25
|
+
product_types: ProductType[];
|
|
26
|
+
product_tags: ProductTag[];
|
|
27
|
+
product_collections: ProductCollection[];
|
|
28
|
+
customer_groups: CustomerGroup[];
|
|
29
|
+
created_at: Date;
|
|
30
|
+
updated_at: Date;
|
|
31
|
+
deleted_at: Date;
|
|
32
|
+
metadata: any;
|
|
33
|
+
private beforeInsert;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* @schema discount_condition
|
|
37
|
+
* title: "Discount Condition"
|
|
38
|
+
* description: "Holds rule conditions for when a discount is applicable"
|
|
39
|
+
* x-resourceId: discount_condition
|
|
40
|
+
* properties:
|
|
41
|
+
* id:
|
|
42
|
+
* description: "The id of the Discount Condition. Will be prefixed by `discon_`."
|
|
43
|
+
* type: string
|
|
44
|
+
* type:
|
|
45
|
+
* description: "The type of the Condition"
|
|
46
|
+
* type: string
|
|
47
|
+
* enum:
|
|
48
|
+
* - products
|
|
49
|
+
* - product_types
|
|
50
|
+
* - product_collections
|
|
51
|
+
* - product_tags
|
|
52
|
+
* - customer_groups
|
|
53
|
+
* created_at:
|
|
54
|
+
* description: "The date with timezone at which the resource was created."
|
|
55
|
+
* type: string
|
|
56
|
+
* format: date-time
|
|
57
|
+
* update_at:
|
|
58
|
+
* description: "The date with timezone at which the resource was last updated."
|
|
59
|
+
* type: string
|
|
60
|
+
* format: date-time
|
|
61
|
+
* deleted_at:
|
|
62
|
+
* description: "The date with timezone at which the resource was deleted."
|
|
63
|
+
* type: string
|
|
64
|
+
* format: date-time
|
|
65
|
+
* metadata:
|
|
66
|
+
* description: "An optional key-value map with additional information."
|
|
67
|
+
* type: object
|
|
68
|
+
*/
|