qeai-sdk 2.0.0 → 2.0.1

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 (219) hide show
  1. package/dist/constants/index.d.ts +14 -12
  2. package/dist/constants/index.js +16 -12
  3. package/dist/constants/product-commands.constant.d.ts +6 -0
  4. package/dist/constants/product-commands.constant.js +6 -0
  5. package/dist/constants/services-config.constant.d.ts +3 -0
  6. package/dist/constants/services-config.constant.js +1 -0
  7. package/dist/constants/translation-commands.constant.d.ts +35 -0
  8. package/dist/constants/translation-commands.constant.js +35 -0
  9. package/dist/dtos/auth/index.d.ts +2 -2
  10. package/dist/dtos/auth/index.js +2 -2
  11. package/dist/dtos/categories/index.d.ts +3 -3
  12. package/dist/dtos/categories/index.js +3 -3
  13. package/dist/dtos/categories/update-category.dto.d.ts +21 -4
  14. package/dist/dtos/categories/update-category.dto.js +39 -7
  15. package/dist/dtos/chain/create-chain.dto.d.ts +1 -1
  16. package/dist/dtos/chain/create-chain.dto.js +1 -1
  17. package/dist/dtos/chain/index.d.ts +3 -3
  18. package/dist/dtos/chain/index.js +3 -3
  19. package/dist/dtos/chain/update-chain.dto.d.ts +27 -3
  20. package/dist/dtos/chain/update-chain.dto.js +45 -4
  21. package/dist/dtos/common/index.d.ts +2 -1
  22. package/dist/dtos/common/index.js +2 -1
  23. package/dist/dtos/common/search-by-name.dto.d.ts +4 -0
  24. package/dist/dtos/common/search-by-name.dto.js +19 -0
  25. package/dist/dtos/index.d.ts +12 -12
  26. package/dist/dtos/index.js +12 -12
  27. package/dist/dtos/ingredients/index.d.ts +4 -4
  28. package/dist/dtos/ingredients/index.js +4 -4
  29. package/dist/dtos/ingredients/search-by-name.dto.d.ts +1 -1
  30. package/dist/dtos/ingredients/search-by-name.dto.js +1 -1
  31. package/dist/dtos/ingredients/update-ingredient.dto.d.ts +15 -3
  32. package/dist/dtos/ingredients/update-ingredient.dto.js +28 -4
  33. package/dist/dtos/orders/change-order-status.dto.d.ts +1 -1
  34. package/dist/dtos/orders/change-order-status.dto.js +1 -1
  35. package/dist/dtos/orders/create-order.dto.d.ts +2 -2
  36. package/dist/dtos/orders/create-order.dto.js +2 -2
  37. package/dist/dtos/orders/index.d.ts +5 -6
  38. package/dist/dtos/orders/index.js +5 -6
  39. package/dist/dtos/orders/order-pagination.dto.d.ts +2 -2
  40. package/dist/dtos/orders/order-pagination.dto.js +2 -2
  41. package/dist/dtos/payments/index.d.ts +3 -3
  42. package/dist/dtos/payments/index.js +3 -3
  43. package/dist/dtos/payments/payment-session.dto.d.ts +1 -1
  44. package/dist/dtos/payments/payment-session.dto.js +1 -1
  45. package/dist/dtos/products/create-product.dto.d.ts +1 -1
  46. package/dist/dtos/products/create-product.dto.js +1 -1
  47. package/dist/dtos/products/index.d.ts +4 -4
  48. package/dist/dtos/products/index.js +4 -4
  49. package/dist/dtos/products/submodules/index.d.ts +6 -6
  50. package/dist/dtos/products/submodules/index.js +6 -6
  51. package/dist/dtos/products/submodules/product-image/bulk-create-product-image.dto.d.ts +1 -1
  52. package/dist/dtos/products/submodules/product-image/bulk-create-product-image.dto.js +1 -1
  53. package/dist/dtos/products/submodules/product-image/index.d.ts +4 -4
  54. package/dist/dtos/products/submodules/product-image/index.js +4 -4
  55. package/dist/dtos/products/submodules/product-question/create-product-question.dto.d.ts +1 -1
  56. package/dist/dtos/products/submodules/product-question/create-product-question.dto.js +1 -1
  57. package/dist/dtos/products/submodules/product-question/find-by-product-id-and-type.dto.d.ts +1 -1
  58. package/dist/dtos/products/submodules/product-question/find-by-product-id-and-type.dto.js +1 -1
  59. package/dist/dtos/products/submodules/product-question/index.d.ts +4 -4
  60. package/dist/dtos/products/submodules/product-question/index.js +4 -4
  61. package/dist/dtos/products/submodules/product-question/replace-by-product-id.dto.d.ts +1 -1
  62. package/dist/dtos/products/submodules/product-question/replace-by-product-id.dto.js +1 -1
  63. package/dist/dtos/products/submodules/product-question/update-product-question.dto.d.ts +1 -1
  64. package/dist/dtos/products/submodules/product-question/update-product-question.dto.js +1 -1
  65. package/dist/dtos/products/submodules/product-recipe/index.d.ts +3 -3
  66. package/dist/dtos/products/submodules/product-recipe/index.js +3 -3
  67. package/dist/dtos/products/submodules/product-recipe/replace-by-product-id.dto.d.ts +1 -1
  68. package/dist/dtos/products/submodules/product-recipe/replace-by-product-id.dto.js +1 -1
  69. package/dist/dtos/products/submodules/product-schedule/index.d.ts +4 -4
  70. package/dist/dtos/products/submodules/product-schedule/index.js +4 -4
  71. package/dist/dtos/products/submodules/product-schedule/replace-by-product-id.dto.d.ts +1 -1
  72. package/dist/dtos/products/submodules/product-schedule/replace-by-product-id.dto.js +1 -1
  73. package/dist/dtos/products/submodules/product-size/index.d.ts +4 -4
  74. package/dist/dtos/products/submodules/product-size/index.js +4 -4
  75. package/dist/dtos/products/submodules/product-size/replace-by-product-id.dto.d.ts +1 -1
  76. package/dist/dtos/products/submodules/product-size/replace-by-product-id.dto.js +1 -1
  77. package/dist/dtos/products/submodules/product-tag/index.d.ts +4 -4
  78. package/dist/dtos/products/submodules/product-tag/index.js +4 -4
  79. package/dist/dtos/products/update-product.dto.d.ts +38 -3
  80. package/dist/dtos/products/update-product.dto.js +69 -4
  81. package/dist/dtos/questions/create-question.dto.d.ts +1 -1
  82. package/dist/dtos/questions/create-question.dto.js +1 -1
  83. package/dist/dtos/questions/index.d.ts +4 -4
  84. package/dist/dtos/questions/index.js +4 -4
  85. package/dist/dtos/questions/search-by-name.dto.d.ts +1 -1
  86. package/dist/dtos/questions/search-by-name.dto.js +1 -1
  87. package/dist/dtos/questions/update-question.dto.d.ts +38 -3
  88. package/dist/dtos/questions/update-question.dto.js +66 -4
  89. package/dist/dtos/restaurants/index.d.ts +3 -3
  90. package/dist/dtos/restaurants/index.js +3 -3
  91. package/dist/dtos/restaurants/update-restaurant.dto.d.ts +41 -3
  92. package/dist/dtos/restaurants/update-restaurant.dto.js +72 -4
  93. package/dist/dtos/tags/index.d.ts +4 -4
  94. package/dist/dtos/tags/index.js +4 -4
  95. package/dist/dtos/tags/search-by-name.dto.d.ts +1 -1
  96. package/dist/dtos/tags/search-by-name.dto.js +1 -1
  97. package/dist/dtos/tags/update-tag.dto.d.ts +8 -3
  98. package/dist/dtos/tags/update-tag.dto.js +17 -6
  99. package/dist/dtos/translations/create-translation.dto.d.ts +1 -1
  100. package/dist/dtos/translations/create-translation.dto.js +1 -1
  101. package/dist/dtos/translations/find-translations-by-entity.dto.d.ts +1 -1
  102. package/dist/dtos/translations/find-translations-by-entity.dto.js +1 -1
  103. package/dist/dtos/translations/index.d.ts +4 -4
  104. package/dist/dtos/translations/index.js +4 -4
  105. package/dist/dtos/translations/update-translation.dto.d.ts +32 -3
  106. package/dist/dtos/translations/update-translation.dto.js +64 -4
  107. package/dist/enums/index.d.ts +12 -12
  108. package/dist/enums/index.js +12 -12
  109. package/dist/index.d.ts +5 -5
  110. package/dist/index.js +5 -5
  111. package/dist/interfaces/auth/access-user.interface.d.ts +2 -2
  112. package/dist/interfaces/auth/account.interface.d.ts +1 -1
  113. package/dist/interfaces/auth/full-token.interface.d.ts +2 -2
  114. package/dist/interfaces/auth/index.d.ts +9 -9
  115. package/dist/interfaces/auth/index.js +9 -9
  116. package/dist/interfaces/auth/payload-jwt.interface.d.ts +2 -2
  117. package/dist/interfaces/auth/responses/auth-response.interface.d.ts +3 -3
  118. package/dist/interfaces/auth/responses/index.d.ts +2 -2
  119. package/dist/interfaces/auth/responses/index.js +2 -2
  120. package/dist/interfaces/auth/responses/refresh-token-response.interface.d.ts +2 -2
  121. package/dist/interfaces/auth/user.interface.d.ts +2 -2
  122. package/dist/interfaces/auth/validate-user.interface.d.ts +2 -2
  123. package/dist/interfaces/categories/categories-list-response.interface.d.ts +3 -3
  124. package/dist/interfaces/categories/category-response.interface.d.ts +2 -2
  125. package/dist/interfaces/categories/index.d.ts +3 -3
  126. package/dist/interfaces/categories/index.js +3 -3
  127. package/dist/interfaces/chains/chain-response.interface.d.ts +2 -2
  128. package/dist/interfaces/chains/chain.interface.d.ts +1 -1
  129. package/dist/interfaces/chains/chains-list-response.interface.d.ts +3 -3
  130. package/dist/interfaces/chains/index.d.ts +3 -3
  131. package/dist/interfaces/chains/index.js +3 -3
  132. package/dist/interfaces/common/api-error-response.interface.d.ts +2 -2
  133. package/dist/interfaces/common/api-response.interface.d.ts +3 -2
  134. package/dist/interfaces/common/index.d.ts +5 -5
  135. package/dist/interfaces/common/index.js +5 -5
  136. package/dist/interfaces/common/rpc-error.interface.d.ts +1 -1
  137. package/dist/interfaces/index.d.ts +12 -12
  138. package/dist/interfaces/index.js +12 -12
  139. package/dist/interfaces/ingredients/index.d.ts +3 -3
  140. package/dist/interfaces/ingredients/index.js +3 -3
  141. package/dist/interfaces/ingredients/ingredient-response.interface.d.ts +2 -2
  142. package/dist/interfaces/ingredients/ingredients-list-response.interface.d.ts +3 -3
  143. package/dist/interfaces/orders/index.d.ts +6 -6
  144. package/dist/interfaces/orders/index.js +6 -6
  145. package/dist/interfaces/orders/order-created.interface.d.ts +3 -3
  146. package/dist/interfaces/orders/order-with-products.interface.d.ts +2 -2
  147. package/dist/interfaces/orders/order.interface.d.ts +2 -2
  148. package/dist/interfaces/orders/responses/change-order-status-response.interface.d.ts +2 -2
  149. package/dist/interfaces/orders/responses/create-order-response.interface.d.ts +2 -2
  150. package/dist/interfaces/orders/responses/index.d.ts +4 -4
  151. package/dist/interfaces/orders/responses/index.js +4 -4
  152. package/dist/interfaces/orders/responses/order-with-products-response.interface.d.ts +2 -2
  153. package/dist/interfaces/orders/responses/orders-list-response.interface.d.ts +3 -3
  154. package/dist/interfaces/payments/audit-storage-strategy.interface.d.ts +1 -1
  155. package/dist/interfaces/payments/index.d.ts +9 -9
  156. package/dist/interfaces/payments/index.js +9 -9
  157. package/dist/interfaces/payments/payment-provider.interface.d.ts +2 -2
  158. package/dist/interfaces/payments/responses/payment-callback-response.interface.d.ts +1 -1
  159. package/dist/interfaces/products/index.d.ts +8 -8
  160. package/dist/interfaces/products/index.js +8 -8
  161. package/dist/interfaces/products/product-recipe.interface.d.ts +1 -1
  162. package/dist/interfaces/products/product-tag.interface.d.ts +1 -1
  163. package/dist/interfaces/products/product.interface.d.ts +3 -3
  164. package/dist/interfaces/products/response/complete-product-response.interface.d.ts +2 -2
  165. package/dist/interfaces/products/response/index.d.ts +6 -6
  166. package/dist/interfaces/products/response/index.js +6 -6
  167. package/dist/interfaces/products/response/product-response.interface.d.ts +2 -2
  168. package/dist/interfaces/products/response/products-list-response.interface.d.ts +3 -3
  169. package/dist/interfaces/products/response/simple-product-response.interface.d.ts +1 -1
  170. package/dist/interfaces/products/response/sub-resources/create-tag-response.interface.d.ts +2 -2
  171. package/dist/interfaces/products/response/sub-resources/delete-sub-resource-response.interface.d.ts +1 -1
  172. package/dist/interfaces/products/response/sub-resources/find-product-image-response.interface.d.ts +2 -2
  173. package/dist/interfaces/products/response/sub-resources/find-product-question-response.interface.d.ts +2 -2
  174. package/dist/interfaces/products/response/sub-resources/find-product-recipe-response.interface.d.ts +2 -2
  175. package/dist/interfaces/products/response/sub-resources/find-product-schedule-response.interface.d.ts +2 -2
  176. package/dist/interfaces/products/response/sub-resources/find-product-size-response.interface.d.ts +2 -2
  177. package/dist/interfaces/products/response/sub-resources/find-product-tag-response.interface.d.ts +2 -2
  178. package/dist/interfaces/products/response/sub-resources/find-sub-resource-response.interface.d.ts +1 -1
  179. package/dist/interfaces/products/response/sub-resources/index.d.ts +25 -25
  180. package/dist/interfaces/products/response/sub-resources/index.js +25 -25
  181. package/dist/interfaces/products/response/sub-resources/list-product-images-response.interface.d.ts +2 -2
  182. package/dist/interfaces/products/response/sub-resources/list-product-questions-response.interface.d.ts +2 -2
  183. package/dist/interfaces/products/response/sub-resources/list-product-recipes-response.interface.d.ts +2 -2
  184. package/dist/interfaces/products/response/sub-resources/list-product-schedules-response.interface.d.ts +2 -2
  185. package/dist/interfaces/products/response/sub-resources/list-product-sizes-response.interface.d.ts +2 -2
  186. package/dist/interfaces/products/response/sub-resources/list-sub-resource-response.interface.d.ts +1 -1
  187. package/dist/interfaces/products/response/sub-resources/product-schedule-availability.interface.d.ts +1 -1
  188. package/dist/interfaces/products/response/sub-resources/question-relationship.interface.d.ts +1 -1
  189. package/dist/interfaces/products/response/sub-resources/recipe-relationship.interface.d.ts +1 -1
  190. package/dist/interfaces/products/response/sub-resources/replace-sub-products-response.interface.d.ts +1 -1
  191. package/dist/interfaces/products/response/sub-resources/sub-resource-response.interface.d.ts +1 -1
  192. package/dist/interfaces/products/response/sub-resources/write-image-response.interface.d.ts +2 -2
  193. package/dist/interfaces/products/response/sub-resources/write-question-product-response.interface.d.ts +2 -2
  194. package/dist/interfaces/products/response/sub-resources/write-recipe-response.interface.d.ts +2 -2
  195. package/dist/interfaces/products/response/sub-resources/write-schedule-response.interface.d.ts +2 -2
  196. package/dist/interfaces/products/response/sub-resources/write-size-response.interface.d.ts +2 -2
  197. package/dist/interfaces/questions/index.d.ts +3 -3
  198. package/dist/interfaces/questions/index.js +3 -3
  199. package/dist/interfaces/questions/question-response.interface.d.ts +2 -2
  200. package/dist/interfaces/questions/questions-list-response.interface.d.ts +3 -3
  201. package/dist/interfaces/restaurants/index.d.ts +3 -3
  202. package/dist/interfaces/restaurants/index.js +3 -3
  203. package/dist/interfaces/restaurants/restaurant-response.interface.d.ts +2 -2
  204. package/dist/interfaces/restaurants/restaurants-list-response.interface.d.ts +3 -3
  205. package/dist/interfaces/tags/index.d.ts +3 -3
  206. package/dist/interfaces/tags/index.js +3 -3
  207. package/dist/interfaces/tags/tag-response.interface.d.ts +2 -2
  208. package/dist/interfaces/tags/tags-list-response.interface.d.ts +3 -3
  209. package/dist/interfaces/translations/index.d.ts +3 -3
  210. package/dist/interfaces/translations/index.js +3 -3
  211. package/dist/interfaces/translations/translation-response.interface.d.ts +2 -2
  212. package/dist/interfaces/translations/translations-list-response.interface.d.ts +2 -2
  213. package/dist/types/index.d.ts +1 -1
  214. package/dist/types/index.js +1 -1
  215. package/package.json +1 -1
  216. package/tsconfig.json +1 -2
  217. package/tsconfig.node.json +10 -9
  218. package/dist/dtos/orders/update-order.dto.d.ts +0 -13
  219. package/dist/dtos/orders/update-order.dto.js +0 -13
