qeai-sdk 2.0.1 → 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.
Files changed (129) hide show
  1. package/dist/dtos/auth/register-user.dto.js +4 -1
  2. package/dist/dtos/categories/create-category.dto.js +6 -3
  3. package/dist/dtos/categories/delete-category.dto.d.ts +1 -1
  4. package/dist/dtos/categories/delete-category.dto.js +5 -3
  5. package/dist/dtos/categories/update-category.dto.d.ts +12 -10
  6. package/dist/dtos/categories/update-category.dto.js +15 -13
  7. package/dist/dtos/chain/create-chain.dto.d.ts +11 -12
  8. package/dist/dtos/chain/create-chain.dto.js +15 -14
  9. package/dist/dtos/chain/delete-chain.dto.d.ts +6 -6
  10. package/dist/dtos/chain/delete-chain.dto.js +11 -9
  11. package/dist/dtos/chain/update-chain.dto.d.ts +26 -16
  12. package/dist/dtos/chain/update-chain.dto.js +32 -21
  13. package/dist/dtos/common/search-by-name.dto.d.ts +23 -0
  14. package/dist/dtos/common/search-by-name.dto.js +24 -1
  15. package/dist/dtos/ingredients/create-ingredient.dto.d.ts +5 -5
  16. package/dist/dtos/ingredients/create-ingredient.dto.js +9 -8
  17. package/dist/dtos/ingredients/delete-ingredient.dto.d.ts +14 -7
  18. package/dist/dtos/ingredients/delete-ingredient.dto.js +18 -9
  19. package/dist/dtos/ingredients/index.d.ts +0 -1
  20. package/dist/dtos/ingredients/index.js +0 -1
  21. package/dist/dtos/ingredients/update-ingredient.dto.d.ts +20 -11
  22. package/dist/dtos/ingredients/update-ingredient.dto.js +28 -19
  23. package/dist/dtos/orders/change-order-status.dto.d.ts +19 -10
  24. package/dist/dtos/orders/change-order-status.dto.js +27 -14
  25. package/dist/dtos/orders/create-order.dto.d.ts +33 -23
  26. package/dist/dtos/orders/create-order.dto.js +43 -31
  27. package/dist/dtos/orders/order-item.dto.d.ts +35 -18
  28. package/dist/dtos/orders/order-item.dto.js +54 -32
  29. package/dist/dtos/orders/order-pagination.dto.d.ts +1 -1
  30. package/dist/dtos/orders/order-pagination.dto.js +3 -3
  31. package/dist/dtos/orders/paid-order.dto.d.ts +16 -8
  32. package/dist/dtos/orders/paid-order.dto.js +25 -14
  33. package/dist/dtos/payments/create-payment-audit-dynamo.dto.d.ts +81 -0
  34. package/dist/dtos/payments/create-payment-audit-dynamo.dto.js +81 -0
  35. package/dist/dtos/payments/create-payment-audit-s3.dto.d.ts +81 -0
  36. package/dist/dtos/payments/create-payment-audit-s3.dto.js +81 -0
  37. package/dist/dtos/payments/index.d.ts +2 -0
  38. package/dist/dtos/payments/index.js +2 -0
  39. package/dist/dtos/payments/payment-session-item.dto.d.ts +4 -4
  40. package/dist/dtos/payments/payment-session-item.dto.js +7 -4
  41. package/dist/dtos/payments/webhook-data.dto.d.ts +1 -1
  42. package/dist/dtos/payments/webhook-data.dto.js +1 -0
  43. package/dist/dtos/products/create-product.dto.d.ts +1 -1
  44. package/dist/dtos/products/create-product.dto.js +2 -1
  45. package/dist/dtos/products/delete-product.dto.d.ts +1 -1
  46. package/dist/dtos/products/delete-product.dto.js +5 -3
  47. package/dist/dtos/products/submodules/product-image/bulk-create-product-image.dto.d.ts +3 -3
  48. package/dist/dtos/products/submodules/product-image/bulk-create-product-image.dto.js +5 -5
  49. package/dist/dtos/products/submodules/product-image/create-product-image.dto.d.ts +1 -1
  50. package/dist/dtos/products/submodules/product-image/create-product-image.dto.js +4 -4
  51. package/dist/dtos/products/submodules/product-image/update-product-image.dto.d.ts +1 -1
  52. package/dist/dtos/products/submodules/product-image/update-product-image.dto.js +4 -4
  53. package/dist/dtos/products/submodules/product-question/create-product-question.dto.d.ts +2 -2
  54. package/dist/dtos/products/submodules/product-question/create-product-question.dto.js +8 -8
  55. package/dist/dtos/products/submodules/product-question/replace-by-product-id.dto.d.ts +1 -1
  56. package/dist/dtos/products/submodules/product-question/update-product-question.dto.d.ts +1 -1
  57. package/dist/dtos/products/submodules/product-question/update-product-question.dto.js +4 -4
  58. package/dist/dtos/products/submodules/product-recipe/create-product-recipe.dto.d.ts +1 -1
  59. package/dist/dtos/products/submodules/product-recipe/create-product-recipe.dto.js +2 -2
  60. package/dist/dtos/products/submodules/product-recipe/replace-by-product-id.dto.d.ts +2 -2
  61. package/dist/dtos/products/submodules/product-recipe/replace-by-product-id.dto.js +5 -5
  62. package/dist/dtos/products/submodules/product-recipe/update-product-recipe.dto.d.ts +1 -8
  63. package/dist/dtos/products/submodules/product-recipe/update-product-recipe.dto.js +3 -16
  64. package/dist/dtos/products/submodules/product-schedule/create-product-schedule.dto.d.ts +1 -1
  65. package/dist/dtos/products/submodules/product-schedule/create-product-schedule.dto.js +2 -2
  66. package/dist/dtos/products/submodules/product-schedule/replace-by-product-id.dto.d.ts +1 -1
  67. package/dist/dtos/products/submodules/product-schedule/update-product-schedule.dto.d.ts +1 -1
  68. package/dist/dtos/products/submodules/product-schedule/update-product-schedule.dto.js +4 -4
  69. package/dist/dtos/products/submodules/product-size/create-product-size.dto.js +1 -1
  70. package/dist/dtos/products/submodules/product-size/product-size-data.dto.js +1 -1
  71. package/dist/dtos/products/submodules/product-size/update-product-size.dto.d.ts +1 -1
  72. package/dist/dtos/products/submodules/product-size/update-product-size.dto.js +2 -2
  73. package/dist/dtos/products/submodules/product-tag/index.d.ts +1 -3
  74. package/dist/dtos/products/submodules/product-tag/index.js +1 -3
  75. package/dist/dtos/products/submodules/product-tag/{remove-product-tag.dto.d.ts → product-tag.dto.d.ts} +1 -1
  76. package/dist/dtos/products/submodules/product-tag/{remove-product-tag.dto.js → product-tag.dto.js} +3 -3
  77. package/dist/dtos/products/update-product.dto.d.ts +4 -4
  78. package/dist/dtos/products/update-product.dto.js +5 -4
  79. package/dist/dtos/questions/create-question.dto.d.ts +1 -1
  80. package/dist/dtos/questions/create-question.dto.js +2 -1
  81. package/dist/dtos/questions/delete-question.dto.d.ts +1 -1
  82. package/dist/dtos/questions/delete-question.dto.js +5 -3
  83. package/dist/dtos/questions/index.d.ts +0 -1
  84. package/dist/dtos/questions/index.js +0 -1
  85. package/dist/dtos/questions/update-question.dto.d.ts +4 -4
  86. package/dist/dtos/questions/update-question.dto.js +5 -5
  87. package/dist/dtos/restaurants/create-restaurant.dto.d.ts +15 -1
  88. package/dist/dtos/restaurants/create-restaurant.dto.js +38 -2
  89. package/dist/dtos/restaurants/delete-restaurant.dto.d.ts +1 -1
  90. package/dist/dtos/restaurants/delete-restaurant.dto.js +5 -3
  91. package/dist/dtos/restaurants/update-restaurant.dto.d.ts +17 -10
  92. package/dist/dtos/restaurants/update-restaurant.dto.js +32 -16
  93. package/dist/dtos/tags/create-tag.dto.d.ts +1 -1
  94. package/dist/dtos/tags/create-tag.dto.js +5 -4
  95. package/dist/dtos/tags/delete-tag.dto.d.ts +1 -1
  96. package/dist/dtos/tags/delete-tag.dto.js +5 -3
  97. package/dist/dtos/tags/index.d.ts +0 -1
  98. package/dist/dtos/tags/index.js +0 -1
  99. package/dist/dtos/tags/update-tag.dto.d.ts +3 -3
  100. package/dist/dtos/tags/update-tag.dto.js +6 -5
  101. package/dist/dtos/translations/create-translation.dto.js +6 -1
  102. package/dist/dtos/translations/delete-translation.dto.d.ts +1 -1
  103. package/dist/dtos/translations/delete-translation.dto.js +4 -3
  104. package/dist/dtos/translations/update-translation.dto.d.ts +3 -3
  105. package/dist/dtos/translations/update-translation.dto.js +7 -4
  106. package/dist/enums/index.d.ts +0 -2
  107. package/dist/enums/index.js +0 -2
  108. package/dist/interfaces/orders/order-item.interface.d.ts +4 -4
  109. package/dist/interfaces/orders/order.interface.d.ts +9 -9
  110. package/dist/types/index.d.ts +1 -0
  111. package/dist/types/index.js +1 -0
  112. package/dist/types/order-mode.type.d.ts +12 -3
  113. package/dist/types/order-mode.type.js +20 -1
  114. package/dist/types/order-status.type.d.ts +22 -0
  115. package/dist/{enums/order-status.enum.d.ts → types/order-status.type.js} +25 -26
  116. package/package.json +1 -1
  117. package/dist/dtos/ingredients/search-by-name.dto.d.ts +0 -18
  118. package/dist/dtos/ingredients/search-by-name.dto.js +0 -33
  119. package/dist/dtos/products/submodules/product-tag/create-product-tag.dto.d.ts +0 -24
  120. package/dist/dtos/products/submodules/product-tag/create-product-tag.dto.js +0 -46
  121. package/dist/dtos/products/submodules/product-tag/find-product-tag.dto.d.ts +0 -24
  122. package/dist/dtos/products/submodules/product-tag/find-product-tag.dto.js +0 -46
  123. package/dist/dtos/questions/search-by-name.dto.d.ts +0 -18
  124. package/dist/dtos/questions/search-by-name.dto.js +0 -33
  125. package/dist/dtos/tags/search-by-name.dto.d.ts +0 -18
  126. package/dist/dtos/tags/search-by-name.dto.js +0 -33
  127. package/dist/enums/order-status.enum.js +0 -69
  128. package/dist/enums/order-type.enum.d.ts +0 -45
  129. package/dist/enums/order-type.enum.js +0 -46
