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.
Files changed (284) 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/auth/register-user.dto.js +4 -1
  12. package/dist/dtos/categories/create-category.dto.js +6 -3
  13. package/dist/dtos/categories/delete-category.dto.d.ts +1 -1
  14. package/dist/dtos/categories/delete-category.dto.js +5 -3
  15. package/dist/dtos/categories/index.d.ts +3 -3
  16. package/dist/dtos/categories/index.js +3 -3
  17. package/dist/dtos/categories/update-category.dto.d.ts +30 -11
  18. package/dist/dtos/categories/update-category.dto.js +48 -14
  19. package/dist/dtos/chain/create-chain.dto.d.ts +12 -13
  20. package/dist/dtos/chain/create-chain.dto.js +16 -15
  21. package/dist/dtos/chain/delete-chain.dto.d.ts +6 -6
  22. package/dist/dtos/chain/delete-chain.dto.js +11 -9
  23. package/dist/dtos/chain/index.d.ts +3 -3
  24. package/dist/dtos/chain/index.js +3 -3
  25. package/dist/dtos/chain/update-chain.dto.d.ts +45 -11
  26. package/dist/dtos/chain/update-chain.dto.js +67 -15
  27. package/dist/dtos/common/index.d.ts +2 -1
  28. package/dist/dtos/common/index.js +2 -1
  29. package/dist/dtos/common/search-by-name.dto.d.ts +27 -0
  30. package/dist/dtos/{tags → common}/search-by-name.dto.js +18 -9
  31. package/dist/dtos/index.d.ts +12 -12
  32. package/dist/dtos/index.js +12 -12
  33. package/dist/dtos/ingredients/create-ingredient.dto.d.ts +5 -5
  34. package/dist/dtos/ingredients/create-ingredient.dto.js +9 -8
  35. package/dist/dtos/ingredients/delete-ingredient.dto.d.ts +14 -7
  36. package/dist/dtos/ingredients/delete-ingredient.dto.js +18 -9
  37. package/dist/dtos/ingredients/index.d.ts +3 -4
  38. package/dist/dtos/ingredients/index.js +3 -4
  39. package/dist/dtos/ingredients/update-ingredient.dto.d.ts +32 -11
  40. package/dist/dtos/ingredients/update-ingredient.dto.js +48 -15
  41. package/dist/dtos/orders/change-order-status.dto.d.ts +19 -10
  42. package/dist/dtos/orders/change-order-status.dto.js +27 -14
  43. package/dist/dtos/orders/create-order.dto.d.ts +34 -24
  44. package/dist/dtos/orders/create-order.dto.js +44 -32
  45. package/dist/dtos/orders/index.d.ts +5 -6
  46. package/dist/dtos/orders/index.js +5 -6
  47. package/dist/dtos/orders/order-item.dto.d.ts +35 -18
  48. package/dist/dtos/orders/order-item.dto.js +54 -32
  49. package/dist/dtos/orders/order-pagination.dto.d.ts +2 -2
  50. package/dist/dtos/orders/order-pagination.dto.js +4 -4
  51. package/dist/dtos/orders/paid-order.dto.d.ts +16 -8
  52. package/dist/dtos/orders/paid-order.dto.js +25 -14
  53. package/dist/dtos/payments/create-payment-audit-dynamo.dto.d.ts +81 -0
  54. package/dist/dtos/payments/create-payment-audit-dynamo.dto.js +81 -0
  55. package/dist/dtos/payments/create-payment-audit-s3.dto.d.ts +81 -0
  56. package/dist/dtos/payments/create-payment-audit-s3.dto.js +81 -0
  57. package/dist/dtos/payments/index.d.ts +5 -3
  58. package/dist/dtos/payments/index.js +5 -3
  59. package/dist/dtos/payments/payment-session-item.dto.d.ts +4 -4
  60. package/dist/dtos/payments/payment-session-item.dto.js +7 -4
  61. package/dist/dtos/payments/payment-session.dto.d.ts +1 -1
  62. package/dist/dtos/payments/payment-session.dto.js +1 -1
  63. package/dist/dtos/payments/webhook-data.dto.d.ts +1 -1
  64. package/dist/dtos/payments/webhook-data.dto.js +1 -0
  65. package/dist/dtos/products/create-product.dto.d.ts +2 -2
  66. package/dist/dtos/products/create-product.dto.js +3 -2
  67. package/dist/dtos/products/delete-product.dto.d.ts +1 -1
  68. package/dist/dtos/products/delete-product.dto.js +5 -3
  69. package/dist/dtos/products/index.d.ts +4 -4
  70. package/dist/dtos/products/index.js +4 -4
  71. package/dist/dtos/products/submodules/index.d.ts +6 -6
  72. package/dist/dtos/products/submodules/index.js +6 -6
  73. package/dist/dtos/products/submodules/product-image/bulk-create-product-image.dto.d.ts +3 -3
  74. package/dist/dtos/products/submodules/product-image/bulk-create-product-image.dto.js +5 -5
  75. package/dist/dtos/products/submodules/product-image/create-product-image.dto.d.ts +1 -1
  76. package/dist/dtos/products/submodules/product-image/create-product-image.dto.js +4 -4
  77. package/dist/dtos/products/submodules/product-image/index.d.ts +4 -4
  78. package/dist/dtos/products/submodules/product-image/index.js +4 -4
  79. package/dist/dtos/products/submodules/product-image/update-product-image.dto.d.ts +1 -1
  80. package/dist/dtos/products/submodules/product-image/update-product-image.dto.js +4 -4
  81. package/dist/dtos/products/submodules/product-question/create-product-question.dto.d.ts +2 -2
  82. package/dist/dtos/products/submodules/product-question/create-product-question.dto.js +8 -8
  83. package/dist/dtos/products/submodules/product-question/find-by-product-id-and-type.dto.d.ts +1 -1
  84. package/dist/dtos/products/submodules/product-question/find-by-product-id-and-type.dto.js +1 -1
  85. package/dist/dtos/products/submodules/product-question/index.d.ts +4 -4
  86. package/dist/dtos/products/submodules/product-question/index.js +4 -4
  87. package/dist/dtos/products/submodules/product-question/replace-by-product-id.dto.d.ts +2 -2
  88. package/dist/dtos/products/submodules/product-question/replace-by-product-id.dto.js +1 -1
  89. package/dist/dtos/products/submodules/product-question/update-product-question.dto.d.ts +2 -2
  90. package/dist/dtos/products/submodules/product-question/update-product-question.dto.js +5 -5
  91. package/dist/dtos/products/submodules/product-recipe/create-product-recipe.dto.d.ts +1 -1
  92. package/dist/dtos/products/submodules/product-recipe/create-product-recipe.dto.js +2 -2
  93. package/dist/dtos/products/submodules/product-recipe/index.d.ts +3 -3
  94. package/dist/dtos/products/submodules/product-recipe/index.js +3 -3
  95. package/dist/dtos/products/submodules/product-recipe/replace-by-product-id.dto.d.ts +2 -2
  96. package/dist/dtos/products/submodules/product-recipe/replace-by-product-id.dto.js +5 -5
  97. package/dist/dtos/products/submodules/product-recipe/update-product-recipe.dto.d.ts +1 -8
  98. package/dist/dtos/products/submodules/product-recipe/update-product-recipe.dto.js +3 -16
  99. package/dist/dtos/products/submodules/product-schedule/create-product-schedule.dto.d.ts +1 -1
  100. package/dist/dtos/products/submodules/product-schedule/create-product-schedule.dto.js +2 -2
  101. package/dist/dtos/products/submodules/product-schedule/index.d.ts +4 -4
  102. package/dist/dtos/products/submodules/product-schedule/index.js +4 -4
  103. package/dist/dtos/products/submodules/product-schedule/replace-by-product-id.dto.d.ts +2 -2
  104. package/dist/dtos/products/submodules/product-schedule/replace-by-product-id.dto.js +1 -1
  105. package/dist/dtos/products/submodules/product-schedule/update-product-schedule.dto.d.ts +1 -1
  106. package/dist/dtos/products/submodules/product-schedule/update-product-schedule.dto.js +4 -4
  107. package/dist/dtos/products/submodules/product-size/create-product-size.dto.js +1 -1
  108. package/dist/dtos/products/submodules/product-size/index.d.ts +4 -4
  109. package/dist/dtos/products/submodules/product-size/index.js +4 -4
  110. package/dist/dtos/products/submodules/product-size/product-size-data.dto.js +1 -1
  111. package/dist/dtos/products/submodules/product-size/replace-by-product-id.dto.d.ts +1 -1
  112. package/dist/dtos/products/submodules/product-size/replace-by-product-id.dto.js +1 -1
  113. package/dist/dtos/products/submodules/product-size/update-product-size.dto.d.ts +1 -1
  114. package/dist/dtos/products/submodules/product-size/update-product-size.dto.js +2 -2
  115. package/dist/dtos/products/submodules/product-tag/index.d.ts +2 -4
  116. package/dist/dtos/products/submodules/product-tag/index.js +2 -4
  117. package/dist/dtos/products/submodules/product-tag/{remove-product-tag.dto.d.ts → product-tag.dto.d.ts} +1 -1
  118. package/dist/dtos/products/submodules/product-tag/{remove-product-tag.dto.js → product-tag.dto.js} +3 -3
  119. package/dist/dtos/products/update-product.dto.d.ts +40 -5
  120. package/dist/dtos/products/update-product.dto.js +73 -7
  121. package/dist/dtos/questions/create-question.dto.d.ts +2 -2
  122. package/dist/dtos/questions/create-question.dto.js +3 -2
  123. package/dist/dtos/questions/delete-question.dto.d.ts +1 -1
  124. package/dist/dtos/questions/delete-question.dto.js +5 -3
  125. package/dist/dtos/questions/index.d.ts +3 -4
  126. package/dist/dtos/questions/index.js +3 -4
  127. package/dist/dtos/questions/update-question.dto.d.ts +40 -5
  128. package/dist/dtos/questions/update-question.dto.js +70 -8
  129. package/dist/dtos/restaurants/create-restaurant.dto.d.ts +15 -1
  130. package/dist/dtos/restaurants/create-restaurant.dto.js +38 -2
  131. package/dist/dtos/restaurants/delete-restaurant.dto.d.ts +1 -1
  132. package/dist/dtos/restaurants/delete-restaurant.dto.js +5 -3
  133. package/dist/dtos/restaurants/index.d.ts +3 -3
  134. package/dist/dtos/restaurants/index.js +3 -3
  135. package/dist/dtos/restaurants/update-restaurant.dto.d.ts +50 -5
  136. package/dist/dtos/restaurants/update-restaurant.dto.js +92 -8
  137. package/dist/dtos/tags/create-tag.dto.d.ts +1 -1
  138. package/dist/dtos/tags/create-tag.dto.js +5 -4
  139. package/dist/dtos/tags/delete-tag.dto.d.ts +1 -1
  140. package/dist/dtos/tags/delete-tag.dto.js +5 -3
  141. package/dist/dtos/tags/index.d.ts +3 -4
  142. package/dist/dtos/tags/index.js +3 -4
  143. package/dist/dtos/tags/update-tag.dto.d.ts +10 -5
  144. package/dist/dtos/tags/update-tag.dto.js +20 -8
  145. package/dist/dtos/translations/create-translation.dto.d.ts +1 -1
  146. package/dist/dtos/translations/create-translation.dto.js +7 -2
  147. package/dist/dtos/translations/delete-translation.dto.d.ts +1 -1
  148. package/dist/dtos/translations/delete-translation.dto.js +4 -3
  149. package/dist/dtos/translations/find-translations-by-entity.dto.d.ts +1 -1
  150. package/dist/dtos/translations/find-translations-by-entity.dto.js +1 -1
  151. package/dist/dtos/translations/index.d.ts +4 -4
  152. package/dist/dtos/translations/index.js +4 -4
  153. package/dist/dtos/translations/update-translation.dto.d.ts +33 -4
  154. package/dist/dtos/translations/update-translation.dto.js +69 -6
  155. package/dist/enums/index.d.ts +10 -12
  156. package/dist/enums/index.js +10 -12
  157. package/dist/index.d.ts +5 -5
  158. package/dist/index.js +5 -5
  159. package/dist/interfaces/auth/access-user.interface.d.ts +2 -2
  160. package/dist/interfaces/auth/account.interface.d.ts +1 -1
  161. package/dist/interfaces/auth/full-token.interface.d.ts +2 -2
  162. package/dist/interfaces/auth/index.d.ts +9 -9
  163. package/dist/interfaces/auth/index.js +9 -9
  164. package/dist/interfaces/auth/payload-jwt.interface.d.ts +2 -2
  165. package/dist/interfaces/auth/responses/auth-response.interface.d.ts +3 -3
  166. package/dist/interfaces/auth/responses/index.d.ts +2 -2
  167. package/dist/interfaces/auth/responses/index.js +2 -2
  168. package/dist/interfaces/auth/responses/refresh-token-response.interface.d.ts +2 -2
  169. package/dist/interfaces/auth/user.interface.d.ts +2 -2
  170. package/dist/interfaces/auth/validate-user.interface.d.ts +2 -2
  171. package/dist/interfaces/categories/categories-list-response.interface.d.ts +3 -3
  172. package/dist/interfaces/categories/category-response.interface.d.ts +2 -2
  173. package/dist/interfaces/categories/index.d.ts +3 -3
  174. package/dist/interfaces/categories/index.js +3 -3
  175. package/dist/interfaces/chains/chain-response.interface.d.ts +2 -2
  176. package/dist/interfaces/chains/chain.interface.d.ts +1 -1
  177. package/dist/interfaces/chains/chains-list-response.interface.d.ts +3 -3
  178. package/dist/interfaces/chains/index.d.ts +3 -3
  179. package/dist/interfaces/chains/index.js +3 -3
  180. package/dist/interfaces/common/api-error-response.interface.d.ts +2 -2
  181. package/dist/interfaces/common/api-response.interface.d.ts +3 -2
  182. package/dist/interfaces/common/index.d.ts +5 -5
  183. package/dist/interfaces/common/index.js +5 -5
  184. package/dist/interfaces/common/rpc-error.interface.d.ts +1 -1
  185. package/dist/interfaces/index.d.ts +12 -12
  186. package/dist/interfaces/index.js +12 -12
  187. package/dist/interfaces/ingredients/index.d.ts +3 -3
  188. package/dist/interfaces/ingredients/index.js +3 -3
  189. package/dist/interfaces/ingredients/ingredient-response.interface.d.ts +2 -2
  190. package/dist/interfaces/ingredients/ingredients-list-response.interface.d.ts +3 -3
  191. package/dist/interfaces/orders/index.d.ts +6 -6
  192. package/dist/interfaces/orders/index.js +6 -6
  193. package/dist/interfaces/orders/order-created.interface.d.ts +3 -3
  194. package/dist/interfaces/orders/order-item.interface.d.ts +4 -4
  195. package/dist/interfaces/orders/order-with-products.interface.d.ts +2 -2
  196. package/dist/interfaces/orders/order.interface.d.ts +9 -9
  197. package/dist/interfaces/orders/responses/change-order-status-response.interface.d.ts +2 -2
  198. package/dist/interfaces/orders/responses/create-order-response.interface.d.ts +2 -2
  199. package/dist/interfaces/orders/responses/index.d.ts +4 -4
  200. package/dist/interfaces/orders/responses/index.js +4 -4
  201. package/dist/interfaces/orders/responses/order-with-products-response.interface.d.ts +2 -2
  202. package/dist/interfaces/orders/responses/orders-list-response.interface.d.ts +3 -3
  203. package/dist/interfaces/payments/audit-storage-strategy.interface.d.ts +1 -1
  204. package/dist/interfaces/payments/index.d.ts +9 -9
  205. package/dist/interfaces/payments/index.js +9 -9
  206. package/dist/interfaces/payments/payment-provider.interface.d.ts +2 -2
  207. package/dist/interfaces/payments/responses/payment-callback-response.interface.d.ts +1 -1
  208. package/dist/interfaces/products/index.d.ts +8 -8
  209. package/dist/interfaces/products/index.js +8 -8
  210. package/dist/interfaces/products/product-recipe.interface.d.ts +1 -1
  211. package/dist/interfaces/products/product-tag.interface.d.ts +1 -1
  212. package/dist/interfaces/products/product.interface.d.ts +3 -3
  213. package/dist/interfaces/products/response/complete-product-response.interface.d.ts +2 -2
  214. package/dist/interfaces/products/response/index.d.ts +6 -6
  215. package/dist/interfaces/products/response/index.js +6 -6
  216. package/dist/interfaces/products/response/product-response.interface.d.ts +2 -2
  217. package/dist/interfaces/products/response/products-list-response.interface.d.ts +3 -3
  218. package/dist/interfaces/products/response/simple-product-response.interface.d.ts +1 -1
  219. package/dist/interfaces/products/response/sub-resources/create-tag-response.interface.d.ts +2 -2
  220. package/dist/interfaces/products/response/sub-resources/delete-sub-resource-response.interface.d.ts +1 -1
  221. package/dist/interfaces/products/response/sub-resources/find-product-image-response.interface.d.ts +2 -2
  222. package/dist/interfaces/products/response/sub-resources/find-product-question-response.interface.d.ts +2 -2
  223. package/dist/interfaces/products/response/sub-resources/find-product-recipe-response.interface.d.ts +2 -2
  224. package/dist/interfaces/products/response/sub-resources/find-product-schedule-response.interface.d.ts +2 -2
  225. package/dist/interfaces/products/response/sub-resources/find-product-size-response.interface.d.ts +2 -2
  226. package/dist/interfaces/products/response/sub-resources/find-product-tag-response.interface.d.ts +2 -2
  227. package/dist/interfaces/products/response/sub-resources/find-sub-resource-response.interface.d.ts +1 -1
  228. package/dist/interfaces/products/response/sub-resources/index.d.ts +25 -25
  229. package/dist/interfaces/products/response/sub-resources/index.js +25 -25
  230. package/dist/interfaces/products/response/sub-resources/list-product-images-response.interface.d.ts +2 -2
  231. package/dist/interfaces/products/response/sub-resources/list-product-questions-response.interface.d.ts +2 -2
  232. package/dist/interfaces/products/response/sub-resources/list-product-recipes-response.interface.d.ts +2 -2
  233. package/dist/interfaces/products/response/sub-resources/list-product-schedules-response.interface.d.ts +2 -2
  234. package/dist/interfaces/products/response/sub-resources/list-product-sizes-response.interface.d.ts +2 -2
  235. package/dist/interfaces/products/response/sub-resources/list-sub-resource-response.interface.d.ts +1 -1
  236. package/dist/interfaces/products/response/sub-resources/product-schedule-availability.interface.d.ts +1 -1
  237. package/dist/interfaces/products/response/sub-resources/question-relationship.interface.d.ts +1 -1
  238. package/dist/interfaces/products/response/sub-resources/recipe-relationship.interface.d.ts +1 -1
  239. package/dist/interfaces/products/response/sub-resources/replace-sub-products-response.interface.d.ts +1 -1
  240. package/dist/interfaces/products/response/sub-resources/sub-resource-response.interface.d.ts +1 -1
  241. package/dist/interfaces/products/response/sub-resources/write-image-response.interface.d.ts +2 -2
  242. package/dist/interfaces/products/response/sub-resources/write-question-product-response.interface.d.ts +2 -2
  243. package/dist/interfaces/products/response/sub-resources/write-recipe-response.interface.d.ts +2 -2
  244. package/dist/interfaces/products/response/sub-resources/write-schedule-response.interface.d.ts +2 -2
  245. package/dist/interfaces/products/response/sub-resources/write-size-response.interface.d.ts +2 -2
  246. package/dist/interfaces/questions/index.d.ts +3 -3
  247. package/dist/interfaces/questions/index.js +3 -3
  248. package/dist/interfaces/questions/question-response.interface.d.ts +2 -2
  249. package/dist/interfaces/questions/questions-list-response.interface.d.ts +3 -3
  250. package/dist/interfaces/restaurants/index.d.ts +3 -3
  251. package/dist/interfaces/restaurants/index.js +3 -3
  252. package/dist/interfaces/restaurants/restaurant-response.interface.d.ts +2 -2
  253. package/dist/interfaces/restaurants/restaurants-list-response.interface.d.ts +3 -3
  254. package/dist/interfaces/tags/index.d.ts +3 -3
  255. package/dist/interfaces/tags/index.js +3 -3
  256. package/dist/interfaces/tags/tag-response.interface.d.ts +2 -2
  257. package/dist/interfaces/tags/tags-list-response.interface.d.ts +3 -3
  258. package/dist/interfaces/translations/index.d.ts +3 -3
  259. package/dist/interfaces/translations/index.js +3 -3
  260. package/dist/interfaces/translations/translation-response.interface.d.ts +2 -2
  261. package/dist/interfaces/translations/translations-list-response.interface.d.ts +2 -2
  262. package/dist/types/index.d.ts +2 -1
  263. package/dist/types/index.js +2 -1
  264. package/dist/types/order-mode.type.d.ts +12 -3
  265. package/dist/types/order-mode.type.js +20 -1
  266. package/dist/types/order-status.type.d.ts +22 -0
  267. package/dist/{enums/order-status.enum.d.ts → types/order-status.type.js} +25 -26
  268. package/package.json +1 -1
  269. package/tsconfig.json +1 -2
  270. package/tsconfig.node.json +10 -9
  271. package/dist/dtos/ingredients/search-by-name.dto.d.ts +0 -18
  272. package/dist/dtos/ingredients/search-by-name.dto.js +0 -33
  273. package/dist/dtos/orders/update-order.dto.d.ts +0 -13
  274. package/dist/dtos/orders/update-order.dto.js +0 -13
  275. package/dist/dtos/products/submodules/product-tag/create-product-tag.dto.d.ts +0 -24
  276. package/dist/dtos/products/submodules/product-tag/create-product-tag.dto.js +0 -46
  277. package/dist/dtos/products/submodules/product-tag/find-product-tag.dto.d.ts +0 -24
  278. package/dist/dtos/products/submodules/product-tag/find-product-tag.dto.js +0 -46
  279. package/dist/dtos/questions/search-by-name.dto.d.ts +0 -18
  280. package/dist/dtos/questions/search-by-name.dto.js +0 -33
  281. package/dist/dtos/tags/search-by-name.dto.d.ts +0 -18
  282. package/dist/enums/order-status.enum.js +0 -69
  283. package/dist/enums/order-type.enum.d.ts +0 -45
  284. package/dist/enums/order-type.enum.js +0 -46
