@floristcloud/api-lib 1.2.159 → 1.2.161

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 (377) hide show
  1. package/build/commands/client/index.js +1 -0
  2. package/build/commands/client/webshop/get-client-me-webshop.query.js +8 -0
  3. package/build/commands/client/webshop/register-client-webshop.command.js +2 -16
  4. package/build/commands/client/webshop/update-client-for-client.command.js +2 -14
  5. package/build/commands/discount-rules/get-product-discount-price.query.js +2 -68
  6. package/build/commands/order/webshop/create-cart.command.js +2 -8
  7. package/build/commands/order/webshop/get-order-for-client.query.js +2 -8
  8. package/build/commands/order/webshop/get-order-list-for-client.query.js +2 -46
  9. package/build/commands/order/webshop/update-cart.command.js +2 -25
  10. package/build/commands/order-product/webshop/get-order-product-for-client-list.query.js +2 -8
  11. package/build/commands/pre-order/webshop/get-pre-order-list-webshop.command.js +2 -16
  12. package/build/commands/pre-order/webshop/get-pre-order-list-webshop.query.js +9 -0
  13. package/build/commands/pre-order/webshop/get-pre-order-webshop.query.js +8 -0
  14. package/build/commands/pre-order/webshop/index.js +2 -1
  15. package/build/commands/pre-order-collection-item/delete-group-pre-order-collection-item.command.js +3 -13
  16. package/build/commands/pre-order-collection-item/get-pre-order-collection-item-grouped-list-for-client.query.js +2 -18
  17. package/build/commands/pre-order-collection-item/get-pre-order-collection-item-list-for-client.query.js +2 -18
  18. package/build/commands/pre-order-product/create-pre-order-product-webshop.command.js +2 -7
  19. package/build/commands/pre-order-product/get-pre-order-product-extended-list-webshop.query.js +9 -0
  20. package/build/commands/pre-order-product/index.js +1 -0
  21. package/build/commands/pre-order-product/update-pre-order-product-webshop.command.js +2 -7
  22. package/build/commands/product/export-stock-products.query.js +11 -0
  23. package/build/commands/product/get-product-list.query.js +4 -25
  24. package/build/commands/product/index.js +1 -0
  25. package/build/commands/product/webshop/get-product-list-for-client.query.js +2 -31
  26. package/build/commands/transaction/webshop/get-transaction-list-for-client.query.js +2 -30
  27. package/build/commands/write-off/webshop/create-write-off-from-order-for-client.command.js +2 -14
  28. package/build/commands/write-off/webshop/get-write-off-list-by-order.query.js +2 -8
  29. package/build/constant/error.js +18 -0
  30. package/build/schemas/category/category-name.schema.js +6 -0
  31. package/build/schemas/category/index.js +23 -0
  32. package/build/schemas/client/client-base.schema.js +37 -0
  33. package/build/schemas/client/client-extended-for-client.schema.js +17 -0
  34. package/build/schemas/client/client-extended-list.schema.js +9 -0
  35. package/build/schemas/client/client-extended.schema.js +21 -0
  36. package/build/schemas/client/client-for-client.schema.js +30 -0
  37. package/build/schemas/client/client-name.schema.js +6 -0
  38. package/build/schemas/client/client.schema.js +6 -54
  39. package/build/schemas/client/get-client-me-webshop-response.schema.js +9 -0
  40. package/build/schemas/client/index.js +10 -0
  41. package/build/schemas/client/register-client-webshop-request.schema.js +13 -0
  42. package/build/schemas/client/register-client-webshop-response.schema.js +9 -0
  43. package/build/schemas/client/update-client-for-client-request.schema.js +11 -0
  44. package/build/schemas/client/update-client-for-client-response.schema.js +9 -0
  45. package/build/schemas/consignment/consignment-distribution-validation.schema.js +4 -4
  46. package/build/schemas/consignment/consignment.schema.js +2 -2
  47. package/build/schemas/discount-rules/discount-rules-data-for-client.schema.js +8 -0
  48. package/build/schemas/discount-rules/discount-rules-for-client.schema.js +11 -0
  49. package/build/schemas/discount-rules/discount-rules.schema.js +4 -4
  50. package/build/schemas/discount-rules/get-product-discount-price-request.schema.js +10 -0
  51. package/build/schemas/discount-rules/get-product-discount-price-response.schema.js +17 -0
  52. package/build/schemas/discount-rules/index.js +24 -0
  53. package/build/schemas/discount-rules/product-discount-price-data.schema.js +18 -0
  54. package/build/schemas/discount-rules/product-discount-price-item.schema.js +22 -0
  55. package/build/schemas/discount-rules/product-discount-price-multiplicity-option.schema.js +25 -0
  56. package/build/schemas/index.js +15 -37
  57. package/build/schemas/money-account/index.js +19 -0
  58. package/build/schemas/money-account/money-account-name.schema.js +6 -0
  59. package/build/schemas/order/create-cart-request.schema.js +5 -0
  60. package/build/schemas/order/create-cart-response.schema.js +9 -0
  61. package/build/schemas/order/get-order-for-client-list-request.schema.js +40 -0
  62. package/build/schemas/order/get-order-for-client-list-response.schema.js +9 -0
  63. package/build/schemas/order/get-order-for-client-request.schema.js +5 -0
  64. package/build/schemas/order/get-order-for-client-response.schema.js +9 -0
  65. package/build/schemas/order/index.js +30 -0
  66. package/build/schemas/order/order-base.schema.js +50 -0
  67. package/build/schemas/order/order-extended-for-client-list.schema.js +9 -0
  68. package/build/schemas/order/order-extended-for-client.schema.js +19 -0
  69. package/build/schemas/order/order-extended.schema.js +19 -0
  70. package/build/schemas/order/order-for-client.schema.js +36 -0
  71. package/build/schemas/order/order.schema.js +9 -81
  72. package/build/schemas/order/update-cart-delivery-request.schema.js +10 -0
  73. package/build/schemas/order/update-cart-request.schema.js +15 -0
  74. package/build/schemas/order/update-cart-response.schema.js +9 -0
  75. package/build/schemas/order-product/active-stepper-positions-for-order-response.schema.js +8 -0
  76. package/build/schemas/order-product/get-order-product-for-client-list-request.schema.js +5 -0
  77. package/build/schemas/order-product/get-order-product-for-client-list-response.schema.js +9 -0
  78. package/build/schemas/order-product/index.js +27 -0
  79. package/build/schemas/order-product/order-product-base.schema.js +27 -0
  80. package/build/schemas/order-product/order-product-extended-for-client-list.schema.js +9 -0
  81. package/build/schemas/order-product/order-product-extended-for-client.schema.js +10 -0
  82. package/build/schemas/order-product/order-product-extended.schema.js +12 -0
  83. package/build/schemas/order-product/order-product-for-client.schema.js +20 -0
  84. package/build/schemas/order-product/order-product-for-distribute.schema.js +15 -0
  85. package/build/schemas/order-product/order-product-list.schema.js +5 -6
  86. package/build/schemas/order-product/order-product-stepper-position.schema.js +13 -0
  87. package/build/schemas/order-product/order-product.schema.js +20 -70
  88. package/build/schemas/order-product/set-order-product-quantity-webshop-request.schema.js +7 -0
  89. package/build/schemas/order-product/set-order-product-quantity-webshop-response.schema.js +9 -0
  90. package/build/schemas/pagination-request.schema.js +9 -0
  91. package/build/schemas/pre-order/get-pre-order-list-webshop-request.schema.js +10 -0
  92. package/build/schemas/pre-order/get-pre-order-list-webshop-response.schema.js +8 -0
  93. package/build/schemas/pre-order/get-pre-order-webshop-response.schema.js +8 -0
  94. package/build/schemas/pre-order/index.js +25 -0
  95. package/build/schemas/pre-order/pre-order-copy.schema.js +4 -4
  96. package/build/schemas/pre-order/pre-order-extended-for-client-list.schema.js +9 -0
  97. package/build/schemas/pre-order/pre-order-extended-for-client.schema.js +15 -0
  98. package/build/schemas/pre-order/pre-order-for-client.schema.js +15 -0
  99. package/build/schemas/pre-order/pre-order-summary.schema.js +5 -0
  100. package/build/schemas/pre-order/pre-order.schema.js +3 -3
  101. package/build/schemas/pre-order-collection/index.js +18 -0
  102. package/build/schemas/pre-order-collection/pre-order-collection-summary-for-client.schema.js +10 -0
  103. package/build/schemas/pre-order-collection-item/create-pre-order-collection-item.schema.js +32 -0
  104. package/build/schemas/pre-order-collection-item/delete-group-pre-order-collection-item-request.schema.js +7 -0
  105. package/build/schemas/pre-order-collection-item/delete-group-pre-order-collection-item-response.schema.js +9 -0
  106. package/build/schemas/pre-order-collection-item/delete-group-pre-order-collection-item-result.schema.js +8 -0
  107. package/build/schemas/pre-order-collection-item/get-pre-order-collection-item-grouped-list-for-client-response.schema.js +9 -0
  108. package/build/schemas/pre-order-collection-item/get-pre-order-collection-item-list-for-client-response.schema.js +9 -0
  109. package/build/schemas/pre-order-collection-item/index.js +34 -0
  110. package/build/schemas/pre-order-collection-item/matching-product.schema.js +13 -0
  111. package/build/schemas/pre-order-collection-item/pre-order-collection-item-base.schema.js +36 -0
  112. package/build/schemas/pre-order-collection-item/pre-order-collection-item-catalog-filter-for-client-request.schema.js +15 -0
  113. package/build/schemas/pre-order-collection-item/pre-order-collection-item-catalog-for-client-list.schema.js +9 -0
  114. package/build/schemas/pre-order-collection-item/pre-order-collection-item-catalog-for-client.schema.js +11 -0
  115. package/build/schemas/pre-order-collection-item/pre-order-collection-item-catalog-grouped-for-client-list.schema.js +9 -0
  116. package/build/schemas/pre-order-collection-item/pre-order-collection-item-catalog-grouped-for-client.schema.js +9 -0
  117. package/build/schemas/pre-order-collection-item/pre-order-collection-item-category.schema.js +11 -0
  118. package/build/schemas/pre-order-collection-item/pre-order-collection-item-client-pre-order-product.schema.js +13 -0
  119. package/build/schemas/pre-order-collection-item/pre-order-collection-item-extended-list.schema.js +9 -0
  120. package/build/schemas/pre-order-collection-item/pre-order-collection-item-extended-with-clients-pre-order-product-list.schema.js +9 -0
  121. package/build/schemas/pre-order-collection-item/pre-order-collection-item-extended-with-clients-pre-order-product.schema.js +8 -0
  122. package/build/schemas/pre-order-collection-item/pre-order-collection-item-extended.schema.js +18 -0
  123. package/build/schemas/pre-order-collection-item/pre-order-collection-item-for-client.schema.js +34 -0
  124. package/build/schemas/pre-order-collection-item/pre-order-collection-item-image.schema.js +7 -0
  125. package/build/schemas/pre-order-collection-item/pre-order-collection-item.schema.js +31 -150
  126. package/build/schemas/pre-order-collection-item/update-pre-order-collection-item.schema.js +35 -0
  127. package/build/schemas/pre-order-product/active-stepper-positions-response.schema.js +8 -0
  128. package/build/schemas/pre-order-product/create-pre-order-product-webshop-request.schema.js +16 -0
  129. package/build/schemas/pre-order-product/create-pre-order-product-webshop-response.schema.js +9 -0
  130. package/build/schemas/pre-order-product/create-pre-order-product.schema.js +18 -0
  131. package/build/schemas/pre-order-product/get-pre-order-product-extended-list-webshop-response.schema.js +9 -0
  132. package/build/schemas/pre-order-product/index.js +25 -0
  133. package/build/schemas/pre-order-product/matching-config.schema.js +12 -0
  134. package/build/schemas/pre-order-product/pre-order-product-base.schema.js +27 -0
  135. package/build/schemas/pre-order-product/pre-order-product-extended-for-client-list.schema.js +9 -0
  136. package/build/schemas/pre-order-product/pre-order-product-extended-for-client.schema.js +15 -0
  137. package/build/schemas/pre-order-product/pre-order-product-extended-list.schema.js +9 -0
  138. package/build/schemas/pre-order-product/pre-order-product-extended.schema.js +14 -0
  139. package/build/schemas/pre-order-product/pre-order-product-for-client.schema.js +24 -0
  140. package/build/schemas/pre-order-product/pre-order-product-list.schema.js +9 -0
  141. package/build/schemas/pre-order-product/pre-order-product-stepper-position.schema.js +14 -0
  142. package/build/schemas/pre-order-product/pre-order-product.schema.js +29 -126
  143. package/build/schemas/pre-order-product/set-pre-order-product-quantity-webshop-request.schema.js +7 -0
  144. package/build/schemas/pre-order-product/set-pre-order-product-quantity-webshop-response.schema.js +9 -0
  145. package/build/schemas/pre-order-product/update-pre-order-product-webshop-request.schema.js +16 -0
  146. package/build/schemas/pre-order-product/update-pre-order-product-webshop-response.schema.js +9 -0
  147. package/build/schemas/pre-order-product/update-pre-order-product.schema.js +24 -0
  148. package/build/schemas/product/export-stock-products-request.schema.js +14 -0
  149. package/build/schemas/product/export-stock-products-response.schema.js +7 -0
  150. package/build/schemas/product/get-product-list-for-client-request.schema.js +28 -0
  151. package/build/schemas/product/get-product-list-for-client-response.schema.js +9 -0
  152. package/build/schemas/product/get-product-list-request.schema.js +21 -0
  153. package/build/schemas/product/get-product-list-response.schema.js +9 -0
  154. package/build/schemas/product/index.js +31 -0
  155. package/build/schemas/product/product-base.schema.js +38 -0
  156. package/build/schemas/product/product-catalog-name.schema.js +10 -0
  157. package/build/schemas/product/product-consignment-for-client.schema.js +8 -0
  158. package/build/schemas/product/product-discount-price-for-client.schema.js +8 -0
  159. package/build/schemas/product/product-extended-for-admin-with-statistic.schema.js +8 -0
  160. package/build/schemas/product/product-extended-for-admin.schema.js +9 -0
  161. package/build/schemas/product/product-extended-for-client.schema.js +31 -0
  162. package/build/schemas/product/product-extended.schema.js +15 -0
  163. package/build/schemas/product/product-for-client.schema.js +25 -0
  164. package/build/schemas/product/product-image-for-client.schema.js +7 -0
  165. package/build/schemas/product/product-list-extended-for-client.schema.js +9 -0
  166. package/build/schemas/product/product-list.schema.js +5 -7
  167. package/build/schemas/product/product.schema.js +12 -135
  168. package/build/schemas/transaction/get-transaction-list-for-client-request.schema.js +27 -0
  169. package/build/schemas/transaction/get-transaction-list-for-client-response.schema.js +9 -0
  170. package/build/schemas/transaction/index.js +23 -0
  171. package/build/schemas/transaction/transaction-base.schema.js +24 -0
  172. package/build/schemas/transaction/transaction-extended-for-client-list.schema.js +9 -0
  173. package/build/schemas/transaction/transaction-extended-for-client.schema.js +12 -0
  174. package/build/schemas/transaction/transaction-extended.schema.js +12 -0
  175. package/build/schemas/transaction/transaction-for-client.schema.js +19 -0
  176. package/build/schemas/transaction/transaction-list.schema.js +5 -6
  177. package/build/schemas/transaction/transaction.schema.js +7 -35
  178. package/build/schemas/user/index.js +19 -0
  179. package/build/schemas/user/user-contact-for-client.schema.js +10 -0
  180. package/build/schemas/user/user-name.schema.js +6 -0
  181. package/build/schemas/write-off/create-write-off-from-order-for-client-request.schema.js +11 -0
  182. package/build/schemas/write-off/create-write-off-from-order-for-client-response.schema.js +9 -0
  183. package/build/schemas/write-off/get-write-off-list-by-order-for-client-request.schema.js +5 -0
  184. package/build/schemas/write-off/get-write-off-list-by-order-for-client-response.schema.js +9 -0
  185. package/build/schemas/write-off/index.js +27 -0
  186. package/build/schemas/write-off/write-off-for-client.schema.js +26 -0
  187. package/build/schemas/write-off/write-off-order-product-for-client.schema.js +8 -0
  188. package/build/schemas/write-off/write-off.schema.js +8 -8
  189. package/commands/client/index.ts +1 -0
  190. package/commands/client/webshop/get-client-me-webshop.query.ts +7 -0
  191. package/commands/client/webshop/register-client-webshop.command.ts +1 -16
  192. package/commands/client/webshop/update-client-for-client.command.ts +1 -14
  193. package/commands/discount-rules/get-product-discount-price.query.ts +1 -69
  194. package/commands/order/webshop/create-cart.command.ts +1 -8
  195. package/commands/order/webshop/get-order-for-client.query.ts +1 -8
  196. package/commands/order/webshop/get-order-list-for-client.query.ts +1 -49
  197. package/commands/order/webshop/update-cart.command.ts +1 -25
  198. package/commands/order-product/webshop/get-order-product-for-client-list.query.ts +1 -8
  199. package/commands/pre-order/webshop/get-pre-order-list-webshop.command.ts +1 -21
  200. package/commands/pre-order/webshop/get-pre-order-list-webshop.query.ts +10 -0
  201. package/commands/pre-order/webshop/get-pre-order-webshop.query.ts +7 -0
  202. package/commands/pre-order/webshop/index.ts +2 -1
  203. package/commands/pre-order-collection-item/delete-group-pre-order-collection-item.command.ts +1 -12
  204. package/commands/pre-order-collection-item/get-pre-order-collection-item-grouped-list-for-client.query.ts +5 -19
  205. package/commands/pre-order-collection-item/get-pre-order-collection-item-list-for-client.query.ts +5 -19
  206. package/commands/pre-order-product/create-pre-order-product-webshop.command.ts +2 -7
  207. package/commands/pre-order-product/get-pre-order-product-extended-list-webshop.query.ts +10 -0
  208. package/commands/pre-order-product/index.ts +1 -0
  209. package/commands/pre-order-product/update-pre-order-product-webshop.command.ts +2 -7
  210. package/commands/product/export-stock-products.query.ts +13 -0
  211. package/commands/product/get-product-list.query.ts +3 -25
  212. package/commands/product/index.ts +1 -0
  213. package/commands/product/webshop/get-product-list-for-client.query.ts +1 -31
  214. package/commands/transaction/webshop/get-transaction-list-for-client.query.ts +1 -33
  215. package/commands/write-off/webshop/create-write-off-from-order-for-client.command.ts +1 -14
  216. package/commands/write-off/webshop/get-write-off-list-by-order.query.ts +1 -8
  217. package/constant/error.ts +18 -0
  218. package/package.json +1 -1
  219. package/schemas/category/category-name.schema.ts +4 -0
  220. package/schemas/category/index.ts +7 -0
  221. package/schemas/client/client-base.schema.ts +38 -0
  222. package/schemas/client/client-extended-for-client.schema.ts +15 -0
  223. package/schemas/client/client-extended-list.schema.ts +7 -0
  224. package/schemas/client/client-extended.schema.ts +20 -0
  225. package/schemas/client/client-for-client.schema.ts +28 -0
  226. package/schemas/client/client-name.schema.ts +4 -0
  227. package/schemas/client/client.schema.ts +3 -62
  228. package/schemas/client/get-client-me-webshop-response.schema.ts +7 -0
  229. package/schemas/client/index.ts +10 -0
  230. package/schemas/client/register-client-webshop-request.schema.ts +11 -0
  231. package/schemas/client/register-client-webshop-response.schema.ts +7 -0
  232. package/schemas/client/update-client-for-client-request.schema.ts +9 -0
  233. package/schemas/client/update-client-for-client-response.schema.ts +7 -0
  234. package/schemas/consignment/consignment-distribution-validation.schema.ts +2 -2
  235. package/schemas/consignment/consignment.schema.ts +1 -1
  236. package/schemas/discount-rules/discount-rules-data-for-client.schema.ts +6 -0
  237. package/schemas/discount-rules/discount-rules-for-client.schema.ts +9 -0
  238. package/schemas/discount-rules/discount-rules.schema.ts +2 -2
  239. package/schemas/discount-rules/get-product-discount-price-request.schema.ts +8 -0
  240. package/schemas/discount-rules/get-product-discount-price-response.schema.ts +15 -0
  241. package/schemas/discount-rules/index.ts +8 -0
  242. package/schemas/discount-rules/product-discount-price-data.schema.ts +16 -0
  243. package/schemas/discount-rules/product-discount-price-item.schema.ts +20 -0
  244. package/schemas/discount-rules/product-discount-price-multiplicity-option.schema.ts +23 -0
  245. package/schemas/index.ts +15 -37
  246. package/schemas/money-account/index.ts +3 -0
  247. package/schemas/money-account/money-account-name.schema.ts +4 -0
  248. package/schemas/order/create-cart-request.schema.ts +3 -0
  249. package/schemas/order/create-cart-response.schema.ts +7 -0
  250. package/schemas/order/get-order-for-client-list-request.schema.ts +41 -0
  251. package/schemas/order/get-order-for-client-list-response.schema.ts +7 -0
  252. package/schemas/order/get-order-for-client-request.schema.ts +3 -0
  253. package/schemas/order/get-order-for-client-response.schema.ts +7 -0
  254. package/schemas/order/index.ts +14 -0
  255. package/schemas/order/order-base.schema.ts +54 -0
  256. package/schemas/order/order-extended-for-client-list.schema.ts +7 -0
  257. package/schemas/order/order-extended-for-client.schema.ts +17 -0
  258. package/schemas/order/order-extended.schema.ts +17 -0
  259. package/schemas/order/order-for-client.schema.ts +34 -0
  260. package/schemas/order/order.schema.ts +4 -90
  261. package/schemas/order/update-cart-delivery-request.schema.ts +8 -0
  262. package/schemas/order/update-cart-request.schema.ts +13 -0
  263. package/schemas/order/update-cart-response.schema.ts +7 -0
  264. package/schemas/order-product/active-stepper-positions-for-order-response.schema.ts +6 -0
  265. package/schemas/order-product/get-order-product-for-client-list-request.schema.ts +3 -0
  266. package/schemas/order-product/get-order-product-for-client-list-response.schema.ts +7 -0
  267. package/schemas/order-product/index.ts +11 -0
  268. package/schemas/order-product/order-product-base.schema.ts +30 -0
  269. package/schemas/order-product/order-product-extended-for-client-list.schema.ts +7 -0
  270. package/schemas/order-product/order-product-extended-for-client.schema.ts +8 -0
  271. package/schemas/order-product/order-product-extended.schema.ts +10 -0
  272. package/schemas/order-product/order-product-for-client.schema.ts +18 -0
  273. package/schemas/order-product/order-product-for-distribute.schema.ts +13 -0
  274. package/schemas/order-product/order-product-list.schema.ts +5 -6
  275. package/schemas/order-product/order-product-stepper-position.schema.ts +11 -0
  276. package/schemas/order-product/order-product.schema.ts +12 -83
  277. package/schemas/order-product/set-order-product-quantity-webshop-request.schema.ts +5 -0
  278. package/schemas/order-product/set-order-product-quantity-webshop-response.schema.ts +7 -0
  279. package/schemas/pagination-request.schema.ts +7 -0
  280. package/schemas/pre-order/get-pre-order-list-webshop-request.schema.ts +8 -0
  281. package/schemas/pre-order/get-pre-order-list-webshop-response.schema.ts +6 -0
  282. package/schemas/pre-order/get-pre-order-webshop-response.schema.ts +6 -0
  283. package/schemas/pre-order/index.ts +9 -0
  284. package/schemas/pre-order/pre-order-copy.schema.ts +2 -2
  285. package/schemas/pre-order/pre-order-extended-for-client-list.schema.ts +7 -0
  286. package/schemas/pre-order/pre-order-extended-for-client.schema.ts +13 -0
  287. package/schemas/pre-order/pre-order-for-client.schema.ts +13 -0
  288. package/schemas/pre-order/pre-order-summary.schema.ts +3 -0
  289. package/schemas/pre-order/pre-order.schema.ts +1 -1
  290. package/schemas/pre-order-collection/index.ts +2 -0
  291. package/schemas/pre-order-collection/pre-order-collection-summary-for-client.schema.ts +8 -0
  292. package/schemas/pre-order-collection-item/create-pre-order-collection-item.schema.ts +30 -0
  293. package/schemas/pre-order-collection-item/delete-group-pre-order-collection-item-request.schema.ts +5 -0
  294. package/schemas/pre-order-collection-item/delete-group-pre-order-collection-item-response.schema.ts +7 -0
  295. package/schemas/pre-order-collection-item/delete-group-pre-order-collection-item-result.schema.ts +6 -0
  296. package/schemas/pre-order-collection-item/get-pre-order-collection-item-grouped-list-for-client-response.schema.ts +7 -0
  297. package/schemas/pre-order-collection-item/get-pre-order-collection-item-list-for-client-response.schema.ts +7 -0
  298. package/schemas/pre-order-collection-item/index.ts +18 -0
  299. package/schemas/pre-order-collection-item/matching-product.schema.ts +11 -0
  300. package/schemas/pre-order-collection-item/pre-order-collection-item-base.schema.ts +34 -0
  301. package/schemas/pre-order-collection-item/pre-order-collection-item-catalog-filter-for-client-request.schema.ts +13 -0
  302. package/schemas/pre-order-collection-item/pre-order-collection-item-catalog-for-client-list.schema.ts +7 -0
  303. package/schemas/pre-order-collection-item/pre-order-collection-item-catalog-for-client.schema.ts +9 -0
  304. package/schemas/pre-order-collection-item/pre-order-collection-item-catalog-grouped-for-client-list.schema.ts +7 -0
  305. package/schemas/pre-order-collection-item/pre-order-collection-item-catalog-grouped-for-client.schema.ts +7 -0
  306. package/schemas/pre-order-collection-item/pre-order-collection-item-category.schema.ts +9 -0
  307. package/schemas/pre-order-collection-item/pre-order-collection-item-client-pre-order-product.schema.ts +11 -0
  308. package/schemas/pre-order-collection-item/pre-order-collection-item-extended-list.schema.ts +7 -0
  309. package/schemas/pre-order-collection-item/pre-order-collection-item-extended-with-clients-pre-order-product-list.schema.ts +7 -0
  310. package/schemas/pre-order-collection-item/pre-order-collection-item-extended-with-clients-pre-order-product.schema.ts +6 -0
  311. package/schemas/pre-order-collection-item/pre-order-collection-item-extended.schema.ts +16 -0
  312. package/schemas/pre-order-collection-item/pre-order-collection-item-for-client.schema.ts +32 -0
  313. package/schemas/pre-order-collection-item/pre-order-collection-item-image.schema.ts +5 -0
  314. package/schemas/pre-order-collection-item/pre-order-collection-item.schema.ts +25 -162
  315. package/schemas/pre-order-collection-item/update-pre-order-collection-item.schema.ts +33 -0
  316. package/schemas/pre-order-product/active-stepper-positions-response.schema.ts +6 -0
  317. package/schemas/pre-order-product/create-pre-order-product-webshop-request.schema.ts +14 -0
  318. package/schemas/pre-order-product/create-pre-order-product-webshop-response.schema.ts +7 -0
  319. package/schemas/pre-order-product/create-pre-order-product.schema.ts +16 -0
  320. package/schemas/pre-order-product/get-pre-order-product-extended-list-webshop-response.schema.ts +7 -0
  321. package/schemas/pre-order-product/index.ts +9 -0
  322. package/schemas/pre-order-product/matching-config.schema.ts +10 -0
  323. package/schemas/pre-order-product/pre-order-product-base.schema.ts +25 -0
  324. package/schemas/pre-order-product/pre-order-product-extended-for-client-list.schema.ts +7 -0
  325. package/schemas/pre-order-product/pre-order-product-extended-for-client.schema.ts +13 -0
  326. package/schemas/pre-order-product/pre-order-product-extended-list.schema.ts +7 -0
  327. package/schemas/pre-order-product/pre-order-product-extended.schema.ts +12 -0
  328. package/schemas/pre-order-product/pre-order-product-for-client.schema.ts +22 -0
  329. package/schemas/pre-order-product/pre-order-product-list.schema.ts +7 -0
  330. package/schemas/pre-order-product/pre-order-product-stepper-position.schema.ts +12 -0
  331. package/schemas/pre-order-product/pre-order-product.schema.ts +19 -138
  332. package/schemas/pre-order-product/set-pre-order-product-quantity-webshop-request.schema.ts +5 -0
  333. package/schemas/pre-order-product/set-pre-order-product-quantity-webshop-response.schema.ts +7 -0
  334. package/schemas/pre-order-product/update-pre-order-product-webshop-request.schema.ts +14 -0
  335. package/schemas/pre-order-product/update-pre-order-product-webshop-response.schema.ts +7 -0
  336. package/schemas/pre-order-product/update-pre-order-product.schema.ts +22 -0
  337. package/schemas/product/export-stock-products-request.schema.ts +12 -0
  338. package/schemas/product/export-stock-products-response.schema.ts +5 -0
  339. package/schemas/product/get-product-list-for-client-request.schema.ts +26 -0
  340. package/schemas/product/get-product-list-for-client-response.schema.ts +7 -0
  341. package/schemas/product/get-product-list-request.schema.ts +19 -0
  342. package/schemas/product/get-product-list-response.schema.ts +7 -0
  343. package/schemas/product/index.ts +15 -0
  344. package/schemas/product/product-base.schema.ts +39 -0
  345. package/schemas/product/product-catalog-name.schema.ts +8 -0
  346. package/schemas/product/product-consignment-for-client.schema.ts +6 -0
  347. package/schemas/product/product-discount-price-for-client.schema.ts +6 -0
  348. package/schemas/product/product-extended-for-admin-with-statistic.schema.ts +8 -0
  349. package/schemas/product/product-extended-for-admin.schema.ts +9 -0
  350. package/schemas/product/product-extended-for-client.schema.ts +31 -0
  351. package/schemas/product/product-extended.schema.ts +15 -0
  352. package/schemas/product/product-for-client.schema.ts +23 -0
  353. package/schemas/product/product-image-for-client.schema.ts +5 -0
  354. package/schemas/product/product-list-extended-for-client.schema.ts +7 -0
  355. package/schemas/product/product-list.schema.ts +2 -6
  356. package/schemas/product/product.schema.ts +6 -152
  357. package/schemas/transaction/get-transaction-list-for-client-request.schema.ts +28 -0
  358. package/schemas/transaction/get-transaction-list-for-client-response.schema.ts +7 -0
  359. package/schemas/transaction/index.ts +7 -0
  360. package/schemas/transaction/transaction-base.schema.ts +27 -0
  361. package/schemas/transaction/transaction-extended-for-client-list.schema.ts +7 -0
  362. package/schemas/transaction/transaction-extended-for-client.schema.ts +10 -0
  363. package/schemas/transaction/transaction-extended.schema.ts +10 -0
  364. package/schemas/transaction/transaction-for-client.schema.ts +17 -0
  365. package/schemas/transaction/transaction-list.schema.ts +5 -6
  366. package/schemas/transaction/transaction.schema.ts +6 -43
  367. package/schemas/user/index.ts +3 -0
  368. package/schemas/user/user-contact-for-client.schema.ts +8 -0
  369. package/schemas/user/user-name.schema.ts +4 -0
  370. package/schemas/write-off/create-write-off-from-order-for-client-request.schema.ts +9 -0
  371. package/schemas/write-off/create-write-off-from-order-for-client-response.schema.ts +7 -0
  372. package/schemas/write-off/get-write-off-list-by-order-for-client-request.schema.ts +3 -0
  373. package/schemas/write-off/get-write-off-list-by-order-for-client-response.schema.ts +7 -0
  374. package/schemas/write-off/index.ts +11 -0
  375. package/schemas/write-off/write-off-for-client.schema.ts +26 -0
  376. package/schemas/write-off/write-off-order-product-for-client.schema.ts +6 -0
  377. package/schemas/write-off/write-off.schema.ts +4 -4