@@ -9,11 +9,34 @@ var __metadata = (this && this.__metadata) || function (k, v) {
9
9
  };
10
10
  import { IsNotEmpty, IsString } from 'class-validator';
11
11
  import { PaginationDto } from './pagination.dto.js';
12
+ /**
13
+ * DTO for searching entities by name.
14
+ *
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
+ * }
26
+ *
27
+ * @since 2.0.0
28
+ */
12
29
  export class SearchByNameDto extends PaginationDto {
30
+ /**
31
+ * The search term for the entity name.
32
+ * Must be a non-empty string.
33
+ *
34
+ * @example "vegetarian"
35
+ */
13
36
  name;
14
37
  }
15
38
  __decorate([
16
39
  IsString(),
17
- IsNotEmpty(),
40
+ IsNotEmpty({ message: 'Search term is required' }),
18
41
  __metadata("design:type", String)
19
42
  ], SearchByNameDto.prototype, "name", void 0);
@@ -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 used in recipes and inventory management.
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
- * Name of the ingredient.
12
- * Must not be empty and maximum length of 100 characters.
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 20 characters.
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 used in recipes and inventory management.
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
- * Name of the ingredient.
22
- * Must not be empty and maximum length of 100 characters.
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 20 characters.
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(100, { message: 'Ingredient name must be at most 100 characters' }),
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(20, { message: 'Unit must be at most 20 characters' }),
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
- * Used by the Products microservice to soft-delete ingredients.
5
- * Includes ingredient ID and user who performed the deletion.
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
- * Ingredient ID to delete.
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
- id: string;
23
+ ingredientId: string;
17
24
  /**
18
- * User who deleted the ingredient.
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
- * Used by the Products microservice to soft-delete ingredients.
15
- * Includes ingredient ID and user who performed the deletion.
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
- * Ingredient ID to delete.
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
- id;
33
+ ingredientId;
27
34
  /**
28
- * User who deleted the ingredient.
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, "id", void 0);
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)
@@ -9,4 +9,3 @@
9
9
  export * from './create-ingredient.dto.js';
10
10
  export * from './update-ingredient.dto.js';
11
11
  export * from './delete-ingredient.dto.js';
12
- export * from './search-by-name.dto.js';
@@ -9,4 +9,3 @@
9
9
  export * from './create-ingredient.dto.js';
10
10
  export * from './update-ingredient.dto.js';
11
11
  export * from './delete-ingredient.dto.js';
12
- export * from './search-by-name.dto.js';
@@ -1,38 +1,47 @@
1
1
  /**
2
2
  * DTO for updating an existing ingredient.
3
3
  *
4
- * Extends CreateIngredientDto with all fields optional.
5
- * Used by the Products microservice to update ingredient details.
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.
6
7
  *
7
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
+ * }
8
17
  */