@@ -7,26 +7,26 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
7
7
  var __metadata = (this && this.__metadata) || function (k, v) {
8
8
  if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
9
9
  };
10
- import { IsString, IsMongoId, IsUUID } from 'class-validator';
10
+ import { IsString, IsMongoId, IsUUID, IsNotEmpty } from "class-validator";
11
11
  /**
12
12
  * DTO for deleting a chain.
13
13
  *
14
14
  * Used by the Products microservice to soft-delete chains.
15
- * Includes chain ID and user who performed the deletion.
15
+ * Holds the chain unique identifier and the user who performed the deletion.
16
16
  *
17
17
  * @since 2.0.0
18
18
  */
19
19
  export class DeleteChainDto {
20
20
  /**
21
- * Chain ID to delete.
22
- * Must be a valid UUID.
21
+ * Unique identifier of the chain to delete.
22
+ * Required. Must be a valid UUID format.
23
23
  *
24
24
  * @example "550e8400-e29b-41d4-a716-446655440000"
25
25
  */
26
- id;
26
+ chainId;
27
27
  /**
28
- * User who deleted the chain.
29
- * Must be a valid MongoDB ObjectId.
28
+ * Unique identifier of the user performing the deletion.
29
+ * Required. Must be a valid MongoDB ObjectId.
30
30
  *
31
31
  * @example "507f1f77bcf86cd799439011"
32
32
  */
@@ -35,10 +35,12 @@ export class DeleteChainDto {
35
35
  __decorate([
36
36
  IsString(),
37
37
  IsUUID(),
38
+ IsNotEmpty({ message: 'chainId is required and must be a valid UUID.' }),
38
39
  __metadata("design:type", String)
39
- ], DeleteChainDto.prototype, "id", void 0);
40
+ ], DeleteChainDto.prototype, "chainId", void 0);
40
41
  __decorate([
41
42
  IsString(),
42
- IsMongoId(),
43
+ IsMongoId({ message: 'deletedBy must be a valid MongoDB ObjectId.' }),
44
+ IsNotEmpty({ message: 'deletedBy is required and must be a valid MongoDB ObjectId.' }),
43
45
  __metadata("design:type", String)
44
46
  ], DeleteChainDto.prototype, "deletedBy", void 0);