@@ -1,73 +1,5 @@
1
1
  import { z } from 'zod';
2
- import { DiscountRulesTypeEnum } from '../../enum';
3
- import { discountPriceOutcomeSchema } from '../../schemas';
4
- import { MoneySchema } from '../../schemas/money.schema';
5
-
6
- const GetProductDiscountPriceRequestSchema = z.object({
7
- productUUID: z.uuid(),
8
- clientUUID: z.preprocess(val => {
9
- return val === 'null' ? null : val;
10
- }, z.uuid().nullable().optional()),
11
- });
12
-
13
- /**
14
- * Цена товара по одному правилу — для показа вариантов.
15
- *
16
- * `discountValueData` описывает, чем правило обернулось для этого товара, а не как оно настроено:
17
- * у правила от себестоимости это готовая цена, и самой наценки здесь нет.
18
- *
19
- * В списки попадают только варианты, которые действительно снижают цену: правило, оставляющее базу
20
- * как есть, выбором не является.
21
- */
22
- const ProductDiscountPriceItemSchema = z.object({
23
- discountRulesUUID: z.string(),
24
- type: z.nativeEnum(DiscountRulesTypeEnum),
25
- discountValueData: discountPriceOutcomeSchema,
26
- priceWithDiscount: MoneySchema,
27
- });
28
-
29
- /**
30
- * Готовые цены товара для клиента: то, что нужно при работе с товаром, а не при настройке правил.
31
- *
32
- * Считает бэк тем же движком, что и для витрины, — панель формулу скидок не повторяет и
33
- * себестоимость не получает. Настройка правил живёт отдельно, в `GetDiscountRulesAllContractQuery`.
34
- *
35
- * `null` в ценах со скидкой означает «скидка неприменима», а не «ноль».
36
- */
37
- const GetProductDiscountPriceResponseSchema = z.object({
38
- message: z.string().optional(),
39
- data: z.object({
40
- productUUID: z.string(),
41
- price: MoneySchema,
42
- priceWithBestDiscount: MoneySchema.nullable(),
43
- multiplicityOptions: z
44
- .object({
45
- uuid: z.string(),
46
- optionPrice: MoneySchema.nullable(),
47
- optionPriceWithDiscount: MoneySchema.nullable(),
48
- isDiscountApplicable: z.boolean(),
49
- /**
50
- * Варианты по этой фасовке: те же правила, но посчитанные от её цены.
51
- *
52
- * Список свой у каждой кратности, потому что база у них разная — у правила нет
53
- * одной цены на товар, пока не выбрана форма отгрузки. Пустой список означает
54
- * «выбирать нечего»: скидки к этой кратности запрещены продавцом либо ни одно
55
- * правило её цену не снижает.
56
- *
57
- * Порядок элементов не отсортирован по цене — он унаследован от сортировки правил
58
- * товара, а база у фасовки другая. Лучшую цену берите из `optionPriceWithDiscount`,
59
- * а не из первого элемента.
60
- */
61
- discountDataList: ProductDiscountPriceItemSchema.array(),
62
- })
63
- .array(),
64
- /**
65
- * Варианты по базовой цене товара. Как и у фасовок, порядок не гарантирован: лучшую цену
66
- * отдаёт `priceWithBestDiscount`.
67
- */
68
- discountDataList: ProductDiscountPriceItemSchema.array(),
69
- }),
70
- });
2
+ import { GetProductDiscountPriceRequestSchema, GetProductDiscountPriceResponseSchema } from '../../schemas';
71
3
 
