qeai-sdk 2.0.0 → 2.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/constants/index.d.ts +14 -12
- package/dist/constants/index.js +16 -12
- package/dist/constants/product-commands.constant.d.ts +6 -0
- package/dist/constants/product-commands.constant.js +6 -0
- package/dist/constants/services-config.constant.d.ts +3 -0
- package/dist/constants/services-config.constant.js +1 -0
- package/dist/constants/translation-commands.constant.d.ts +35 -0
- package/dist/constants/translation-commands.constant.js +35 -0
- package/dist/dtos/auth/index.d.ts +2 -2
- package/dist/dtos/auth/index.js +2 -2
- package/dist/dtos/auth/register-user.dto.js +4 -1
- package/dist/dtos/categories/create-category.dto.js +6 -3
- package/dist/dtos/categories/delete-category.dto.d.ts +1 -1
- package/dist/dtos/categories/delete-category.dto.js +5 -3
- package/dist/dtos/categories/index.d.ts +3 -3
- package/dist/dtos/categories/index.js +3 -3
- package/dist/dtos/categories/update-category.dto.d.ts +30 -11
- package/dist/dtos/categories/update-category.dto.js +48 -14
- package/dist/dtos/chain/create-chain.dto.d.ts +12 -13
- package/dist/dtos/chain/create-chain.dto.js +16 -15
- package/dist/dtos/chain/delete-chain.dto.d.ts +6 -6
- package/dist/dtos/chain/delete-chain.dto.js +11 -9
- package/dist/dtos/chain/index.d.ts +3 -3
- package/dist/dtos/chain/index.js +3 -3
- package/dist/dtos/chain/update-chain.dto.d.ts +45 -11
- package/dist/dtos/chain/update-chain.dto.js +67 -15
- package/dist/dtos/common/index.d.ts +2 -1
- package/dist/dtos/common/index.js +2 -1
- package/dist/dtos/common/search-by-name.dto.d.ts +27 -0
- package/dist/dtos/{tags → common}/search-by-name.dto.js +18 -9
- package/dist/dtos/index.d.ts +12 -12
- package/dist/dtos/index.js +12 -12
- package/dist/dtos/ingredients/create-ingredient.dto.d.ts +5 -5
- package/dist/dtos/ingredients/create-ingredient.dto.js +9 -8
- package/dist/dtos/ingredients/delete-ingredient.dto.d.ts +14 -7
- package/dist/dtos/ingredients/delete-ingredient.dto.js +18 -9
- package/dist/dtos/ingredients/index.d.ts +3 -4
- package/dist/dtos/ingredients/index.js +3 -4
- package/dist/dtos/ingredients/update-ingredient.dto.d.ts +32 -11
- package/dist/dtos/ingredients/update-ingredient.dto.js +48 -15
- package/dist/dtos/orders/change-order-status.dto.d.ts +19 -10
- package/dist/dtos/orders/change-order-status.dto.js +27 -14
- package/dist/dtos/orders/create-order.dto.d.ts +34 -24
- package/dist/dtos/orders/create-order.dto.js +44 -32
- package/dist/dtos/orders/index.d.ts +5 -6
- package/dist/dtos/orders/index.js +5 -6
- package/dist/dtos/orders/order-item.dto.d.ts +35 -18
- package/dist/dtos/orders/order-item.dto.js +54 -32
- package/dist/dtos/orders/order-pagination.dto.d.ts +2 -2
- package/dist/dtos/orders/order-pagination.dto.js +4 -4
- package/dist/dtos/orders/paid-order.dto.d.ts +16 -8
- package/dist/dtos/orders/paid-order.dto.js +25 -14
- package/dist/dtos/payments/create-payment-audit-dynamo.dto.d.ts +81 -0
- package/dist/dtos/payments/create-payment-audit-dynamo.dto.js +81 -0
- package/dist/dtos/payments/create-payment-audit-s3.dto.d.ts +81 -0
- package/dist/dtos/payments/create-payment-audit-s3.dto.js +81 -0
- package/dist/dtos/payments/index.d.ts +5 -3
- package/dist/dtos/payments/index.js +5 -3
- package/dist/dtos/payments/payment-session-item.dto.d.ts +4 -4
- package/dist/dtos/payments/payment-session-item.dto.js +7 -4
- package/dist/dtos/payments/payment-session.dto.d.ts +1 -1
- package/dist/dtos/payments/payment-session.dto.js +1 -1
- package/dist/dtos/payments/webhook-data.dto.d.ts +1 -1
- package/dist/dtos/payments/webhook-data.dto.js +1 -0
- package/dist/dtos/products/create-product.dto.d.ts +2 -2
- package/dist/dtos/products/create-product.dto.js +3 -2
- package/dist/dtos/products/delete-product.dto.d.ts +1 -1
- package/dist/dtos/products/delete-product.dto.js +5 -3
- package/dist/dtos/products/index.d.ts +4 -4
- package/dist/dtos/products/index.js +4 -4
- package/dist/dtos/products/submodules/index.d.ts +6 -6
- package/dist/dtos/products/submodules/index.js +6 -6
- package/dist/dtos/products/submodules/product-image/bulk-create-product-image.dto.d.ts +3 -3
- package/dist/dtos/products/submodules/product-image/bulk-create-product-image.dto.js +5 -5
- package/dist/dtos/products/submodules/product-image/create-product-image.dto.d.ts +1 -1
- package/dist/dtos/products/submodules/product-image/create-product-image.dto.js +4 -4
- package/dist/dtos/products/submodules/product-image/index.d.ts +4 -4
- package/dist/dtos/products/submodules/product-image/index.js +4 -4
- package/dist/dtos/products/submodules/product-image/update-product-image.dto.d.ts +1 -1
- package/dist/dtos/products/submodules/product-image/update-product-image.dto.js +4 -4
- package/dist/dtos/products/submodules/product-question/create-product-question.dto.d.ts +2 -2
- package/dist/dtos/products/submodules/product-question/create-product-question.dto.js +8 -8
- package/dist/dtos/products/submodules/product-question/find-by-product-id-and-type.dto.d.ts +1 -1
- package/dist/dtos/products/submodules/product-question/find-by-product-id-and-type.dto.js +1 -1
- package/dist/dtos/products/submodules/product-question/index.d.ts +4 -4
- package/dist/dtos/products/submodules/product-question/index.js +4 -4
- package/dist/dtos/products/submodules/product-question/replace-by-product-id.dto.d.ts +2 -2
- package/dist/dtos/products/submodules/product-question/replace-by-product-id.dto.js +1 -1
- package/dist/dtos/products/submodules/product-question/update-product-question.dto.d.ts +2 -2
- package/dist/dtos/products/submodules/product-question/update-product-question.dto.js +5 -5
- package/dist/dtos/products/submodules/product-recipe/create-product-recipe.dto.d.ts +1 -1
- package/dist/dtos/products/submodules/product-recipe/create-product-recipe.dto.js +2 -2
- package/dist/dtos/products/submodules/product-recipe/index.d.ts +3 -3
- package/dist/dtos/products/submodules/product-recipe/index.js +3 -3
- package/dist/dtos/products/submodules/product-recipe/replace-by-product-id.dto.d.ts +2 -2
- package/dist/dtos/products/submodules/product-recipe/replace-by-product-id.dto.js +5 -5
- package/dist/dtos/products/submodules/product-recipe/update-product-recipe.dto.d.ts +1 -8
- package/dist/dtos/products/submodules/product-recipe/update-product-recipe.dto.js +3 -16
- package/dist/dtos/products/submodules/product-schedule/create-product-schedule.dto.d.ts +1 -1
- package/dist/dtos/products/submodules/product-schedule/create-product-schedule.dto.js +2 -2
- package/dist/dtos/products/submodules/product-schedule/index.d.ts +4 -4
- package/dist/dtos/products/submodules/product-schedule/index.js +4 -4
- package/dist/dtos/products/submodules/product-schedule/replace-by-product-id.dto.d.ts +2 -2
- package/dist/dtos/products/submodules/product-schedule/replace-by-product-id.dto.js +1 -1
- package/dist/dtos/products/submodules/product-schedule/update-product-schedule.dto.d.ts +1 -1
- package/dist/dtos/products/submodules/product-schedule/update-product-schedule.dto.js +4 -4
- package/dist/dtos/products/submodules/product-size/create-product-size.dto.js +1 -1
- package/dist/dtos/products/submodules/product-size/index.d.ts +4 -4
- package/dist/dtos/products/submodules/product-size/index.js +4 -4
- package/dist/dtos/products/submodules/product-size/product-size-data.dto.js +1 -1
- package/dist/dtos/products/submodules/product-size/replace-by-product-id.dto.d.ts +1 -1
- package/dist/dtos/products/submodules/product-size/replace-by-product-id.dto.js +1 -1
- package/dist/dtos/products/submodules/product-size/update-product-size.dto.d.ts +1 -1
- package/dist/dtos/products/submodules/product-size/update-product-size.dto.js +2 -2
- package/dist/dtos/products/submodules/product-tag/index.d.ts +2 -4
- package/dist/dtos/products/submodules/product-tag/index.js +2 -4
- package/dist/dtos/products/submodules/product-tag/{remove-product-tag.dto.d.ts → product-tag.dto.d.ts} +1 -1
- package/dist/dtos/products/submodules/product-tag/{remove-product-tag.dto.js → product-tag.dto.js} +3 -3
- package/dist/dtos/products/update-product.dto.d.ts +40 -5
- package/dist/dtos/products/update-product.dto.js +73 -7
- package/dist/dtos/questions/create-question.dto.d.ts +2 -2
- package/dist/dtos/questions/create-question.dto.js +3 -2
- package/dist/dtos/questions/delete-question.dto.d.ts +1 -1
- package/dist/dtos/questions/delete-question.dto.js +5 -3
- package/dist/dtos/questions/index.d.ts +3 -4
- package/dist/dtos/questions/index.js +3 -4
- package/dist/dtos/questions/update-question.dto.d.ts +40 -5
- package/dist/dtos/questions/update-question.dto.js +70 -8
- package/dist/dtos/restaurants/create-restaurant.dto.d.ts +15 -1
- package/dist/dtos/restaurants/create-restaurant.dto.js +38 -2
- package/dist/dtos/restaurants/delete-restaurant.dto.d.ts +1 -1
- package/dist/dtos/restaurants/delete-restaurant.dto.js +5 -3
- package/dist/dtos/restaurants/index.d.ts +3 -3
- package/dist/dtos/restaurants/index.js +3 -3
- package/dist/dtos/restaurants/update-restaurant.dto.d.ts +50 -5
- package/dist/dtos/restaurants/update-restaurant.dto.js +92 -8
- package/dist/dtos/tags/create-tag.dto.d.ts +1 -1
- package/dist/dtos/tags/create-tag.dto.js +5 -4
- package/dist/dtos/tags/delete-tag.dto.d.ts +1 -1
- package/dist/dtos/tags/delete-tag.dto.js +5 -3
- package/dist/dtos/tags/index.d.ts +3 -4
- package/dist/dtos/tags/index.js +3 -4
- package/dist/dtos/tags/update-tag.dto.d.ts +10 -5
- package/dist/dtos/tags/update-tag.dto.js +20 -8
- package/dist/dtos/translations/create-translation.dto.d.ts +1 -1
- package/dist/dtos/translations/create-translation.dto.js +7 -2
- package/dist/dtos/translations/delete-translation.dto.d.ts +1 -1
- package/dist/dtos/translations/delete-translation.dto.js +4 -3
- package/dist/dtos/translations/find-translations-by-entity.dto.d.ts +1 -1
- package/dist/dtos/translations/find-translations-by-entity.dto.js +1 -1
- package/dist/dtos/translations/index.d.ts +4 -4
- package/dist/dtos/translations/index.js +4 -4
- package/dist/dtos/translations/update-translation.dto.d.ts +33 -4
- package/dist/dtos/translations/update-translation.dto.js +69 -6
- package/dist/enums/index.d.ts +10 -12
- package/dist/enums/index.js +10 -12
- package/dist/index.d.ts +5 -5
- package/dist/index.js +5 -5
- package/dist/interfaces/auth/access-user.interface.d.ts +2 -2
- package/dist/interfaces/auth/account.interface.d.ts +1 -1
- package/dist/interfaces/auth/full-token.interface.d.ts +2 -2
- package/dist/interfaces/auth/index.d.ts +9 -9
- package/dist/interfaces/auth/index.js +9 -9
- package/dist/interfaces/auth/payload-jwt.interface.d.ts +2 -2
- package/dist/interfaces/auth/responses/auth-response.interface.d.ts +3 -3
- package/dist/interfaces/auth/responses/index.d.ts +2 -2
- package/dist/interfaces/auth/responses/index.js +2 -2
- package/dist/interfaces/auth/responses/refresh-token-response.interface.d.ts +2 -2
- package/dist/interfaces/auth/user.interface.d.ts +2 -2
- package/dist/interfaces/auth/validate-user.interface.d.ts +2 -2
- package/dist/interfaces/categories/categories-list-response.interface.d.ts +3 -3
- package/dist/interfaces/categories/category-response.interface.d.ts +2 -2
- package/dist/interfaces/categories/index.d.ts +3 -3
- package/dist/interfaces/categories/index.js +3 -3
- package/dist/interfaces/chains/chain-response.interface.d.ts +2 -2
- package/dist/interfaces/chains/chain.interface.d.ts +1 -1
- package/dist/interfaces/chains/chains-list-response.interface.d.ts +3 -3
- package/dist/interfaces/chains/index.d.ts +3 -3
- package/dist/interfaces/chains/index.js +3 -3
- package/dist/interfaces/common/api-error-response.interface.d.ts +2 -2
- package/dist/interfaces/common/api-response.interface.d.ts +3 -2
- package/dist/interfaces/common/index.d.ts +5 -5
- package/dist/interfaces/common/index.js +5 -5
- package/dist/interfaces/common/rpc-error.interface.d.ts +1 -1
- package/dist/interfaces/index.d.ts +12 -12
- package/dist/interfaces/index.js +12 -12
- package/dist/interfaces/ingredients/index.d.ts +3 -3
- package/dist/interfaces/ingredients/index.js +3 -3
- package/dist/interfaces/ingredients/ingredient-response.interface.d.ts +2 -2
- package/dist/interfaces/ingredients/ingredients-list-response.interface.d.ts +3 -3
- package/dist/interfaces/orders/index.d.ts +6 -6
- package/dist/interfaces/orders/index.js +6 -6
- package/dist/interfaces/orders/order-created.interface.d.ts +3 -3
- package/dist/interfaces/orders/order-item.interface.d.ts +4 -4
- package/dist/interfaces/orders/order-with-products.interface.d.ts +2 -2
- package/dist/interfaces/orders/order.interface.d.ts +9 -9
- package/dist/interfaces/orders/responses/change-order-status-response.interface.d.ts +2 -2
- package/dist/interfaces/orders/responses/create-order-response.interface.d.ts +2 -2
- package/dist/interfaces/orders/responses/index.d.ts +4 -4
- package/dist/interfaces/orders/responses/index.js +4 -4
- package/dist/interfaces/orders/responses/order-with-products-response.interface.d.ts +2 -2
- package/dist/interfaces/orders/responses/orders-list-response.interface.d.ts +3 -3
- package/dist/interfaces/payments/audit-storage-strategy.interface.d.ts +1 -1
- package/dist/interfaces/payments/index.d.ts +9 -9
- package/dist/interfaces/payments/index.js +9 -9
- package/dist/interfaces/payments/payment-provider.interface.d.ts +2 -2
- package/dist/interfaces/payments/responses/payment-callback-response.interface.d.ts +1 -1
- package/dist/interfaces/products/index.d.ts +8 -8
- package/dist/interfaces/products/index.js +8 -8
- package/dist/interfaces/products/product-recipe.interface.d.ts +1 -1
- package/dist/interfaces/products/product-tag.interface.d.ts +1 -1
- package/dist/interfaces/products/product.interface.d.ts +3 -3
- package/dist/interfaces/products/response/complete-product-response.interface.d.ts +2 -2
- package/dist/interfaces/products/response/index.d.ts +6 -6
- package/dist/interfaces/products/response/index.js +6 -6
- package/dist/interfaces/products/response/product-response.interface.d.ts +2 -2
- package/dist/interfaces/products/response/products-list-response.interface.d.ts +3 -3
- package/dist/interfaces/products/response/simple-product-response.interface.d.ts +1 -1
- package/dist/interfaces/products/response/sub-resources/create-tag-response.interface.d.ts +2 -2
- package/dist/interfaces/products/response/sub-resources/delete-sub-resource-response.interface.d.ts +1 -1
- package/dist/interfaces/products/response/sub-resources/find-product-image-response.interface.d.ts +2 -2
- package/dist/interfaces/products/response/sub-resources/find-product-question-response.interface.d.ts +2 -2
- package/dist/interfaces/products/response/sub-resources/find-product-recipe-response.interface.d.ts +2 -2
- package/dist/interfaces/products/response/sub-resources/find-product-schedule-response.interface.d.ts +2 -2
- package/dist/interfaces/products/response/sub-resources/find-product-size-response.interface.d.ts +2 -2
- package/dist/interfaces/products/response/sub-resources/find-product-tag-response.interface.d.ts +2 -2
- package/dist/interfaces/products/response/sub-resources/find-sub-resource-response.interface.d.ts +1 -1
- package/dist/interfaces/products/response/sub-resources/index.d.ts +25 -25
- package/dist/interfaces/products/response/sub-resources/index.js +25 -25
- package/dist/interfaces/products/response/sub-resources/list-product-images-response.interface.d.ts +2 -2
- package/dist/interfaces/products/response/sub-resources/list-product-questions-response.interface.d.ts +2 -2
- package/dist/interfaces/products/response/sub-resources/list-product-recipes-response.interface.d.ts +2 -2
- package/dist/interfaces/products/response/sub-resources/list-product-schedules-response.interface.d.ts +2 -2
- package/dist/interfaces/products/response/sub-resources/list-product-sizes-response.interface.d.ts +2 -2
- package/dist/interfaces/products/response/sub-resources/list-sub-resource-response.interface.d.ts +1 -1
- package/dist/interfaces/products/response/sub-resources/product-schedule-availability.interface.d.ts +1 -1
- package/dist/interfaces/products/response/sub-resources/question-relationship.interface.d.ts +1 -1
- package/dist/interfaces/products/response/sub-resources/recipe-relationship.interface.d.ts +1 -1
- package/dist/interfaces/products/response/sub-resources/replace-sub-products-response.interface.d.ts +1 -1
- package/dist/interfaces/products/response/sub-resources/sub-resource-response.interface.d.ts +1 -1
- package/dist/interfaces/products/response/sub-resources/write-image-response.interface.d.ts +2 -2
- package/dist/interfaces/products/response/sub-resources/write-question-product-response.interface.d.ts +2 -2
- package/dist/interfaces/products/response/sub-resources/write-recipe-response.interface.d.ts +2 -2
- package/dist/interfaces/products/response/sub-resources/write-schedule-response.interface.d.ts +2 -2
- package/dist/interfaces/products/response/sub-resources/write-size-response.interface.d.ts +2 -2
- package/dist/interfaces/questions/index.d.ts +3 -3
- package/dist/interfaces/questions/index.js +3 -3
- package/dist/interfaces/questions/question-response.interface.d.ts +2 -2
- package/dist/interfaces/questions/questions-list-response.interface.d.ts +3 -3
- package/dist/interfaces/restaurants/index.d.ts +3 -3
- package/dist/interfaces/restaurants/index.js +3 -3
- package/dist/interfaces/restaurants/restaurant-response.interface.d.ts +2 -2
- package/dist/interfaces/restaurants/restaurants-list-response.interface.d.ts +3 -3
- package/dist/interfaces/tags/index.d.ts +3 -3
- package/dist/interfaces/tags/index.js +3 -3
- package/dist/interfaces/tags/tag-response.interface.d.ts +2 -2
- package/dist/interfaces/tags/tags-list-response.interface.d.ts +3 -3
- package/dist/interfaces/translations/index.d.ts +3 -3
- package/dist/interfaces/translations/index.js +3 -3
- package/dist/interfaces/translations/translation-response.interface.d.ts +2 -2
- package/dist/interfaces/translations/translations-list-response.interface.d.ts +2 -2
- package/dist/types/index.d.ts +2 -1
- package/dist/types/index.js +2 -1
- package/dist/types/order-mode.type.d.ts +12 -3
- package/dist/types/order-mode.type.js +20 -1
- package/dist/types/order-status.type.d.ts +22 -0
- package/dist/{enums/order-status.enum.d.ts → types/order-status.type.js} +25 -26
- package/package.json +1 -1
- package/tsconfig.json +1 -2
- package/tsconfig.node.json +10 -9
- package/dist/dtos/ingredients/search-by-name.dto.d.ts +0 -18
- package/dist/dtos/ingredients/search-by-name.dto.js +0 -33
- package/dist/dtos/orders/update-order.dto.d.ts +0 -13
- package/dist/dtos/orders/update-order.dto.js +0 -13
- package/dist/dtos/products/submodules/product-tag/create-product-tag.dto.d.ts +0 -24
- package/dist/dtos/products/submodules/product-tag/create-product-tag.dto.js +0 -46
- package/dist/dtos/products/submodules/product-tag/find-product-tag.dto.d.ts +0 -24
- package/dist/dtos/products/submodules/product-tag/find-product-tag.dto.js +0 -46
- package/dist/dtos/questions/search-by-name.dto.d.ts +0 -18
- package/dist/dtos/questions/search-by-name.dto.js +0 -33
- package/dist/dtos/tags/search-by-name.dto.d.ts +0 -18
- package/dist/enums/order-status.enum.js +0 -69
- package/dist/enums/order-type.enum.d.ts +0 -45
- package/dist/enums/order-type.enum.js +0 -46
|
@@ -15,15 +15,17 @@
|
|
|
15
15
|
*
|
|
16
16
|
* @since 2.0.0
|
|
17
17
|
*/
|
|
18
|
-
export * from './auth-commands.constant';
|
|
19
|
-
export * from './category-commands.constant';
|
|
20
|
-
export * from './chain-commands.constant';
|
|
21
|
-
export * from './ingredient-commands.constant';
|
|
22
|
-
export * from './order-commands.constant';
|
|
23
|
-
export * from './payment-commands.constant';
|
|
24
|
-
export * from './payment-events.constant';
|
|
25
|
-
export * from './product-commands.constant';
|
|
26
|
-
export * from './product-events.constant';
|
|
27
|
-
export * from './question-commands.constant';
|
|
28
|
-
export * from './restaurant-commands.constant';
|
|
29
|
-
export * from './tag-commands.constant';
|
|
18
|
+
export * from './auth-commands.constant.js';
|
|
19
|
+
export * from './category-commands.constant.js';
|
|
20
|
+
export * from './chain-commands.constant.js';
|
|
21
|
+
export * from './ingredient-commands.constant.js';
|
|
22
|
+
export * from './order-commands.constant.js';
|
|
23
|
+
export * from './payment-commands.constant.js';
|
|
24
|
+
export * from './payment-events.constant.js';
|
|
25
|
+
export * from './product-commands.constant.js';
|
|
26
|
+
export * from './product-events.constant.js';
|
|
27
|
+
export * from './question-commands.constant.js';
|
|
28
|
+
export * from './restaurant-commands.constant.js';
|
|
29
|
+
export * from './tag-commands.constant.js';
|
|
30
|
+
export * from './translation-commands.constant.js';
|
|
31
|
+
export * from './services-config.constant.js';
|
package/dist/constants/index.js
CHANGED
|
@@ -16,24 +16,28 @@
|
|
|
16
16
|
* @since 2.0.0
|
|
17
17
|
*/
|
|
18
18
|
// Auth commands
|
|
19
|
-
export * from './auth-commands.constant';
|
|
19
|
+
export * from './auth-commands.constant.js';
|
|
20
20
|
// Category commands
|
|
21
|
-
export * from './category-commands.constant';
|
|
21
|
+
export * from './category-commands.constant.js';
|
|
22
22
|
// Chain commands
|
|
23
|
-
export * from './chain-commands.constant';
|
|
23
|
+
export * from './chain-commands.constant.js';
|
|
24
24
|
// Ingredient commands
|
|
25
|
-
export * from './ingredient-commands.constant';
|
|
25
|
+
export * from './ingredient-commands.constant.js';
|
|
26
26
|
// Order commands
|
|
27
|
-
export * from './order-commands.constant';
|
|
27
|
+
export * from './order-commands.constant.js';
|
|
28
28
|
// Payment commands and events
|
|
29
|
-
export * from './payment-commands.constant';
|
|
30
|
-
export * from './payment-events.constant';
|
|
29
|
+
export * from './payment-commands.constant.js';
|
|
30
|
+
export * from './payment-events.constant.js';
|
|
31
31
|
// Product commands and events
|
|
32
|
-
export * from './product-commands.constant';
|
|
33
|
-
export * from './product-events.constant';
|
|
32
|
+
export * from './product-commands.constant.js';
|
|
33
|
+
export * from './product-events.constant.js';
|
|
34
34
|
// Question commands
|
|
35
|
-
export * from './question-commands.constant';
|
|
35
|
+
export * from './question-commands.constant.js';
|
|
36
36
|
// Restaurant commands
|
|
37
|
-
export * from './restaurant-commands.constant';
|
|
37
|
+
export * from './restaurant-commands.constant.js';
|
|
38
38
|
// Tag commands
|
|
39
|
-
export * from './tag-commands.constant';
|
|
39
|
+
export * from './tag-commands.constant.js';
|
|
40
|
+
// Translation commands
|
|
41
|
+
export * from './translation-commands.constant.js';
|
|
42
|
+
// Services config
|
|
43
|
+
export * from './services-config.constant.js';
|
|
@@ -88,10 +88,16 @@ export declare const PRODUCT_COMMANDS: {
|
|
|
88
88
|
readonly IMAGE_REMOVE: "product-image.remove";
|
|
89
89
|
/** Remove all images for a product */
|
|
90
90
|
readonly IMAGE_REMOVE_BY_PRODUCT: "product-image.remove-by-product-id";
|
|
91
|
+
/** Bulk create images for a product */
|
|
92
|
+
readonly IMAGE_BULK_CREATE: "product-image.bulk-create";
|
|
93
|
+
/** Set primary image for a product */
|
|
94
|
+
readonly IMAGE_SET_PRIMARY: "product-image.set-primary";
|
|
91
95
|
/** Create a new question for a product */
|
|
92
96
|
readonly QUESTION_CREATE: "product-question.create";
|
|
93
97
|
/** Retrieve all questions for a product */
|
|
94
98
|
readonly QUESTION_FIND_BY_PRODUCT: "product-question.find-by-product-id";
|
|
99
|
+
/** Retrieve questions for a product filtered by type */
|
|
100
|
+
readonly QUESTION_FIND_BY_PRODUCT_AND_TYPE: "product-question.find-by-product-id-and-type";
|
|
95
101
|
/** Retrieve specific product question by ID */
|
|
96
102
|
readonly QUESTION_FIND_ONE: "product-question.find-one";
|
|
97
103
|
/** Replace all questions for a product */
|
|
@@ -93,11 +93,17 @@ export const PRODUCT_COMMANDS = {
|
|
|
93
93
|
IMAGE_REMOVE: 'product-image.remove',
|
|
94
94
|
/** Remove all images for a product */
|
|
95
95
|
IMAGE_REMOVE_BY_PRODUCT: 'product-image.remove-by-product-id',
|
|
96
|
+
/** Bulk create images for a product */
|
|
97
|
+
IMAGE_BULK_CREATE: 'product-image.bulk-create',
|
|
98
|
+
/** Set primary image for a product */
|
|
99
|
+
IMAGE_SET_PRIMARY: 'product-image.set-primary',
|
|
96
100
|
// === ProductQuestion ===
|
|
97
101
|
/** Create a new question for a product */
|
|
98
102
|
QUESTION_CREATE: 'product-question.create',
|
|
99
103
|
/** Retrieve all questions for a product */
|
|
100
104
|
QUESTION_FIND_BY_PRODUCT: 'product-question.find-by-product-id',
|
|
105
|
+
/** Retrieve questions for a product filtered by type */
|
|
106
|
+
QUESTION_FIND_BY_PRODUCT_AND_TYPE: 'product-question.find-by-product-id-and-type',
|
|
101
107
|
/** Retrieve specific product question by ID */
|
|
102
108
|
QUESTION_FIND_ONE: 'product-question.find-one',
|
|
103
109
|
/** Replace all questions for a product */
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export const SERVICES = { NATS_SERVICE: "NATS_SERVICE" };
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Translation service command subjects.
|
|
3
|
+
*
|
|
4
|
+
* Centralized constant containing all subject/message keys
|
|
5
|
+
* for commands between client(s) and the Translation microservice.
|
|
6
|
+
* Each key corresponds to a MessagePattern used for inter-service communication
|
|
7
|
+
* regarding translation management.
|
|
8
|
+
*
|
|
9
|
+
* Naming convention:
|
|
10
|
+
* - Keys use SCREAMING_SNAKE_CASE.
|
|
11
|
+
* - Subject values use kebab-case between dots, matching the entity domain ('translation').
|
|
12
|
+
*
|
|
13
|
+
* Usage examples:
|
|
14
|
+
* - TRANSLATION_COMMANDS.CREATE: Subject for creating a translation.
|
|
15
|
+
* - TRANSLATION_COMMANDS.FIND_ALL_BY_ENTITY: Subject for retrieving translations by entity.
|
|
16
|
+
* - TRANSLATION_COMMANDS.FIND_ONE: Subject for fetching a specific translation by ID.
|
|
17
|
+
* - TRANSLATION_COMMANDS.UPDATE: Subject for updating a translation.
|
|
18
|
+
* - TRANSLATION_COMMANDS.DELETE: Subject for soft deleting a translation.
|
|
19
|
+
*
|
|
20
|
+
* Centralizing these keys ensures consistency, discoverability, and maintainability.
|
|
21
|
+
*
|
|
22
|
+
* @since 2.0.0
|
|
23
|
+
*/
|
|
24
|
+
export declare const TRANSLATION_COMMANDS: {
|
|
25
|
+
/** Create a new translation */
|
|
26
|
+
readonly CREATE: "translation.create";
|
|
27
|
+
/** Retrieve all translations for a specific entity */
|
|
28
|
+
readonly FIND_ALL_BY_ENTITY: "translation.find-all-by-entity";
|
|
29
|
+
/** Retrieve a specific translation by ID */
|
|
30
|
+
readonly FIND_ONE: "translation.find-one";
|
|
31
|
+
/** Update an existing translation */
|
|
32
|
+
readonly UPDATE: "translation.update";
|
|
33
|
+
/** Soft delete a translation by ID */
|
|
34
|
+
readonly DELETE: "translation.delete";
|
|
35
|
+
};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Translation service command subjects.
|
|
3
|
+
*
|
|
4
|
+
* Centralized constant containing all subject/message keys
|
|
5
|
+
* for commands between client(s) and the Translation microservice.
|
|
6
|
+
* Each key corresponds to a MessagePattern used for inter-service communication
|
|
7
|
+
* regarding translation management.
|
|
8
|
+
*
|
|
9
|
+
* Naming convention:
|
|
10
|
+
* - Keys use SCREAMING_SNAKE_CASE.
|
|
11
|
+
* - Subject values use kebab-case between dots, matching the entity domain ('translation').
|
|
12
|
+
*
|
|
13
|
+
* Usage examples:
|
|
14
|
+
* - TRANSLATION_COMMANDS.CREATE: Subject for creating a translation.
|
|
15
|
+
* - TRANSLATION_COMMANDS.FIND_ALL_BY_ENTITY: Subject for retrieving translations by entity.
|
|
16
|
+
* - TRANSLATION_COMMANDS.FIND_ONE: Subject for fetching a specific translation by ID.
|
|
17
|
+
* - TRANSLATION_COMMANDS.UPDATE: Subject for updating a translation.
|
|
18
|
+
* - TRANSLATION_COMMANDS.DELETE: Subject for soft deleting a translation.
|
|
19
|
+
*
|
|
20
|
+
* Centralizing these keys ensures consistency, discoverability, and maintainability.
|
|
21
|
+
*
|
|
22
|
+
* @since 2.0.0
|
|
23
|
+
*/
|
|
24
|
+
export const TRANSLATION_COMMANDS = {
|
|
25
|
+
/** Create a new translation */
|
|
26
|
+
CREATE: 'translation.create',
|
|
27
|
+
/** Retrieve all translations for a specific entity */
|
|
28
|
+
FIND_ALL_BY_ENTITY: 'translation.find-all-by-entity',
|
|
29
|
+
/** Retrieve a specific translation by ID */
|
|
30
|
+
FIND_ONE: 'translation.find-one',
|
|
31
|
+
/** Update an existing translation */
|
|
32
|
+
UPDATE: 'translation.update',
|
|
33
|
+
/** Soft delete a translation by ID */
|
|
34
|
+
DELETE: 'translation.delete',
|
|
35
|
+
};
|
package/dist/dtos/auth/index.js
CHANGED
|
@@ -7,7 +7,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
7
7
|
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
8
8
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
9
9
|
};
|
|
10
|
-
import { IsEmail, IsString, IsStrongPassword } from 'class-validator';
|
|
10
|
+
import { IsEmail, IsNotEmpty, IsString, IsStrongPassword, MinLength } from 'class-validator';
|
|
11
11
|
/**
|
|
12
12
|
* DTO for user registration requests.
|
|
13
13
|
*
|
|
@@ -40,6 +40,8 @@ export class RegisterUserDto {
|
|
|
40
40
|
}
|
|
41
41
|
__decorate([
|
|
42
42
|
IsString(),
|
|
43
|
+
IsNotEmpty(),
|
|
44
|
+
MinLength(3),
|
|
43
45
|
__metadata("design:type", String)
|
|
44
46
|
], RegisterUserDto.prototype, "name", void 0);
|
|
45
47
|
__decorate([
|
|
@@ -48,6 +50,7 @@ __decorate([
|
|
|
48
50
|
__metadata("design:type", String)
|
|
49
51
|
], RegisterUserDto.prototype, "email", void 0);
|
|
50
52
|
__decorate([
|
|
53
|
+
IsNotEmpty(),
|
|
51
54
|
IsString(),
|
|
52
55
|
IsStrongPassword({
|
|
53
56
|
minLength: 8,
|
|
@@ -7,7 +7,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
7
7
|
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
8
8
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
9
9
|
};
|
|
10
|
-
import { IsString, IsOptional, IsBoolean,
|
|
10
|
+
import { IsString, IsOptional, IsBoolean, IsNotEmpty, MinLength, MaxLength, IsUUID } from 'class-validator';
|
|
11
11
|
/**
|
|
12
12
|
* DTO for creating a new category.
|
|
13
13
|
*
|
|
@@ -49,11 +49,14 @@ export class CreateCategoryDto {
|
|
|
49
49
|
__decorate([
|
|
50
50
|
IsString(),
|
|
51
51
|
IsNotEmpty({ message: 'Category name is required' }),
|
|
52
|
+
MinLength(3),
|
|
52
53
|
__metadata("design:type", String)
|
|
53
54
|
], CreateCategoryDto.prototype, "name", void 0);
|
|
54
55
|
__decorate([
|
|
55
56
|
IsOptional(),
|
|
56
57
|
IsString(),
|
|
58
|
+
MinLength(10),
|
|
59
|
+
MaxLength(200),
|
|
57
60
|
__metadata("design:type", String)
|
|
58
61
|
], CreateCategoryDto.prototype, "description", void 0);
|
|
59
62
|
__decorate([
|
|
@@ -62,8 +65,8 @@ __decorate([
|
|
|
62
65
|
__metadata("design:type", Boolean)
|
|
63
66
|
], CreateCategoryDto.prototype, "status", void 0);
|
|
64
67
|
__decorate([
|
|
65
|
-
IsOptional(),
|
|
66
68
|
IsString(),
|
|
67
|
-
|
|
69
|
+
IsUUID(),
|
|
70
|
+
IsNotEmpty(),
|
|
68
71
|
__metadata("design:type", String)
|
|
69
72
|
], CreateCategoryDto.prototype, "createdBy", void 0);
|
|
@@ -7,7 +7,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
7
7
|
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
8
8
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
9
9
|
};
|
|
10
|
-
import { IsString, IsMongoId, IsUUID } from 'class-validator';
|
|
10
|
+
import { IsString, IsMongoId, IsUUID, IsNotEmpty } from 'class-validator';
|
|
11
11
|
/**
|
|
12
12
|
* DTO for deleting a category.
|
|
13
13
|
*
|
|
@@ -23,7 +23,7 @@ export class DeleteCategoryDto {
|
|
|
23
23
|
*
|
|
24
24
|
* @example "550e8400-e29b-41d4-a716-446655440000"
|
|
25
25
|
*/
|
|
26
|
-
|
|
26
|
+
categoryId;
|
|
27
27
|
/**
|
|
28
28
|
* User who deleted the category.
|
|
29
29
|
* Must be a valid MongoDB ObjectId.
|
|
@@ -35,10 +35,12 @@ export class DeleteCategoryDto {
|
|
|
35
35
|
__decorate([
|
|
36
36
|
IsString(),
|
|
37
37
|
IsUUID(),
|
|
38
|
+
IsNotEmpty(),
|
|
38
39
|
__metadata("design:type", String)
|
|
39
|
-
], DeleteCategoryDto.prototype, "
|
|
40
|
+
], DeleteCategoryDto.prototype, "categoryId", void 0);
|
|
40
41
|
__decorate([
|
|
41
42
|
IsString(),
|
|
42
43
|
IsMongoId(),
|
|
44
|
+
IsNotEmpty(),
|
|
43
45
|
__metadata("design:type", String)
|
|
44
46
|
], DeleteCategoryDto.prototype, "deletedBy", void 0);
|
|
@@ -6,6 +6,6 @@
|
|
|
6
6
|
*
|
|
7
7
|
* @since 2.0.0
|
|
8
8
|
*/
|
|
9
|
-
export * from './create-category.dto';
|
|
10
|
-
export * from './update-category.dto';
|
|
11
|
-
export * from './delete-category.dto';
|
|
9
|
+
export * from './create-category.dto.js';
|
|
10
|
+
export * from './update-category.dto.js';
|
|
11
|
+
export * from './delete-category.dto.js';
|
|
@@ -6,6 +6,6 @@
|
|
|
6
6
|
*
|
|
7
7
|
* @since 2.0.0
|
|
8
8
|
*/
|
|
9
|
-
export * from './create-category.dto';
|
|
10
|
-
export * from './update-category.dto';
|
|
11
|
-
export * from './delete-category.dto';
|
|
9
|
+
export * from './create-category.dto.js';
|
|
10
|
+
export * from './update-category.dto.js';
|
|
11
|
+
export * from './delete-category.dto.js';
|
|
@@ -1,26 +1,45 @@
|
|
|
1
|
-
declare const UpdateCategoryDto_base: import("@nestjs/mapped-types").MappedType<Partial<unknown>>;
|
|
2
1
|
/**
|
|
3
2
|
* DTO for updating an existing category.
|
|
4
3
|
*
|
|
5
|
-
*
|
|
6
|
-
* Used by the Products microservice to
|
|
4
|
+
* Allows partial updates of category details. All fields except `categoryId` and `updatedBy` are optional,
|
|
5
|
+
* permitting fine-grained modifications. Used by the Products microservice to apply changes to product categories.
|
|
7
6
|
*
|
|
8
7
|
* @since 2.0.0
|
|
9
8
|
*/
|
|
10
|
-
export declare class UpdateCategoryDto
|
|
9
|
+
export declare class UpdateCategoryDto {
|
|
11
10
|
/**
|
|
12
|
-
* Category
|
|
13
|
-
*
|
|
11
|
+
* Category name.
|
|
12
|
+
* Optional. If provided, must be a string.
|
|
13
|
+
*
|
|
14
|
+
* @example "Beverages"
|
|
15
|
+
*/
|
|
16
|
+
name?: string;
|
|
17
|
+
/**
|
|
18
|
+
* Category description.
|
|
19
|
+
* Optional. If provided, must be a string.
|
|
20
|
+
*
|
|
21
|
+
* @example "All types of drinks and beverages"
|
|
22
|
+
*/
|
|
23
|
+
description?: string;
|
|
24
|
+
/**
|
|
25
|
+
* Category status (active/inactive).
|
|
26
|
+
* Optional. If provided, must be a boolean.
|
|
27
|
+
*
|
|
28
|
+
* @example true
|
|
29
|
+
*/
|
|
30
|
+
status?: boolean;
|
|
31
|
+
/**
|
|
32
|
+
* Unique identifier of the category to update.
|
|
33
|
+
* Required. Must be a valid UUID string.
|
|
14
34
|
*
|
|
15
35
|
* @example "550e8400-e29b-41d4-a716-446655440000"
|
|
16
36
|
*/
|
|
17
|
-
|
|
37
|
+
categoryId: string;
|
|
18
38
|
/**
|
|
19
|
-
*
|
|
20
|
-
* Must be a valid MongoDB ObjectId
|
|
39
|
+
* Unique identifier of the user performing the update.
|
|
40
|
+
* Required. Must be a valid MongoDB ObjectId.
|
|
21
41
|
*
|
|
22
42
|
* @example "507f1f77bcf86cd799439011"
|
|
23
43
|
*/
|
|
24
|
-
updatedBy
|
|
44
|
+
updatedBy: string;
|
|
25
45
|
}
|
|
26
|
-
export {};
|
|
@@ -7,42 +7,76 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
7
7
|
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
8
8
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
9
9
|
};
|
|
10
|
-
import {
|
|
11
|
-
import { IsString, IsOptional, IsMongoId, IsUUID } from 'class-validator';
|
|
12
|
-
import { CreateCategoryDto } from './create-category.dto';
|
|
10
|
+
import { IsString, IsOptional, IsMongoId, IsUUID, IsBoolean, IsNotEmpty } from 'class-validator';
|
|
13
11
|
/**
|
|
14
12
|
* DTO for updating an existing category.
|
|
15
13
|
*
|
|
16
|
-
*
|
|
17
|
-
* Used by the Products microservice to
|
|
14
|
+
* Allows partial updates of category details. All fields except `categoryId` and `updatedBy` are optional,
|
|
15
|
+
* permitting fine-grained modifications. Used by the Products microservice to apply changes to product categories.
|
|
18
16
|
*
|
|
19
17
|
* @since 2.0.0
|
|
20
18
|
*/
|
|
21
|
-
export class UpdateCategoryDto
|
|
19
|
+
export class UpdateCategoryDto {
|
|
22
20
|
/**
|
|
23
|
-
* Category
|
|
24
|
-
*
|
|
21
|
+
* Category name.
|
|
22
|
+
* Optional. If provided, must be a string.
|
|
23
|
+
*
|
|
24
|
+
* @example "Beverages"
|
|
25
|
+
*/
|
|
26
|
+
name;
|
|
27
|
+
/**
|
|
28
|
+
* Category description.
|
|
29
|
+
* Optional. If provided, must be a string.
|
|
30
|
+
*
|
|
31
|
+
* @example "All types of drinks and beverages"
|
|
32
|
+
*/
|
|
33
|
+
description;
|
|
34
|
+
/**
|
|
35
|
+
* Category status (active/inactive).
|
|
36
|
+
* Optional. If provided, must be a boolean.
|
|
37
|
+
*
|
|
38
|
+
* @example true
|
|
39
|
+
*/
|
|
40
|
+
status;
|
|
41
|
+
/**
|
|
42
|
+
* Unique identifier of the category to update.
|
|
43
|
+
* Required. Must be a valid UUID string.
|
|
25
44
|
*
|
|
26
45
|
* @example "550e8400-e29b-41d4-a716-446655440000"
|
|
27
46
|
*/
|
|
28
|
-
|
|
47
|
+
categoryId;
|
|
29
48
|
/**
|
|
30
|
-
*
|
|
31
|
-
* Must be a valid MongoDB ObjectId
|
|
49
|
+
* Unique identifier of the user performing the update.
|
|
50
|
+
* Required. Must be a valid MongoDB ObjectId.
|
|
32
51
|
*
|
|
33
52
|
* @example "507f1f77bcf86cd799439011"
|
|
34
53
|
*/
|
|
35
54
|
updatedBy;
|
|
36
55
|
}
|
|
37
56
|
__decorate([
|
|
57
|
+
IsOptional(),
|
|
38
58
|
IsString(),
|
|
39
|
-
|
|
59
|
+
__metadata("design:type", String)
|
|
60
|
+
], UpdateCategoryDto.prototype, "name", void 0);
|
|
61
|
+
__decorate([
|
|
62
|
+
IsOptional(),
|
|
63
|
+
IsString(),
|
|
64
|
+
__metadata("design:type", String)
|
|
65
|
+
], UpdateCategoryDto.prototype, "description", void 0);
|
|
66
|
+
__decorate([
|
|
40
67
|
IsOptional(),
|
|
68
|
+
IsBoolean(),
|
|
69
|
+
__metadata("design:type", Boolean)
|
|
70
|
+
], UpdateCategoryDto.prototype, "status", void 0);
|
|
71
|
+
__decorate([
|
|
72
|
+
IsString(),
|
|
73
|
+
IsUUID(),
|
|
74
|
+
IsNotEmpty({ message: 'categoryId is required and must be a valid UUID.' }),
|
|
41
75
|
__metadata("design:type", String)
|
|
42
|
-
], UpdateCategoryDto.prototype, "
|
|
76
|
+
], UpdateCategoryDto.prototype, "categoryId", void 0);
|
|
43
77
|
__decorate([
|
|
44
78
|
IsString(),
|
|
45
79
|
IsMongoId(),
|
|
46
|
-
|
|
80
|
+
IsNotEmpty({ message: 'updatedBy is required and must be a valid MongoId.' }),
|
|
47
81
|
__metadata("design:type", String)
|
|
48
82
|
], UpdateCategoryDto.prototype, "updatedBy", void 0);
|
|
@@ -1,43 +1,42 @@
|
|
|
1
|
-
import { Currency } from '../../enums/currency.enum';
|
|
1
|
+
import { Currency } from '../../enums/currency.enum.js';
|
|
2
2
|
/**
|
|
3
3
|
* DTO for creating a new chain.
|
|
4
4
|
*
|
|
5
5
|
* Used by the Products microservice to create new restaurant chains.
|
|
6
|
-
* Chains represent restaurant brands that
|
|
6
|
+
* Chains represent restaurant brands that may operate multiple locations.
|
|
7
7
|
*
|
|
8
8
|
* @since 2.0.0
|
|
9
9
|
*/
|
|
10
10
|
export declare class CreateChainDto {
|
|
11
11
|
/**
|
|
12
|
-
*
|
|
13
|
-
* Must
|
|
12
|
+
* Name of the chain.
|
|
13
|
+
* Required. Must be a string of at least 3 characters.
|
|
14
14
|
*
|
|
15
15
|
* @example "McDonald's"
|
|
16
16
|
*/
|
|
17
17
|
name: string;
|
|
18
18
|
/**
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
* Defaults to PEN
|
|
19
|
+
* Currency to be used by the entire chain.
|
|
20
|
+
* Optional. If provided, must be a valid currency code defined in the Currency enum.
|
|
21
|
+
* Defaults to PEN.
|
|
22
22
|
*
|
|
23
23
|
* @example Currency.PEN
|
|
24
24
|
* @default Currency.PEN
|
|
25
25
|
*/
|
|
26
26
|
currency?: Currency;
|
|
27
27
|
/**
|
|
28
|
-
* Global tax percentage
|
|
29
|
-
* Must be between 0 and 100
|
|
30
|
-
* Defaults to 0 if not provided.
|
|
28
|
+
* Global tax percentage to apply across the whole chain.
|
|
29
|
+
* Optional. Must be a number between 0 and 100. Defaults to 0.0 (no tax).
|
|
31
30
|
*
|
|
32
31
|
* @example 8.5
|
|
33
32
|
* @default 0.0
|
|
34
33
|
*/
|
|
35
34
|
taxPercent?: number;
|
|
36
35
|
/**
|
|
37
|
-
*
|
|
38
|
-
* Must be a valid MongoDB ObjectId
|
|
36
|
+
* Unique identifier of the user who is creating the chain.
|
|
37
|
+
* Required. Must be a valid MongoDB ObjectId.
|
|
39
38
|
*
|
|
40
39
|
* @example "507f1f77bcf86cd799439011"
|
|
41
40
|
*/
|
|
42
|
-
createdBy
|
|
41
|
+
createdBy: string;
|
|
43
42
|
}
|
|
@@ -7,45 +7,44 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
7
7
|
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
8
8
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
9
9
|
};
|
|
10
|
-
import { IsString, IsOptional, IsNumber, Min, Max, IsEnum, IsMongoId } from 'class-validator';
|
|
11
|
-
import { Currency } from '../../enums/currency.enum';
|
|
10
|
+
import { IsString, IsOptional, IsNumber, Min, Max, IsEnum, IsMongoId, IsNotEmpty, MinLength } from 'class-validator';
|
|
11
|
+
import { Currency } from '../../enums/currency.enum.js';
|
|
12
12
|
/**
|
|
13
13
|
* DTO for creating a new chain.
|
|
14
14
|
*
|
|
15
15
|
* Used by the Products microservice to create new restaurant chains.
|
|
16
|
-
* Chains represent restaurant brands that
|
|
16
|
+
* Chains represent restaurant brands that may operate multiple locations.
|
|
17
17
|
*
|
|
18
18
|
* @since 2.0.0
|
|
19
19
|
*/
|
|
20
20
|
export class CreateChainDto {
|
|
21
21
|
/**
|
|
22
|
-
*
|
|
23
|
-
* Must
|
|
22
|
+
* Name of the chain.
|
|
23
|
+
* Required. Must be a string of at least 3 characters.
|
|
24
24
|
*
|
|
25
25
|
* @example "McDonald's"
|
|
26
26
|
*/
|
|
27
27
|
name;
|
|
28
28
|
/**
|
|
29
|
-
*
|
|
30
|
-
*
|
|
31
|
-
* Defaults to PEN
|
|
29
|
+
* Currency to be used by the entire chain.
|
|
30
|
+
* Optional. If provided, must be a valid currency code defined in the Currency enum.
|
|
31
|
+
* Defaults to PEN.
|
|
32
32
|
*
|
|
33
33
|
* @example Currency.PEN
|
|
34
34
|
* @default Currency.PEN
|
|
35
35
|
*/
|
|
36
36
|
currency = Currency.PEN;
|
|
37
37
|
/**
|
|
38
|
-
* Global tax percentage
|
|
39
|
-
* Must be between 0 and 100
|
|
40
|
-
* Defaults to 0 if not provided.
|
|
38
|
+
* Global tax percentage to apply across the whole chain.
|
|
39
|
+
* Optional. Must be a number between 0 and 100. Defaults to 0.0 (no tax).
|
|
41
40
|
*
|
|
42
41
|
* @example 8.5
|
|
43
42
|
* @default 0.0
|
|
44
43
|
*/
|
|
45
44
|
taxPercent = 0.0;
|
|
46
45
|
/**
|
|
47
|
-
*
|
|
48
|
-
* Must be a valid MongoDB ObjectId
|
|
46
|
+
* Unique identifier of the user who is creating the chain.
|
|
47
|
+
* Required. Must be a valid MongoDB ObjectId.
|
|
49
48
|
*
|
|
50
49
|
* @example "507f1f77bcf86cd799439011"
|
|
51
50
|
*/
|
|
@@ -53,6 +52,8 @@ export class CreateChainDto {
|
|
|
53
52
|
}
|
|
54
53
|
__decorate([
|
|
55
54
|
IsString(),
|
|
55
|
+
IsNotEmpty({ message: 'Chain name is required' }),
|
|
56
|
+
MinLength(3),
|
|
56
57
|
__metadata("design:type", String)
|
|
57
58
|
], CreateChainDto.prototype, "name", void 0);
|
|
58
59
|
__decorate([
|
|
@@ -68,8 +69,8 @@ __decorate([
|
|
|
68
69
|
__metadata("design:type", Number)
|
|
69
70
|
], CreateChainDto.prototype, "taxPercent", void 0);
|
|
70
71
|
__decorate([
|
|
71
|
-
IsOptional(),
|
|
72
72
|
IsString(),
|
|
73
|
-
IsMongoId(),
|
|
73
|
+
IsMongoId({ message: 'createdBy must be a valid MongoDB ObjectId' }),
|
|
74
|
+
IsNotEmpty({ message: 'createdBy is required and must be a valid MongoDB ObjectId' }),
|
|
74
75
|
__metadata("design:type", String)
|
|
75
76
|
], CreateChainDto.prototype, "createdBy", void 0);
|
|
@@ -2,21 +2,21 @@
|
|
|
2
2
|
* DTO for deleting a chain.
|
|
3
3
|
*
|
|
4
4
|
* Used by the Products microservice to soft-delete chains.
|
|
5
|
-
*
|
|
5
|
+
* Holds the chain unique identifier and the user who performed the deletion.
|
|
6
6
|
*
|
|
7
7
|
* @since 2.0.0
|
|
8
8
|
*/
|
|
9
9
|
export declare class DeleteChainDto {
|
|
10
10
|
/**
|
|
11
|
-
*
|
|
12
|
-
* Must be a valid UUID.
|
|
11
|
+
* Unique identifier of the chain to delete.
|
|
12
|
+
* Required. Must be a valid UUID format.
|
|
13
13
|
*
|
|
14
14
|
* @example "550e8400-e29b-41d4-a716-446655440000"
|
|
15
15
|
*/
|
|
16
|
-
|
|
16
|
+
chainId: string;
|
|
17
17
|
/**
|
|
18
|
-
*
|
|
19
|
-
* Must be a valid MongoDB ObjectId.
|
|
18
|
+
* Unique identifier of the user performing the deletion.
|
|
19
|
+
* Required. Must be a valid MongoDB ObjectId.
|
|
20
20
|
*
|
|
21
21
|
* @example "507f1f77bcf86cd799439011"
|
|
22
22
|
*/
|