@@ -6,6 +6,6 @@
6
6
  *
7
7
  * @since 2.0.0
8
8
  */
9
- export * from './create-chain.dto';
10
- export * from './update-chain.dto';
11
- export * from './delete-chain.dto';
9
+ export * from './create-chain.dto.js';
10
+ export * from './update-chain.dto.js';
11
+ export * from './delete-chain.dto.js';
@@ -6,6 +6,6 @@
6
6
  *
7
7
  * @since 2.0.0
8
8
  */
9
- export * from './create-chain.dto';
10
- export * from './update-chain.dto';
11
- export * from './delete-chain.dto';
9
+ export * from './create-chain.dto.js';
10
+ export * from './update-chain.dto.js';
11
+ export * from './delete-chain.dto.js';
@@ -1,26 +1,60 @@
1
- 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
  *
5
- * Extends CreateChainDto with all fields optional.
6
- * Used by the Products microservice to update chain details.
5
+ * Provides structure and validation for payloads to update a chain (restaurant brand)
6
+ * in the system. All fields related to chain details are optional to allow partial updates,
7
+ * but identifiers (chainId, updatedBy) are required for correct auditing and entity targeting.
8
+ *
9
+ * Used by the Products microservice to apply modifications to the properties of an existing chain.
7
10
  *
