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
@@ -8,111 +8,133 @@ var __metadata = (this && this.__metadata) || function (k, v) {
8
8
  if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
9
9
  };
10
10
  import { Type } from 'class-transformer';
11
- import { IsArray, IsNumber, IsOptional, IsPositive, IsString, IsUUID, ValidateNested, } from 'class-validator';
11
+ import { IsArray, IsNotEmpty, IsNumber, IsOptional, IsPositive, IsString, IsUUID, MaxLength, MinLength, ValidateNested, } from 'class-validator';
12
12
  /**
13
- * DTO for order item information.
13
+ * Data Transfer Object representing a single item within an order.
14
14
  *
15
- * Represents a single item in an order with its product details,
16
- * size (if applicable), quantity, price, and optional notes or child items.
17
- * Supports nested items for complex order structures (e.g., combo meals).
15
+ * Used by QeHay to structure each item the customer wishes to order, including the product, quantity, pricing, variant size,
16
+ * optional notes, and possible nested (child) items such as combos.
18
17
  *
18
+ * All properties are validated and documented to ensure data integrity and improve maintainability.
19
+ *
20
+ * @class OrderItemDto
19
21
  * @since 2.0.0
20
22
  */
21
23
  export class OrderItemDto {
22
24
  /**
23
- * Unique identifier of the product.
24
- * Must be a valid UUID.
25
+ * Unique identifier for the product.
26
+ * Required.
27
+ * Must be a valid UUID v4.
25
28
  *
29
+ * @type {string}
26
30
  * @example "550e8400-e29b-41d4-a716-446655440000"
27
31
  */
28
32
  productId;
29
33
  /**
30
- * Optional unique identifier of the product size variant.
31
- * Must be a valid UUID if provided.
34
+ * Optional unique identifier for the product size (variant).
35
+ * Only set when the selected product has multiple sizes/variants.
36
+ * Must be a valid UUID v4 if provided.
32
37
  *
38
+ * @type {string}
33
39
  * @example "660e8400-e29b-41d4-a716-446655440001"
34
40
  */
35
41
  productSizeId;
36
42
  /**
37
- * Optional name of the size variant.
43
+ * Optional name or label for the product size/variant.
44
+ * Useful for displaying selected size in the client.
38
45
  *
46
+ * @type {string}
39
47
  * @example "Large"
40
48
  */
41
49
  sizeName;
42
50
  /**
43
- * Optional price for the size variant.
44
- * Must be a positive number if provided.
51
+ * Optional additional price for the selected size/variant.
52
+ * If specified, must be a positive number.
45
53
  *
54
+ * @type {number}
46
55
  * @example 12.99
47
56
  */
48
57
  sizePrice;
49
58
  /**
50
- * Quantity of this item in the order.
51
- * Must be a positive number.
59
+ * Quantity of the ordered product (how many units the customer wants).
60
+ * Required.
61
+ * Must be a positive number (greater than zero).
52
62
  *
63
+ * @type {number}
53
64
  * @example 2
54
65
  */
55
66
  quantity;
56
67
  /**
57
- * Unit price for this item.
68
+ * Unit price for this item (for one product or one variant, without multiplying by quantity).
69
+ * Required.
58
70
  * Must be a positive number.
59
71
  *
72
+ * @type {number}
60
73
  * @example 9.99
61
74
  */
62
75
  price;
63
76
  /**
64
- * Optional notes or special instructions for this item.
77
+ * Optional notes or special instructions for this item (i.e. "No onions", "Add extra cheese").
78
+ * Useful for customizations or clarifications by the customer.
79
+ * Minimum length: 5 characters. Maximum: 200.
65
80
  *
81
+ * @type {string}
66
82
  * @example "No onions, extra cheese"
67
83
  */
68
84
  notes;
69
85
  /**
70
- * Optional array of child items (for nested structures like combo meals).
71
- * Each child item is validated as an OrderItemDto.
86
+ * Optional array of nested child items (for combos, extras, etc).
87
+ * Each child item must also be a valid OrderItemDto instance, supporting recursive order nesting.
72
88
  *
73
- * @example [{ productId: "...", quantity: 1, price: 5.99 }]
89
+ * @type {OrderItemDto[]}
90
+ * @example [{ "productId": "...", "quantity": 1, "price": 5.99 }]
74
91
  */
75
92
  childItems;
76
93
  }