@@ -15,15 +15,17 @@
15
15
  *
16
16
  * @since 2.0.0
17
17
  */
18
- export * from './auth-commands.constant';
19
- export * from './category-commands.constant';
20
- export * from './chain-commands.constant';
21
- export * from './ingredient-commands.constant';
22
- export * from './order-commands.constant';
23
- export * from './payment-commands.constant';
24
- export * from './payment-events.constant';
25
- export * from './product-commands.constant';
26
- export * from './product-events.constant';
27
- export * from './question-commands.constant';
28
- export * from './restaurant-commands.constant';
29
- export * from './tag-commands.constant';
18
+ export * from './auth-commands.constant.js';
19
+ export * from './category-commands.constant.js';
20
+ export * from './chain-commands.constant.js';
21
+ export * from './ingredient-commands.constant.js';
22
+ export * from './order-commands.constant.js';
23
+ export * from './payment-commands.constant.js';
24
+ export * from './payment-events.constant.js';
25
+ export * from './product-commands.constant.js';
26
+ export * from './product-events.constant.js';
27
+ export * from './question-commands.constant.js';
28
+ export * from './restaurant-commands.constant.js';
29
+ export * from './tag-commands.constant.js';
30
+ export * from './translation-commands.constant.js';
31
+ export * from './services-config.constant.js';
@@ -16,24 +16,28 @@
16
16
  * @since 2.0.0