8
11
  * @since 2.0.0
12
+ *
13
+ * @example
14
+ * {
15
+ * "chainId": "550e8400-e29b-41d4-a716-446655440000",
16
+ * "name": "McDonald's",
17
+ * "currency": "PEN",
18
+ * "taxPercent": 8.5,
19
+ * "updatedBy": "507f1f77bcf86cd799439011"
20
+ * }
9
21
  */
10
- export declare class UpdateChainDto extends UpdateChainDto_base {
22
+ export declare class UpdateChainDto {
23
+ /**
24
+ * The name of the chain (brand).
25
+ * Optional. If provided, must have at least 3 characters.
26
+ *
27
+ * @example "McDonald's"
28
+ */
29
+ name?: string;
30
+ /**
31
+ * The currency code for the chain.
32
+ * Optional. Must be a value from the Currency enum if provided.
33
+ *
34
+ * @example Currency.PEN
35
+ * @default Currency.PEN
36
+ */
37
+ currency?: Currency;
38
+ /**
39
+ * Global tax percentage applied across the chain.
40
+ * Optional. Must be a number between 0 and 100 if provided.
41
+ *
42
+ * @example 8.5
43
+ * @default 0.0
44
+ */
45
+ taxPercent?: number;
11
46
  /**
12
- * Chain ID to update.
13
- * Must be a valid UUID.
47
+ * Unique identifier of the chain to update.
48
+ * Required. Must be a valid UUID string.
14
49
  *
15
50
  * @example "550e8400-e29b-41d4-a716-446655440000"
16
51
  */
17
- id?: string;
52
+ chainId: string;
18
53
  /**
19
- * User who updated the chain.
20
- * Must be a valid MongoDB ObjectId if provided.
54
+ * Unique identifier of the user performing the update.
55
+ * Required. Must be a valid MongoDB ObjectId.
21
56
  *
22
57
  * @example "507f1f77bcf86cd799439011"
23
58
  */
24
- updatedBy?: string;
59
+ updatedBy: string;
25
60
  }
26
- export {};
@@ -7,42 +7,94 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
7
7
  var __metadata = (this && this.__metadata) || function (k, v) {
8
8
  if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
9
9
  };
10
- import { 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, MinLength, IsNotEmpty, } from "class-validator";
11
+ import { Currency } from "../../enums/currency.enum.js";
13
12
  /**
14
13
  * DTO for updating an existing chain.
15
14
  *
16
- * Extends CreateChainDto with all fields optional.
17
- * Used by the Products microservice to update chain details.
15
+ * Provides structure and validation for payloads to update a chain (restaurant brand)
16
+ * in the system. All fields related to chain details are optional to allow partial updates,
17
+ * but identifiers (chainId, updatedBy) are required for correct auditing and entity targeting.
18
+ *
19
+ * Used by the Products microservice to apply modifications to the properties of an existing chain.
18
20
  *
19
21
  * @since 2.0.0
22
+ *
23
+ * @example
24
+ * {
25
+ * "chainId": "550e8400-e29b-41d4-a716-446655440000",
26
+ * "name": "McDonald's",
27
+ * "currency": "PEN",
28
+ * "taxPercent": 8.5,
29
+ * "updatedBy": "507f1f77bcf86cd799439011"
30
+ * }
20
31
  */
21
- export class UpdateChainDto extends PartialType(CreateChainDto) {
32
+ export class UpdateChainDto {
33
+ /**
34
+ * The name of the chain (brand).
35
+ * Optional. If provided, must have at least 3 characters.
36
+ *
37
+ * @example "McDonald's"
38
+ */
39
+ name;
40
+ /**
41
+ * The currency code for the chain.
42
+ * Optional. Must be a value from the Currency enum if provided.
43
+ *
44
+ * @example Currency.PEN
45
+ * @default Currency.PEN
46
+ */
47
+ currency = Currency.PEN;
48
+ /**
49
+ * Global tax percentage applied across the chain.
50
+ * Optional. Must be a number between 0 and 100 if provided.
51
+ *
52
+ * @example 8.5
53
+ * @default 0.0
54
+ */
55
+ taxPercent = 0.0;
22
56
  /**
23
- * Chain ID to update.
24
- * Must be a valid UUID.
57
+ * Unique identifier of the chain to update.
58
+ * Required. Must be a valid UUID string.
25
59
  *
26
60
  * @example "550e8400-e29b-41d4-a716-446655440000"
27
61
  */
28
- id;
62
+ chainId;
29
63
  /**
30
- * User who updated the chain.
31
- * Must be a valid MongoDB ObjectId if provided.
64
+ * Unique identifier of the user performing the update.
65
+ * Required. Must be a valid MongoDB ObjectId.
32
66
  *
33
67
  * @example "507f1f77bcf86cd799439011"
34
68
  */
35
69
  updatedBy;
36
70
  }
37
71
  __decorate([
72
+ IsOptional(),
38
73
  IsString(),
39
- IsUUID(),
74
+ MinLength(3, { message: 'Chain name must be at least 3 characters' }),
75
+ __metadata("design:type", String)
76
+ ], UpdateChainDto.prototype, "name", void 0);
77
+ __decorate([
40
78
  IsOptional(),
79
+ IsEnum(Currency, { message: "Currency must be a valid currency code" }),
41
80
  __metadata("design:type", String)
42
- ], UpdateChainDto.prototype, "id", void 0);
81
+ ], UpdateChainDto.prototype, "currency", void 0);
43
82
  __decorate([
44
- IsString(),
45
- IsMongoId(),
46
83
  IsOptional(),
84
+ IsNumber({}, { message: "Tax percentage must be a number" }),
85
+ Min(0, { message: "Tax percentage must be at least 0" }),
86
+ Max(100, { message: "Tax percentage must be at most 100" }),
87
+ __metadata("design:type", Number)
88
+ ], UpdateChainDto.prototype, "taxPercent", void 0);
89
+ __decorate([
90
+ IsString(),
91
+ IsUUID(),
92
+ IsNotEmpty({ message: 'chainId is required and must be a valid UUID.' }),
93
+ __metadata("design:type", String)
94
+ ], UpdateChainDto.prototype, "chainId", void 0);
95
+ __decorate([
96
+ IsString(),
97
+ IsMongoId({ message: 'updatedBy must be a valid MongoDB ObjectId.' }),
98
+ IsNotEmpty({ message: 'updatedBy is required and must be a valid MongoDB ObjectId.' }),
47
99
  __metadata("design:type", String)
48
100
  ], UpdateChainDto.prototype, "updatedBy", void 0);