77
94
  __decorate([
78
- IsString(),
79
- IsUUID(),
95
+ IsString({ message: "productId must be a string" }),
96
+ IsUUID('4', { message: "productId must be a valid UUID v4" }),
97
+ IsNotEmpty({ message: "productId is required" }),
80
98
  __metadata("design:type", String)
81
99
  ], OrderItemDto.prototype, "productId", void 0);
82
100
  __decorate([
83
- IsString(),
101
+ IsString({ message: "productSizeId must be a string" }),
84
102
  IsOptional(),
85
- IsUUID(),
103
+ IsUUID('4', { message: "productSizeId must be a valid UUID v4" }),
86
104
  __metadata("design:type", String)
87
105
  ], OrderItemDto.prototype, "productSizeId", void 0);
88
106
  __decorate([
89
- IsString(),
107
+ IsString({ message: "sizeName must be a string" }),
90
108
  IsOptional(),
91
109
  __metadata("design:type", String)
92
110
  ], OrderItemDto.prototype, "sizeName", void 0);
93
111
  __decorate([
94
- IsNumber(),
112
+ IsNumber({}, { message: "sizePrice must be a number" }),
95
113
  IsOptional(),
96
- IsPositive(),
114
+ IsPositive({ message: "sizePrice must be a positive number" }),
97
115
  __metadata("design:type", Number)
98
116
  ], OrderItemDto.prototype, "sizePrice", void 0);
99
117
  __decorate([
100
- IsNumber(),
101
- IsPositive(),
118
+ IsNumber({}, { message: "quantity must be a number" }),
119
+ IsPositive({ message: "quantity must be a positive number" }),
120
+ IsNotEmpty({ message: "quantity is required" }),
102
121
  __metadata("design:type", Number)
103
122
  ], OrderItemDto.prototype, "quantity", void 0);
104
123
  __decorate([
105
- IsNumber(),
106
- IsPositive(),
124
+ IsNumber({}, { message: "price must be a number" }),
125
+ IsPositive({ message: "price must be a positive number" }),
126
+ IsNotEmpty({ message: "price is required" }),
107
127
  __metadata("design:type", Number)
108
128
  ], OrderItemDto.prototype, "price", void 0);
109
129
  __decorate([
110
- IsString(),
130
+ IsString({ message: "notes must be a string" }),
111
131
  IsOptional(),
132
+ MinLength(5, { message: "notes must be at least 5 characters" }),
133
+ MaxLength(200, { message: "notes must be at most 200 characters" }),
112
134
  __metadata("design:type", String)
113
135
  ], OrderItemDto.prototype, "notes", void 0);