9
18
  export declare class UpdateIngredientDto {
10
19
  /**
11
- * Name of the ingredient.
12
- * Must not be empty and maximum length of 100 characters.
20
+ * Ingredient name.
21
+ * Optional. If provided, must be a string with a maximum length of 25 characters.
13
22
  *
14
23
  * @example "Tomato"
15
24
  */
16
25
  name?: string;
17
26
  /**
18
27
  * Unit of measurement for the ingredient.
19
- * Must not be empty and maximum length of 20 characters.
28
+ * Optional. If provided, must be a string with a maximum length of 12 characters.
20
29
  *
21
30
  * @example "kg"
22
31
  */
23
32
  unit?: string;
24
33
  /**
25
- * Ingredient ID to update.
26
- * Must be a valid UUID.
34
+ * Unique identifier of the ingredient to update.
35
+ * Required. Must be a valid UUID string.
27
36
  *
28
37
  * @example "550e8400-e29b-41d4-a716-446655440000"
29
38
  */
30
- id?: string;
39
+ ingredientId: string;
31
40
  /**
32
- * User who updated the ingredient.
33
- * Must be a valid MongoDB ObjectId if provided.
41
+ * Unique identifier of the user performing the update.
42
+ * Required. Must be a valid MongoDB ObjectId.
34
43
  *
35
44
  * @example "507f1f77bcf86cd799439011"
36
45
  */
37
- updatedBy?: string;
46
+ updatedBy: string;
38
47
  }