@@ -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,27 @@
1
+ import { PaginationDto } from './pagination.dto.js';
2
+ /**
3
+ * DTO for searching entities by name.
4
+ *
5
+ * This class extends PaginationDto and is designed to be used as a base
6
+ * DTO for search operations where a search by text (typically a name)
7
+ * is required. It is used across multiple modules to standardize
8
+ * search-by-name functionality and provide pagination support.
9
+ *
10
+ * @example
11
+ * {
12
+ * "name": "cheese",
13
+ * "page": 1,
14
+ * "limit": 10
15
+ * }
16
+ *
17
+ * @since 2.0.0
18
+ */
19
+ export declare class SearchByNameDto extends PaginationDto {
20
+ /**
21
+ * The search term for the entity name.
22
+ * Must be a non-empty string.
23
+ *
24
+ * @example "vegetarian"
25
+ */
26
+ name: string;
27
+ }
@@ -7,20 +7,29 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
7
7
  var __metadata = (this && this.__metadata) || function (k, v) {
8
8
  if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
9
9
  };
10
- import { IsString, IsNotEmpty } from 'class-validator';
11
- import { PaginationDto } from '../common/pagination.dto';
10
+ import { IsNotEmpty, IsString } from 'class-validator';
11
+ import { PaginationDto } from './pagination.dto.js';
12
12
  /**
13
- * DTO for searching tags by name.
13
+ * DTO for searching entities by name.
14
14
  *
15
- * Extends PaginationDto to include name search functionality.
16
- * Used by the Products microservice to search tags by name with pagination.
15
+ * This class extends PaginationDto and is designed to be used as a base
16
+ * DTO for search operations where a search by text (typically a name)
17
+ * is required. It is used across multiple modules to standardize
18
+ * search-by-name functionality and provide pagination support.
19
+ *
20
+ * @example
21
+ * {
22
+ * "name": "cheese",
23
+ * "page": 1,
24
+ * "limit": 10
25
+ * }
17
26
  *
18
27
  * @since 2.0.0
19
28
  */