17
17
  */
18
18
  // Auth commands
19
- export * from './auth-commands.constant';
19
+ export * from './auth-commands.constant.js';
20
20
  // Category commands
21
- export * from './category-commands.constant';
21
+ export * from './category-commands.constant.js';
22
22
  // Chain commands
23
- export * from './chain-commands.constant';
23
+ export * from './chain-commands.constant.js';
24
24
  // Ingredient commands
25
- export * from './ingredient-commands.constant';
25
+ export * from './ingredient-commands.constant.js';
26
26
  // Order commands
27
- export * from './order-commands.constant';
27
+ export * from './order-commands.constant.js';
28
28
  // Payment commands and events
29
- export * from './payment-commands.constant';
30
- export * from './payment-events.constant';
29
+ export * from './payment-commands.constant.js';
30
+ export * from './payment-events.constant.js';
31
31
  // Product commands and events
32
- export * from './product-commands.constant';
33
- export * from './product-events.constant';
32
+ export * from './product-commands.constant.js';
33
+ export * from './product-events.constant.js';
34
34
  // Question commands
35
- export * from './question-commands.constant';
35
+ export * from './question-commands.constant.js';
36
36
  // Restaurant commands
37
- export * from './restaurant-commands.constant';
37
+ export * from './restaurant-commands.constant.js';
38
38
  // Tag commands