114
136
  __decorate([
115
- IsArray(),
137
+ IsArray({ message: "childItems must be an array" }),
116
138
  IsOptional(),
117
139
  ValidateNested({ each: true }),
118
140
  Type(() => OrderItemDto),
@@ -1,5 +1,5 @@
1
- import { OrderStatus } from '../../enums/order-status.enum';
2
- import { PaginationDto } from '../common/pagination.dto';
1
+ import { PaginationDto } from '../common/pagination.dto.js';
2
+ import type { OrderStatus } from '../../types/order-status.type.js';
3
3
  /**
4
4
  * DTO for paginated order queries with optional status filter.
5
5
  *
@@ -7,9 +7,9 @@ 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, IsOptional } from 'class-validator';
11
- import { OrderStatus } from '../../enums/order-status.enum';
12
- import { PaginationDto } from '../common/pagination.dto';
10
+ import { IsIn, IsOptional } from 'class-validator';
11
+ import { PaginationDto } from '../common/pagination.dto.js';
12
+ import { ORDER_STATUS } from '../../types/order-status.type.js';
13
13
  /**
14
14
  * DTO for paginated order queries with optional status filter.
15
15
  *
@@ -29,6 +29,6 @@ export class OrderPaginationDto extends PaginationDto {
29
29
  }
30
30
  __decorate([
31
31
  IsOptional(),
32
- IsEnum(OrderStatus, { message: 'Status must be a valid order status' }),
32
+ IsIn(ORDER_STATUS, { message: 'Status must be a valid order status' }),
33
33
  __metadata("design:type", String)
34
34
  ], OrderPaginationDto.prototype, "status", void 0);
@@ -1,29 +1,37 @@
1
1
  /**
2
- * DTO for paid order information.
2
+ * Data Transfer Object for paid order information in QeHay.
3
3
  *
4
- * Represents order payment confirmation data after a successful payment.
5
- * Used by the Orders microservice to update order payment status.
4
+ * This DTO is used to communicate the result of a successful payment for an order.
5
+ * It encapsulates all data needed to mark an order as paid and link it to the relevant payment evidence.
6
+ * Used by the Orders microservice (and related systems) to update order payment status and retain payment tracing information.
6
7
  *
8
+ * Each property is validated and clearly documented to guarantee interoperability and support audits.
9
+ *
10
+ * @class PaidOrderDto
7
11
  * @since 2.0.0
8
12
  */
9
13
  export declare class PaidOrderDto {
10
14
  /**
11
- * Payment charge identifier from the payment provider.
15
+ * Payment charge identifier provided by the payment gateway or provider.
16
+ * This value links the QeHay order to the payment platform transaction.
12
17
  *
18
+ * @type {string}
13
19
  * @example "ch_1234567890abcdef"
14
20
  */
15
21
  paymentChargeId: string;
16
22
  /**
17
- * Unique identifier of the paid order.
18
- * Must be a valid UUID.
23
+ * Unique identifier (UUID v4) of the paid order within QeHay.
24
+ * Used to reference and update the order entity.
19
25
  *
26
+ * @type {string}
20
27
  * @example "550e8400-e29b-41d4-a716-446655440000"
21
28
  */
22
29
  orderId: string;
23
30
  /**
24
- * URL to the payment receipt.
25
- * Must be a valid URL format.
31
+ * Direct URL of the payment receipt generated by the payment platform.
32
+ * This allows for audit, download, or viewing of payment proof by users or admins.
26
33
  *
34
+ * @type {string}
27
35
  * @example "https://payments.example.com/receipts/receipt_123456"
28
36
  */
29
37
  receiptUrl: string;
@@ -7,48 +7,59 @@ 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, IsUrl, IsUUID } from 'class-validator';
10
+ import { IsNotEmpty, IsString, IsUrl, IsUUID } from "class-validator";
11
11
  /**
12
- * DTO for paid order information.
12
+ * Data Transfer Object for paid order information in QeHay.
13
13
  *
14
- * Represents order payment confirmation data after a successful payment.
15
- * Used by the Orders microservice to update order payment status.
14
+ * This DTO is used to communicate the result of a successful payment for an order.
15
+ * It encapsulates all data needed to mark an order as paid and link it to the relevant payment evidence.
16
+ * Used by the Orders microservice (and related systems) to update order payment status and retain payment tracing information.
16
17
  *
18
+ * Each property is validated and clearly documented to guarantee interoperability and support audits.
19
+ *
20
+ * @class PaidOrderDto
17
21
  * @since 2.0.0
18
22
  */
19
23
  export class PaidOrderDto {
20
24
  /**
21
- * Payment charge identifier from the payment provider.
25
+ * Payment charge identifier provided by the payment gateway or provider.
26
+ * This value links the QeHay order to the payment platform transaction.
22
27
  *
28
+ * @type {string}
23
29
  * @example "ch_1234567890abcdef"
24
30
  */
25
31
  paymentChargeId;
26
32
  /**
27
- * Unique identifier of the paid order.
28
- * Must be a valid UUID.
33
+ * Unique identifier (UUID v4) of the paid order within QeHay.
34
+ * Used to reference and update the order entity.
29
35
  *
36
+ * @type {string}
30
37
  * @example "550e8400-e29b-41d4-a716-446655440000"
31
38
  */
32
39
  orderId;
33
40
  /**
34
- * URL to the payment receipt.
35
- * Must be a valid URL format.
41
+ * Direct URL of the payment receipt generated by the payment platform.
42
+ * This allows for audit, download, or viewing of payment proof by users or admins.
36
43
  *
44
+ * @type {string}
37
45
  * @example "https://payments.example.com/receipts/receipt_123456"
38
46
  */
39
47
  receiptUrl;
40
48
  }
41
49
  __decorate([
42
- IsString(),
50
+ IsString({ message: "paymentChargeId must be a string" }),
51
+ IsNotEmpty({ message: "paymentChargeId is required" }),
43
52
  __metadata("design:type", String)
44
53
  ], PaidOrderDto.prototype, "paymentChargeId", void 0);
45
54
  __decorate([
46
- IsString(),
47
- IsUUID(),
55
+ IsString({ message: "orderId must be a string" }),
56
+ IsUUID("4", { message: "orderId must be a valid UUID v4" }),
57
+ IsNotEmpty({ message: "orderId is required" }),
48
58
  __metadata("design:type", String)
49
59
  ], PaidOrderDto.prototype, "orderId", void 0);
50
60
  __decorate([
51
- IsString(),
52
- IsUrl(),
61
+ IsString({ message: "receiptUrl must be a string" }),
62
+ IsUrl({}, { message: "receiptUrl must be a valid URL" }),
63
+ IsNotEmpty({ message: "receiptUrl is required" }),
53
64
  __metadata("design:type", String)
54
65
  ], PaidOrderDto.prototype, "receiptUrl", void 0);
@@ -0,0 +1,81 @@
1
+ export declare class CreatePaymentAuditDynamoDto {
2
+ /**
3
+ * Unique identifier for the audited transaction.
4
+ * Should be globally unique per transaction.
5
+ *
6
+ * @example "txn_123abc456"
7
+ */
8
+ transactionId: string;
9
+ /**
10
+ * ISO 8601 timestamp indicating when the payment event occurred.
11
+ *
12
+ * @example "2024-06-01T12:00:00.000Z"
13
+ */
14
+ timestamp: string;
15
+ /**
16
+ * Unique identifier of the related order.
17
+ *
18
+ * @example "order_789xyz"
19
+ */
20
+ orderId: string;
21
+ /**
22
+ * Name of the payment provider (e.g., "stripe", "culqi").
23
+ *
24
+ * @example "stripe"
25
+ */
26
+ provider: string;
27
+ /**
28
+ * Name or path of the API endpoint called (e.g., "/charges").
29
+ *
30
+ * @example "/charges"
31
+ */
32
+ endpoint: string;
33
+ /**
34
+ * HTTP method used for the audited request.
35
+ *
36
+ * @example "POST"
37
+ */
38
+ method: string;
39
+ /**
40
+ * HTTP response status code from the provider (e.g., 200, 500).
41
+ *
42
+ * @example 200
43
+ */
44
+ statusCode: number;
45
+ /**
46
+ * Status of the operation/audit (e.g., "success", "error").
47
+ *
48
+ * @example "success"
49
+ */
50
+ status: string;
51
+ /**
52
+ * Processing time for the audited action, in milliseconds.
53
+ *
54
+ * @example 845
55
+ */
56
+ durationMs: number;
57
+ /**
58
+ * (Optional) IP address from which the request originated.
59
+ *
60
+ * @example "192.168.0.1"
61
+ */
62
+ ipAddress?: string;
63
+ /**
64
+ * URL of the external log or audit file, if available (e.g., S3 presigned url).
65
+ *
66
+ * @example "https://s3.amazonaws.com/bucket/audit/txn_123.json"
67
+ */
68
+ logUrl: string;
69
+ /**
70
+ * ISO 8601 timestamp indicating when the audit record was created.
71
+ *
72
+ * @example "2024-06-01T12:01:00.000Z"
73
+ */
74
+ createdAt: string;
75
+ /**
76
+ * ISO 8601 timestamp indicating the last update to the audit record.
77
+ *
78
+ * @example "2024-06-01T12:05:30.000Z"
79
+ */
80
+ updatedAt: string;
81
+ }
@@ -0,0 +1,81 @@
1
+ export class CreatePaymentAuditDynamoDto {
2
+ /**
3
+ * Unique identifier for the audited transaction.
4
+ * Should be globally unique per transaction.
5
+ *
6
+ * @example "txn_123abc456"
7
+ */
8
+ transactionId;
9
+ /**
10
+ * ISO 8601 timestamp indicating when the payment event occurred.
11
+ *
12
+ * @example "2024-06-01T12:00:00.000Z"
13
+ */
14
+ timestamp;
15
+ /**
16
+ * Unique identifier of the related order.
17
+ *
18
+ * @example "order_789xyz"
19
+ */
20
+ orderId;
21
+ /**
22
+ * Name of the payment provider (e.g., "stripe", "culqi").
23
+ *
24
+ * @example "stripe"
25
+ */
26
+ provider;
27
+ /**
28
+ * Name or path of the API endpoint called (e.g., "/charges").
29
+ *
30
+ * @example "/charges"
31
+ */
32
+ endpoint;
33
+ /**
34
+ * HTTP method used for the audited request.
35
+ *
36
+ * @example "POST"
37
+ */
38
+ method;
39
+ /**
40
+ * HTTP response status code from the provider (e.g., 200, 500).
41
+ *
42
+ * @example 200
43
+ */
44
+ statusCode;
45
+ /**
46
+ * Status of the operation/audit (e.g., "success", "error").
47
+ *
48
+ * @example "success"
49
+ */
50
+ status;
51
+ /**
52
+ * Processing time for the audited action, in milliseconds.
53
+ *
54
+ * @example 845
55
+ */
56
+ durationMs;
57
+ /**
58
+ * (Optional) IP address from which the request originated.
59
+ *
60
+ * @example "192.168.0.1"
61
+ */
62
+ ipAddress;
63
+ /**
64
+ * URL of the external log or audit file, if available (e.g., S3 presigned url).
65
+ *
66
+ * @example "https://s3.amazonaws.com/bucket/audit/txn_123.json"
67
+ */
68
+ logUrl;
69
+ /**
70
+ * ISO 8601 timestamp indicating when the audit record was created.
71
+ *
72
+ * @example "2024-06-01T12:01:00.000Z"
73
+ */
74
+ createdAt;
75
+ /**
76
+ * ISO 8601 timestamp indicating the last update to the audit record.
77
+ *
78
+ * @example "2024-06-01T12:05:30.000Z"
79
+ */
80
+ updatedAt;
81
+ }
@@ -0,0 +1,81 @@
1
+ /**
2
+ * DTO for storing payment audit records in S3.
3
+ *
4
+ * Encapsulates all relevant information of a payment transaction
5
+ * to be stored in S3 for logging, compliance, and traceability.
6
+ *
7
+ * Follows Clean Code, SOLID, and best practices for maintainability and extensibility.
8
+ *
9
+ * @since 2.0.0
10
+ */
11
+ export declare class CreatePaymentAudiS3tDto {
12
+ /**
13
+ * Unique identifier for the audited transaction.
14
+ * Should be globally unique per transaction.
15
+ *
16
+ * @example "txn_123abc456"
17
+ */
18
+ transactionId: string;
19
+ /**
20
+ * Unique identifier of the associated order.
21
+ *
22
+ * @example "order_789xyz"
23
+ */
24
+ orderId: string;
25
+ /**
26
+ * Name of the payment provider (e.g., "stripe", "culqi").
27
+ *
28
+ * @example "stripe"
29
+ */
30
+ provider: string;
31
+ /**
32
+ * API endpoint called during the payment operation (e.g., "/charges").
33
+ *
34
+ * @example "/charges"
35
+ */
36
+ endpoint: string;
37
+ /**
38
+ * HTTP method used (e.g., "POST", "GET").
39
+ *
40
+ * @example "POST"
41
+ */
42
+ method: string;
43
+ /**
44
+ * HTTP response status code from the provider (e.g., 200, 500).
45
+ *
46
+ * @example 200
47
+ */
48
+ statusCode: number;
49
+ /**
50
+ * Status of the audited operation (e.g., "success", "error").
51
+ *
52
+ * @example "success"
53
+ */
54
+ status: string;
55
+ /**
56
+ * Total execution time of the audited operation, in milliseconds.
57
+ *
58
+ * @example 523
59
+ */
60
+ durationMs: number;
61
+ /**
62
+ * (Optional) IP address from which the request originated.
63
+ *
64
+ * @example "192.168.1.10"
65
+ */
66
+ ipAddress?: string;
67
+ /**
68
+ * Payload sent in the audited request.
69
+ * Must be a serializable object.
70
+ *
71
+ * @example { amount: 19.99, currency: "PEN" }
72
+ */
73
+ requestBody: Record<string, any>;
74
+ /**
75
+ * Payload received in the audited response.
76
+ * Must be a serializable object.
77
+ *
78
+ * @example { providerResponse: ..., result: ... }
79
+ */
80
+ responseBody: Record<string, any>;
81
+ }
@@ -0,0 +1,81 @@
1
+ /**
2
+ * DTO for storing payment audit records in S3.
3
+ *
4
+ * Encapsulates all relevant information of a payment transaction
5
+ * to be stored in S3 for logging, compliance, and traceability.
6
+ *
7
+ * Follows Clean Code, SOLID, and best practices for maintainability and extensibility.
8
+ *
9
+ * @since 2.0.0
10
+ */
11
+ export class CreatePaymentAudiS3tDto {
12
+ /**
13
+ * Unique identifier for the audited transaction.
14
+ * Should be globally unique per transaction.
15
+ *
16
+ * @example "txn_123abc456"
17
+ */
18
+ transactionId;
19
+ /**
20
+ * Unique identifier of the associated order.
21
+ *
22
+ * @example "order_789xyz"
23
+ */
24
+ orderId;
25
+ /**
26
+ * Name of the payment provider (e.g., "stripe", "culqi").
27
+ *
28
+ * @example "stripe"
29
+ */
30
+ provider;
31
+ /**
32
+ * API endpoint called during the payment operation (e.g., "/charges").
33
+ *
34
+ * @example "/charges"
35
+ */
36
+ endpoint;
37
+ /**
38
+ * HTTP method used (e.g., "POST", "GET").
39
+ *
40
+ * @example "POST"
41
+ */
42
+ method;
43
+ /**
44
+ * HTTP response status code from the provider (e.g., 200, 500).
45
+ *
46
+ * @example 200
47
+ */
48
+ statusCode;
49
+ /**
50
+ * Status of the audited operation (e.g., "success", "error").
51
+ *
52
+ * @example "success"
53
+ */
54
+ status;
55
+ /**
56
+ * Total execution time of the audited operation, in milliseconds.
57
+ *
58
+ * @example 523
59
+ */
60
+ durationMs;
61
+ /**
62
+ * (Optional) IP address from which the request originated.
63
+ *
64
+ * @example "192.168.1.10"
65
+ */
66
+ ipAddress;
67
+ /**
68
+ * Payload sent in the audited request.
69
+ * Must be a serializable object.
70
+ *
71
+ * @example { amount: 19.99, currency: "PEN" }
72
+ */
73
+ requestBody;
74
+ /**
75
+ * Payload received in the audited response.
76
+ * Must be a serializable object.
77
+ *
78
+ * @example { providerResponse: ..., result: ... }
79
+ */
80
+ responseBody;
81
+ }
@@ -6,6 +6,8 @@
6
6
  *
7
7
  * @since 2.0.0
8
8
  */
9
- export * from './payment-session.dto';
10
- export * from './payment-session-item.dto';
11
- export * from './webhook-data.dto';
9
+ export * from './payment-session.dto.js';
10
+ export * from './payment-session-item.dto.js';
11
+ export * from './webhook-data.dto.js';
12
+ export * from './create-payment-audit-dynamo.dto.js';
13
+ export * from './create-payment-audit-s3.dto.js';
@@ -6,6 +6,8 @@
6
6
  *
7
7
  * @since 2.0.0
8
8
  */
9
- export * from './payment-session.dto';
10
- export * from './payment-session-item.dto';
11
- export * from './webhook-data.dto';
9
+ export * from './payment-session.dto.js';
10
+ export * from './payment-session-item.dto.js';
11
+ export * from './webhook-data.dto.js';
12
+ export * from './create-payment-audit-dynamo.dto.js';
13
+ export * from './create-payment-audit-s3.dto.js';