20
- export class SearchTagByNameDto extends PaginationDto {
29
+ export class SearchByNameDto extends PaginationDto {
21
30
  /**
22
- * Search term for tag name.
23
- * Must not be empty.
31
+ * The search term for the entity name.
32
+ * Must be a non-empty string.
24
33
  *
25
34
  * @example "vegetarian"
26
35
  */
@@ -30,4 +39,4 @@ __decorate([
30
39
  IsString(),
31
40
  IsNotEmpty({ message: 'Search term is required' }),
32
41
  __metadata("design:type", String)
33
- ], SearchTagByNameDto.prototype, "name", void 0);
42
+ ], 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";
@@ -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)
@@ -6,7 +6,6 @@
6
6
  *
7
7
  * @since 2.0.0
8
8
  */
9
- export * from './create-ingredient.dto';
10
- export * from './update-ingredient.dto';
11
- export * from './delete-ingredient.dto';
12
- export * from './search-by-name.dto';
9
+ export * from './create-ingredient.dto.js';
10
+ export * from './update-ingredient.dto.js';
11
+ export * from './delete-ingredient.dto.js';
@@ -6,7 +6,6 @@
6
6
  *
7
7
  * @since 2.0.0
8
8
  */
9
- export * from './create-ingredient.dto';
10
- export * from './update-ingredient.dto';
11
- export * from './delete-ingredient.dto';
12
- export * from './search-by-name.dto';
9
+ export * from './create-ingredient.dto.js';
10
+ export * from './update-ingredient.dto.js';
11
+ export * from './delete-ingredient.dto.js';