72
4
  export namespace GetProductDiscountPriceContractQuery {
73
5
  export const RequestSchema = GetProductDiscountPriceRequestSchema;
@@ -1,12 +1,5 @@
1
1
  import { z } from 'zod';
2
- import { OrderForClientSchema } from '../../../schemas';
3
-
4
- const CreateCartRequestSchema = z.object({});
5
-
6
- const CreateCartResponseSchema = z.object({
7
- message: z.string().optional(),
8
- data: OrderForClientSchema,
9
- });
2
+ import { CreateCartRequestSchema, CreateCartResponseSchema } from '../../../schemas';
10
3
 
11
4
  export namespace CreateCartContractCommand {
12
5
  export const RequestSchema = CreateCartRequestSchema;
@@ -1,12 +1,5 @@
1
1
  import { z } from 'zod';
2
- import { OrderExtendedForClientSchema } from '../../../schemas';
3
-
4
- const GetOrderForClientRequestSchema = z.object({});
5
-
6
- const GetOrderForClientResponseSchema = z.object({
7
- message: z.string().optional(),
8
- data: OrderExtendedForClientSchema.nullable(),
9
- });
2
+ import { GetOrderForClientRequestSchema, GetOrderForClientResponseSchema } from '../../../schemas';
10
3
 
11
4
  export namespace GetOrderForClientContractQuery {
12
5
  export const RequestSchema = GetOrderForClientRequestSchema;
@@ -1,53 +1,5 @@
1
1
  import { z } from 'zod';
2
- import { OrderExtendedForClientSchema } from '../../../schemas';
3
- import { dateRangeCheck, setEndDay, setStartDay } from '../../../helpers/date.helper';
4
- import { OrderStatusEnum } from '../../../enum/order-status.enum';
5
- import { OrderWebshopAvailableStatusList } from '../../../enum';
6
-
7
- const GetOrderForClientListRequestSchema = z
8
- .object({
9
- page: z.coerce.number().default(1),
10
- count: z.coerce.number().default(10),
11
- startDate: z.coerce
12
- .date()
13
- .optional()
14
- .transform(val => (val ? setStartDay(val) : val)),
15
- endDate: z.coerce
16
- .date()
17
- .optional()
18
- .transform(val => (val ? setEndDay(val) : val)),
19
- isPaid: z.coerce.boolean().optional(),
20
- statuses: z
21
- .nativeEnum(OrderStatusEnum)
22
- .array()
23
- .optional()
24
- .transform(arr => (arr && arr.length === 0 ? OrderWebshopAvailableStatusList : (arr ?? OrderWebshopAvailableStatusList)))
25
- .default(OrderWebshopAvailableStatusList)
26
- .refine(arr => arr.every(s => OrderWebshopAvailableStatusList.includes(s)), {
27
- message: 'validation.statusNotAllowedWebshop',
28
- }),
29
- })
30
- .refine(
31
- value => {
32
- const { startDate, endDate } = value;
33
- if (startDate && endDate) {
34
- return dateRangeCheck(startDate, endDate);
35
- }
36
- return true;
37
- },
38
- {
39
- message: 'validation.dateRange',
40
- path: ['endDate', 'startDate'],
41
- },
42
- );
43
-
44
- const GetOrderForClientListResponseSchema = z.object({
45
- message: z.string().optional(),
46
- data: z.object({
47
- orderList: OrderExtendedForClientSchema.array(),
48
- total: z.number(),
49
- }),
50
- });
2
+ import { GetOrderForClientListRequestSchema, GetOrderForClientListResponseSchema } from '../../../schemas';
51
3
 
52
4
  export namespace GetOrderForClientListContractQuery {
53
5
  export const RequestSchema = GetOrderForClientListRequestSchema;
@@ -1,29 +1,5 @@
1
1
  import { z } from 'zod';
2
- import { CalendarDaySchema, OrderForClientSchema } from '../../../schemas';
3
-
4
- const UpdateCartRequestSchema = z.object({
5
- clientComment: z.string().nullable().optional().default(null),
6
- branchUUID: z.uuid().optional().nullable().default(null),
7
- // Дата выдачи/доставки заказа — одна для самовывоза и доставки. Относится к товару в наличии:
8
- // заказы с товаром в пути после оформления получают дату прихода. Имеет приоритет над
9
- // устаревшим `delivery.deliveryDate`.
10
- plannedShipmentDate: CalendarDaySchema.nullable().optional(),
11
- delivery: z
12
- .object({
13
- /** @deprecated Используйте `plannedShipmentDate` — единую дату для самовывоза и доставки. */
14
- deliveryDate: z.coerce.date().optional().nullable().default(null),
15
- address: z.string().nullable().optional().default(null),
16
- time: z.string().nullable().optional().default(null),
17
- })
18
- .optional()
19
- .nullable()
20
- .default(null),
21
- });
22
-
23
- const UpdateCartResponseSchema = z.object({
24
- message: z.string().optional(),
25
- data: OrderForClientSchema,
26
- });
2
+ import { UpdateCartRequestSchema, UpdateCartResponseSchema } from '../../../schemas';
27
3
 
28
4
  export namespace UpdateCartContractCommand {
29
5
  export const RequestSchema = UpdateCartRequestSchema;
@@ -1,12 +1,5 @@
1
1
  import { z } from 'zod';
2
- import { OrderProductForClientListSchema } from '../../../schemas';
3
-
4
- const GetOrderProductForClientListRequestSchema = z.object({});
5
-
6
- const GetOrderProductForClientListResponseSchema = z.object({
7
- message: z.string().optional(),
8
- data: OrderProductForClientListSchema,
9
- });
2
+ import { GetOrderProductForClientListRequestSchema, GetOrderProductForClientListResponseSchema } from '../../../schemas';
10
3
 
11
4
  export namespace GetOrderProductForClientListContractQuery {
12
5
  export const RequestSchema = GetOrderProductForClientListRequestSchema;
@@ -1,21 +1 @@
1
- import { z } from 'zod';
2
- import { PreOrderStatusEnum } from '../../../enum';
3
- import { PreOrderListSchema } from '../../../schemas';
4
-
5
- const GetPreOrderListWebshopRequestSchema = z.object({
6
- page: z.coerce.number().optional().default(1),
7
- count: z.coerce.number().optional().default(10),
8
- statuses: z.array(z.nativeEnum(PreOrderStatusEnum)).optional(),
9
- });
10
-
11
- const GetPreOrderListResponseSchema = z.object({
12
- data: PreOrderListSchema,
13
- });
14
-
15
- export namespace GetPreOrderListWebshopContractCommand {
16
- export const RequestSchema = GetPreOrderListWebshopRequestSchema;
17
- export type Request = z.infer<typeof RequestSchema>;
18
-
19
- export const ResponseSchema = GetPreOrderListResponseSchema;
20
- export type Response = z.infer<typeof ResponseSchema>;
21
- }
1
+ export { GetPreOrderListWebshopContractCommand } from './get-pre-order-list-webshop.query';
@@ -0,0 +1,10 @@
1
+ import { z } from 'zod';
2
+ import { GetPreOrderListWebshopRequestSchema, GetPreOrderListWebshopResponseSchema } from '../../../schemas';
3
+
4
+ export namespace GetPreOrderListWebshopContractCommand {
5
+ export const RequestSchema = GetPreOrderListWebshopRequestSchema;
6
+ export type Request = z.infer<typeof RequestSchema>;
7
+
8
+ export const ResponseSchema = GetPreOrderListWebshopResponseSchema;
9
+ export type Response = z.infer<typeof ResponseSchema>;
10
+ }
@@ -0,0 +1,7 @@
1
+ import { z } from 'zod';
2
+ import { GetPreOrderWebshopResponseSchema } from '../../../schemas';
3
+
4
+ export namespace GetPreOrderWebshopContractQuery {
5
+ export const ResponseSchema = GetPreOrderWebshopResponseSchema;
6
+ export type Response = z.infer<typeof ResponseSchema>;
7
+ }
@@ -1,5 +1,6 @@
1
1
  export * from './update-pre-order-webshop.command';
2
2
  export * from './create-pre-order-webshop.command';
3
- export * from './get-pre-order-list-webshop.command';
3
+ export * from './get-pre-order-list-webshop.query';
4
4
  export * from './delete-pre-order-webshop.command';
5
5
  export * from './checkout-pre-order-webshop.command';
6
+ export * from './get-pre-order-webshop.query';
@@ -1,16 +1,5 @@
1
1
  import { z } from 'zod';
2
-
3
- const DeleteGroupPreOrderCollectionItemRequestSchema = z.object({
4
- preOrderCollectionItemUUIDs: z.array(z.string()),
5
- });
6
-
7
- const DeleteGroupPreOrderCollectionItemResponseSchema = z.object({
8
- message: z.string().optional(),
9
- data: z.object({
10
- success: z.boolean(),
11
- missedItems: z.array(z.string()).optional(),
12
- }),
13
- });
2
+ import { DeleteGroupPreOrderCollectionItemRequestSchema, DeleteGroupPreOrderCollectionItemResponseSchema } from '../../schemas';
14
3
 
15
4
  export namespace DeleteGroupPreOrderCollectionItemContractCommand {
16
5
  export const RequestSchema = DeleteGroupPreOrderCollectionItemRequestSchema;
@@ -1,25 +1,11 @@
1
1
  import { z } from 'zod';
2
- import { PreOrderCollectionItemGroupedListSchema } from '../../schemas';
3
-
4
- const GetPreOrderCollectionItemGroupedListForClientRequestSchema = z.object({
5
- sizes: z.array(z.string()).optional(),
6
- colors: z.array(z.string()).optional(),
7
- preOrderCollectionsUUID: z.array(z.string()).optional(),
8
- categoriesUUID: z.array(z.string()).optional(),
9
- growers: z.array(z.string()).optional(),
10
- countries: z.array(z.string()).optional(),
11
- searchQuery: z.string().optional(),
12
- page: z.coerce.number().optional().default(1),
13
- count: z.coerce.number().optional().default(10),
14
- });
15
-
16
- const GetPreOrderCollectionItemGroupedListForClientResponseSchema = z.object({
17
- message: z.string().optional(),
18
- data: PreOrderCollectionItemGroupedListSchema,
19
- });
2
+ import {
3
+ PreOrderCollectionItemCatalogFilterForClientRequestSchema,
4
+ GetPreOrderCollectionItemGroupedListForClientResponseSchema,
5
+ } from '../../schemas';
20
6
 
21
7
  export namespace GetPreOrderCollectionItemGroupedListForClientContractQuery {
22
- export const RequestSchema = GetPreOrderCollectionItemGroupedListForClientRequestSchema;
8
+ export const RequestSchema = PreOrderCollectionItemCatalogFilterForClientRequestSchema;
23
9
  export type Request = z.infer<typeof RequestSchema>;
24
10
 
25
11
  export const ResponseSchema = GetPreOrderCollectionItemGroupedListForClientResponseSchema;
@@ -1,25 +1,11 @@
1
1
  import { z } from 'zod';
2
- import { PreOrderCollectionItemExtendedWithPreOrderCollectionListSchema } from '../../schemas';
3
-
4
- const GetPreOrderCollectionItemListForClientRequestSchema = z.object({
5
- sizes: z.array(z.string()).optional(),
6
- colors: z.array(z.string()).optional(),
7
- preOrderCollectionsUUID: z.array(z.string()).optional(),
8
- categoriesUUID: z.array(z.string()).optional(),
9
- growers: z.array(z.string()).optional(),
10
- countries: z.array(z.string()).optional(),
11
- searchQuery: z.string().optional(),
12
- page: z.coerce.number().optional().default(1),
13
- count: z.coerce.number().optional().default(10),
14
- });
15
-
16
- const GetPreOrderCollectionItemListForClientResponseSchema = z.object({
17
- message: z.string().optional(),
18
- data: PreOrderCollectionItemExtendedWithPreOrderCollectionListSchema,
19
- });
2
+ import {
3
+ PreOrderCollectionItemCatalogFilterForClientRequestSchema,
4
+ GetPreOrderCollectionItemListForClientResponseSchema,
5
+ } from '../../schemas';
20
6
 
21
7
  export namespace GetPreOrderCollectionItemListForClientContractQuery {
22
- export const RequestSchema = GetPreOrderCollectionItemListForClientRequestSchema;
8
+ export const RequestSchema = PreOrderCollectionItemCatalogFilterForClientRequestSchema;
23
9
  export type Request = z.infer<typeof RequestSchema>;
24
10
 
25
11
  export const ResponseSchema = GetPreOrderCollectionItemListForClientResponseSchema;
@@ -1,13 +1,8 @@
1
1
  import { z } from 'zod';
2
- import { CreatePreOrderProductWebshopSchema, PreOrderProductSchema } from '../../schemas';
3
-
4
- const CreatePreOrderProductWebshopResponseSchema = z.object({
5
- message: z.string().optional(),
6
- data: PreOrderProductSchema,
7
- });
2
+ import { CreatePreOrderProductWebshopRequestSchema, CreatePreOrderProductWebshopResponseSchema } from '../../schemas';
8
3
 
9
4
  export namespace CreatePreOrderProductWebshopContractCommand {
10
- export const RequestSchema = CreatePreOrderProductWebshopSchema;
5
+ export const RequestSchema = CreatePreOrderProductWebshopRequestSchema;
11
6
  export type Request = z.infer<typeof RequestSchema>;
12
7
 
13
8
  export const ResponseSchema = CreatePreOrderProductWebshopResponseSchema;
@@ -0,0 +1,10 @@
1
+ import { z } from 'zod';
2
+ import { PaginationRequestSchema, GetPreOrderProductExtendedListWebshopResponseSchema } from '../../schemas';
3
+
4
+ export namespace GetPreOrderProductExtendedListWebshopContractQuery {
5
+ export const RequestSchema = PaginationRequestSchema;
6
+ export type Request = z.infer<typeof RequestSchema>;
7
+
8
+ export const ResponseSchema = GetPreOrderProductExtendedListWebshopResponseSchema;
9
+ export type Response = z.infer<typeof ResponseSchema>;
10
+ }
@@ -11,6 +11,7 @@ export * from './delete-pre-order-product-webshop.command';
11
11
  export * from './update-pre-order-product-webshop.command';
12
12
  export * from './get-pre-order-product-list.query';
13
13
  export * from './get-pre-order-product-extended-list.query';
14
+ export * from './get-pre-order-product-extended-list-webshop.query';
14
15
  export * from './get-active-stepper-positions.query';
15
16
  export * from './create-manually-pre-order-product-for-standing-order.command';
16
17
  export * from './get-pre-order-products-by-pre-order-list.command';
@@ -1,13 +1,8 @@
1
1
  import { z } from 'zod';
2
- import { PreOrderProductSchema, UpdatePreOrderProductWebshopSchema } from '../../schemas';
3
-
4
- const UpdatePreOrderProductWebshopResponseSchema = z.object({
5
- message: z.string().optional(),
6
- data: PreOrderProductSchema,
7
- });
2
+ import { UpdatePreOrderProductWebshopRequestSchema, UpdatePreOrderProductWebshopResponseSchema } from '../../schemas';
8
3
 
9
4
  export namespace UpdatePreOrderProductWebshopContractCommand {
10
- export const RequestSchema = UpdatePreOrderProductWebshopSchema;
5
+ export const RequestSchema = UpdatePreOrderProductWebshopRequestSchema;
11
6
  export type Request = z.infer<typeof RequestSchema>;
12
7
 
13
8
  export const ResponseSchema = UpdatePreOrderProductWebshopResponseSchema;
@@ -0,0 +1,13 @@
1
+ import type { z } from 'zod';
2
+ import { ExportStockProductsRequestSchema } from '../../schemas/product/export-stock-products-request.schema';
3
+ import { ExportStockProductsResponseSchema } from '../../schemas/product/export-stock-products-response.schema';
4
+
5
+ export namespace ExportStockProductsContractQuery {
6
+ export const MAX_PRODUCTS = 10_000;
7
+
8
+ export const RequestSchema = ExportStockProductsRequestSchema;
9
+ export type Request = z.infer<typeof RequestSchema>;
10
+
11
+ export const ResponseSchema = ExportStockProductsResponseSchema;
12
+ export type Response = z.infer<typeof ResponseSchema>;
13
+ }
@@ -1,28 +1,6 @@
1
- import { z } from 'zod';
2
- import { ProductMarkEnum } from '../../enum';
3
- import { ProductListSchema } from '../../schemas';
4
-
5
- const GetProductListRequestSchema = z.object({
6
- page: z.coerce.number().optional().default(1),
7
- count: z.coerce.number().optional().default(10),
8
- stock: z.coerce.boolean().optional(),
9
- consignmentUUID: z.string().optional(),
10
- searchQuery: z.string().optional(),
11
- onlyAvailable: z.coerce.boolean().optional(),
12
- categoryUUID: z.string().optional(),
13
- typeUUID: z.string().optional(),
14
- grower: z.string().optional(),
15
- country: z.string().optional(),
16
- color: z.string().optional(),
17
- size: z.string().optional(),
18
- deliveryDates: z.array(z.coerce.date()).optional(),
19
- marks: z.enum(ProductMarkEnum).array().optional(),
20
- });
21
-
22
- const GetProductListResponseSchema = z.object({
23
- message: z.string().optional(),
24
- data: ProductListSchema,
25
- });
1
+ import type { z } from 'zod';
2
+ import { GetProductListRequestSchema } from '../../schemas/product/get-product-list-request.schema';
3
+ import { GetProductListResponseSchema } from '../../schemas/product/get-product-list-response.schema';
26
4
 
27
5
  export namespace GetProductListContractQuery {
28
6
  export const RequestSchema = GetProductListRequestSchema;
@@ -1,5 +1,6 @@
1
1
  export * from './get-product.query';
2
2
  export * from './get-product-list.query';
3
+ export * from './export-stock-products.query';
3
4
  export * from './create-product.command';
4
5
  export * from './update-product.command';
5
6
  export * from './delete-product.command';
@@ -1,35 +1,5 @@
1
1
  import { z } from 'zod';
2
- import { OrderByEnum, ProductClientSortByEnum, ProductMarkEnum } from '../../../enum';
3
- import { ProductListExtendedForClientSchema } from '../../../schemas';
4
-
5
- const GetProductListForClientRequestSchema = z.object({
6
- page: z.string().transform(val => Number(val) || 1),
7
- count: z.string().transform(val => Number(val) || 10),
8
- stock: z
9
- .string()
10
- .transform(val => (val === 'true' ? true : val === 'false' ? false : undefined))
11
- .optional(),
12
- deliveryDates: z.coerce.date().array().optional(),
13
- sizes: z.string().array().optional(),
14
- colors: z.string().array().optional(),
15
- growers: z.string().array().optional(),
16
- countries: z.string().array().optional(),
17
- categoryUUID: z.string().optional(),
18
- typeUUID: z.string().optional(),
19
- searchQuery: z.string().optional(),
20
- marks: z.nativeEnum(ProductMarkEnum).array().optional(),
21
- // Без `sortBy` порядок остаётся прежним — по категории, названию и размеру. Сортировка по цене
22
- // идёт по базовому прайсу, скидки клиента её не двигают: см. ProductClientSortByEnum.
23
- sortBy: z.nativeEnum(ProductClientSortByEnum).optional(),
24
- // Без `.default()`: он уезжает в `_output`, а значит и в опубликованный `Request`, делая поле
25
- // обязательным для клиентов. Отсутствующее направление билдер и так читает как ASC.
26
- sortOrder: z.nativeEnum(OrderByEnum).optional(),
27
- });
28
-
29
- const GetProductListForClientResponseSchema = z.object({
30
- message: z.string().optional(),
31
- data: ProductListExtendedForClientSchema,
32
- });
2
+ import { GetProductListForClientRequestSchema, GetProductListForClientResponseSchema } from '../../../schemas';
33
3
 
34
4
  export namespace GetProductListForClientContractQuery {
35
5
  export const RequestSchema = GetProductListForClientRequestSchema;
@@ -1,37 +1,5 @@
1
1
  import { z } from 'zod';
2
- import { TransactionListForClientSchema } from '../../../schemas';
3
- import { dateRangeCheck } from '../../../helpers/date.helper';
4
- import { TransactionTypeEnum } from '../../../enum';
5
-
6
- const GetTransactionListForClientRequestSchema = z
7
- .object({
8
- page: z.coerce.number().optional().default(1),
9
- count: z.coerce.number().optional().default(10),
10
- startDate: z.coerce.date().optional(),
11
- endDate: z.coerce.date().optional(),
12
- transactionType: z.nativeEnum(TransactionTypeEnum).optional(),
13
- moneyAccountUUID: z.string().optional(),
14
- orderUUID: z.string().optional(),
15
- searchQuery: z.string().optional(),
16
- })
17
- .refine(
18
- value => {
19
- const { startDate, endDate } = value;
20
- if (startDate && endDate) {
21
- return dateRangeCheck(startDate, endDate);
22
- }
23
- return true;
24
- },
25
- {
26
- message: 'validation.dateRange',
27
- path: ['endDate', 'startDate'],
28
- },
29
- );
30
-
31
- const GetTransactionListForClientResponseSchema = z.object({
32
- message: z.string().optional(),
33
- data: TransactionListForClientSchema,
34
- });
2
+ import { GetTransactionListForClientRequestSchema, GetTransactionListForClientResponseSchema } from '../../../schemas';
35
3
 
36
4
  export namespace GetTransactionListForClientContractQuery {
37
5
  export const RequestSchema = GetTransactionListForClientRequestSchema;
@@ -1,18 +1,5 @@
1
1
  import { z } from 'zod';
2
- import { WriteOffSchema } from '../../../schemas';
3
-
4
- const CreateWriteOffFromOrderForClientRequestSchema = z.object({
5
- // Колонка `WriteOff.quantity` — Int: дробное значение доходило до Prisma и падало общей ошибкой.
6
- quantity: z.coerce.number().int().positive(),
7
- comment: z.string().nullable(),
8
- productUUID: z.string(),
9
- orderProductUUID: z.string(),
10
- });
11
-
12
- const CreateWriteOffFromOrderForClientResponseSchema = z.object({
13
- message: z.string().optional(),
14
- data: WriteOffSchema.nullable(),
15
- });
2
+ import { CreateWriteOffFromOrderForClientRequestSchema, CreateWriteOffFromOrderForClientResponseSchema } from '../../../schemas';
16
3
 
17
4
  export namespace CreateWriteOffFromOrderForClientContractCommand {
18
5
  export const RequestSchema = CreateWriteOffFromOrderForClientRequestSchema;
@@ -1,12 +1,5 @@
1
1
  import { z } from 'zod';
2
- import { WriteOffSchema } from '../../../schemas';
3
-
4
- const GetWriteOffListByOrderForClientRequestSchema = z.object({});
5
-
6
- const GetWriteOffListByOrderForClientResponseSchema = z.object({
7
- message: z.string().optional(),
8
- data: WriteOffSchema.array(),
9
- });
2
+ import { GetWriteOffListByOrderForClientRequestSchema, GetWriteOffListByOrderForClientResponseSchema } from '../../../schemas';
10
3
 
11
4
  export namespace GetWriteOffListByOrderForClientContractQuery {
12
5
  export const RequestSchema = GetWriteOffListByOrderForClientRequestSchema;
package/constant/error.ts CHANGED
@@ -243,6 +243,11 @@ export const ERRORS = {
243
243
  PRODUCT_MULTIPLICITY_OPTION_USED_IN_ORDER: { code: 'P018', message: 'Product multiplicity option used in order', httpCode: 400 },
244
244
  PRODUCT_MULTIPLICITY_OPTION_NOT_DELETED: { code: 'P019', message: 'Failed to delete product multiplicity option', httpCode: 500 },
245
245
  PRODUCT_IMAGE_MATCHING_FAILED: { code: 'P020', message: 'Failed to match images for products', httpCode: 500 },
246
+ PRODUCT_STOCK_EXPORT_LIMIT_EXCEEDED: {
247
+ code: 'P021',
248
+ message: 'Too many products to export. Narrow the filters and try again',
249
+ httpCode: 400,
250
+ },
246
251
 
247
252
  // PRODUCT CONFIGURATION
248
253
  PRODUCT_CONFIGURATION_NOT_CREATED: { code: 'PCFG001', message: 'Failed to create product configuration', httpCode: 500 },
@@ -400,6 +405,12 @@ export const ERRORS = {
400
405
  message: 'An active write-off for this order product already exists',
401
406
  httpCode: 409,
402
407
  },
408
+ WRITE_OFF_ORDER_PRODUCT_MISMATCH: {
409
+ code: 'W019',
410
+ message: 'The order product does not belong to the order or has another product',
411
+ httpCode: 400,
412
+ },
413
+ WRITE_OFF_NOT_PENDING: { code: 'W020', message: 'Only a pending write-off can be deleted by the client', httpCode: 400 },
403
414
 
404
415
  //ORDER
405
416
  ORDER_NOT_CREATED: { code: 'O001', message: 'Failed to create order', httpCode: 500 },
@@ -624,6 +635,7 @@ export const ERRORS = {
624
635
  message: 'Cannot guarantee exclusive price correction right now, try again later',
625
636
  httpCode: 503,
626
637
  },
638
+ ORDER_PRODUCT_CART_NOT_EDITABLE: { code: 'OP029', message: 'Only an open cart can be changed by the client', httpCode: 400 },
627
639
 
628
640
  //TRANSACTION
629
641
  TRANSACTION_NOT_CREATED: { code: 'TR001', message: 'Failed to transaction product', httpCode: 500 },
@@ -1235,6 +1247,11 @@ export const ERRORS = {
1235
1247
  message: 'Pre-orders changed during the move, retry the operation',
1236
1248
  httpCode: 409,
1237
1249
  },
1250
+ PRE_ORDER_COLLECTION_ITEM_MULTIPLICITY_OPTION_NOT_FOUND: {
1251
+ code: 'POCI040',
1252
+ message: 'Multiplicity option of the pre order collection item not found',
1253
+ httpCode: 404,
1254
+ },
1238
1255
 
1239
1256
  // EMPLOYEE SCHEDULE
1240
1257
  EMPLOYEE_SCHEDULE_NOT_CREATED: { code: 'ES001', message: 'Failed to create employee schedule', httpCode: 500 },
@@ -1258,6 +1275,7 @@ export const ERRORS = {
1258
1275
  message: 'Too many products for a single consignment discount operation',
1259
1276
  httpCode: 400,
1260
1277
  },
1278
+ DISCOUNT_RULES_NOT_FOUND: { code: 'DR010', message: 'Discount-rules not found', httpCode: 404 },
1261
1279
 
1262
1280
  // ACTION LOG
1263
1281
  ACTION_LOG_NOT_CREATED: { code: 'ALG001', message: 'Failed to create action-log', httpCode: 500 },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@floristcloud/api-lib",
3
- "version": "1.2.159",
3
+ "version": "1.2.161",
4
4
  "description": "",
5
5
  "main": "./build/index.js",
6
6
  "scripts": {
@@ -0,0 +1,4 @@
1
+ import { CategorySchema } from './category.schema';
2
+
3
+ // Категория только по идентификатору и названию — для ссылок из чужой карточки.
4
+ export const CategoryNameSchema = CategorySchema.pick({ uuid: true, name: true });
@@ -0,0 +1,7 @@
1
+ export * from './category-create.schema';
2
+ export * from './category-filter-value.schema';
3
+ export * from './category-update.schema';
4
+ export * from './category-list-filter.schema';
5
+ export * from './category-list.schema';
6
+ export * from './category.schema';
7
+ export * from './category-name.schema';