39
- export * from './tag-commands.constant';
39
+ export * from './tag-commands.constant.js';
40
+ // Translation commands
41
+ export * from './translation-commands.constant.js';
42
+ // Services config
43
+ export * from './services-config.constant.js';
@@ -88,10 +88,16 @@ export declare const PRODUCT_COMMANDS: {
88
88
  readonly IMAGE_REMOVE: "product-image.remove";
89
89
  /** Remove all images for a product */
90
90
  readonly IMAGE_REMOVE_BY_PRODUCT: "product-image.remove-by-product-id";
91
+ /** Bulk create images for a product */
92
+ readonly IMAGE_BULK_CREATE: "product-image.bulk-create";
93
+ /** Set primary image for a product */
94
+ readonly IMAGE_SET_PRIMARY: "product-image.set-primary";
91
95
  /** Create a new question for a product */
92
96
  readonly QUESTION_CREATE: "product-question.create";
93
97
  /** Retrieve all questions for a product */
94
98
  readonly QUESTION_FIND_BY_PRODUCT: "product-question.find-by-product-id";
99
+ /** Retrieve questions for a product filtered by type */
100
+ readonly QUESTION_FIND_BY_PRODUCT_AND_TYPE: "product-question.find-by-product-id-and-type";
95
101
  /** Retrieve specific product question by ID */
96
102
  readonly QUESTION_FIND_ONE: "product-question.find-one";
97
103
  /** Replace all questions for a product */
@@ -93,11 +93,17 @@ export const PRODUCT_COMMANDS = {
93
93
  IMAGE_REMOVE: 'product-image.remove',
94
94
  /** Remove all images for a product */
95
95
  IMAGE_REMOVE_BY_PRODUCT: 'product-image.remove-by-product-id',
96
+ /** Bulk create images for a product */
97
+ IMAGE_BULK_CREATE: 'product-image.bulk-create',
98
+ /** Set primary image for a product */
99
+ IMAGE_SET_PRIMARY: 'product-image.set-primary',
96
100
  // === ProductQuestion ===
97
101
  /** Create a new question for a product */
98
102
  QUESTION_CREATE: 'product-question.create',
99
103
  /** Retrieve all questions for a product */
100
104
  QUESTION_FIND_BY_PRODUCT: 'product-question.find-by-product-id',
105
+ /** Retrieve questions for a product filtered by type */
106
+ QUESTION_FIND_BY_PRODUCT_AND_TYPE: 'product-question.find-by-product-id-and-type',
101
107
  /** Retrieve specific product question by ID */
102
108
  QUESTION_FIND_ONE: 'product-question.find-one',
103
109
  /** Replace all questions for a product */
@@ -0,0 +1,3 @@
1
+ export declare const SERVICES: {
2
+ NATS_SERVICE: string;
3
+ };
@@ -0,0 +1 @@
1
+ export const SERVICES = { NATS_SERVICE: "NATS_SERVICE" };
@@ -0,0 +1,35 @@
1
+ /**
2
+ * Translation service command subjects.
3
+ *
4
+ * Centralized constant containing all subject/message keys
5
+ * for commands between client(s) and the Translation microservice.
6
+ * Each key corresponds to a MessagePattern used for inter-service communication
7
+ * regarding translation management.
8
+ *
9
+ * Naming convention:
10
+ * - Keys use SCREAMING_SNAKE_CASE.
11
+ * - Subject values use kebab-case between dots, matching the entity domain ('translation').
12
+ *
13
+ * Usage examples:
14
+ * - TRANSLATION_COMMANDS.CREATE: Subject for creating a translation.
15
+ * - TRANSLATION_COMMANDS.FIND_ALL_BY_ENTITY: Subject for retrieving translations by entity.
16
+ * - TRANSLATION_COMMANDS.FIND_ONE: Subject for fetching a specific translation by ID.
17
+ * - TRANSLATION_COMMANDS.UPDATE: Subject for updating a translation.
18
+ * - TRANSLATION_COMMANDS.DELETE: Subject for soft deleting a translation.
19
+ *
20
+ * Centralizing these keys ensures consistency, discoverability, and maintainability.
21
+ *
22
+ * @since 2.0.0
23
+ */
24
+ export declare const TRANSLATION_COMMANDS: {
25
+ /** Create a new translation */
26
+ readonly CREATE: "translation.create";
27
+ /** Retrieve all translations for a specific entity */
28
+ readonly FIND_ALL_BY_ENTITY: "translation.find-all-by-entity";
29
+ /** Retrieve a specific translation by ID */
30
+ readonly FIND_ONE: "translation.find-one";
31
+ /** Update an existing translation */
32
+ readonly UPDATE: "translation.update";
33
+ /** Soft delete a translation by ID */
34
+ readonly DELETE: "translation.delete";
35
+ };
@@ -0,0 +1,35 @@
1
+ /**
2
+ * Translation service command subjects.
3
+ *
4
+ * Centralized constant containing all subject/message keys
5
+ * for commands between client(s) and the Translation microservice.
6
+ * Each key corresponds to a MessagePattern used for inter-service communication
7
+ * regarding translation management.
8
+ *
9
+ * Naming convention:
10
+ * - Keys use SCREAMING_SNAKE_CASE.
11
+ * - Subject values use kebab-case between dots, matching the entity domain ('translation').
12
+ *
13
+ * Usage examples:
14
+ * - TRANSLATION_COMMANDS.CREATE: Subject for creating a translation.
15
+ * - TRANSLATION_COMMANDS.FIND_ALL_BY_ENTITY: Subject for retrieving translations by entity.
16
+ * - TRANSLATION_COMMANDS.FIND_ONE: Subject for fetching a specific translation by ID.
17
+ * - TRANSLATION_COMMANDS.UPDATE: Subject for updating a translation.
18
+ * - TRANSLATION_COMMANDS.DELETE: Subject for soft deleting a translation.
19
+ *
20
+ * Centralizing these keys ensures consistency, discoverability, and maintainability.
21
+ *
22
+ * @since 2.0.0
23
+ */
24
+ export const TRANSLATION_COMMANDS = {
25
+ /** Create a new translation */
26
+ CREATE: 'translation.create',
27
+ /** Retrieve all translations for a specific entity */
28
+ FIND_ALL_BY_ENTITY: 'translation.find-all-by-entity',
29
+ /** Retrieve a specific translation by ID */
30
+ FIND_ONE: 'translation.find-one',
31
+ /** Update an existing translation */
32
+ UPDATE: 'translation.update',
33
+ /** Soft delete a translation by ID */
34
+ DELETE: 'translation.delete',
35
+ };
@@ -6,5 +6,5 @@
6
6
  *
7
7
  * @since 2.0.0
8
8
  */
9
- export * from './login-user.dto';
10
- export * from './register-user.dto';
9
+ export * from './login-user.dto.js';
10
+ export * from './register-user.dto.js';
@@ -6,5 +6,5 @@
6
6
  *
7
7
  * @since 2.0.0
8
8
  */
9
- export * from './login-user.dto';
10
- export * from './register-user.dto';
9
+ export * from './login-user.dto.js';
10
+ export * from './register-user.dto.js';
@@ -6,6 +6,6 @@
6
6
  *
7
7
  * @since 2.0.0
8
8
  */
9
- export * from './create-category.dto';
10
- export * from './update-category.dto';
11
- export * from './delete-category.dto';
9
+ export * from './create-category.dto.js';
10
+ export * from './update-category.dto.js';
11
+ export * from './delete-category.dto.js';
@@ -6,6 +6,6 @@
6
6
  *
7
7
  * @since 2.0.0
8
8
  */
9
- export * from './create-category.dto';
10
- export * from './update-category.dto';
11
- export * from './delete-category.dto';
9
+ export * from './create-category.dto.js';
10
+ export * from './update-category.dto.js';
11
+ export * from './delete-category.dto.js';
@@ -1,13 +1,31 @@
1
- declare const UpdateCategoryDto_base: import("@nestjs/mapped-types").MappedType<Partial<unknown>>;
2
1
  /**
3
2
  * DTO for updating an existing category.
4
3
  *
5
- * Extends CreateCategoryDto with all fields optional.
4
+ * All fields are optional for partial updates.
6
5
  * Used by the Products microservice to update category details.
7
6
  *
8
7
  * @since 2.0.0
9
8
  */
10
- export declare class UpdateCategoryDto extends UpdateCategoryDto_base {
9
+ export declare class UpdateCategoryDto {
10
+ /**
11
+ * Category name.
12
+ * Must not be empty if provided.
13
+ *
14
+ * @example "Beverages"
15
+ */
16
+ name?: string;
17
+ /**
18
+ * Optional category description.
19
+ *
20
+ * @example "All types of drinks and beverages"
21
+ */
22
+ description?: string;
23
+ /**
24
+ * Category status (active/inactive).
25
+ *
26
+ * @example true
27
+ */
28
+ status?: boolean;
11
29
  /**
12
30
  * Category ID to update.
13
31
  * Must be a valid UUID.
@@ -23,4 +41,3 @@ export declare class UpdateCategoryDto extends UpdateCategoryDto_base {
23
41
  */
24
42
  updatedBy?: string;
25
43
  }
26
- export {};
@@ -7,18 +7,35 @@ 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 { PartialType } from '@nestjs/mapped-types';
11
- import { IsString, IsOptional, IsMongoId, IsUUID } from 'class-validator';
12
- import { CreateCategoryDto } from './create-category.dto';
10
+ import { IsString, IsOptional, IsMongoId, IsUUID, IsBoolean } from 'class-validator';
13
11
  /**
14
12
  * DTO for updating an existing category.
15
13
  *
16
- * Extends CreateCategoryDto with all fields optional.
14
+ * All fields are optional for partial updates.
17
15
  * Used by the Products microservice to update category details.
18
16
  *
19
17
  * @since 2.0.0
20
18
  */
21
- export class UpdateCategoryDto extends PartialType(CreateCategoryDto) {
19
+ export class UpdateCategoryDto {
20
+ /**
21
+ * Category name.
22
+ * Must not be empty if provided.
23
+ *
24
+ * @example "Beverages"
25
+ */
26
+ name;
27
+ /**
28
+ * Optional category description.
29
+ *
30
+ * @example "All types of drinks and beverages"
31
+ */
32
+ description;
33
+ /**
34
+ * Category status (active/inactive).
35
+ *
36
+ * @example true
37
+ */
38
+ status;
22
39
  /**
23
40
  * Category ID to update.
24
41
  * Must be a valid UUID.
@@ -35,14 +52,29 @@ export class UpdateCategoryDto extends PartialType(CreateCategoryDto) {
35
52
  updatedBy;
36
53
  }
37
54
  __decorate([
55
+ IsOptional(),
38
56
  IsString(),
39
- IsUUID(),
57
+ __metadata("design:type", String)
58
+ ], UpdateCategoryDto.prototype, "name", void 0);
59
+ __decorate([
40
60
  IsOptional(),
61
+ IsString(),
62
+ __metadata("design:type", String)
63
+ ], UpdateCategoryDto.prototype, "description", void 0);
64
+ __decorate([
65
+ IsOptional(),
66
+ IsBoolean(),
67
+ __metadata("design:type", Boolean)
68
+ ], UpdateCategoryDto.prototype, "status", void 0);
69
+ __decorate([
70
+ IsOptional(),
71
+ IsString(),
72
+ IsUUID(),
41
73
  __metadata("design:type", String)
42
74
  ], UpdateCategoryDto.prototype, "id", void 0);
43
75
  __decorate([
76
+ IsOptional(),
44
77
  IsString(),
45
78
  IsMongoId(),
46
- IsOptional(),
47
79
  __metadata("design:type", String)
48
80
  ], UpdateCategoryDto.prototype, "updatedBy", void 0);
@@ -1,4 +1,4 @@
1
- import { Currency } from '../../enums/currency.enum';
1
+ import { Currency } from '../../enums/currency.enum.js';
2
2
  /**
3
3
  * DTO for creating a new chain.
4
4
  *
@@ -8,7 +8,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
10
  import { IsString, IsOptional, IsNumber, Min, Max, IsEnum, IsMongoId } from 'class-validator';
11
- import { Currency } from '../../enums/currency.enum';
11
+ import { Currency } from '../../enums/currency.enum.js';
12
12
  /**
13
13
  * DTO for creating a new chain.
14
14
  *
@@ -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';
@@ -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,4 +1,4 @@
1
- declare const UpdateChainDto_base: import("@nestjs/mapped-types").MappedType<Partial<unknown>>;
1
+ import { Currency } from "../../enums/currency.enum.js";
2
2
  /**
3
3
  * DTO for updating an existing chain.
4
4
  *
@@ -7,7 +7,32 @@ declare const UpdateChainDto_base: import("@nestjs/mapped-types").MappedType<Par
7
7
  *
8
8
  * @since 2.0.0
9
9
  */
10
- export declare class UpdateChainDto extends UpdateChainDto_base {
10
+ export declare class UpdateChainDto {
11
+ /**
12
+ * Chain name.
13
+ * Must not be empty.
14
+ *
15
+ * @example "McDonald's"
16
+ */
17
+ name?: string;
18
+ /**
19
+ * Chain currency code.
20
+ * Must be a valid Currency enum value.
21
+ * Defaults to PEN if not provided.
22
+ *
23
+ * @example Currency.PEN
24
+ * @default Currency.PEN
25
+ */
26
+ currency?: Currency;
27
+ /**
28
+ * Global tax percentage for the chain.
29
+ * Must be between 0 and 100 if provided.
30
+ * Defaults to 0 if not provided.
31
+ *
32
+ * @example 8.5
33
+ * @default 0.0
34
+ */
35
+ taxPercent?: number;
11
36
  /**
12
37
  * Chain ID to update.
13
38
  * Must be a valid UUID.
@@ -23,4 +48,3 @@ export declare class UpdateChainDto extends UpdateChainDto_base {
23
48
  */
24
49
  updatedBy?: string;
25
50
  }
26
- export {};
@@ -7,9 +7,8 @@ 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 { PartialType } from '@nestjs/mapped-types';
11
- import { IsString, IsOptional, IsMongoId, IsUUID } from 'class-validator';
12
- import { CreateChainDto } from './create-chain.dto';
10
+ import { IsString, IsOptional, IsMongoId, IsUUID, IsNumber, Max, Min, IsEnum, } from "class-validator";
11
+ import { Currency } from "../../enums/currency.enum.js";
13
12
  /**
14
13
  * DTO for updating an existing chain.
15
14
  *
@@ -18,7 +17,32 @@ import { CreateChainDto } from './create-chain.dto';
18
17
  *
19
18
  * @since 2.0.0
20
19
  */
21
- export class UpdateChainDto extends PartialType(CreateChainDto) {
20
+ export class UpdateChainDto {
21
+ /**
22
+ * Chain name.
23
+ * Must not be empty.
24
+ *
25
+ * @example "McDonald's"
26
+ */
27
+ name;
28
+ /**
29
+ * Chain currency code.
30
+ * Must be a valid Currency enum value.
31
+ * Defaults to PEN if not provided.
32
+ *
33
+ * @example Currency.PEN
34
+ * @default Currency.PEN
35
+ */
36
+ currency = Currency.PEN;
37
+ /**
38
+ * Global tax percentage for the chain.
39
+ * Must be between 0 and 100 if provided.
40
+ * Defaults to 0 if not provided.
41
+ *
42
+ * @example 8.5
43
+ * @default 0.0
44
+ */
45
+ taxPercent = 0.0;
22
46
  /**
23
47
  * Chain ID to update.
24
48
  * Must be a valid UUID.
@@ -34,6 +58,23 @@ export class UpdateChainDto extends PartialType(CreateChainDto) {
34
58
  */
35
59
  updatedBy;
36
60
  }
61
+ __decorate([
62
+ IsString(),
63
+ IsOptional(),
64
+ __metadata("design:type", String)
65
+ ], UpdateChainDto.prototype, "name", void 0);
66
+ __decorate([
67
+ IsOptional(),
68
+ IsEnum(Currency, { message: "Currency must be a valid currency code" }),
69
+ __metadata("design:type", String)
70
+ ], UpdateChainDto.prototype, "currency", void 0);
71
+ __decorate([
72
+ IsOptional(),
73
+ IsNumber({}, { message: "Tax percentage must be a number" }),
74
+ Min(0, { message: "Tax percentage must be at least 0" }),
75
+ Max(100, { message: "Tax percentage must be at most 100" }),
76
+ __metadata("design:type", Number)
77
+ ], UpdateChainDto.prototype, "taxPercent", void 0);
37
78
  __decorate([
38
79
  IsString(),
39
80
  IsUUID(),
@@ -6,4 +6,5 @@
6
6
  *
7
7
  * @since 2.0.0
8
8
  */
9
- export * from './pagination.dto';
9
+ export * from './pagination.dto.js';
10
+ export * from './search-by-name.dto.js';
@@ -6,4 +6,5 @@
6
6
  *
7
7
  * @since 2.0.0
8
8
  */
9
- export * from './pagination.dto';
9
+ export * from './pagination.dto.js';
10
+ export * from './search-by-name.dto.js';
@@ -0,0 +1,4 @@
1
+ import { PaginationDto } from './pagination.dto.js';
2
+ export declare class SearchByNameDto extends PaginationDto {
3
+ name: string;
4
+ }
@@ -0,0 +1,19 @@
1
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
2
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
4
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
5
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
6
+ };
7
+ var __metadata = (this && this.__metadata) || function (k, v) {
8
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
9
+ };
10
+ import { IsNotEmpty, IsString } from 'class-validator';
11
+ import { PaginationDto } from './pagination.dto.js';
12
+ export class SearchByNameDto extends PaginationDto {
13
+ name;
14
+ }
15
+ __decorate([
16
+ IsString(),
17
+ IsNotEmpty(),
18
+ __metadata("design:type", String)
19
+ ], SearchByNameDto.prototype, "name", void 0);
@@ -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";
@@ -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";
@@ -6,7 +6,7 @@
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';
12
+ export * from './search-by-name.dto.js';
@@ -6,7 +6,7 @@
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';
12
+ export * from './search-by-name.dto.js';
@@ -1,4 +1,4 @@
1
- import { PaginationDto } from '../common/pagination.dto';
1
+ import { PaginationDto } from '../common/pagination.dto.js';
2
2
  /**
3
3
  * DTO for searching ingredients by name.
4
4
  *
@@ -8,7 +8,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
10
  import { IsString, IsNotEmpty } from 'class-validator';
11
- import { PaginationDto } from '../common/pagination.dto';
11
+ import { PaginationDto } from '../common/pagination.dto.js';
12
12
  /**
13
13
  * DTO for searching ingredients by name.
14
14
  *