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
|
@@ -1,26 +1,47 @@
|
|
|
1
|
-
declare const UpdateIngredientDto_base: import("@nestjs/mapped-types").MappedType<Partial<unknown>>;
|
|
2
1
|
/**
|
|
3
2
|
* DTO for updating an existing ingredient.
|
|
4
3
|
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
4
|
+
* Provides structure and validation for payloads to update ingredient data within the system.
|
|
5
|
+
* Permits partial updates: only the provided fields will be updated.
|
|
6
|
+
* Used by the Products microservice to modify ingredient details.
|
|
7
7
|
*
|
|
8
8
|
* @since 2.0.0
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* {
|
|
12
|
+
* "ingredientId": "550e8400-e29b-41d4-a716-446655440000",
|
|
13
|
+
* "name": "Tomato",
|
|
14
|
+
* "unit": "kg",
|
|
15
|
+
* "updatedBy": "507f1f77bcf86cd799439011"
|
|
16
|
+
* }
|
|
9
17
|
*/
|
|
10
|
-
export declare class UpdateIngredientDto
|
|
18
|
+
export declare class UpdateIngredientDto {
|
|
19
|
+
/**
|
|
20
|
+
* Ingredient name.
|
|
21
|
+
* Optional. If provided, must be a string with a maximum length of 25 characters.
|
|
22
|
+
*
|
|
23
|
+
* @example "Tomato"
|
|
24
|
+
*/
|
|
25
|
+
name?: string;
|
|
26
|
+
/**
|
|
27
|
+
* Unit of measurement for the ingredient.
|
|
28
|
+
* Optional. If provided, must be a string with a maximum length of 12 characters.
|
|
29
|
+
*
|
|
30
|
+
* @example "kg"
|
|
31
|
+
*/
|
|
32
|
+
unit?: string;
|
|
11
33
|
/**
|
|
12
|
-
*
|
|
13
|
-
* Must be a valid UUID.
|
|
34
|
+
* Unique identifier of the ingredient to update.
|
|
35
|
+
* Required. Must be a valid UUID string.
|
|
14
36
|
*
|
|
15
37
|
* @example "550e8400-e29b-41d4-a716-446655440000"
|
|
16
38
|
*/
|
|
17
|
-
|
|
39
|
+
ingredientId: string;
|
|
18
40
|
/**
|
|
19
|
-
*
|
|
20
|
-
* Must be a valid MongoDB ObjectId
|
|
41
|
+
* Unique identifier of the user performing the update.
|
|
42
|
+
* Required. Must be a valid MongoDB ObjectId.
|
|
21
43
|
*
|
|
22
44
|
* @example "507f1f77bcf86cd799439011"
|
|
23
45
|
*/
|
|
24
|
-
updatedBy
|
|
46
|
+
updatedBy: string;
|
|
25
47
|
}
|
|
26
|
-
export {};
|
|
@@ -7,42 +7,75 @@ 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 { CreateIngredientDto } from './create-ingredient.dto';
|
|
10
|
+
import { IsString, IsOptional, IsMongoId, IsUUID, MaxLength, IsNotEmpty, } from "class-validator";
|
|
13
11
|
/**
|
|
14
12
|
* DTO for updating an existing ingredient.
|
|
15
13
|
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
14
|
+
* Provides structure and validation for payloads to update ingredient data within the system.
|
|
15
|
+
* Permits partial updates: only the provided fields will be updated.
|
|
16
|
+
* Used by the Products microservice to modify ingredient details.
|
|
18
17
|
*
|
|
19
18
|
* @since 2.0.0
|
|
19
|
+
*
|
|
20
|
+
* @example
|
|
21
|
+
* {
|
|
22
|
+
* "ingredientId": "550e8400-e29b-41d4-a716-446655440000",
|
|
23
|
+
* "name": "Tomato",
|
|
24
|
+
* "unit": "kg",
|
|
25
|
+
* "updatedBy": "507f1f77bcf86cd799439011"
|
|
26
|
+
* }
|
|
20
27
|
*/
|
|
21
|
-
export class UpdateIngredientDto
|
|
28
|
+
export class UpdateIngredientDto {
|
|
22
29
|
/**
|
|
23
|
-
* Ingredient
|
|
24
|
-
*
|
|
30
|
+
* Ingredient name.
|
|
31
|
+
* Optional. If provided, must be a string with a maximum length of 25 characters.
|
|
32
|
+
*
|
|
33
|
+
* @example "Tomato"
|
|
34
|
+
*/
|
|
35
|
+
name;
|
|
36
|
+
/**
|
|
37
|
+
* Unit of measurement for the ingredient.
|
|
38
|
+
* Optional. If provided, must be a string with a maximum length of 12 characters.
|
|
39
|
+
*
|
|
40
|
+
* @example "kg"
|
|
41
|
+
*/
|
|
42
|
+
unit;
|
|
43
|
+
/**
|
|
44
|
+
* Unique identifier of the ingredient to update.
|
|
45
|
+
* Required. Must be a valid UUID string.
|
|
25
46
|
*
|
|
26
47
|
* @example "550e8400-e29b-41d4-a716-446655440000"
|
|
27
48
|
*/
|
|
28
|
-
|
|
49
|
+
ingredientId;
|
|
29
50
|
/**
|
|
30
|
-
*
|
|
31
|
-
* Must be a valid MongoDB ObjectId
|
|
51
|
+
* Unique identifier of the user performing the update.
|
|
52
|
+
* Required. Must be a valid MongoDB ObjectId.
|
|
32
53
|
*
|
|
33
54
|
* @example "507f1f77bcf86cd799439011"
|
|
34
55
|
*/
|
|
35
56
|
updatedBy;
|
|
36
57
|
}
|
|
37
58
|
__decorate([
|
|
59
|
+
IsOptional(),
|
|
38
60
|
IsString(),
|
|
39
|
-
|
|
61
|
+
MaxLength(25, { message: "Ingredient name must be at most 25 characters" }),
|
|
62
|
+
__metadata("design:type", String)
|
|
63
|
+
], UpdateIngredientDto.prototype, "name", void 0);
|
|
64
|
+
__decorate([
|
|
40
65
|
IsOptional(),
|
|
66
|
+
IsString(),
|
|
67
|
+
MaxLength(12, { message: "Unit must be at most 12 characters" }),
|
|
41
68
|
__metadata("design:type", String)
|
|
42
|
-
], UpdateIngredientDto.prototype, "
|
|
69
|
+
], UpdateIngredientDto.prototype, "unit", void 0);
|
|
43
70
|
__decorate([
|
|
44
71
|
IsString(),
|
|
45
|
-
|
|
46
|
-
|
|
72
|
+
IsUUID(),
|
|
73
|
+
IsNotEmpty({ message: 'ingredientId is required and must be a valid UUID.' }),
|
|
74
|
+
__metadata("design:type", String)
|
|
75
|
+
], UpdateIngredientDto.prototype, "ingredientId", void 0);
|
|
76
|
+
__decorate([
|
|
77
|
+
IsString(),
|
|
78
|
+
IsMongoId({ message: 'updatedBy must be a valid MongoDB ObjectId.' }),
|
|
79
|
+
IsNotEmpty({ message: 'updatedBy is required and must be a valid MongoDB ObjectId.' }),
|
|
47
80
|
__metadata("design:type", String)
|
|
48
81
|
], UpdateIngredientDto.prototype, "updatedBy", void 0);
|
|
@@ -1,25 +1,34 @@
|
|
|
1
|
-
import { OrderStatus } from
|
|
1
|
+
import type { OrderStatus } from "../../types/order-status.type.js";
|
|
2
2
|
/**
|
|
3
|
-
* DTO for changing an order
|
|
3
|
+
* Data Transfer Object (DTO) for changing the status of an order.
|
|
4
4
|
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
5
|
+
* This DTO is used by the Orders microservice to request a status change for an existing order.
|
|
6
|
+
* It ensures that the required order identifier and the new order status are both valid.
|
|
7
7
|
*
|
|
8
|
+
* @class ChangeOrderStatusDto
|
|
8
9
|
* @since 2.0.0
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* {
|
|
13
|
+
* "orderId": "550e8400-e29b-41d4-a716-446655440000",
|
|
14
|
+
* "status": "CONFIRMED"
|
|
15
|
+
* }
|
|
9
16
|
*/
|
|
10
17
|
export declare class ChangeOrderStatusDto {
|
|
11
18
|
/**
|
|
12
|
-
* Unique identifier of the order to
|
|
13
|
-
* Must be a valid UUID version 4.
|
|
19
|
+
* Unique identifier of the order whose status is to be updated.
|
|
20
|
+
* Must be a valid UUID (version 4).
|
|
14
21
|
*
|
|
22
|
+
* @type {string}
|
|
15
23
|
* @example "550e8400-e29b-41d4-a716-446655440000"
|
|
16
24
|
*/
|
|
17
|
-
|
|
25
|
+
orderId: string;
|
|
18
26
|
/**
|
|
19
|
-
* New status for the order.
|
|
20
|
-
* Must be a valid OrderStatus enum
|
|
27
|
+
* New status value to set for the order.
|
|
28
|
+
* Must be a valid value from the OrderStatus enum.
|
|
21
29
|
*
|
|
22
|
-
* @
|
|
30
|
+
* @type {OrderStatus}
|
|
31
|
+
* @example "CONFIRMED"
|
|
23
32
|
*/
|
|
24
33
|
status: OrderStatus;
|
|
25
34
|
}
|
|
@@ -7,37 +7,50 @@ 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 {
|
|
10
|
+
import { IsIn, IsNotEmpty, IsString, IsUUID } from "class-validator";
|
|
11
|
+
import { ORDER_STATUS } from "../../types/order-status.type.js";
|
|
12
12
|
/**
|
|
13
|
-
* DTO for changing an order
|
|
13
|
+
* Data Transfer Object (DTO) for changing the status of an order.
|
|
14
14
|
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
15
|
+
* This DTO is used by the Orders microservice to request a status change for an existing order.
|
|
16
|
+
* It ensures that the required order identifier and the new order status are both valid.
|
|
17
17
|
*
|
|
18
|
+
* @class ChangeOrderStatusDto
|
|
18
19
|
* @since 2.0.0
|
|
20
|
+
*
|
|
21
|
+
* @example
|
|
22
|
+
* {
|
|
23
|
+
* "orderId": "550e8400-e29b-41d4-a716-446655440000",
|
|
24
|
+
* "status": "CONFIRMED"
|
|
25
|
+
* }
|
|
19
26
|
*/
|
|
20
27
|
export class ChangeOrderStatusDto {
|
|
21
28
|
/**
|
|
22
|
-
* Unique identifier of the order to
|
|
23
|
-
* Must be a valid UUID version 4.
|
|
29
|
+
* Unique identifier of the order whose status is to be updated.
|
|
30
|
+
* Must be a valid UUID (version 4).
|
|
24
31
|
*
|
|
32
|
+
* @type {string}
|
|
25
33
|
* @example "550e8400-e29b-41d4-a716-446655440000"
|
|
26
34
|
*/
|
|
27
|
-
|
|
35
|
+
orderId;
|
|
28
36
|
/**
|
|
29
|
-
* New status for the order.
|
|
30
|
-
* Must be a valid OrderStatus enum
|
|
37
|
+
* New status value to set for the order.
|
|
38
|
+
* Must be a valid value from the OrderStatus enum.
|
|
31
39
|
*
|
|
32
|
-
* @
|
|
40
|
+
* @type {OrderStatus}
|
|
41
|
+
* @example "CONFIRMED"
|
|
33
42
|
*/
|
|
34
43
|
status;
|
|
35
44
|
}
|
|
36
45
|
__decorate([
|
|
37
|
-
IsUUID(4, { message:
|
|
46
|
+
IsUUID(4, { message: "orderId must be a valid UUID v4" }),
|
|
47
|
+
IsString({ message: "orderId must be a string" }),
|
|
48
|
+
IsNotEmpty({ message: "orderId is required" }),
|
|
38
49
|
__metadata("design:type", String)
|
|
39
|
-
], ChangeOrderStatusDto.prototype, "
|
|
50
|
+
], ChangeOrderStatusDto.prototype, "orderId", void 0);
|
|
40
51
|
__decorate([
|
|
41
|
-
|
|
52
|
+
IsIn(ORDER_STATUS, { message: "status must be a valid order status" }),
|
|
53
|
+
IsString({ message: "status must be a string" }),
|
|
54
|
+
IsNotEmpty({ message: "status is required" }),
|
|
42
55
|
__metadata("design:type", String)
|
|
43
56
|
], ChangeOrderStatusDto.prototype, "status", void 0);
|
|
@@ -1,62 +1,72 @@
|
|
|
1
|
-
import { OrderItemDto } from './order-item.dto';
|
|
2
|
-
import {
|
|
1
|
+
import { OrderItemDto } from './order-item.dto.js';
|
|
2
|
+
import { type OrderMode } from '../../types/order-mode.type.js';
|
|
3
3
|
/**
|
|
4
|
-
*
|
|
4
|
+
* Data Transfer Object for creating a new order in QeHay.
|
|
5
5
|
*
|
|
6
|
-
*
|
|
7
|
-
* order
|
|
8
|
-
*
|
|
6
|
+
* This DTO defines the structure, validation and documentation for the data needed to create a restaurant order.
|
|
7
|
+
* It supports all main QeHay order flows (DINE_IN, PICKUP, DELIVERY) and enforces minimum business rules at field level.
|
|
8
|
+
*
|
|
9
|
+
* Each property is validated and documented for clear API contracts and seamless integration with client apps.
|
|
9
10
|
*
|
|
10
11
|
* @since 2.0.0
|
|
11
12
|
*/
|
|
12
13
|
export declare class CreateOrderDto {
|
|
13
14
|
/**
|
|
14
|
-
*
|
|
15
|
-
* Must contain at least one item.
|
|
16
|
-
* Each
|
|
15
|
+
* List of items included in the order.
|
|
16
|
+
* - Must contain at least one item.
|
|
17
|
+
* - Each element is validated as OrderItemDto.
|
|
17
18
|
*
|
|
18
|
-
* @
|
|
19
|
+
* @type {OrderItemDto[]}
|
|
20
|
+
* @example [{ "productId": "651cb9...", "quantity": 2, "price": 19.98 }]
|
|
19
21
|
*/
|
|
20
22
|
items: OrderItemDto[];
|
|
21
23
|
/**
|
|
22
|
-
* Type of order (DINE_IN, PICKUP,
|
|
23
|
-
*
|
|
24
|
+
* Type of order (DINE_IN, PICKUP, DELIVERY).
|
|
25
|
+
* This determines the flow and required additional fields.
|
|
24
26
|
*
|
|
25
|
-
* @
|
|
27
|
+
* @type {OrderMode}
|
|
28
|
+
* @example "DELIVERY"
|
|
26
29
|
*/
|
|
27
|
-
mode:
|
|
30
|
+
mode: OrderMode;
|
|
28
31
|
/**
|
|
29
|
-
*
|
|
30
|
-
*
|
|
32
|
+
* Table identifier for dine-in orders.
|
|
33
|
+
* - Required for DINE_IN orders.
|
|
34
|
+
* - Ignored for PICKUP and DELIVERY.
|
|
35
|
+
* - Must be at least 2 characters if provided.
|
|
31
36
|
*
|
|
37
|
+
* @type {string}
|
|
32
38
|
* @example "Table 5"
|
|
33
39
|
*/
|
|
34
40
|
tableId?: string;
|
|
35
41
|
/**
|
|
36
|
-
*
|
|
42
|
+
* Delivery address, required when mode is DELIVERY.
|
|
37
43
|
*
|
|
44
|
+
* @type {string}
|
|
38
45
|
* @example "123 Main St, Downtown"
|
|
39
46
|
*/
|
|
40
47
|
deliveryAddress?: string;
|
|
41
48
|
/**
|
|
42
|
-
*
|
|
43
|
-
*
|
|
49
|
+
* Scheduled pickup time for pickup orders, as a valid ISO 8601 string.
|
|
50
|
+
* Only relevant for PICKUP mode.
|
|
44
51
|
*
|
|
52
|
+
* @type {string}
|
|
45
53
|
* @example "2024-01-15T18:30:00Z"
|
|
46
54
|
*/
|
|
47
55
|
pickupTime?: string;
|
|
48
56
|
/**
|
|
49
|
-
*
|
|
50
|
-
* Required for orders
|
|
57
|
+
* Identifier of the payment method selected by the customer.
|
|
58
|
+
* - Required for orders requiring pre-payment (typically DELIVERY and PICKUP).
|
|
51
59
|
*
|
|
60
|
+
* @type {string}
|
|
52
61
|
* @example "payment-method-uuid-123"
|
|
53
62
|
*/
|
|
54
63
|
paymentMethodId: string;
|
|
55
64
|
/**
|
|
56
|
-
*
|
|
57
|
-
*
|
|
65
|
+
* User identifier (MongoDB ObjectId) of the customer who created the order.
|
|
66
|
+
* - Required. Used for user traceability and order ownership.
|
|
58
67
|
*
|
|
68
|
+
* @type {string}
|
|
59
69
|
* @example "507f1f77bcf86cd799439011"
|
|
60
70
|
*/
|
|
61
|
-
userId
|
|
71
|
+
userId: string;
|
|
62
72
|
}
|
|
@@ -8,65 +8,75 @@ 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
10
|
import { Type } from 'class-transformer';
|
|
11
|
-
import { IsArray, ArrayMinSize, ValidateNested,
|
|
12
|
-
import { OrderItemDto } from './order-item.dto';
|
|
13
|
-
import {
|
|
11
|
+
import { IsArray, ArrayMinSize, ValidateNested, IsString, IsOptional, MinLength, IsMongoId, IsNotEmpty, IsDateString, IsIn, } from 'class-validator';
|
|
12
|
+
import { OrderItemDto } from './order-item.dto.js';
|
|
13
|
+
import { ORDER_MODES } from '../../types/order-mode.type.js';
|
|
14
14
|
/**
|
|
15
|
-
*
|
|
15
|
+
* Data Transfer Object for creating a new order in QeHay.
|
|
16
16
|
*
|
|
17
|
-
*
|
|
18
|
-
* order
|
|
19
|
-
*
|
|
17
|
+
* This DTO defines the structure, validation and documentation for the data needed to create a restaurant order.
|
|
18
|
+
* It supports all main QeHay order flows (DINE_IN, PICKUP, DELIVERY) and enforces minimum business rules at field level.
|
|
19
|
+
*
|
|
20
|
+
* Each property is validated and documented for clear API contracts and seamless integration with client apps.
|
|
20
21
|
*
|
|
21
22
|
* @since 2.0.0
|
|
22
23
|
*/
|
|
23
24
|
export class CreateOrderDto {
|
|
24
25
|
/**
|
|
25
|
-
*
|
|
26
|
-
* Must contain at least one item.
|
|
27
|
-
* Each
|
|
26
|
+
* List of items included in the order.
|
|
27
|
+
* - Must contain at least one item.
|
|
28
|
+
* - Each element is validated as OrderItemDto.
|
|
28
29
|
*
|
|
29
|
-
* @
|
|
30
|
+
* @type {OrderItemDto[]}
|
|
31
|
+
* @example [{ "productId": "651cb9...", "quantity": 2, "price": 19.98 }]
|
|
30
32
|
*/
|
|
31
33
|
items;
|
|
32
34
|
/**
|
|
33
|
-
* Type of order (DINE_IN, PICKUP,
|
|
34
|
-
*
|
|
35
|
+
* Type of order (DINE_IN, PICKUP, DELIVERY).
|
|
36
|
+
* This determines the flow and required additional fields.
|
|
35
37
|
*
|
|
36
|
-
* @
|
|
38
|
+
* @type {OrderMode}
|
|
39
|
+
* @example "DELIVERY"
|
|
37
40
|
*/
|
|
38
41
|
mode;
|
|
39
42
|
/**
|
|
40
|
-
*
|
|
41
|
-
*
|
|
43
|
+
* Table identifier for dine-in orders.
|
|
44
|
+
* - Required for DINE_IN orders.
|
|
45
|
+
* - Ignored for PICKUP and DELIVERY.
|
|
46
|
+
* - Must be at least 2 characters if provided.
|
|
42
47
|
*
|
|
48
|
+
* @type {string}
|
|
43
49
|
* @example "Table 5"
|
|
44
50
|
*/
|
|
45
51
|
tableId;
|
|
46
52
|
/**
|
|
47
|
-
*
|
|
53
|
+
* Delivery address, required when mode is DELIVERY.
|
|
48
54
|
*
|
|
55
|
+
* @type {string}
|
|
49
56
|
* @example "123 Main St, Downtown"
|
|
50
57
|
*/
|
|
51
58
|
deliveryAddress;
|
|
52
59
|
/**
|
|
53
|
-
*
|
|
54
|
-
*
|
|
60
|
+
* Scheduled pickup time for pickup orders, as a valid ISO 8601 string.
|
|
61
|
+
* Only relevant for PICKUP mode.
|
|
55
62
|
*
|
|
63
|
+
* @type {string}
|
|
56
64
|
* @example "2024-01-15T18:30:00Z"
|
|
57
65
|
*/
|
|
58
66
|
pickupTime;
|
|
59
67
|
/**
|
|
60
|
-
*
|
|
61
|
-
* Required for orders
|
|
68
|
+
* Identifier of the payment method selected by the customer.
|
|
69
|
+
* - Required for orders requiring pre-payment (typically DELIVERY and PICKUP).
|
|
62
70
|
*
|
|
71
|
+
* @type {string}
|
|
63
72
|
* @example "payment-method-uuid-123"
|
|
64
73
|
*/
|
|
65
74
|
paymentMethodId;
|
|
66
75
|
/**
|
|
67
|
-
*
|
|
68
|
-
*
|
|
76
|
+
* User identifier (MongoDB ObjectId) of the customer who created the order.
|
|
77
|
+
* - Required. Used for user traceability and order ownership.
|
|
69
78
|
*
|
|
79
|
+
* @type {string}
|
|
70
80
|
* @example "507f1f77bcf86cd799439011"
|
|
71
81
|
*/
|
|
72
82
|
userId;
|
|
@@ -79,33 +89,35 @@ __decorate([
|
|
|
79
89
|
__metadata("design:type", Array)
|
|
80
90
|
], CreateOrderDto.prototype, "items", void 0);
|
|
81
91
|
__decorate([
|
|
82
|
-
|
|
92
|
+
IsIn(ORDER_MODES, { message: 'Order type must be DINE_IN, PICKUP, or DELIVERY' }),
|
|
93
|
+
IsString({ message: 'Order mode must be a string' }),
|
|
94
|
+
IsNotEmpty({ message: 'Order mode is required' }),
|
|
83
95
|
__metadata("design:type", String)
|
|
84
96
|
], CreateOrderDto.prototype, "mode", void 0);
|
|
85
97
|
__decorate([
|
|
86
|
-
IsString(),
|
|
87
|
-
MinLength(2),
|
|
98
|
+
IsString({ message: 'tableId must be a string' }),
|
|
99
|
+
MinLength(2, { message: 'tableId must be at least 2 characters' }),
|
|
88
100
|
IsOptional(),
|
|
89
101
|
__metadata("design:type", String)
|
|
90
102
|
], CreateOrderDto.prototype, "tableId", void 0);
|
|
91
103
|
__decorate([
|
|
92
|
-
IsString(),
|
|
104
|
+
IsString({ message: 'Delivery address must be a string' }),
|
|
93
105
|
IsOptional(),
|
|
94
106
|
__metadata("design:type", String)
|
|
95
107
|
], CreateOrderDto.prototype, "deliveryAddress", void 0);
|
|
96
108
|
__decorate([
|
|
97
|
-
IsDateString(),
|
|
109
|
+
IsDateString({}, { message: 'pickupTime must be a valid ISO date string' }),
|
|
98
110
|
IsOptional(),
|
|
99
111
|
__metadata("design:type", String)
|
|
100
112
|
], CreateOrderDto.prototype, "pickupTime", void 0);
|
|
101
113
|
__decorate([
|
|
102
|
-
IsString(),
|
|
114
|
+
IsString({ message: 'paymentMethodId must be a string' }),
|
|
103
115
|
IsNotEmpty({ message: 'Payment method ID is required' }),
|
|
104
116
|
__metadata("design:type", String)
|
|
105
117
|
], CreateOrderDto.prototype, "paymentMethodId", void 0);
|
|
106
118
|
__decorate([
|
|
107
|
-
IsString(),
|
|
108
|
-
IsMongoId(),
|
|
109
|
-
|
|
119
|
+
IsString({ message: 'userId must be a string' }),
|
|
120
|
+
IsMongoId({ message: 'userId must be a valid MongoDB ObjectId' }),
|
|
121
|
+
IsNotEmpty({ message: 'userId is required' }),
|
|
110
122
|
__metadata("design:type", String)
|
|
111
123
|
], CreateOrderDto.prototype, "userId", void 0);
|
|
@@ -6,9 +6,8 @@
|
|
|
6
6
|
*
|
|
7
7
|
* @since 2.0.0
|
|
8
8
|
*/
|
|
9
|
-
export * from './create-order.dto';
|
|
10
|
-
export * from './
|
|
11
|
-
export * from './order-
|
|
12
|
-
export * from './
|
|
13
|
-
export * from './order
|
|
14
|
-
export * from './paid-order.dto';
|
|
9
|
+
export * from './create-order.dto.js';
|
|
10
|
+
export * from './order-item.dto.js';
|
|
11
|
+
export * from './change-order-status.dto.js';
|
|
12
|
+
export * from './order-pagination.dto.js';
|
|
13
|
+
export * from './paid-order.dto.js';
|
|
@@ -6,9 +6,8 @@
|
|
|
6
6
|
*
|
|
7
7
|
* @since 2.0.0
|
|
8
8
|
*/
|
|
9
|
-
export * from './create-order.dto';
|
|
10
|
-
export * from './
|
|
11
|
-
export * from './order-
|
|
12
|
-
export * from './
|
|
13
|
-
export * from './order
|
|
14
|
-
export * from './paid-order.dto';
|
|
9
|
+
export * from './create-order.dto.js';
|
|
10
|
+
export * from './order-item.dto.js';
|
|
11
|
+
export * from './change-order-status.dto.js';
|
|
12
|
+
export * from './order-pagination.dto.js';
|
|
13
|
+
export * from './paid-order.dto.js';
|
|
@@ -1,65 +1,82 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* Data Transfer Object representing a single item within an order.
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
* Supports nested items for complex order structures (e.g., combo meals).
|
|
4
|
+
* Used by QeHay to structure each item the customer wishes to order, including the product, quantity, pricing, variant size,
|
|
5
|
+
* optional notes, and possible nested (child) items such as combos.
|
|
7
6
|
*
|
|
7
|
+
* All properties are validated and documented to ensure data integrity and improve maintainability.
|
|
8
|
+
*
|
|
9
|
+
* @class OrderItemDto
|
|
8
10
|
* @since 2.0.0
|
|
9
11
|
*/
|
|
10
12
|
export declare class OrderItemDto {
|
|
11
13
|
/**
|
|
12
|
-
* Unique identifier
|
|
13
|
-
*
|
|
14
|
+
* Unique identifier for the product.
|
|
15
|
+
* Required.
|
|
16
|
+
* Must be a valid UUID v4.
|
|
14
17
|
*
|
|
18
|
+
* @type {string}
|
|
15
19
|
* @example "550e8400-e29b-41d4-a716-446655440000"
|
|
16
20
|
*/
|
|
17
21
|
productId: string;
|
|
18
22
|
/**
|
|
19
|
-
* Optional unique identifier
|
|
20
|
-
*
|
|
23
|
+
* Optional unique identifier for the product size (variant).
|
|
24
|
+
* Only set when the selected product has multiple sizes/variants.
|
|
25
|
+
* Must be a valid UUID v4 if provided.
|
|
21
26
|
*
|
|
27
|
+
* @type {string}
|
|
22
28
|
* @example "660e8400-e29b-41d4-a716-446655440001"
|
|
23
29
|
*/
|
|
24
30
|
productSizeId?: string;
|
|
25
31
|
/**
|
|
26
|
-
* Optional name
|
|
32
|
+
* Optional name or label for the product size/variant.
|
|
33
|
+
* Useful for displaying selected size in the client.
|
|
27
34
|
*
|
|
35
|
+
* @type {string}
|
|
28
36
|
* @example "Large"
|
|
29
37
|
*/
|
|
30
38
|
sizeName?: string;
|
|
31
39
|
/**
|
|
32
|
-
* Optional price for the size
|
|
33
|
-
*
|
|
40
|
+
* Optional additional price for the selected size/variant.
|
|
41
|
+
* If specified, must be a positive number.
|
|
34
42
|
*
|
|
43
|
+
* @type {number}
|
|
35
44
|
* @example 12.99
|
|
36
45
|
*/
|
|
37
46
|
sizePrice?: number;
|
|
38
47
|
/**
|
|
39
|
-
* Quantity of
|
|
40
|
-
*
|
|
48
|
+
* Quantity of the ordered product (how many units the customer wants).
|
|
49
|
+
* Required.
|
|
50
|
+
* Must be a positive number (greater than zero).
|
|
41
51
|
*
|
|
52
|
+
* @type {number}
|
|
42
53
|
* @example 2
|
|
43
54
|
*/
|
|
44
55
|
quantity: number;
|
|
45
56
|
/**
|
|
46
|
-
* Unit price for this item.
|
|
57
|
+
* Unit price for this item (for one product or one variant, without multiplying by quantity).
|
|
58
|
+
* Required.
|
|
47
59
|
* Must be a positive number.
|
|
48
60
|
*
|
|
61
|
+
* @type {number}
|
|
49
62
|
* @example 9.99
|
|
50
63
|
*/
|
|
51
64
|
price: number;
|
|
52
65
|
/**
|
|
53
|
-
* Optional notes or special instructions for this item.
|
|
66
|
+
* Optional notes or special instructions for this item (i.e. "No onions", "Add extra cheese").
|
|
67
|
+
* Useful for customizations or clarifications by the customer.
|
|
68
|
+
* Minimum length: 5 characters. Maximum: 200.
|
|
54
69
|
*
|
|
70
|
+
* @type {string}
|
|
55
71
|
* @example "No onions, extra cheese"
|
|
56
72
|
*/
|
|
57
73
|
notes?: string;
|
|
58
74
|
/**
|
|
59
|
-
* Optional array of child items (for
|
|
60
|
-
* Each child item
|
|
75
|
+
* Optional array of nested child items (for combos, extras, etc).
|
|
76
|
+
* Each child item must also be a valid OrderItemDto instance, supporting recursive order nesting.
|
|
61
77
|
*
|
|
62
|
-
* @
|
|
78
|
+
* @type {OrderItemDto[]}
|
|
79
|
+
* @example [{ "productId": "...", "quantity": 1, "price": 5.99 }]
|
|
63
80
|
*/
|
|
64
81
|
childItems?: OrderItemDto[];
|
|
65
82
|
}
|