@@ -7,66 +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 { IsString, IsOptional, IsMongoId, IsUUID, MaxLength, } from "class-validator";
10
+ import { IsString, IsOptional, IsMongoId, IsUUID, MaxLength, IsNotEmpty, } from "class-validator";
11
11
  /**
12
12
  * DTO for updating an existing ingredient.
13
13
  *
14
- * Extends CreateIngredientDto with all fields optional.
15
- * Used by the Products microservice to update ingredient details.
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.
16
17
  *
17
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
+ * }
18
27
  */
19
28
  export class UpdateIngredientDto {
20
29
  /**
21
- * Name of the ingredient.
22
- * Must not be empty and maximum length of 100 characters.
30
+ * Ingredient name.
31
+ * Optional. If provided, must be a string with a maximum length of 25 characters.
23
32
  *
24
33
  * @example "Tomato"
25
34
  */
26
35
  name;
27
36
  /**
28
37
  * Unit of measurement for the ingredient.
29
- * Must not be empty and maximum length of 20 characters.
38
+ * Optional. If provided, must be a string with a maximum length of 12 characters.
30
39
  *
31
40
  * @example "kg"
32
41
  */
33
42
  unit;
34
43
  /**
35
- * Ingredient ID to update.
36
- * Must be a valid UUID.
44
+ * Unique identifier of the ingredient to update.
45
+ * Required. Must be a valid UUID string.
37
46
  *
38
47
  * @example "550e8400-e29b-41d4-a716-446655440000"
39
48
  */
40
- id;
49
+ ingredientId;
41
50
  /**
42
- * User who updated the ingredient.
43
- * Must be a valid MongoDB ObjectId if provided.
51
+ * Unique identifier of the user performing the update.
52
+ * Required. Must be a valid MongoDB ObjectId.
44
53
  *
45
54
  * @example "507f1f77bcf86cd799439011"
46
55
  */
47
56
  updatedBy;
48
57
  }
49
58
  __decorate([
50
- IsString(),
51
- MaxLength(100, { message: "Ingredient name must be at most 100 characters" }),
52
59
  IsOptional(),
60
+ IsString(),
61
+ MaxLength(25, { message: "Ingredient name must be at most 25 characters" }),
53
62
  __metadata("design:type", String)
54
63
  ], UpdateIngredientDto.prototype, "name", void 0);
55
64
  __decorate([
56
- IsString(),
57
- MaxLength(20, { message: "Unit must be at most 20 characters" }),
58
65
  IsOptional(),
66
+ IsString(),
67
+ MaxLength(12, { message: "Unit must be at most 12 characters" }),
59
68
  __metadata("design:type", String)
60
69
  ], UpdateIngredientDto.prototype, "unit", void 0);
