@medusajs/medusa 1.2.2-dev.53 → 1.3.1-alpha.63
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 +98 -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/authenticate-customer.d.ts +2 -1
- package/dist/api/middlewares/authenticate-customer.js +1 -2
- package/dist/api/middlewares/authenticate-customer.js.map +1 -1
- package/dist/api/middlewares/authenticate.d.ts +2 -1
- package/dist/api/middlewares/authenticate.js.map +1 -1
- package/dist/api/middlewares/await-middleware.d.ts +3 -1
- package/dist/api/middlewares/await-middleware.js +2 -31
- package/dist/api/middlewares/await-middleware.js.map +1 -1
- package/dist/api/middlewares/batch-job/can-access-batch-job.d.ts +1 -0
- package/dist/api/middlewares/batch-job/can-access-batch-job.js +70 -0
- package/dist/api/middlewares/batch-job/can-access-batch-job.js.map +1 -0
- package/dist/api/middlewares/batch-job/get-requested-batch-job.d.ts +1 -0
- package/dist/api/middlewares/batch-job/get-requested-batch-job.js +67 -0
- package/dist/api/middlewares/batch-job/get-requested-batch-job.js.map +1 -0
- package/dist/api/middlewares/error-handler.d.ts +3 -1
- package/dist/api/middlewares/error-handler.js +4 -4
- package/dist/api/middlewares/error-handler.js.map +1 -1
- package/dist/api/middlewares/index.d.ts +12 -10
- package/dist/api/middlewares/index.js +9 -0
- package/dist/api/middlewares/index.js.map +1 -1
- package/dist/api/middlewares/normalized-query.d.ts +6 -1
- package/dist/api/middlewares/normalized-query.js +5 -2
- package/dist/api/middlewares/normalized-query.js.map +1 -1
- package/dist/api/middlewares/transform-body.d.ts +4 -0
- package/dist/api/middlewares/transform-body.js +66 -0
- package/dist/api/middlewares/transform-body.js.map +1 -0
- package/dist/api/middlewares/transform-query.d.ts +6 -0
- package/dist/api/middlewares/transform-query.js +86 -0
- package/dist/api/middlewares/transform-query.js.map +1 -0
- 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/batch/index.d.ts +13 -0
- package/dist/api/routes/admin/batch/index.js +50 -0
- package/dist/api/routes/admin/batch/index.js.map +1 -0
- package/dist/api/routes/admin/batch/list-batch-jobs.d.ts +48 -0
- package/dist/api/routes/admin/batch/list-batch-jobs.js +220 -0
- package/dist/api/routes/admin/batch/list-batch-jobs.js.map +1 -0
- 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/discounts/create-condition.d.ts +58 -0
- package/dist/api/routes/admin/discounts/create-condition.js +186 -0
- package/dist/api/routes/admin/discounts/create-condition.js.map +1 -0
- package/dist/api/routes/admin/discounts/create-discount.d.ts +14 -4
- package/dist/api/routes/admin/discounts/create-discount.js +72 -16
- 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-condition.d.ts +36 -0
- package/dist/api/routes/admin/discounts/delete-condition.js +151 -0
- package/dist/api/routes/admin/discounts/delete-condition.js.map +1 -0
- 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-condition.d.ts +31 -0
- package/dist/api/routes/admin/discounts/get-condition.js +125 -0
- package/dist/api/routes/admin/discounts/get-condition.js.map +1 -0
- package/dist/api/routes/admin/discounts/get-discount-by-code.d.ts +4 -0
- package/dist/api/routes/admin/discounts/get-discount-by-code.js +40 -6
- package/dist/api/routes/admin/discounts/get-discount-by-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 +11 -3
- package/dist/api/routes/admin/discounts/index.js +13 -7
- 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-condition.d.ts +55 -0
- package/dist/api/routes/admin/discounts/update-condition.js +184 -0
- package/dist/api/routes/admin/discounts/update-condition.js.map +1 -0
- package/dist/api/routes/admin/discounts/update-discount.d.ts +18 -12
- package/dist/api/routes/admin/discounts/update-discount.js +79 -33
- 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.d.ts +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/list-draft-orders.js +7 -6
- package/dist/api/routes/admin/draft-orders/list-draft-orders.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 +23 -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-claim.d.ts +4 -14
- package/dist/api/routes/admin/orders/create-claim.js +9 -14
- package/dist/api/routes/admin/orders/create-claim.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/fulfill-claim.d.ts +1 -1
- package/dist/api/routes/admin/orders/fulfill-claim.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-claim.d.ts +1 -1
- package/dist/api/routes/admin/orders/update-claim.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/price-lists/add-prices-batch.js +158 -0
- 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 +88 -0
- package/dist/api/routes/admin/price-lists/create-price-list.js +190 -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/price-lists/delete-price-list.js +84 -0
- 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/admin/price-lists/delete-prices-batch.js +118 -0
- package/dist/api/routes/admin/price-lists/delete-prices-batch.js.map +1 -0
- package/dist/api/routes/admin/price-lists/delete-product-prices.d.ts +32 -0
- package/dist/api/routes/admin/price-lists/delete-product-prices.js +105 -0
- package/dist/api/routes/admin/price-lists/delete-product-prices.js.map +1 -0
- package/dist/api/routes/admin/price-lists/delete-variant-prices.d.ts +32 -0
- package/dist/api/routes/admin/price-lists/delete-variant-prices.js +105 -0
- package/dist/api/routes/admin/price-lists/delete-variant-prices.js.map +1 -0
- package/dist/api/routes/admin/price-lists/get-price-list.d.ts +22 -0
- package/dist/api/routes/admin/price-lists/get-price-list.js +78 -0
- package/dist/api/routes/admin/price-lists/get-price-list.js.map +1 -0
- package/dist/api/routes/admin/price-lists/index.d.ts +30 -0
- package/dist/api/routes/admin/price-lists/index.js +76 -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 +75 -0
- package/dist/api/routes/admin/price-lists/list-price-list-products.js +255 -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 +39 -0
- package/dist/api/routes/admin/price-lists/list-price-lists.js +165 -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/product-tags/list-product-tags.d.ts +2 -1
- package/dist/api/routes/admin/product-tags/list-product-tags.js +6 -3
- package/dist/api/routes/admin/product-tags/list-product-tags.js.map +1 -1
- package/dist/api/routes/admin/product-types/list-product-types.d.ts +2 -1
- package/dist/api/routes/admin/product-types/list-product-types.js +6 -3
- package/dist/api/routes/admin/product-types/list-product-types.js.map +1 -1
- 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 +3 -2
- package/dist/api/routes/admin/products/index.js +8 -3
- 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/list-variants.d.ts +35 -0
- package/dist/api/routes/admin/products/list-variants.js +173 -0
- package/dist/api/routes/admin/products/list-variants.js.map +1 -0
- 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/shipping-options/list-shipping-options.d.ts +2 -2
- package/dist/api/routes/admin/shipping-options/list-shipping-options.js +2 -2
- package/dist/api/routes/admin/shipping-options/list-shipping-options.js.map +1 -1
- package/dist/api/routes/admin/store/get-store.js +4 -2
- package/dist/api/routes/admin/store/get-store.js.map +1 -1
- package/dist/api/routes/admin/store/update-store.d.ts +1 -0
- package/dist/api/routes/admin/store/update-store.js +5 -0
- package/dist/api/routes/admin/store/update-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/admin/users/update-user.d.ts +1 -1
- package/dist/api/routes/admin/users/update-user.js.map +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 +8 -8
- 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/customers/get-payment-methods.js +6 -7
- package/dist/api/routes/store/customers/get-payment-methods.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 +2 -2
- package/dist/api/routes/store/products/list-products.js +21 -14
- 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 +2 -1
- package/dist/api/routes/store/variants/list-variants.js +38 -9
- package/dist/api/routes/store/variants/list-variants.js.map +1 -1
- package/dist/commands/develop.js +2 -2
- package/dist/commands/develop.js.map +1 -1
- package/dist/commands/migrate.js +17 -6
- package/dist/commands/migrate.js.map +1 -1
- package/dist/commands/start.js +6 -0
- package/dist/commands/start.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 +26 -17
- package/dist/helpers/test-request.js.map +1 -1
- package/dist/index.d.ts +4 -58
- package/dist/index.js +4 -61
- package/dist/index.js.map +1 -1
- package/dist/interfaces/base-service.d.ts +66 -0
- package/dist/interfaces/base-service.js +377 -0
- package/dist/interfaces/base-service.js.map +1 -0
- package/dist/interfaces/batch-job-strategy.d.ts +28 -0
- package/dist/interfaces/batch-job-strategy.js +75 -0
- package/dist/interfaces/batch-job-strategy.js.map +1 -0
- package/dist/interfaces/file-service.d.ts +62 -0
- package/dist/interfaces/file-service.js +32 -0
- package/dist/interfaces/file-service.js.map +1 -0
- package/dist/interfaces/index.d.ts +4 -0
- package/dist/interfaces/index.js +4 -0
- package/dist/interfaces/index.js.map +1 -1
- package/dist/interfaces/models/base-entity.d.ts +8 -0
- package/dist/interfaces/models/base-entity.js +36 -0
- package/dist/interfaces/models/base-entity.js.map +1 -0
- package/dist/interfaces/models/soft-deletable-entity.d.ts +4 -0
- package/dist/interfaces/models/soft-deletable-entity.js +43 -0
- package/dist/interfaces/models/soft-deletable-entity.js.map +1 -0
- 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/interfaces/transaction-base-service.d.ts +23 -0
- package/dist/interfaces/transaction-base-service.js +200 -0
- package/dist/interfaces/transaction-base-service.js.map +1 -0
- 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 +38 -10
- package/dist/loaders/plugins.js +43 -30
- 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/address.d.ts +3 -6
- package/dist/models/address.js +23 -24
- package/dist/models/address.js.map +1 -1
- package/dist/models/batch-job.d.ts +55 -0
- package/dist/models/batch-job.js +118 -0
- package/dist/models/batch-job.js.map +1 -0
- package/dist/models/cart.d.ts +5 -8
- package/dist/models/cart.js +35 -36
- package/dist/models/cart.js.map +1 -1
- package/dist/models/claim-image.d.ts +3 -6
- package/dist/models/claim-image.js +22 -23
- package/dist/models/claim-image.js.map +1 -1
- package/dist/models/claim-item.d.ts +3 -6
- package/dist/models/claim-item.js +25 -24
- package/dist/models/claim-item.js.map +1 -1
- package/dist/models/claim-order.d.ts +4 -4
- package/dist/models/claim-order.js +28 -13
- package/dist/models/claim-order.js.map +1 -1
- package/dist/models/claim-tag.d.ts +3 -6
- package/dist/models/claim-tag.js +22 -23
- package/dist/models/claim-tag.js.map +1 -1
- 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/custom-shipping-option.d.ts +3 -6
- package/dist/models/custom-shipping-option.js +23 -24
- package/dist/models/custom-shipping-option.js.map +1 -1
- package/dist/models/customer-group.d.ts +6 -7
- package/dist/models/customer-group.js +30 -36
- package/dist/models/customer-group.js.map +1 -1
- package/dist/models/customer.d.ts +3 -6
- package/dist/models/customer.js +23 -25
- package/dist/models/customer.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 +65 -0
- package/dist/models/discount-condition.js +209 -0
- package/dist/models/discount-condition.js.map +1 -0
- package/dist/models/discount-rule.d.ts +8 -11
- package/dist/models/discount-rule.js +28 -38
- package/dist/models/discount-rule.js.map +1 -1
- package/dist/models/discount.d.ts +7 -10
- package/dist/models/discount.js +30 -30
- package/dist/models/discount.js.map +1 -1
- package/dist/models/draft-order.d.ts +4 -7
- package/dist/models/draft-order.js +25 -22
- package/dist/models/draft-order.js.map +1 -1
- package/dist/models/fulfillment-item.js.map +1 -1
- package/dist/models/fulfillment-provider.js.map +1 -1
- package/dist/models/fulfillment.d.ts +5 -7
- package/dist/models/fulfillment.js +29 -21
- package/dist/models/fulfillment.js.map +1 -1
- package/dist/models/gift-card-transaction.js +2 -5
- package/dist/models/gift-card-transaction.js.map +1 -1
- package/dist/models/gift-card.d.ts +3 -6
- package/dist/models/gift-card.js +22 -23
- package/dist/models/gift-card.js.map +1 -1
- package/dist/models/idempotency-key.d.ts +2 -2
- package/dist/models/idempotency-key.js +2 -3
- package/dist/models/idempotency-key.js.map +1 -1
- package/dist/models/image.d.ts +3 -6
- package/dist/models/image.js +22 -23
- package/dist/models/image.js.map +1 -1
- package/dist/models/index.d.ts +67 -0
- package/dist/models/index.js +80 -0
- package/dist/models/index.js.map +1 -0
- package/dist/models/invite.d.ts +3 -6
- package/dist/models/invite.js +22 -24
- package/dist/models/invite.js.map +1 -1
- package/dist/models/line-item-adjustment.d.ts +13 -0
- package/dist/models/line-item-adjustment.js +76 -0
- package/dist/models/line-item-adjustment.js.map +1 -0
- package/dist/models/line-item-tax-line.js +4 -6
- package/dist/models/line-item-tax-line.js.map +1 -1
- package/dist/models/line-item.d.ts +5 -5
- package/dist/models/line-item.js +29 -19
- package/dist/models/line-item.js.map +1 -1
- package/dist/models/money-amount.d.ts +12 -8
- package/dist/models/money-amount.js +47 -30
- package/dist/models/money-amount.js.map +1 -1
- package/dist/models/note.d.ts +3 -6
- package/dist/models/note.js +22 -23
- package/dist/models/note.js.map +1 -1
- package/dist/models/notification.d.ts +3 -5
- package/dist/models/notification.js +22 -19
- package/dist/models/notification.js.map +1 -1
- package/dist/models/oauth.d.ts +1 -1
- package/dist/models/oauth.js +2 -5
- package/dist/models/oauth.js.map +1 -1
- package/dist/models/order.d.ts +3 -5
- package/dist/models/order.js +25 -21
- package/dist/models/order.js.map +1 -1
- package/dist/models/payment-provider.js.map +1 -1
- package/dist/models/payment-session.d.ts +3 -5
- package/dist/models/payment-session.js +22 -19
- package/dist/models/payment-session.js.map +1 -1
- package/dist/models/payment.d.ts +4 -6
- package/dist/models/payment.js +22 -19
- package/dist/models/payment.js.map +1 -1
- package/dist/models/price-list.d.ts +54 -0
- package/dist/models/price-list.js +144 -0
- package/dist/models/price-list.js.map +1 -0
- package/dist/models/product-collection.d.ts +4 -7
- package/dist/models/product-collection.js +25 -24
- package/dist/models/product-collection.js.map +1 -1
- package/dist/models/product-option-value.d.ts +3 -6
- package/dist/models/product-option-value.js +24 -26
- package/dist/models/product-option-value.js.map +1 -1
- package/dist/models/product-option.d.ts +3 -6
- package/dist/models/product-option.js +23 -24
- package/dist/models/product-option.js.map +1 -1
- package/dist/models/product-tag.d.ts +3 -6
- package/dist/models/product-tag.js +22 -23
- package/dist/models/product-tag.js.map +1 -1
- package/dist/models/product-tax-rate.d.ts +1 -1
- package/dist/models/product-tax-rate.js.map +1 -1
- package/dist/models/product-type-tax-rate.d.ts +1 -1
- package/dist/models/product-type-tax-rate.js.map +1 -1
- package/dist/models/product-type.d.ts +3 -6
- package/dist/models/product-type.js +22 -23
- package/dist/models/product-type.js.map +1 -1
- package/dist/models/product-variant.d.ts +3 -6
- package/dist/models/product-variant.js +30 -26
- package/dist/models/product-variant.js.map +1 -1
- package/dist/models/product.d.ts +3 -6
- package/dist/models/product.js +25 -22
- package/dist/models/product.js.map +1 -1
- package/dist/models/refund.d.ts +3 -5
- package/dist/models/refund.js +22 -17
- package/dist/models/refund.js.map +1 -1
- package/dist/models/region.d.ts +3 -6
- package/dist/models/region.js +23 -24
- package/dist/models/region.js.map +1 -1
- package/dist/models/return-item.d.ts +1 -1
- package/dist/models/return-item.js.map +1 -1
- package/dist/models/return-reason.d.ts +3 -6
- package/dist/models/return-reason.js +24 -25
- package/dist/models/return-reason.js.map +1 -1
- package/dist/models/return.d.ts +5 -7
- package/dist/models/return.js +29 -21
- package/dist/models/return.js.map +1 -1
- package/dist/models/shipping-method-tax-line.js +4 -6
- package/dist/models/shipping-method-tax-line.js.map +1 -1
- package/dist/models/shipping-method.d.ts +2 -2
- package/dist/models/shipping-method.js +3 -6
- package/dist/models/shipping-method.js.map +1 -1
- package/dist/models/shipping-option-requirement.js +2 -5
- package/dist/models/shipping-option-requirement.js.map +1 -1
- package/dist/models/shipping-option.d.ts +5 -8
- package/dist/models/shipping-option.js +26 -25
- package/dist/models/shipping-option.js.map +1 -1
- package/dist/models/shipping-profile.d.ts +3 -6
- package/dist/models/shipping-profile.js +22 -23
- package/dist/models/shipping-profile.js.map +1 -1
- package/dist/models/shipping-tax-rate.d.ts +1 -1
- package/dist/models/shipping-tax-rate.js.map +1 -1
- package/dist/models/staged-job.d.ts +1 -1
- package/dist/models/staged-job.js +2 -3
- package/dist/models/staged-job.js.map +1 -1
- package/dist/models/store.d.ts +3 -5
- package/dist/models/store.js +22 -17
- package/dist/models/store.js.map +1 -1
- package/dist/models/swap.d.ts +9 -12
- package/dist/models/swap.js +55 -52
- package/dist/models/swap.js.map +1 -1
- package/dist/models/tax-line.d.ts +3 -5
- package/dist/models/tax-line.js +20 -14
- package/dist/models/tax-line.js.map +1 -1
- package/dist/models/tax-rate.d.ts +3 -5
- package/dist/models/tax-rate.js +22 -19
- package/dist/models/tax-rate.js.map +1 -1
- package/dist/models/tracking-link.d.ts +3 -6
- package/dist/models/tracking-link.js +26 -27
- package/dist/models/tracking-link.js.map +1 -1
- package/dist/models/user.d.ts +3 -6
- package/dist/models/user.js +22 -23
- package/dist/models/user.js.map +1 -1
- package/dist/repositories/batch-job.d.ts +4 -0
- package/dist/repositories/batch-job.js +38 -0
- package/dist/repositories/batch-job.js.map +1 -0
- package/dist/repositories/cart.d.ts +2 -2
- package/dist/repositories/cart.js.map +1 -1
- package/dist/repositories/customer.d.ts +1 -1
- package/dist/repositories/customer.js +7 -9
- package/dist/repositories/customer.js.map +1 -1
- package/dist/repositories/discount-condition.d.ts +38 -0
- package/dist/repositories/discount-condition.js +398 -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 +8 -2
- package/dist/repositories/money-amount.js +177 -2
- package/dist/repositories/money-amount.js.map +1 -1
- package/dist/repositories/order.d.ts +1 -1
- package/dist/repositories/price-list.d.ts +11 -0
- package/dist/repositories/price-list.js +247 -0
- package/dist/repositories/price-list.js.map +1 -0
- package/dist/repositories/product.d.ts +5 -1
- package/dist/repositories/product.js +96 -18
- 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 +189 -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/batch-job.d.ts +24 -0
- package/dist/services/batch-job.js +126 -0
- package/dist/services/batch-job.js.map +1 -0
- package/dist/services/cart.d.ts +66 -55
- package/dist/services/cart.js +1315 -1405
- package/dist/services/cart.js.map +1 -1
- package/dist/services/claim-item.d.ts +23 -27
- package/dist/services/claim-item.js +217 -247
- package/dist/services/claim-item.js.map +1 -1
- package/dist/services/claim.d.ts +89 -71
- package/dist/services/claim.js +915 -840
- package/dist/services/claim.js.map +1 -1
- package/dist/services/customer.d.ts +0 -7
- package/dist/services/customer.js +8 -35
- package/dist/services/customer.js.map +1 -1
- package/dist/services/discount-condition.d.ts +31 -0
- package/dist/services/discount-condition.js +232 -0
- package/dist/services/discount-condition.js.map +1 -0
- package/dist/services/discount.d.ts +50 -59
- package/dist/services/discount.js +274 -176
- package/dist/services/discount.js.map +1 -1
- package/dist/services/draft-order.d.ts +69 -66
- package/dist/services/draft-order.js +375 -352
- package/dist/services/draft-order.js.map +1 -1
- package/dist/services/event-bus.d.ts +72 -56
- package/dist/services/event-bus.js +122 -99
- package/dist/services/event-bus.js.map +1 -1
- package/dist/services/file.d.ts +14 -0
- package/dist/services/file.js +43 -0
- package/dist/services/file.js.map +1 -0
- 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 +434 -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.d.ts +0 -13
- package/dist/services/order.js +4 -30
- 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 +107 -0
- package/dist/services/price-list.js +740 -0
- package/dist/services/price-list.js.map +1 -0
- package/dist/services/pricing.d.ts +87 -0
- package/dist/services/pricing.js +443 -0
- package/dist/services/pricing.js.map +1 -0
- package/dist/services/product-tag.d.ts +2 -2
- package/dist/services/product-tag.js +15 -2
- package/dist/services/product-tag.js.map +1 -1
- package/dist/services/product-type.d.ts +1 -1
- package/dist/services/product-type.js +14 -1
- package/dist/services/product-type.js.map +1 -1
- 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 -11
- package/dist/services/product.js +251 -87
- package/dist/services/product.js.map +1 -1
- package/dist/services/region.js +12 -8
- package/dist/services/region.js.map +1 -1
- package/dist/services/return.js +2 -1
- package/dist/services/return.js.map +1 -1
- package/dist/services/shipping-option.d.ts +44 -109
- package/dist/services/shipping-option.js +309 -353
- package/dist/services/shipping-option.js.map +1 -1
- package/dist/services/store.d.ts +36 -45
- package/dist/services/store.js +207 -217
- package/dist/services/store.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/cart-completion.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 +15 -0
- package/dist/types/batch-job.js +63 -0
- package/dist/types/batch-job.js.map +1 -0
- package/dist/types/cart.d.ts +2 -2
- package/dist/types/claim.d.ts +67 -0
- package/dist/types/claim.js +3 -0
- package/dist/types/claim.js.map +1 -0
- package/dist/types/common.d.ts +53 -13
- package/dist/types/common.js +1 -0
- package/dist/types/common.js.map +1 -1
- package/dist/types/discount.d.ts +68 -1
- package/dist/types/discount.js +129 -5
- package/dist/types/discount.js.map +1 -1
- package/dist/types/global.d.ts +53 -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/note.d.ts +1 -1
- package/dist/types/price-list.d.ts +73 -0
- package/dist/types/price-list.js +157 -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/pricing.d.ts +25 -0
- package/dist/types/pricing.js +3 -0
- package/dist/types/pricing.js.map +1 -0
- package/dist/types/product-variant.d.ts +24 -1
- package/dist/types/product-variant.js +65 -1
- package/dist/types/product-variant.js.map +1 -1
- package/dist/types/product.d.ts +18 -0
- package/dist/types/product.js +104 -5
- package/dist/types/product.js.map +1 -1
- package/dist/types/shipping-options.d.ts +56 -0
- package/dist/types/shipping-options.js +3 -0
- package/dist/types/shipping-options.js.map +1 -0
- package/dist/types/store.d.ts +9 -0
- package/dist/types/store.js +3 -0
- package/dist/types/store.js.map +1 -0
- package/dist/types/tax-service.d.ts +2 -2
- package/dist/types/user.d.ts +2 -2
- 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/build-query.d.ts +8 -0
- package/dist/utils/build-query.js +114 -0
- package/dist/utils/build-query.js.map +1 -0
- package/dist/utils/countries.d.ts +3 -2
- package/dist/utils/countries.js.map +1 -1
- package/dist/utils/currencies.d.ts +10 -1899
- package/dist/utils/currencies.js.map +1 -1
- 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/format-registration-name.d.ts +4 -4
- package/dist/utils/format-registration-name.js +7 -10
- package/dist/utils/format-registration-name.js.map +1 -1
- package/dist/utils/generate-entity-id.d.ts +6 -0
- package/dist/utils/generate-entity-id.js +19 -0
- package/dist/utils/generate-entity-id.js.map +1 -0
- package/dist/utils/get-query-config.d.ts +9 -0
- package/dist/utils/get-query-config.js +133 -0
- package/dist/utils/get-query-config.js.map +1 -0
- package/dist/utils/index.d.ts +4 -0
- package/dist/utils/index.js +17 -0
- package/dist/utils/index.js.map +1 -0
- package/dist/utils/set-metadata.d.ts +9 -0
- package/dist/utils/set-metadata.js +72 -0
- package/dist/utils/set-metadata.js.map +1 -0
- package/dist/utils/sleep.d.ts +1 -0
- package/dist/utils/sleep.js +50 -0
- package/dist/utils/sleep.js.map +1 -0
- package/dist/utils/validate-id.d.ts +4 -0
- package/dist/utils/validate-id.js +47 -0
- package/dist/utils/validate-id.js.map +1 -0
- package/jest.config.js +6 -0
- package/package.json +11 -9
- package/tsconfig.spec.json +10 -0
- package/yarn-error.log +23292 -1023
|
@@ -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: Record<string, unknown>;
|
|
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;;kEAChB;IAtBtB,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: Record<string, unknown>;
|
|
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;;8DAChB;IAtBtB,wBAAwB;QADpC,IAAA,gBAAM,GAAE;OACI,wBAAwB,CAuBpC;IAAD,+BAAC;CAAA,AAvBD,IAuBC;AAvBY,4DAAwB;AAyBrC;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG"}
|
|
@@ -0,0 +1,65 @@
|
|
|
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
|
+
import { SoftDeletableEntity } from "../interfaces/models/soft-deletable-entity";
|
|
8
|
+
export declare enum DiscountConditionType {
|
|
9
|
+
PRODUCTS = "products",
|
|
10
|
+
PRODUCT_TYPES = "product_types",
|
|
11
|
+
PRODUCT_COLLECTIONS = "product_collections",
|
|
12
|
+
PRODUCT_TAGS = "product_tags",
|
|
13
|
+
CUSTOMER_GROUPS = "customer_groups"
|
|
14
|
+
}
|
|
15
|
+
export declare enum DiscountConditionOperator {
|
|
16
|
+
IN = "in",
|
|
17
|
+
NOT_IN = "not_in"
|
|
18
|
+
}
|
|
19
|
+
export declare class DiscountCondition extends SoftDeletableEntity {
|
|
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
|
+
metadata: Record<string, unknown>;
|
|
30
|
+
private beforeInsert;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* @schema discount_condition
|
|
34
|
+
* title: "Discount Condition"
|
|
35
|
+
* description: "Holds rule conditions for when a discount is applicable"
|
|
36
|
+
* x-resourceId: discount_condition
|
|
37
|
+
* properties:
|
|
38
|
+
* id:
|
|
39
|
+
* description: "The id of the Discount Condition. Will be prefixed by `discon_`."
|
|
40
|
+
* type: string
|
|
41
|
+
* type:
|
|
42
|
+
* description: "The type of the Condition"
|
|
43
|
+
* type: string
|
|
44
|
+
* enum:
|
|
45
|
+
* - products
|
|
46
|
+
* - product_types
|
|
47
|
+
* - product_collections
|
|
48
|
+
* - product_tags
|
|
49
|
+
* - customer_groups
|
|
50
|
+
* created_at:
|
|
51
|
+
* description: "The date with timezone at which the resource was created."
|
|
52
|
+
* type: string
|
|
53
|
+
* format: date-time
|
|
54
|
+
* update_at:
|
|
55
|
+
* description: "The date with timezone at which the resource was last updated."
|
|
56
|
+
* type: string
|
|
57
|
+
* format: date-time
|
|
58
|
+
* deleted_at:
|
|
59
|
+
* description: "The date with timezone at which the resource was deleted."
|
|
60
|
+
* type: string
|
|
61
|
+
* format: date-time
|
|
62
|
+
* metadata:
|
|
63
|
+
* description: "An optional key-value map with additional information."
|
|
64
|
+
* type: object
|
|
65
|
+
*/
|
|
@@ -0,0 +1,209 @@
|
|
|
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 __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
18
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
19
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
20
|
+
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;
|
|
21
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
22
|
+
};
|
|
23
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
24
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
25
|
+
};
|
|
26
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
27
|
+
exports.DiscountCondition = exports.DiscountConditionOperator = exports.DiscountConditionType = void 0;
|
|
28
|
+
var typeorm_1 = require("typeorm");
|
|
29
|
+
var db_aware_column_1 = require("../utils/db-aware-column");
|
|
30
|
+
var customer_group_1 = require("./customer-group");
|
|
31
|
+
var discount_rule_1 = require("./discount-rule");
|
|
32
|
+
var product_1 = require("./product");
|
|
33
|
+
var product_collection_1 = require("./product-collection");
|
|
34
|
+
var product_tag_1 = require("./product-tag");
|
|
35
|
+
var product_type_1 = require("./product-type");
|
|
36
|
+
var soft_deletable_entity_1 = require("../interfaces/models/soft-deletable-entity");
|
|
37
|
+
var generate_entity_id_1 = require("../utils/generate-entity-id");
|
|
38
|
+
var DiscountConditionType;
|
|
39
|
+
(function (DiscountConditionType) {
|
|
40
|
+
DiscountConditionType["PRODUCTS"] = "products";
|
|
41
|
+
DiscountConditionType["PRODUCT_TYPES"] = "product_types";
|
|
42
|
+
DiscountConditionType["PRODUCT_COLLECTIONS"] = "product_collections";
|
|
43
|
+
DiscountConditionType["PRODUCT_TAGS"] = "product_tags";
|
|
44
|
+
DiscountConditionType["CUSTOMER_GROUPS"] = "customer_groups";
|
|
45
|
+
})(DiscountConditionType = exports.DiscountConditionType || (exports.DiscountConditionType = {}));
|
|
46
|
+
var DiscountConditionOperator;
|
|
47
|
+
(function (DiscountConditionOperator) {
|
|
48
|
+
DiscountConditionOperator["IN"] = "in";
|
|
49
|
+
DiscountConditionOperator["NOT_IN"] = "not_in";
|
|
50
|
+
})(DiscountConditionOperator = exports.DiscountConditionOperator || (exports.DiscountConditionOperator = {}));
|
|
51
|
+
var DiscountCondition = /** @class */ (function (_super) {
|
|
52
|
+
__extends(DiscountCondition, _super);
|
|
53
|
+
function DiscountCondition() {
|
|
54
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
55
|
+
}
|
|
56
|
+
DiscountCondition.prototype.beforeInsert = function () {
|
|
57
|
+
this.id = (0, generate_entity_id_1.generateEntityId)(this.id, "discon");
|
|
58
|
+
};
|
|
59
|
+
__decorate([
|
|
60
|
+
(0, db_aware_column_1.DbAwareColumn)({
|
|
61
|
+
type: "enum",
|
|
62
|
+
enum: DiscountConditionType,
|
|
63
|
+
}),
|
|
64
|
+
__metadata("design:type", String)
|
|
65
|
+
], DiscountCondition.prototype, "type", void 0);
|
|
66
|
+
__decorate([
|
|
67
|
+
(0, db_aware_column_1.DbAwareColumn)({
|
|
68
|
+
type: "enum",
|
|
69
|
+
enum: DiscountConditionOperator,
|
|
70
|
+
}),
|
|
71
|
+
__metadata("design:type", String)
|
|
72
|
+
], DiscountCondition.prototype, "operator", void 0);
|
|
73
|
+
__decorate([
|
|
74
|
+
(0, typeorm_1.Index)(),
|
|
75
|
+
(0, typeorm_1.Column)(),
|
|
76
|
+
__metadata("design:type", String)
|
|
77
|
+
], DiscountCondition.prototype, "discount_rule_id", void 0);
|
|
78
|
+
__decorate([
|
|
79
|
+
(0, typeorm_1.ManyToOne)(function () { return discount_rule_1.DiscountRule; }, function (dr) { return dr.conditions; }),
|
|
80
|
+
(0, typeorm_1.JoinColumn)({ name: "discount_rule_id" }),
|
|
81
|
+
__metadata("design:type", discount_rule_1.DiscountRule)
|
|
82
|
+
], DiscountCondition.prototype, "discount_rule", void 0);
|
|
83
|
+
__decorate([
|
|
84
|
+
(0, typeorm_1.ManyToMany)(function () { return product_1.Product; }),
|
|
85
|
+
(0, typeorm_1.JoinTable)({
|
|
86
|
+
name: "discount_condition_product",
|
|
87
|
+
joinColumn: {
|
|
88
|
+
name: "condition_id",
|
|
89
|
+
referencedColumnName: "id",
|
|
90
|
+
},
|
|
91
|
+
inverseJoinColumn: {
|
|
92
|
+
name: "product_id",
|
|
93
|
+
referencedColumnName: "id",
|
|
94
|
+
},
|
|
95
|
+
}),
|
|
96
|
+
__metadata("design:type", Array)
|
|
97
|
+
], DiscountCondition.prototype, "products", void 0);
|
|
98
|
+
__decorate([
|
|
99
|
+
(0, typeorm_1.ManyToMany)(function () { return product_type_1.ProductType; }),
|
|
100
|
+
(0, typeorm_1.JoinTable)({
|
|
101
|
+
name: "discount_condition_product_type",
|
|
102
|
+
joinColumn: {
|
|
103
|
+
name: "condition_id",
|
|
104
|
+
referencedColumnName: "id",
|
|
105
|
+
},
|
|
106
|
+
inverseJoinColumn: {
|
|
107
|
+
name: "product_type_id",
|
|
108
|
+
referencedColumnName: "id",
|
|
109
|
+
},
|
|
110
|
+
}),
|
|
111
|
+
__metadata("design:type", Array)
|
|
112
|
+
], DiscountCondition.prototype, "product_types", void 0);
|
|
113
|
+
__decorate([
|
|
114
|
+
(0, typeorm_1.ManyToMany)(function () { return product_tag_1.ProductTag; }),
|
|
115
|
+
(0, typeorm_1.JoinTable)({
|
|
116
|
+
name: "discount_condition_product_tag",
|
|
117
|
+
joinColumn: {
|
|
118
|
+
name: "condition_id",
|
|
119
|
+
referencedColumnName: "id",
|
|
120
|
+
},
|
|
121
|
+
inverseJoinColumn: {
|
|
122
|
+
name: "product_tag_id",
|
|
123
|
+
referencedColumnName: "id",
|
|
124
|
+
},
|
|
125
|
+
}),
|
|
126
|
+
__metadata("design:type", Array)
|
|
127
|
+
], DiscountCondition.prototype, "product_tags", void 0);
|
|
128
|
+
__decorate([
|
|
129
|
+
(0, typeorm_1.ManyToMany)(function () { return product_collection_1.ProductCollection; }),
|
|
130
|
+
(0, typeorm_1.JoinTable)({
|
|
131
|
+
name: "discount_condition_product_collection",
|
|
132
|
+
joinColumn: {
|
|
133
|
+
name: "condition_id",
|
|
134
|
+
referencedColumnName: "id",
|
|
135
|
+
},
|
|
136
|
+
inverseJoinColumn: {
|
|
137
|
+
name: "product_collection_id",
|
|
138
|
+
referencedColumnName: "id",
|
|
139
|
+
},
|
|
140
|
+
}),
|
|
141
|
+
__metadata("design:type", Array)
|
|
142
|
+
], DiscountCondition.prototype, "product_collections", void 0);
|
|
143
|
+
__decorate([
|
|
144
|
+
(0, typeorm_1.ManyToMany)(function () { return customer_group_1.CustomerGroup; }),
|
|
145
|
+
(0, typeorm_1.JoinTable)({
|
|
146
|
+
name: "discount_condition_customer_group",
|
|
147
|
+
joinColumn: {
|
|
148
|
+
name: "condition_id",
|
|
149
|
+
referencedColumnName: "id",
|
|
150
|
+
},
|
|
151
|
+
inverseJoinColumn: {
|
|
152
|
+
name: "customer_group_id",
|
|
153
|
+
referencedColumnName: "id",
|
|
154
|
+
},
|
|
155
|
+
}),
|
|
156
|
+
__metadata("design:type", Array)
|
|
157
|
+
], DiscountCondition.prototype, "customer_groups", void 0);
|
|
158
|
+
__decorate([
|
|
159
|
+
(0, db_aware_column_1.DbAwareColumn)({ type: "jsonb", nullable: true }),
|
|
160
|
+
__metadata("design:type", Object)
|
|
161
|
+
], DiscountCondition.prototype, "metadata", void 0);
|
|
162
|
+
__decorate([
|
|
163
|
+
(0, typeorm_1.BeforeInsert)(),
|
|
164
|
+
__metadata("design:type", Function),
|
|
165
|
+
__metadata("design:paramtypes", []),
|
|
166
|
+
__metadata("design:returntype", void 0)
|
|
167
|
+
], DiscountCondition.prototype, "beforeInsert", null);
|
|
168
|
+
DiscountCondition = __decorate([
|
|
169
|
+
(0, typeorm_1.Entity)(),
|
|
170
|
+
(0, typeorm_1.Unique)("dctypeuniq", ["type", "operator", "discount_rule_id"])
|
|
171
|
+
], DiscountCondition);
|
|
172
|
+
return DiscountCondition;
|
|
173
|
+
}(soft_deletable_entity_1.SoftDeletableEntity));
|
|
174
|
+
exports.DiscountCondition = DiscountCondition;
|
|
175
|
+
/**
|
|
176
|
+
* @schema discount_condition
|
|
177
|
+
* title: "Discount Condition"
|
|
178
|
+
* description: "Holds rule conditions for when a discount is applicable"
|
|
179
|
+
* x-resourceId: discount_condition
|
|
180
|
+
* properties:
|
|
181
|
+
* id:
|
|
182
|
+
* description: "The id of the Discount Condition. Will be prefixed by `discon_`."
|
|
183
|
+
* type: string
|
|
184
|
+
* type:
|
|
185
|
+
* description: "The type of the Condition"
|
|
186
|
+
* type: string
|
|
187
|
+
* enum:
|
|
188
|
+
* - products
|
|
189
|
+
* - product_types
|
|
190
|
+
* - product_collections
|
|
191
|
+
* - product_tags
|
|
192
|
+
* - customer_groups
|
|
193
|
+
* created_at:
|
|
194
|
+
* description: "The date with timezone at which the resource was created."
|
|
195
|
+
* type: string
|
|
196
|
+
* format: date-time
|
|
197
|
+
* update_at:
|
|
198
|
+
* description: "The date with timezone at which the resource was last updated."
|
|
199
|
+
* type: string
|
|
200
|
+
* format: date-time
|
|
201
|
+
* deleted_at:
|
|
202
|
+
* description: "The date with timezone at which the resource was deleted."
|
|
203
|
+
* type: string
|
|
204
|
+
* format: date-time
|
|
205
|
+
* metadata:
|
|
206
|
+
* description: "An optional key-value map with additional information."
|
|
207
|
+
* type: object
|
|
208
|
+
*/
|
|
209
|
+
//# sourceMappingURL=discount-condition.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"discount-condition.js","sourceRoot":"","sources":["../../src/models/discount-condition.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,mCAUgB;AAChB,4DAAwD;AACxD,mDAAgD;AAChD,iDAA8C;AAC9C,qCAAmC;AACnC,2DAAwD;AACxD,6CAA0C;AAC1C,+CAA4C;AAC5C,oFAAgF;AAChF,kEAA8D;AAE9D,IAAY,qBAMX;AAND,WAAY,qBAAqB;IAC/B,8CAAqB,CAAA;IACrB,wDAA+B,CAAA;IAC/B,oEAA2C,CAAA;IAC3C,sDAA6B,CAAA;IAC7B,4DAAmC,CAAA;AACrC,CAAC,EANW,qBAAqB,GAArB,6BAAqB,KAArB,6BAAqB,QAMhC;AAED,IAAY,yBAGX;AAHD,WAAY,yBAAyB;IACnC,sCAAS,CAAA;IACT,8CAAiB,CAAA;AACnB,CAAC,EAHW,yBAAyB,GAAzB,iCAAyB,KAAzB,iCAAyB,QAGpC;AAID;IAAuC,qCAAmB;IAA1D;;IAkGA,CAAC;IAHS,wCAAY,GAApB;QACE,IAAI,CAAC,EAAE,GAAG,IAAA,qCAAgB,EAAC,IAAI,CAAC,EAAE,EAAE,QAAQ,CAAC,CAAA;IAC/C,CAAC;IA5FD;QAJC,IAAA,+BAAa,EAAC;YACb,IAAI,EAAE,MAAM;YACZ,IAAI,EAAE,qBAAqB;SAC5B,CAAC;;mDACyB;IAM3B;QAJC,IAAA,+BAAa,EAAC;YACb,IAAI,EAAE,MAAM;YACZ,IAAI,EAAE,yBAAyB;SAChC,CAAC;;uDACiC;IAInC;QAFC,IAAA,eAAK,GAAE;QACP,IAAA,gBAAM,GAAE;;+DACe;IAIxB;QAFC,IAAA,mBAAS,EAAC,cAAM,OAAA,4BAAY,EAAZ,CAAY,EAAE,UAAC,EAAE,IAAK,OAAA,EAAE,CAAC,UAAU,EAAb,CAAa,CAAC;QACpD,IAAA,oBAAU,EAAC,EAAE,IAAI,EAAE,kBAAkB,EAAE,CAAC;kCAC1B,4BAAY;4DAAA;IAc3B;QAZC,IAAA,oBAAU,EAAC,cAAM,OAAA,iBAAO,EAAP,CAAO,CAAC;QACzB,IAAA,mBAAS,EAAC;YACT,IAAI,EAAE,4BAA4B;YAClC,UAAU,EAAE;gBACV,IAAI,EAAE,cAAc;gBACpB,oBAAoB,EAAE,IAAI;aAC3B;YACD,iBAAiB,EAAE;gBACjB,IAAI,EAAE,YAAY;gBAClB,oBAAoB,EAAE,IAAI;aAC3B;SACF,CAAC;;uDACiB;IAcnB;QAZC,IAAA,oBAAU,EAAC,cAAM,OAAA,0BAAW,EAAX,CAAW,CAAC;QAC7B,IAAA,mBAAS,EAAC;YACT,IAAI,EAAE,iCAAiC;YACvC,UAAU,EAAE;gBACV,IAAI,EAAE,cAAc;gBACpB,oBAAoB,EAAE,IAAI;aAC3B;YACD,iBAAiB,EAAE;gBACjB,IAAI,EAAE,iBAAiB;gBACvB,oBAAoB,EAAE,IAAI;aAC3B;SACF,CAAC;;4DAC0B;IAc5B;QAZC,IAAA,oBAAU,EAAC,cAAM,OAAA,wBAAU,EAAV,CAAU,CAAC;QAC5B,IAAA,mBAAS,EAAC;YACT,IAAI,EAAE,gCAAgC;YACtC,UAAU,EAAE;gBACV,IAAI,EAAE,cAAc;gBACpB,oBAAoB,EAAE,IAAI;aAC3B;YACD,iBAAiB,EAAE;gBACjB,IAAI,EAAE,gBAAgB;gBACtB,oBAAoB,EAAE,IAAI;aAC3B;SACF,CAAC;;2DACwB;IAc1B;QAZC,IAAA,oBAAU,EAAC,cAAM,OAAA,sCAAiB,EAAjB,CAAiB,CAAC;QACnC,IAAA,mBAAS,EAAC;YACT,IAAI,EAAE,uCAAuC;YAC7C,UAAU,EAAE;gBACV,IAAI,EAAE,cAAc;gBACpB,oBAAoB,EAAE,IAAI;aAC3B;YACD,iBAAiB,EAAE;gBACjB,IAAI,EAAE,uBAAuB;gBAC7B,oBAAoB,EAAE,IAAI;aAC3B;SACF,CAAC;;kEACsC;IAcxC;QAZC,IAAA,oBAAU,EAAC,cAAM,OAAA,8BAAa,EAAb,CAAa,CAAC;QAC/B,IAAA,mBAAS,EAAC;YACT,IAAI,EAAE,mCAAmC;YACzC,UAAU,EAAE;gBACV,IAAI,EAAE,cAAc;gBACpB,oBAAoB,EAAE,IAAI;aAC3B;YACD,iBAAiB,EAAE;gBACjB,IAAI,EAAE,mBAAmB;gBACzB,oBAAoB,EAAE,IAAI;aAC3B;SACF,CAAC;;8DAC8B;IAGhC;QADC,IAAA,+BAAa,EAAC,EAAE,IAAI,EAAE,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;uDAChB;IAGjC;QADC,IAAA,sBAAY,GAAE;;;;yDAGd;IAjGU,iBAAiB;QAF7B,IAAA,gBAAM,GAAE;QACR,IAAA,gBAAM,EAAC,YAAY,EAAE,CAAC,MAAM,EAAE,UAAU,EAAE,kBAAkB,CAAC,CAAC;OAClD,iBAAiB,CAkG7B;IAAD,wBAAC;CAAA,AAlGD,CAAuC,2CAAmB,GAkGzD;AAlGY,8CAAiB;AAoG9B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { DiscountCondition } from "./discount-condition";
|
|
2
|
+
import { SoftDeletableEntity } from "../interfaces/models/soft-deletable-entity";
|
|
2
3
|
export declare enum DiscountRuleType {
|
|
3
4
|
FIXED = "fixed",
|
|
4
5
|
PERCENTAGE = "percentage",
|
|
@@ -8,17 +9,13 @@ export declare enum AllocationType {
|
|
|
8
9
|
TOTAL = "total",
|
|
9
10
|
ITEM = "item"
|
|
10
11
|
}
|
|
11
|
-
export declare class DiscountRule {
|
|
12
|
-
id: string;
|
|
12
|
+
export declare class DiscountRule extends SoftDeletableEntity {
|
|
13
13
|
description: string;
|
|
14
14
|
type: DiscountRuleType;
|
|
15
15
|
value: number;
|
|
16
16
|
allocation: AllocationType;
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
updated_at: Date;
|
|
20
|
-
deleted_at: Date;
|
|
21
|
-
metadata: any;
|
|
17
|
+
conditions: DiscountCondition[];
|
|
18
|
+
metadata: Record<string, unknown>;
|
|
22
19
|
private beforeInsert;
|
|
23
20
|
}
|
|
24
21
|
/**
|
|
@@ -49,11 +46,11 @@ export declare class DiscountRule {
|
|
|
49
46
|
* enum:
|
|
50
47
|
* - total
|
|
51
48
|
* - item
|
|
52
|
-
*
|
|
53
|
-
* description: "A set of
|
|
49
|
+
* conditions:
|
|
50
|
+
* description: "A set of conditions that can be used to limit when the discount can be used"
|
|
54
51
|
* type: array
|
|
55
52
|
* items:
|
|
56
|
-
* $ref: "#/components/schemas/
|
|
53
|
+
* $ref: "#/components/schemas/discount_condition"
|
|
57
54
|
* created_at:
|
|
58
55
|
* description: "The date with timezone at which the resource was created."
|
|
59
56
|
* type: string
|