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
|
@@ -7,26 +7,26 @@ 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
|
|
10
|
+
import { IsString, IsMongoId, IsUUID, IsNotEmpty } from "class-validator";
|
|
11
11
|
/**
|
|
12
12
|
* DTO for deleting a chain.
|
|
13
13
|
*
|
|
14
14
|
* Used by the Products microservice to soft-delete chains.
|
|
15
|
-
*
|
|
15
|
+
* Holds the chain unique identifier and the user who performed the deletion.
|
|
16
16
|
*
|
|
17
17
|
* @since 2.0.0
|
|
18
18
|
*/
|
|
19
19
|
export class DeleteChainDto {
|
|
20
20
|
/**
|
|
21
|
-
*
|
|
22
|
-
* Must be a valid UUID.
|
|
21
|
+
* Unique identifier of the chain to delete.
|
|
22
|
+
* Required. Must be a valid UUID format.
|
|
23
23
|
*
|
|
24
24
|
* @example "550e8400-e29b-41d4-a716-446655440000"
|
|
25
25
|
*/
|
|
26
|
-
|
|
26
|
+
chainId;
|
|
27
27
|
/**
|
|
28
|
-
*
|
|
29
|
-
* Must be a valid MongoDB ObjectId.
|
|
28
|
+
* Unique identifier of the user performing the deletion.
|
|
29
|
+
* Required. Must be a valid MongoDB ObjectId.
|
|
30
30
|
*
|
|
31
31
|
* @example "507f1f77bcf86cd799439011"
|
|
32
32
|
*/
|
|
@@ -35,10 +35,12 @@ export class DeleteChainDto {
|
|
|
35
35
|
__decorate([
|
|
36
36
|
IsString(),
|
|
37
37
|
IsUUID(),
|
|
38
|
+
IsNotEmpty({ message: 'chainId is required and must be a valid UUID.' }),
|
|
38
39
|
__metadata("design:type", String)
|
|
39
|
-
], DeleteChainDto.prototype, "
|
|
40
|
+
], DeleteChainDto.prototype, "chainId", void 0);
|
|
40
41
|
__decorate([
|
|
41
42
|
IsString(),
|
|
42
|
-
IsMongoId(),
|
|
43
|
+
IsMongoId({ message: 'deletedBy must be a valid MongoDB ObjectId.' }),
|
|
44
|
+
IsNotEmpty({ message: 'deletedBy is required and must be a valid MongoDB ObjectId.' }),
|
|
43
45
|
__metadata("design:type", String)
|
|
44
46
|
], DeleteChainDto.prototype, "deletedBy", void 0);
|
|
@@ -6,6 +6,6 @@
|
|
|
6
6
|
*
|
|
7
7
|
* @since 2.0.0
|
|
8
8
|
*/
|
|
9
|
-
export * from './create-chain.dto';
|
|
10
|
-
export * from './update-chain.dto';
|
|
11
|
-
export * from './delete-chain.dto';
|
|
9
|
+
export * from './create-chain.dto.js';
|
|
10
|
+
export * from './update-chain.dto.js';
|
|
11
|
+
export * from './delete-chain.dto.js';
|
package/dist/dtos/chain/index.js
CHANGED
|
@@ -6,6 +6,6 @@
|
|
|
6
6
|
*
|
|
7
7
|
* @since 2.0.0
|
|
8
8
|
*/
|
|
9
|
-
export * from './create-chain.dto';
|
|
10
|
-
export * from './update-chain.dto';
|
|
11
|
-
export * from './delete-chain.dto';
|
|
9
|
+
export * from './create-chain.dto.js';
|
|
10
|
+
export * from './update-chain.dto.js';
|
|
11
|
+
export * from './delete-chain.dto.js';
|
|
@@ -1,26 +1,60 @@
|
|
|
1
|
-
|
|
1
|
+
import { Currency } from "../../enums/currency.enum.js";
|
|
2
2
|
/**
|
|
3
3
|
* DTO for updating an existing chain.
|
|
4
4
|
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
5
|
+
* Provides structure and validation for payloads to update a chain (restaurant brand)
|
|
6
|
+
* in the system. All fields related to chain details are optional to allow partial updates,
|
|
7
|
+
* but identifiers (chainId, updatedBy) are required for correct auditing and entity targeting.
|
|
8
|
+
*
|
|
9
|
+
* Used by the Products microservice to apply modifications to the properties of an existing chain.
|
|
7
10
|
*
|
|
8
11
|
* @since 2.0.0
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* {
|
|
15
|
+
* "chainId": "550e8400-e29b-41d4-a716-446655440000",
|
|
16
|
+
* "name": "McDonald's",
|
|
17
|
+
* "currency": "PEN",
|
|
18
|
+
* "taxPercent": 8.5,
|
|
19
|
+
* "updatedBy": "507f1f77bcf86cd799439011"
|
|
20
|
+
* }
|
|
9
21
|
*/
|
|
10
|
-
export declare class UpdateChainDto
|
|
22
|
+
export declare class UpdateChainDto {
|
|
23
|
+
/**
|
|
24
|
+
* The name of the chain (brand).
|
|
25
|
+
* Optional. If provided, must have at least 3 characters.
|
|
26
|
+
*
|
|
27
|
+
* @example "McDonald's"
|
|
28
|
+
*/
|
|
29
|
+
name?: string;
|
|
30
|
+
/**
|
|
31
|
+
* The currency code for the chain.
|
|
32
|
+
* Optional. Must be a value from the Currency enum if provided.
|
|
33
|
+
*
|
|
34
|
+
* @example Currency.PEN
|
|
35
|
+
* @default Currency.PEN
|
|
36
|
+
*/
|
|
37
|
+
currency?: Currency;
|
|
38
|
+
/**
|
|
39
|
+
* Global tax percentage applied across the chain.
|
|
40
|
+
* Optional. Must be a number between 0 and 100 if provided.
|
|
41
|
+
*
|
|
42
|
+
* @example 8.5
|
|
43
|
+
* @default 0.0
|
|
44
|
+
*/
|
|
45
|
+
taxPercent?: number;
|
|
11
46
|
/**
|
|
12
|
-
*
|
|
13
|
-
* Must be a valid UUID.
|
|
47
|
+
* Unique identifier of the chain to update.
|
|
48
|
+
* Required. Must be a valid UUID string.
|
|
14
49
|
*
|
|
15
50
|
* @example "550e8400-e29b-41d4-a716-446655440000"
|
|
16
51
|
*/
|
|
17
|
-
|
|
52
|
+
chainId: string;
|
|
18
53
|
/**
|
|
19
|
-
*
|
|
20
|
-
* Must be a valid MongoDB ObjectId
|
|
54
|
+
* Unique identifier of the user performing the update.
|
|
55
|
+
* Required. Must be a valid MongoDB ObjectId.
|
|
21
56
|
*
|
|
22
57
|
* @example "507f1f77bcf86cd799439011"
|
|
23
58
|
*/
|
|
24
|
-
updatedBy
|
|
59
|
+
updatedBy: string;
|
|
25
60
|
}
|
|
26
|
-
export {};
|
|
@@ -7,42 +7,94 @@ 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 {
|
|
12
|
-
import { CreateChainDto } from './create-chain.dto';
|
|
10
|
+
import { IsString, IsOptional, IsMongoId, IsUUID, IsNumber, Max, Min, IsEnum, MinLength, IsNotEmpty, } from "class-validator";
|
|
11
|
+
import { Currency } from "../../enums/currency.enum.js";
|
|
13
12
|
/**
|
|
14
13
|
* DTO for updating an existing chain.
|
|
15
14
|
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
15
|
+
* Provides structure and validation for payloads to update a chain (restaurant brand)
|
|
16
|
+
* in the system. All fields related to chain details are optional to allow partial updates,
|
|
17
|
+
* but identifiers (chainId, updatedBy) are required for correct auditing and entity targeting.
|
|
18
|
+
*
|
|
19
|
+
* Used by the Products microservice to apply modifications to the properties of an existing chain.
|
|
18
20
|
*
|
|
19
21
|
* @since 2.0.0
|
|
22
|
+
*
|
|
23
|
+
* @example
|
|
24
|
+
* {
|
|
25
|
+
* "chainId": "550e8400-e29b-41d4-a716-446655440000",
|
|
26
|
+
* "name": "McDonald's",
|
|
27
|
+
* "currency": "PEN",
|
|
28
|
+
* "taxPercent": 8.5,
|
|
29
|
+
* "updatedBy": "507f1f77bcf86cd799439011"
|
|
30
|
+
* }
|
|
20
31
|
*/
|
|
21
|
-
export class UpdateChainDto
|
|
32
|
+
export class UpdateChainDto {
|
|
33
|
+
/**
|
|
34
|
+
* The name of the chain (brand).
|
|
35
|
+
* Optional. If provided, must have at least 3 characters.
|
|
36
|
+
*
|
|
37
|
+
* @example "McDonald's"
|
|
38
|
+
*/
|
|
39
|
+
name;
|
|
40
|
+
/**
|
|
41
|
+
* The currency code for the chain.
|
|
42
|
+
* Optional. Must be a value from the Currency enum if provided.
|
|
43
|
+
*
|
|
44
|
+
* @example Currency.PEN
|
|
45
|
+
* @default Currency.PEN
|
|
46
|
+
*/
|
|
47
|
+
currency = Currency.PEN;
|
|
48
|
+
/**
|
|
49
|
+
* Global tax percentage applied across the chain.
|
|
50
|
+
* Optional. Must be a number between 0 and 100 if provided.
|
|
51
|
+
*
|
|
52
|
+
* @example 8.5
|
|
53
|
+
* @default 0.0
|
|
54
|
+
*/
|
|
55
|
+
taxPercent = 0.0;
|
|
22
56
|
/**
|
|
23
|
-
*
|
|
24
|
-
* Must be a valid UUID.
|
|
57
|
+
* Unique identifier of the chain to update.
|
|
58
|
+
* Required. Must be a valid UUID string.
|
|
25
59
|
*
|
|
26
60
|
* @example "550e8400-e29b-41d4-a716-446655440000"
|
|
27
61
|
*/
|
|
28
|
-
|
|
62
|
+
chainId;
|
|
29
63
|
/**
|
|
30
|
-
*
|
|
31
|
-
* Must be a valid MongoDB ObjectId
|
|
64
|
+
* Unique identifier of the user performing the update.
|
|
65
|
+
* Required. Must be a valid MongoDB ObjectId.
|
|
32
66
|
*
|
|
33
67
|
* @example "507f1f77bcf86cd799439011"
|
|
34
68
|
*/
|
|
35
69
|
updatedBy;
|
|
36
70
|
}
|
|
37
71
|
__decorate([
|
|
72
|
+
IsOptional(),
|
|
38
73
|
IsString(),
|
|
39
|
-
|
|
74
|
+
MinLength(3, { message: 'Chain name must be at least 3 characters' }),
|
|
75
|
+
__metadata("design:type", String)
|
|
76
|
+
], UpdateChainDto.prototype, "name", void 0);
|
|
77
|
+
__decorate([
|
|
40
78
|
IsOptional(),
|
|
79
|
+
IsEnum(Currency, { message: "Currency must be a valid currency code" }),
|
|
41
80
|
__metadata("design:type", String)
|
|
42
|
-
], UpdateChainDto.prototype, "
|
|
81
|
+
], UpdateChainDto.prototype, "currency", void 0);
|
|
43
82
|
__decorate([
|
|
44
|
-
IsString(),
|
|
45
|
-
IsMongoId(),
|
|
46
83
|
IsOptional(),
|
|
84
|
+
IsNumber({}, { message: "Tax percentage must be a number" }),
|
|
85
|
+
Min(0, { message: "Tax percentage must be at least 0" }),
|
|
86
|
+
Max(100, { message: "Tax percentage must be at most 100" }),
|
|
87
|
+
__metadata("design:type", Number)
|
|
88
|
+
], UpdateChainDto.prototype, "taxPercent", void 0);
|
|
89
|
+
__decorate([
|
|
90
|
+
IsString(),
|
|
91
|
+
IsUUID(),
|
|
92
|
+
IsNotEmpty({ message: 'chainId is required and must be a valid UUID.' }),
|
|
93
|
+
__metadata("design:type", String)
|
|
94
|
+
], UpdateChainDto.prototype, "chainId", void 0);
|
|
95
|
+
__decorate([
|
|
96
|
+
IsString(),
|
|
97
|
+
IsMongoId({ message: 'updatedBy must be a valid MongoDB ObjectId.' }),
|
|
98
|
+
IsNotEmpty({ message: 'updatedBy is required and must be a valid MongoDB ObjectId.' }),
|
|
47
99
|
__metadata("design:type", String)
|
|
48
100
|
], UpdateChainDto.prototype, "updatedBy", void 0);
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { PaginationDto } from './pagination.dto.js';
|
|
2
|
+
/**
|
|
3
|
+
* DTO for searching entities by name.
|
|
4
|
+
*
|
|
5
|
+
* This class extends PaginationDto and is designed to be used as a base
|
|
6
|
+
* DTO for search operations where a search by text (typically a name)
|
|
7
|
+
* is required. It is used across multiple modules to standardize
|
|
8
|
+
* search-by-name functionality and provide pagination support.
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* {
|
|
12
|
+
* "name": "cheese",
|
|
13
|
+
* "page": 1,
|
|
14
|
+
* "limit": 10
|
|
15
|
+
* }
|
|
16
|
+
*
|
|
17
|
+
* @since 2.0.0
|
|
18
|
+
*/
|
|
19
|
+
export declare class SearchByNameDto extends PaginationDto {
|
|
20
|
+
/**
|
|
21
|
+
* The search term for the entity name.
|
|
22
|
+
* Must be a non-empty string.
|
|
23
|
+
*
|
|
24
|
+
* @example "vegetarian"
|
|
25
|
+
*/
|
|
26
|
+
name: string;
|
|
27
|
+
}
|
|
@@ -7,20 +7,29 @@ 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 { PaginationDto } from '
|
|
10
|
+
import { IsNotEmpty, IsString } from 'class-validator';
|
|
11
|
+
import { PaginationDto } from './pagination.dto.js';
|
|
12
12
|
/**
|
|
13
|
-
* DTO for searching
|
|
13
|
+
* DTO for searching entities by name.
|
|
14
14
|
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
15
|
+
* This class extends PaginationDto and is designed to be used as a base
|
|
16
|
+
* DTO for search operations where a search by text (typically a name)
|
|
17
|
+
* is required. It is used across multiple modules to standardize
|
|
18
|
+
* search-by-name functionality and provide pagination support.
|
|
19
|
+
*
|
|
20
|
+
* @example
|
|
21
|
+
* {
|
|
22
|
+
* "name": "cheese",
|
|
23
|
+
* "page": 1,
|
|
24
|
+
* "limit": 10
|
|
25
|
+
* }
|
|
17
26
|
*
|
|
18
27
|
* @since 2.0.0
|
|
19
28
|
*/
|
|
20
|
-
export class
|
|
29
|
+
export class SearchByNameDto extends PaginationDto {
|
|
21
30
|
/**
|
|
22
|
-
*
|
|
23
|
-
* Must
|
|
31
|
+
* The search term for the entity name.
|
|
32
|
+
* Must be a non-empty string.
|
|
24
33
|
*
|
|
25
34
|
* @example "vegetarian"
|
|
26
35
|
*/
|
|
@@ -30,4 +39,4 @@ __decorate([
|
|
|
30
39
|
IsString(),
|
|
31
40
|
IsNotEmpty({ message: 'Search term is required' }),
|
|
32
41
|
__metadata("design:type", String)
|
|
33
|
-
],
|
|
42
|
+
], SearchByNameDto.prototype, "name", void 0);
|
package/dist/dtos/index.d.ts
CHANGED
|
@@ -14,15 +14,15 @@
|
|
|
14
14
|
*
|
|
15
15
|
* @since 2.0.0
|
|
16
16
|
*/
|
|
17
|
-
export * from "./common";
|
|
18
|
-
export * from "./auth";
|
|
19
|
-
export * from "./orders";
|
|
20
|
-
export * from "./payments";
|
|
21
|
-
export * from "./products";
|
|
22
|
-
export * from "./categories";
|
|
23
|
-
export * from "./restaurants";
|
|
24
|
-
export * from "./chain";
|
|
25
|
-
export * from "./tags";
|
|
26
|
-
export * from "./ingredients";
|
|
27
|
-
export * from "./questions";
|
|
28
|
-
export * from "./translations";
|
|
17
|
+
export * from "./common/index.js";
|
|
18
|
+
export * from "./auth/index.js";
|
|
19
|
+
export * from "./orders/index.js";
|
|
20
|
+
export * from "./payments/index.js";
|
|
21
|
+
export * from "./products/index.js";
|
|
22
|
+
export * from "./categories/index.js";
|
|
23
|
+
export * from "./restaurants/index.js";
|
|
24
|
+
export * from "./chain/index.js";
|
|
25
|
+
export * from "./tags/index.js";
|
|
26
|
+
export * from "./ingredients/index.js";
|
|
27
|
+
export * from "./questions/index.js";
|
|
28
|
+
export * from "./translations/index.js";
|
package/dist/dtos/index.js
CHANGED
|
@@ -15,26 +15,26 @@
|
|
|
15
15
|
* @since 2.0.0
|
|
16
16
|
*/
|
|
17
17
|
// Common DTOs
|
|
18
|
-
export * from "./common";
|
|
18
|
+
export * from "./common/index.js";
|
|
19
19
|
// Auth DTOs
|
|
20
|
-
export * from "./auth";
|
|
20
|
+
export * from "./auth/index.js";
|
|
21
21
|
// Order DTOs
|
|
22
|
-
export * from "./orders";
|
|
22
|
+
export * from "./orders/index.js";
|
|
23
23
|
// Payment DTOs
|
|
24
|
-
export * from "./payments";
|
|
24
|
+
export * from "./payments/index.js";
|
|
25
25
|
// Product DTOs
|
|
26
|
-
export * from "./products";
|
|
26
|
+
export * from "./products/index.js";
|
|
27
27
|
// Category DTOs
|
|
28
|
-
export * from "./categories";
|
|
28
|
+
export * from "./categories/index.js";
|
|
29
29
|
// Restaurant DTOs
|
|
30
|
-
export * from "./restaurants";
|
|
30
|
+
export * from "./restaurants/index.js";
|
|
31
31
|
// Chain DTOs
|
|
32
|
-
export * from "./chain";
|
|
32
|
+
export * from "./chain/index.js";
|
|
33
33
|
// Tag DTOs
|
|
34
|
-
export * from "./tags";
|
|
34
|
+
export * from "./tags/index.js";
|
|
35
35
|
// Ingredient DTOs
|
|
36
|
-
export * from "./ingredients";
|
|
36
|
+
export * from "./ingredients/index.js";
|
|
37
37
|
// Question DTOs
|
|
38
|
-
export * from "./questions";
|
|
38
|
+
export * from "./questions/index.js";
|
|
39
39
|
// Translations DTOs
|
|
40
|
-
export * from "./translations";
|
|
40
|
+
export * from "./translations/index.js";
|
|
@@ -2,27 +2,27 @@
|
|
|
2
2
|
* DTO for creating a new ingredient.
|
|
3
3
|
*
|
|
4
4
|
* Used by the Products microservice to create new ingredients.
|
|
5
|
-
* Ingredients are
|
|
5
|
+
* Ingredients are utilized in recipes and inventory management.
|
|
6
6
|
*
|
|
7
7
|
* @since 2.0.0
|
|
8
8
|
*/
|
|
9
9
|
export declare class CreateIngredientDto {
|
|
10
10
|
/**
|
|
11
|
-
*
|
|
12
|
-
* Must not be empty and maximum length of
|
|
11
|
+
* Ingredient name.
|
|
12
|
+
* Must not be empty and must have a maximum length of 25 characters.
|
|
13
13
|
*
|
|
14
14
|
* @example "Tomato"
|
|
15
15
|
*/
|
|
16
16
|
name: string;
|
|
17
17
|
/**
|
|
18
18
|
* Unit of measurement for the ingredient.
|
|
19
|
-
* Must not be empty and maximum length of
|
|
19
|
+
* Must not be empty and must have a maximum length of 12 characters.
|
|
20
20
|
*
|
|
21
21
|
* @example "kg"
|
|
22
22
|
*/
|
|
23
23
|
unit: string;
|
|
24
24
|
/**
|
|
25
|
-
* User who created the ingredient.
|
|
25
|
+
* User ID of the user who created the ingredient.
|
|
26
26
|
* Must be a valid MongoDB ObjectId.
|
|
27
27
|
*
|
|
28
28
|
* @example "507f1f77bcf86cd799439011"
|
|
@@ -12,27 +12,27 @@ import { IsString, IsNotEmpty, MaxLength, IsMongoId } from 'class-validator';
|
|
|
12
12
|
* DTO for creating a new ingredient.
|
|
13
13
|
*
|
|
14
14
|
* Used by the Products microservice to create new ingredients.
|
|
15
|
-
* Ingredients are
|
|
15
|
+
* Ingredients are utilized in recipes and inventory management.
|
|
16
16
|
*
|
|
17
17
|
* @since 2.0.0
|
|
18
18
|
*/
|
|
19
19
|
export class CreateIngredientDto {
|
|
20
20
|
/**
|
|
21
|
-
*
|
|
22
|
-
* Must not be empty and maximum length of
|
|
21
|
+
* Ingredient name.
|
|
22
|
+
* Must not be empty and must have a maximum length of 25 characters.
|
|
23
23
|
*
|
|
24
24
|
* @example "Tomato"
|
|
25
25
|
*/
|
|
26
26
|
name;
|
|
27
27
|
/**
|
|
28
28
|
* Unit of measurement for the ingredient.
|
|
29
|
-
* Must not be empty and maximum length of
|
|
29
|
+
* Must not be empty and must have a maximum length of 12 characters.
|
|
30
30
|
*
|
|
31
31
|
* @example "kg"
|
|
32
32
|
*/
|
|
33
33
|
unit;
|
|
34
34
|
/**
|
|
35
|
-
* User who created the ingredient.
|
|
35
|
+
* User ID of the user who created the ingredient.
|
|
36
36
|
* Must be a valid MongoDB ObjectId.
|
|
37
37
|
*
|
|
38
38
|
* @example "507f1f77bcf86cd799439011"
|
|
@@ -42,17 +42,18 @@ export class CreateIngredientDto {
|
|
|
42
42
|
__decorate([
|
|
43
43
|
IsString(),
|
|
44
44
|
IsNotEmpty({ message: 'Ingredient name is required' }),
|
|
45
|
-
MaxLength(
|
|
45
|
+
MaxLength(25, { message: 'Ingredient name must be at most 25 characters' }),
|
|
46
46
|
__metadata("design:type", String)
|
|
47
47
|
], CreateIngredientDto.prototype, "name", void 0);
|
|
48
48
|
__decorate([
|
|
49
49
|
IsString(),
|
|
50
50
|
IsNotEmpty({ message: 'Unit is required' }),
|
|
51
|
-
MaxLength(
|
|
51
|
+
MaxLength(12, { message: 'Unit must be at most 12 characters' }),
|
|
52
52
|
__metadata("design:type", String)
|
|
53
53
|
], CreateIngredientDto.prototype, "unit", void 0);
|
|
54
54
|
__decorate([
|
|
55
55
|
IsString(),
|
|
56
|
-
IsMongoId(),
|
|
56
|
+
IsMongoId({ message: 'createdBy must be a valid MongoDB ObjectId' }),
|
|
57
|
+
IsNotEmpty({ message: 'createdBy is required and must be a valid MongoDB ObjectId' }),
|
|
57
58
|
__metadata("design:type", String)
|
|
58
59
|
], CreateIngredientDto.prototype, "createdBy", void 0);
|
|
@@ -1,22 +1,29 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* DTO for deleting an ingredient.
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
4
|
+
* Provides structure and validation for requests to soft-delete ingredients
|
|
5
|
+
* in the system. Used by the Products microservice to safely remove ingredient records.
|
|
6
|
+
* Captures which ingredient is being deleted and which user performs the operation for audit purposes.
|
|
6
7
|
*
|
|
7
8
|
* @since 2.0.0
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* {
|
|
12
|
+
* "ingredientId": "550e8400-e29b-41d4-a716-446655440000",
|
|
13
|
+
* "deletedBy": "507f1f77bcf86cd799439011"
|
|
14
|
+
* }
|
|
8
15
|
*/
|
|
9
16
|
export declare class DeleteIngredientDto {
|
|
10
17
|
/**
|
|
11
|
-
*
|
|
12
|
-
* Must be a valid UUID.
|
|
18
|
+
* Unique identifier of the ingredient to delete.
|
|
19
|
+
* Required. Must be a valid UUID string.
|
|
13
20
|
*
|
|
14
21
|
* @example "550e8400-e29b-41d4-a716-446655440000"
|
|
15
22
|
*/
|
|
16
|
-
|
|
23
|
+
ingredientId: string;
|
|
17
24
|
/**
|
|
18
|
-
*
|
|
19
|
-
* Must be a valid MongoDB ObjectId.
|
|
25
|
+
* Unique identifier of the user performing the deletion.
|
|
26
|
+
* Required. Must be a valid MongoDB ObjectId.
|
|
20
27
|
*
|
|
21
28
|
* @example "507f1f77bcf86cd799439011"
|
|
22
29
|
*/
|
|
@@ -7,37 +7,46 @@ 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 an ingredient.
|
|
13
13
|
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
14
|
+
* Provides structure and validation for requests to soft-delete ingredients
|
|
15
|
+
* in the system. Used by the Products microservice to safely remove ingredient records.
|
|
16
|
+
* Captures which ingredient is being deleted and which user performs the operation for audit purposes.
|
|
16
17
|
*
|
|
17
18
|
* @since 2.0.0
|
|
19
|
+
*
|
|
20
|
+
* @example
|
|
21
|
+
* {
|
|
22
|
+
* "ingredientId": "550e8400-e29b-41d4-a716-446655440000",
|
|
23
|
+
* "deletedBy": "507f1f77bcf86cd799439011"
|
|
24
|
+
* }
|
|
18
25
|
*/
|
|
19
26
|
export class DeleteIngredientDto {
|
|
20
27
|
/**
|
|
21
|
-
*
|
|
22
|
-
* Must be a valid UUID.
|
|
28
|
+
* Unique identifier of the ingredient to delete.
|
|
29
|
+
* Required. Must be a valid UUID string.
|
|
23
30
|
*
|
|
24
31
|
* @example "550e8400-e29b-41d4-a716-446655440000"
|
|
25
32
|
*/
|
|
26
|
-
|
|
33
|
+
ingredientId;
|
|
27
34
|
/**
|
|
28
|
-
*
|
|
29
|
-
* Must be a valid MongoDB ObjectId.
|
|
35
|
+
* Unique identifier of the user performing the deletion.
|
|
36
|
+
* Required. Must be a valid MongoDB ObjectId.
|
|
30
37
|
*
|
|
31
38
|
* @example "507f1f77bcf86cd799439011"
|
|
32
39
|
*/
|
|
33
40
|
deletedBy;
|
|
34
41
|
}
|
|
35
42
|
__decorate([
|
|
43
|
+
IsNotEmpty({ message: 'ingredientId is required and must be a valid UUID.' }),
|
|
36
44
|
IsString(),
|
|
37
45
|
IsUUID(),
|
|
38
46
|
__metadata("design:type", String)
|
|
39
|
-
], DeleteIngredientDto.prototype, "
|
|
47
|
+
], DeleteIngredientDto.prototype, "ingredientId", void 0);
|
|
40
48
|
__decorate([
|
|
49
|
+
IsNotEmpty({ message: 'deletedBy is required and must be a valid MongoDB ObjectId.' }),
|
|
41
50
|
IsString(),
|
|
42
51
|
IsMongoId(),
|
|
43
52
|
__metadata("design:type", String)
|
|
@@ -6,7 +6,6 @@
|
|
|
6
6
|
*
|
|
7
7
|
* @since 2.0.0
|
|
8
8
|
*/
|
|
9
|
-
export * from './create-ingredient.dto';
|
|
10
|
-
export * from './update-ingredient.dto';
|
|
11
|
-
export * from './delete-ingredient.dto';
|
|
12
|
-
export * from './search-by-name.dto';
|
|
9
|
+
export * from './create-ingredient.dto.js';
|
|
10
|
+
export * from './update-ingredient.dto.js';
|
|
11
|
+
export * from './delete-ingredient.dto.js';
|
|
@@ -6,7 +6,6 @@
|
|
|
6
6
|
*
|
|
7
7
|
* @since 2.0.0
|
|
8
8
|
*/
|
|
9
|
-
export * from './create-ingredient.dto';
|
|
10
|
-
export * from './update-ingredient.dto';
|
|
11
|
-
export * from './delete-ingredient.dto';
|
|
12
|
-
export * from './search-by-name.dto';
|
|
9
|
+
export * from './create-ingredient.dto.js';
|
|
10
|
+
export * from './update-ingredient.dto.js';
|
|
11
|
+
export * from './delete-ingredient.dto.js';
|