61
70
  __decorate([
62
71
  IsString(),
63
72
  IsUUID(),
64
- IsOptional(),
73
+ IsNotEmpty({ message: 'ingredientId is required and must be a valid UUID.' }),
65
74
  __metadata("design:type", String)
66
- ], UpdateIngredientDto.prototype, "id", void 0);
75
+ ], UpdateIngredientDto.prototype, "ingredientId", void 0);
67
76
  __decorate([
68
77
  IsString(),
69
- IsMongoId(),
70
- IsOptional(),
78
+ IsMongoId({ message: 'updatedBy must be a valid MongoDB ObjectId.' }),
79
+ IsNotEmpty({ message: 'updatedBy is required and must be a valid MongoDB ObjectId.' }),
71
80
  __metadata("design:type", String)
72
81
  ], UpdateIngredientDto.prototype, "updatedBy", void 0);
@@ -1,25 +1,34 @@
1
- import { OrderStatus } from '../../enums/order-status.enum.js';
1
+ import type { OrderStatus } from "../../types/order-status.type.js";
2
2
  /**
3
- * DTO for changing an order's status.
3
+ * Data Transfer Object (DTO) for changing the status of an order.
4
4
  *
5
- * Used by the Orders microservice to update the status of an existing order.
6
- * Validates the order ID and new status value.
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 update.
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
- id: string;
25
+ orderId: string;
18
26
  /**
19
- * New status for the order.
20
- * Must be a valid OrderStatus enum value.
27
+ * New status value to set for the order.
28
+ * Must be a valid value from the OrderStatus enum.
21
29
  *
22
- * @example OrderStatus.CONFIRMED
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 { IsEnum, IsUUID } from 'class-validator';
11
- import { OrderStatus } from '../../enums/order-status.enum.js';
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's status.
13
+ * Data Transfer Object (DTO) for changing the status of an order.
14
14
  *
15
- * Used by the Orders microservice to update the status of an existing order.
16
- * Validates the order ID and new status value.
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 update.
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
- id;
35
+ orderId;
28
36
  /**
29
- * New status for the order.
30
- * Must be a valid OrderStatus enum value.
37
+ * New status value to set for the order.
38
+ * Must be a valid value from the OrderStatus enum.
31
39
  *
32
- * @example OrderStatus.CONFIRMED
40
+ * @type {OrderStatus}
41
+ * @example "CONFIRMED"
33
42
  */
34
43
  status;
35
44
  }
36
45
  __decorate([
37
- IsUUID(4, { message: 'Order ID must be a valid UUID' }),
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, "id", void 0);
50
+ ], ChangeOrderStatusDto.prototype, "orderId", void 0);
40
51
  __decorate([
41
- IsEnum(OrderStatus, { message: 'Status must be a valid order status' }),
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
1
  import { OrderItemDto } from './order-item.dto.js';
2
- import { OrderType } from '../../enums/order-type.enum.js';
2
+ import { type OrderMode } from '../../types/order-mode.type.js';
3
3
  /**
4
- * DTO for creating a new order.
4
+ * Data Transfer Object for creating a new order in QeHay.
5
5
  *
6
- * Used by the Orders microservice to create new orders with items,
7
- * order type, and optional delivery/pickup information.
8
- * Validates the order structure and required fields based on order type.
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
- * Array of items in the order.
15
- * Must contain at least one item.
16
- * Each item is validated as an OrderItemDto.
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
- * @example [{ productId: "...", quantity: 2, price: 19.98 }]
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, or DELIVERY).
23
- * Determines the fulfillment flow and required fields.
24
+ * Type of order (DINE_IN, PICKUP, DELIVERY).
25
+ * This determines the flow and required additional fields.
24
26
  *
25
- * @example OrderType.DELIVERY
27
+ * @type {OrderMode}
28
+ * @example "DELIVERY"
26
29
  */
27
- mode: OrderType;
30
+ mode: OrderMode;
28
31
  /**
29
- * Optional table identifier for dine-in orders.
30
- * Must be at least 2 characters long if provided.
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
- * Optional delivery address for delivery orders.
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
- * Optional pickup time for pickup orders.
43
- * Must be a valid ISO date string if provided.
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
- * Payment method identifier.
50
- * Required for orders that require payment before confirmation.
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
- * Optional user identifier who created the order.
57
- * Must be a valid MongoDB ObjectId if provided.
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?: string;
71
+ userId: string;
62
72
  }