@shophost/rest-api 2.0.30 → 2.0.32

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 (352) hide show
  1. package/package.json +18 -13
  2. package/scripts/minify.mjs +123 -0
  3. package/src/app.js +1 -53
  4. package/src/core/auth/auth.schema.js +1 -41
  5. package/src/core/auth/auth.util.js +1 -44
  6. package/src/core/auth/better-auth.lib.js +1 -100
  7. package/src/core/auth/generate-password-hash.util.d.ts +0 -3
  8. package/src/core/auth/generate-password-hash.util.js +1 -30
  9. package/src/core/auth/headers.schema.js +1 -22
  10. package/src/core/auth/user.schema.js +1 -30
  11. package/src/core/db/__generated__/client/browser.d.ts +0 -128
  12. package/src/core/db/__generated__/client/browser.js +1 -18
  13. package/src/core/db/__generated__/client/client.d.ts +0 -143
  14. package/src/core/db/__generated__/client/client.js +1 -35
  15. package/src/core/db/__generated__/client/commonInputTypes.js +1 -11
  16. package/src/core/db/__generated__/client/enums.js +1 -200
  17. package/src/core/db/__generated__/client/internal/class.d.ts +0 -343
  18. package/src/core/db/__generated__/client/internal/class.js +1 -55
  19. package/src/core/db/__generated__/client/internal/prismaNamespace.d.ts +0 -234
  20. package/src/core/db/__generated__/client/internal/prismaNamespace.js +1 -541
  21. package/src/core/db/__generated__/client/internal/prismaNamespaceBrowser.d.ts +0 -15
  22. package/src/core/db/__generated__/client/internal/prismaNamespaceBrowser.js +1 -512
  23. package/src/core/db/__generated__/client/models/Account.d.ts +0 -628
  24. package/src/core/db/__generated__/client/models/Account.js +1 -2
  25. package/src/core/db/__generated__/client/models/Address.d.ts +0 -701
  26. package/src/core/db/__generated__/client/models/Address.js +1 -2
  27. package/src/core/db/__generated__/client/models/Campaign.d.ts +0 -638
  28. package/src/core/db/__generated__/client/models/Campaign.js +1 -2
  29. package/src/core/db/__generated__/client/models/ClosingTimes.d.ts +0 -634
  30. package/src/core/db/__generated__/client/models/ClosingTimes.js +1 -2
  31. package/src/core/db/__generated__/client/models/File.d.ts +0 -752
  32. package/src/core/db/__generated__/client/models/File.js +1 -2
  33. package/src/core/db/__generated__/client/models/Invitation.d.ts +0 -628
  34. package/src/core/db/__generated__/client/models/Invitation.js +1 -2
  35. package/src/core/db/__generated__/client/models/LegalEntity.d.ts +0 -652
  36. package/src/core/db/__generated__/client/models/LegalEntity.js +1 -2
  37. package/src/core/db/__generated__/client/models/Manufacturer.d.ts +0 -679
  38. package/src/core/db/__generated__/client/models/Manufacturer.js +1 -2
  39. package/src/core/db/__generated__/client/models/ManufacturerTranslation.d.ts +0 -628
  40. package/src/core/db/__generated__/client/models/ManufacturerTranslation.js +1 -2
  41. package/src/core/db/__generated__/client/models/Member.d.ts +0 -628
  42. package/src/core/db/__generated__/client/models/Member.js +1 -2
  43. package/src/core/db/__generated__/client/models/Modifier.d.ts +0 -662
  44. package/src/core/db/__generated__/client/models/Modifier.js +1 -2
  45. package/src/core/db/__generated__/client/models/ModifierGroup.d.ts +0 -686
  46. package/src/core/db/__generated__/client/models/ModifierGroup.js +1 -2
  47. package/src/core/db/__generated__/client/models/ModifierGroupTranslation.d.ts +0 -628
  48. package/src/core/db/__generated__/client/models/ModifierGroupTranslation.js +1 -2
  49. package/src/core/db/__generated__/client/models/OpeningTimes.d.ts +0 -634
  50. package/src/core/db/__generated__/client/models/OpeningTimes.js +1 -2
  51. package/src/core/db/__generated__/client/models/Order.d.ts +0 -700
  52. package/src/core/db/__generated__/client/models/Order.js +1 -2
  53. package/src/core/db/__generated__/client/models/OrderItem.d.ts +0 -686
  54. package/src/core/db/__generated__/client/models/OrderItem.js +1 -2
  55. package/src/core/db/__generated__/client/models/OrderItemTranslation.d.ts +0 -628
  56. package/src/core/db/__generated__/client/models/OrderItemTranslation.js +1 -2
  57. package/src/core/db/__generated__/client/models/Organization.d.ts +0 -811
  58. package/src/core/db/__generated__/client/models/Organization.js +1 -2
  59. package/src/core/db/__generated__/client/models/OrganizationConfiguration.d.ts +0 -676
  60. package/src/core/db/__generated__/client/models/OrganizationConfiguration.js +1 -2
  61. package/src/core/db/__generated__/client/models/Payment.d.ts +0 -668
  62. package/src/core/db/__generated__/client/models/Payment.js +1 -2
  63. package/src/core/db/__generated__/client/models/PaymentSession.d.ts +0 -638
  64. package/src/core/db/__generated__/client/models/PaymentSession.js +1 -2
  65. package/src/core/db/__generated__/client/models/Product.d.ts +0 -746
  66. package/src/core/db/__generated__/client/models/Product.js +1 -2
  67. package/src/core/db/__generated__/client/models/ProductCategory.d.ts +0 -689
  68. package/src/core/db/__generated__/client/models/ProductCategory.js +1 -2
  69. package/src/core/db/__generated__/client/models/ProductCategoryTranslation.d.ts +0 -628
  70. package/src/core/db/__generated__/client/models/ProductCategoryTranslation.js +1 -2
  71. package/src/core/db/__generated__/client/models/ProductSnapshot.d.ts +0 -664
  72. package/src/core/db/__generated__/client/models/ProductSnapshot.js +1 -2
  73. package/src/core/db/__generated__/client/models/ProductTranslation.d.ts +0 -628
  74. package/src/core/db/__generated__/client/models/ProductTranslation.js +1 -2
  75. package/src/core/db/__generated__/client/models/Reservation.d.ts +0 -650
  76. package/src/core/db/__generated__/client/models/Reservation.js +1 -2
  77. package/src/core/db/__generated__/client/models/Session.d.ts +0 -628
  78. package/src/core/db/__generated__/client/models/Session.js +1 -2
  79. package/src/core/db/__generated__/client/models/ShippingMethod.d.ts +0 -679
  80. package/src/core/db/__generated__/client/models/ShippingMethod.js +1 -2
  81. package/src/core/db/__generated__/client/models/ShippingZone.d.ts +0 -638
  82. package/src/core/db/__generated__/client/models/ShippingZone.js +1 -2
  83. package/src/core/db/__generated__/client/models/User.d.ts +0 -736
  84. package/src/core/db/__generated__/client/models/User.js +1 -2
  85. package/src/core/db/__generated__/client/models/Verification.d.ts +0 -592
  86. package/src/core/db/__generated__/client/models/Verification.js +1 -2
  87. package/src/core/db/__generated__/client/models.js +1 -2
  88. package/src/core/db/index.js +1 -2
  89. package/src/core/exceptions/http-exception.js +1 -9
  90. package/src/core/hono/hono.js +1 -123
  91. package/src/core/lib/prisma.d.ts +9 -1
  92. package/src/core/lib/prisma.js +1 -11
  93. package/src/core/logging/pino.js +1 -5
  94. package/src/core/notifications/email.service.d.ts +0 -15
  95. package/src/core/notifications/email.service.js +1 -116
  96. package/src/core/openapi/openapi.lib.js +1 -26
  97. package/src/core/types/google-maps.types.js +1 -2
  98. package/src/core/utils/currency.util.js +1 -11
  99. package/src/core/utils/env.util.js +1 -8
  100. package/src/core/utils/object.util.d.ts +0 -10
  101. package/src/core/utils/object.util.js +1 -39
  102. package/src/core/utils/translations.util.js +0 -2
  103. package/src/core/utils/zod.util.d.ts +0 -12
  104. package/src/core/utils/zod.util.js +1 -85
  105. package/src/db.js +1 -3
  106. package/src/features/access/access.handler.js +1 -91
  107. package/src/features/access/access.route.js +1 -220
  108. package/src/features/access/access.schema.js +1 -108
  109. package/src/features/access/access.service.js +1 -294
  110. package/src/features/cart/cart.handler.js +1 -17
  111. package/src/features/cart/cart.route.js +1 -32
  112. package/src/features/cart/cart.schema.js +1 -39
  113. package/src/features/cart/cart.service.d.ts +0 -7
  114. package/src/features/cart/cart.service.js +1 -97
  115. package/src/features/cart/cart.util.js +1 -76
  116. package/src/features/file/file.handler.js +1 -23
  117. package/src/features/file/file.route.js +1 -34
  118. package/src/features/file/file.schema.js +1 -77
  119. package/src/features/file/file.service.d.ts +0 -6
  120. package/src/features/file/file.service.js +1 -66
  121. package/src/features/health/health.handler.js +1 -10
  122. package/src/features/health/health.route.js +1 -25
  123. package/src/features/index.js +1 -16
  124. package/src/features/location/location.handler.js +1 -25
  125. package/src/features/location/location.route.js +1 -56
  126. package/src/features/location/location.schema.js +1 -50
  127. package/src/features/location/location.service.d.ts +0 -3
  128. package/src/features/location/location.service.js +1 -141
  129. package/src/features/manufacturer/manufacturer.handler.js +1 -53
  130. package/src/features/manufacturer/manufacturer.route.js +1 -97
  131. package/src/features/manufacturer/manufacturer.schema.js +1 -125
  132. package/src/features/manufacturer/manufacturer.service.d.ts +0 -19
  133. package/src/features/manufacturer/manufacturer.service.js +1 -190
  134. package/src/features/order/emails/order-confirmation.email.js +1 -229
  135. package/src/features/order/emails/order-notification.email.js +1 -229
  136. package/src/features/order/fulfilment.schema.js +1 -3
  137. package/src/features/order/order.handler.js +1 -54
  138. package/src/features/order/order.route.js +1 -111
  139. package/src/features/order/order.schema.js +1 -158
  140. package/src/features/order/order.service.d.ts +0 -15
  141. package/src/features/order/order.service.js +1 -306
  142. package/src/features/order/recipient.schema.js +1 -38
  143. package/src/features/organization/legal-entity.schema.js +1 -83
  144. package/src/features/organization/organization-configuration.schema.js +1 -115
  145. package/src/features/organization/organization.handler.js +1 -48
  146. package/src/features/organization/organization.route.js +1 -84
  147. package/src/features/organization/organization.schema.js +1 -64
  148. package/src/features/organization/organization.service.d.ts +0 -15
  149. package/src/features/organization/organization.service.js +1 -334
  150. package/src/features/payment/payment.handler.js +1 -16
  151. package/src/features/payment/payment.route.js +1 -22
  152. package/src/features/payment/payment.schema.js +1 -46
  153. package/src/features/payment/payment.service.js +1 -100
  154. package/src/features/payment/stripe.service.js +1 -164
  155. package/src/features/product/product-modifier.schema.js +1 -84
  156. package/src/features/product/product.handler.js +1 -87
  157. package/src/features/product/product.route.js +1 -179
  158. package/src/features/product/product.schema.js +1 -143
  159. package/src/features/product/product.service.d.ts +0 -25
  160. package/src/features/product/product.service.js +1 -440
  161. package/src/features/product-category/product-category.handler.js +1 -59
  162. package/src/features/product-category/product-category.route.js +1 -139
  163. package/src/features/product-category/product-category.schema.js +1 -86
  164. package/src/features/product-category/product-category.service.d.ts +0 -22
  165. package/src/features/product-category/product-category.service.js +1 -220
  166. package/src/features/reservation/emails/reservation-cancellation.email.js +1 -82
  167. package/src/features/reservation/emails/reservation-confirmation.email.js +1 -82
  168. package/src/features/reservation/emails/reservation-notification.email.js +1 -93
  169. package/src/features/reservation/reservation.handler.js +1 -65
  170. package/src/features/reservation/reservation.route.js +1 -167
  171. package/src/features/reservation/reservation.schema.js +1 -51
  172. package/src/features/reservation/reservation.service.d.ts +0 -18
  173. package/src/features/reservation/reservation.service.js +1 -231
  174. package/src/features/shipping/shipping.handler.js +1 -32
  175. package/src/features/shipping/shipping.route.js +1 -51
  176. package/src/features/shipping/shipping.service.d.ts +0 -7
  177. package/src/features/shipping/shipping.service.js +1 -96
  178. package/src/features/shipping-method/shipping-method.handler.js +1 -60
  179. package/src/features/shipping-method/shipping-method.route.js +1 -144
  180. package/src/features/shipping-method/shipping-method.schema.js +1 -48
  181. package/src/features/shipping-method/shipping-method.service.d.ts +0 -25
  182. package/src/features/shipping-method/shipping-method.service.js +1 -229
  183. package/src/features/shipping-method/shipping-zone.schema.js +1 -31
  184. package/src/features/webhook/webhook.handler.js +1 -50
  185. package/src/features/webhook/webhook.route.js +1 -33
  186. package/src/index.js +1 -6
  187. package/src/integrations/next.js +1 -82
  188. package/src/schemas/address.schema.d.ts +0 -8
  189. package/src/schemas/address.schema.js +1 -112
  190. package/src/schemas/currency.schema.d.ts +0 -42
  191. package/src/schemas/currency.schema.js +1 -118
  192. package/src/schemas/error.schema.js +1 -12
  193. package/src/schemas/index.js +1 -29
  194. package/src/schemas/locales.schema.js +1 -238
  195. package/src/schemas/number.schema.js +1 -29
  196. package/src/schemas/pagination.schema.js +1 -54
  197. package/src/schemas/params.schema.js +1 -20
  198. package/src/schemas/queries.schema.js +1 -6
  199. package/src/test/global-setup.d.ts +1 -0
  200. package/src/test/global-setup.js +1 -0
  201. package/src/test/integration/api-fixtures.d.ts +4 -16
  202. package/src/test/integration/api-fixtures.js +1 -225
  203. package/src/test/integration/seed.d.ts +81 -0
  204. package/src/test/integration/seed.js +1 -0
  205. package/src/test/integration/test-helpers.d.ts +107 -924
  206. package/src/test/integration/test-helpers.js +1 -1100
  207. package/src/test/setup-test-env.d.ts +1 -1
  208. package/src/test/setup-test-env.js +1 -29
  209. package/src/app.js.map +0 -1
  210. package/src/core/auth/auth.schema.js.map +0 -1
  211. package/src/core/auth/auth.util.js.map +0 -1
  212. package/src/core/auth/better-auth.lib.js.map +0 -1
  213. package/src/core/auth/generate-password-hash.util.js.map +0 -1
  214. package/src/core/auth/headers.schema.js.map +0 -1
  215. package/src/core/auth/user.schema.js.map +0 -1
  216. package/src/core/db/__generated__/client/browser.js.map +0 -1
  217. package/src/core/db/__generated__/client/client.js.map +0 -1
  218. package/src/core/db/__generated__/client/commonInputTypes.js.map +0 -1
  219. package/src/core/db/__generated__/client/enums.js.map +0 -1
  220. package/src/core/db/__generated__/client/internal/class.js.map +0 -1
  221. package/src/core/db/__generated__/client/internal/prismaNamespace.js.map +0 -1
  222. package/src/core/db/__generated__/client/internal/prismaNamespaceBrowser.js.map +0 -1
  223. package/src/core/db/__generated__/client/models/Account.js.map +0 -1
  224. package/src/core/db/__generated__/client/models/Address.js.map +0 -1
  225. package/src/core/db/__generated__/client/models/Campaign.js.map +0 -1
  226. package/src/core/db/__generated__/client/models/ClosingTimes.js.map +0 -1
  227. package/src/core/db/__generated__/client/models/File.js.map +0 -1
  228. package/src/core/db/__generated__/client/models/Invitation.js.map +0 -1
  229. package/src/core/db/__generated__/client/models/LegalEntity.js.map +0 -1
  230. package/src/core/db/__generated__/client/models/Manufacturer.js.map +0 -1
  231. package/src/core/db/__generated__/client/models/ManufacturerTranslation.js.map +0 -1
  232. package/src/core/db/__generated__/client/models/Member.js.map +0 -1
  233. package/src/core/db/__generated__/client/models/Modifier.js.map +0 -1
  234. package/src/core/db/__generated__/client/models/ModifierGroup.js.map +0 -1
  235. package/src/core/db/__generated__/client/models/ModifierGroupTranslation.js.map +0 -1
  236. package/src/core/db/__generated__/client/models/OpeningTimes.js.map +0 -1
  237. package/src/core/db/__generated__/client/models/Order.js.map +0 -1
  238. package/src/core/db/__generated__/client/models/OrderItem.js.map +0 -1
  239. package/src/core/db/__generated__/client/models/OrderItemTranslation.js.map +0 -1
  240. package/src/core/db/__generated__/client/models/Organization.js.map +0 -1
  241. package/src/core/db/__generated__/client/models/OrganizationConfiguration.js.map +0 -1
  242. package/src/core/db/__generated__/client/models/Payment.js.map +0 -1
  243. package/src/core/db/__generated__/client/models/PaymentSession.js.map +0 -1
  244. package/src/core/db/__generated__/client/models/Product.js.map +0 -1
  245. package/src/core/db/__generated__/client/models/ProductCategory.js.map +0 -1
  246. package/src/core/db/__generated__/client/models/ProductCategoryTranslation.js.map +0 -1
  247. package/src/core/db/__generated__/client/models/ProductSnapshot.js.map +0 -1
  248. package/src/core/db/__generated__/client/models/ProductTranslation.js.map +0 -1
  249. package/src/core/db/__generated__/client/models/Reservation.js.map +0 -1
  250. package/src/core/db/__generated__/client/models/Session.js.map +0 -1
  251. package/src/core/db/__generated__/client/models/ShippingMethod.js.map +0 -1
  252. package/src/core/db/__generated__/client/models/ShippingZone.js.map +0 -1
  253. package/src/core/db/__generated__/client/models/User.js.map +0 -1
  254. package/src/core/db/__generated__/client/models/Verification.js.map +0 -1
  255. package/src/core/db/__generated__/client/models.js.map +0 -1
  256. package/src/core/db/index.js.map +0 -1
  257. package/src/core/exceptions/http-exception.js.map +0 -1
  258. package/src/core/hono/hono.js.map +0 -1
  259. package/src/core/lib/prisma.js.map +0 -1
  260. package/src/core/logging/pino.js.map +0 -1
  261. package/src/core/notifications/email.service.js.map +0 -1
  262. package/src/core/openapi/openapi.lib.js.map +0 -1
  263. package/src/core/types/google-maps.types.js.map +0 -1
  264. package/src/core/utils/currency.util.js.map +0 -1
  265. package/src/core/utils/env.util.js.map +0 -1
  266. package/src/core/utils/object.util.js.map +0 -1
  267. package/src/core/utils/translations.util.js.map +0 -1
  268. package/src/core/utils/zod.util.js.map +0 -1
  269. package/src/db.js.map +0 -1
  270. package/src/features/access/access.handler.js.map +0 -1
  271. package/src/features/access/access.route.js.map +0 -1
  272. package/src/features/access/access.schema.js.map +0 -1
  273. package/src/features/access/access.service.js.map +0 -1
  274. package/src/features/cart/cart.handler.js.map +0 -1
  275. package/src/features/cart/cart.route.js.map +0 -1
  276. package/src/features/cart/cart.schema.js.map +0 -1
  277. package/src/features/cart/cart.service.js.map +0 -1
  278. package/src/features/cart/cart.util.js.map +0 -1
  279. package/src/features/file/file.handler.js.map +0 -1
  280. package/src/features/file/file.route.js.map +0 -1
  281. package/src/features/file/file.schema.js.map +0 -1
  282. package/src/features/file/file.service.js.map +0 -1
  283. package/src/features/health/health.handler.js.map +0 -1
  284. package/src/features/health/health.route.js.map +0 -1
  285. package/src/features/index.js.map +0 -1
  286. package/src/features/location/location.handler.js.map +0 -1
  287. package/src/features/location/location.route.js.map +0 -1
  288. package/src/features/location/location.schema.js.map +0 -1
  289. package/src/features/location/location.service.js.map +0 -1
  290. package/src/features/manufacturer/manufacturer.handler.js.map +0 -1
  291. package/src/features/manufacturer/manufacturer.route.js.map +0 -1
  292. package/src/features/manufacturer/manufacturer.schema.js.map +0 -1
  293. package/src/features/manufacturer/manufacturer.service.js.map +0 -1
  294. package/src/features/order/emails/order-confirmation.email.js.map +0 -1
  295. package/src/features/order/emails/order-notification.email.js.map +0 -1
  296. package/src/features/order/fulfilment.schema.js.map +0 -1
  297. package/src/features/order/order.handler.js.map +0 -1
  298. package/src/features/order/order.route.js.map +0 -1
  299. package/src/features/order/order.schema.js.map +0 -1
  300. package/src/features/order/order.service.js.map +0 -1
  301. package/src/features/order/recipient.schema.js.map +0 -1
  302. package/src/features/organization/legal-entity.schema.js.map +0 -1
  303. package/src/features/organization/organization-configuration.schema.js.map +0 -1
  304. package/src/features/organization/organization.handler.js.map +0 -1
  305. package/src/features/organization/organization.route.js.map +0 -1
  306. package/src/features/organization/organization.schema.js.map +0 -1
  307. package/src/features/organization/organization.service.js.map +0 -1
  308. package/src/features/payment/payment.handler.js.map +0 -1
  309. package/src/features/payment/payment.route.js.map +0 -1
  310. package/src/features/payment/payment.schema.js.map +0 -1
  311. package/src/features/payment/payment.service.js.map +0 -1
  312. package/src/features/payment/stripe.service.js.map +0 -1
  313. package/src/features/product/product-modifier.schema.js.map +0 -1
  314. package/src/features/product/product.handler.js.map +0 -1
  315. package/src/features/product/product.route.js.map +0 -1
  316. package/src/features/product/product.schema.js.map +0 -1
  317. package/src/features/product/product.service.js.map +0 -1
  318. package/src/features/product-category/product-category.handler.js.map +0 -1
  319. package/src/features/product-category/product-category.route.js.map +0 -1
  320. package/src/features/product-category/product-category.schema.js.map +0 -1
  321. package/src/features/product-category/product-category.service.js.map +0 -1
  322. package/src/features/reservation/emails/reservation-cancellation.email.js.map +0 -1
  323. package/src/features/reservation/emails/reservation-confirmation.email.js.map +0 -1
  324. package/src/features/reservation/emails/reservation-notification.email.js.map +0 -1
  325. package/src/features/reservation/reservation.handler.js.map +0 -1
  326. package/src/features/reservation/reservation.route.js.map +0 -1
  327. package/src/features/reservation/reservation.schema.js.map +0 -1
  328. package/src/features/reservation/reservation.service.js.map +0 -1
  329. package/src/features/shipping/shipping.handler.js.map +0 -1
  330. package/src/features/shipping/shipping.route.js.map +0 -1
  331. package/src/features/shipping/shipping.service.js.map +0 -1
  332. package/src/features/shipping-method/shipping-method.handler.js.map +0 -1
  333. package/src/features/shipping-method/shipping-method.route.js.map +0 -1
  334. package/src/features/shipping-method/shipping-method.schema.js.map +0 -1
  335. package/src/features/shipping-method/shipping-method.service.js.map +0 -1
  336. package/src/features/shipping-method/shipping-zone.schema.js.map +0 -1
  337. package/src/features/webhook/webhook.handler.js.map +0 -1
  338. package/src/features/webhook/webhook.route.js.map +0 -1
  339. package/src/index.js.map +0 -1
  340. package/src/integrations/next.js.map +0 -1
  341. package/src/schemas/address.schema.js.map +0 -1
  342. package/src/schemas/currency.schema.js.map +0 -1
  343. package/src/schemas/error.schema.js.map +0 -1
  344. package/src/schemas/index.js.map +0 -1
  345. package/src/schemas/locales.schema.js.map +0 -1
  346. package/src/schemas/number.schema.js.map +0 -1
  347. package/src/schemas/pagination.schema.js.map +0 -1
  348. package/src/schemas/params.schema.js.map +0 -1
  349. package/src/schemas/queries.schema.js.map +0 -1
  350. package/src/test/integration/api-fixtures.js.map +0 -1
  351. package/src/test/integration/test-helpers.js.map +0 -1
  352. package/src/test/setup-test-env.js.map +0 -1
@@ -1,83 +1 @@
1
- import { z } from "@hono/zod-openapi";
2
- import { AddressSchema, CreateAddressSchema, UpdateAddressSchema, } from "../../schemas/address.schema";
3
- export const LegalEntitySchema = z
4
- .object({
5
- id: z.string().openapi({
6
- example: "clm1234567890abcdef",
7
- description: "The unique identifier of the legal entity",
8
- }),
9
- name: z.string().openapi({
10
- example: "Acme Corporation",
11
- description: "The name of the legal entity",
12
- }),
13
- taxId: z.string().min(2).max(20).openapi({
14
- example: "PL1234567890",
15
- description: "The TAX ID of the legal entity",
16
- }),
17
- email: z.string().email().nullable().openapi({
18
- example: "contact@acme.com",
19
- description: "The email of the legal entity",
20
- format: "email",
21
- }),
22
- phone: z.string().nullable().openapi({
23
- example: "+48123456789",
24
- description: "The phone number of the legal entity",
25
- }),
26
- createdAt: z.date().openapi({
27
- description: "The date and time when the legal entity was created",
28
- format: "date-time",
29
- }),
30
- address: AddressSchema.required().openapi({
31
- description: "The address of the legal entity",
32
- }),
33
- })
34
- .openapi("LegalEntity");
35
- export const CreateLegalEntitySchema = z
36
- .object({
37
- name: z.string().min(1, "Name is required").openapi({
38
- example: "Acme Corporation",
39
- description: "The name of the legal entity",
40
- }),
41
- taxId: z.string().min(2).max(20).openapi({
42
- example: "PL1234567890",
43
- description: "The TAX ID of the legal entity",
44
- }),
45
- email: z.string().email().optional().openapi({
46
- example: "contact@acme.com",
47
- description: "The email of the legal entity",
48
- format: "email",
49
- }),
50
- phone: z.string().optional().openapi({
51
- example: "+48123456789",
52
- description: "The phone number of the legal entity",
53
- }),
54
- address: CreateAddressSchema.required().openapi({
55
- description: "The address of the legal entity",
56
- }),
57
- })
58
- .openapi("CreateLegalEntity");
59
- export const UpdateLegalEntitySchema = z
60
- .object({
61
- name: z.string().min(1, "Name is required").optional().openapi({
62
- example: "Acme Corporation",
63
- description: "The name of the legal entity",
64
- }),
65
- taxId: z.string().min(2).max(20).openapi({
66
- example: "PL1234567890",
67
- description: "The TAX ID of the legal entity",
68
- }),
69
- email: z.string().email().optional().openapi({
70
- example: "contact@acme.com",
71
- description: "The email of the legal entity",
72
- format: "email",
73
- }),
74
- phone: z.string().optional().openapi({
75
- example: "+48123456789",
76
- description: "The phone number of the legal entity",
77
- }),
78
- address: UpdateAddressSchema.required().openapi({
79
- description: "The address of the legal entity",
80
- }),
81
- })
82
- .openapi("UpdateLegalEntity");
83
- //# sourceMappingURL=legal-entity.schema.js.map
1
+ import{z as e}from"@hono/zod-openapi";import{AddressSchema as t,CreateAddressSchema as i,UpdateAddressSchema as a}from"../../schemas/address.schema";export const LegalEntitySchema=e.object({id:e.string().openapi({example:"clm1234567890abcdef",description:"The unique identifier of the legal entity"}),name:e.string().openapi({example:"Acme Corporation",description:"The name of the legal entity"}),taxId:e.string().min(2).max(20).openapi({example:"PL1234567890",description:"The TAX ID of the legal entity"}),email:e.string().email().nullable().openapi({example:"contact@acme.com",description:"The email of the legal entity",format:"email"}),phone:e.string().nullable().openapi({example:"+48123456789",description:"The phone number of the legal entity"}),createdAt:e.date().openapi({description:"The date and time when the legal entity was created",format:"date-time"}),address:t.required().openapi({description:"The address of the legal entity"})}).openapi("LegalEntity");export const CreateLegalEntitySchema=e.object({name:e.string().min(1,"Name is required").openapi({example:"Acme Corporation",description:"The name of the legal entity"}),taxId:e.string().min(2).max(20).openapi({example:"PL1234567890",description:"The TAX ID of the legal entity"}),email:e.string().email().optional().openapi({example:"contact@acme.com",description:"The email of the legal entity",format:"email"}),phone:e.string().optional().openapi({example:"+48123456789",description:"The phone number of the legal entity"}),address:i.required().openapi({description:"The address of the legal entity"})}).openapi("CreateLegalEntity");export const UpdateLegalEntitySchema=e.object({name:e.string().min(1,"Name is required").optional().openapi({example:"Acme Corporation",description:"The name of the legal entity"}),taxId:e.string().min(2).max(20).openapi({example:"PL1234567890",description:"The TAX ID of the legal entity"}),email:e.string().email().optional().openapi({example:"contact@acme.com",description:"The email of the legal entity",format:"email"}),phone:e.string().optional().openapi({example:"+48123456789",description:"The phone number of the legal entity"}),address:a.required().openapi({description:"The address of the legal entity"})}).openapi("UpdateLegalEntity");
@@ -1,115 +1 @@
1
- import { z } from "@hono/zod-openapi";
2
- import { currency } from "../../schemas/currency.schema";
3
- import { locale } from "../../schemas/locales.schema";
4
- export const TimeScheduleSchema = z
5
- .object({
6
- monday: z.string().nullable().openapi({
7
- example: "09:00",
8
- description: "Opening time for Monday",
9
- }),
10
- tuesday: z.string().nullable().openapi({
11
- example: "09:00",
12
- description: "Opening time for Tuesday",
13
- }),
14
- wednesday: z.string().nullable().openapi({
15
- example: "09:00",
16
- description: "Opening time for Wednesday",
17
- }),
18
- thursday: z.string().nullable().openapi({
19
- example: "09:00",
20
- description: "Opening time for Thursday",
21
- }),
22
- friday: z.string().nullable().openapi({
23
- example: "09:00",
24
- description: "Opening time for Friday",
25
- }),
26
- saturday: z.string().nullable().openapi({
27
- example: "09:00",
28
- description: "Opening time for Saturday",
29
- }),
30
- sunday: z.string().nullable().openapi({
31
- example: "09:00",
32
- description: "Opening time for Sunday",
33
- }),
34
- })
35
- .openapi("TimeSchedule");
36
- export const OrganizationConfigurationSchema = z
37
- .object({
38
- id: z.string().openapi({
39
- example: "clm1234567890abcdef",
40
- description: "Unique identifier for the organization configuration",
41
- }),
42
- hostname: z.coerce.string().optional().openapi({
43
- example: "store.example.com",
44
- description: "Hostname associated with the organization",
45
- }),
46
- countriesShipping: z.array(z.string()).openapi({
47
- example: ["US", "CA"],
48
- description: "List of countries where shipping is available",
49
- }),
50
- stripeAccountId: z.coerce.string().optional().openapi({
51
- example: "acct_123456789",
52
- description: "Stripe account ID associated with the organization",
53
- }),
54
- enableHostCheckout: z.boolean().openapi({
55
- example: true,
56
- description: "Indicates if host checkout is enabled",
57
- }),
58
- enableHostTracking: z.boolean().openapi({
59
- example: true,
60
- description: "Indicates if host tracking is enabled",
61
- }),
62
- isAcceptingOrders: z.boolean().openapi({
63
- example: true,
64
- description: "Indicates if the organization is currently accepting orders",
65
- }),
66
- isOpen: z.boolean().default(false).openapi({
67
- example: true,
68
- description: "Indicates if the organization is currently open",
69
- }),
70
- defaultLocale: locale,
71
- supportedLocales: z.array(locale).openapi({
72
- description: "List of supported locales for the organization",
73
- }),
74
- openingTimes: TimeScheduleSchema.optional(),
75
- closingTimes: TimeScheduleSchema.optional(),
76
- facebookProfile: z.string().nullable().optional().openapi({
77
- example: "https://www.facebook.com/example",
78
- description: "Facebook profile URL for the organization",
79
- }),
80
- instagramProfile: z.string().nullable().optional().openapi({
81
- example: "https://www.instagram.com/example",
82
- description: "Instagram profile URL for the organization",
83
- }),
84
- xProfile: z.string().nullable().optional().openapi({
85
- example: "https://www.x.com/example",
86
- description: "X profile URL for the organization",
87
- }),
88
- defaultCurrency: currency.openapi({
89
- example: "USD",
90
- description: "Default currency for the organization",
91
- }),
92
- createdAt: z.date().openapi({
93
- description: "Timestamp when the organization configuration was created",
94
- }),
95
- })
96
- .openapi("OrganizationConfiguration");
97
- export const UpdateOrganizationConfigurationSchema = OrganizationConfigurationSchema.pick({
98
- hostname: true,
99
- countriesShipping: true,
100
- stripeAccountId: true,
101
- enableHostCheckout: true,
102
- enableHostTracking: true,
103
- isAcceptingOrders: true,
104
- defaultLocale: true,
105
- supportedLocales: true,
106
- defaultCurrency: true,
107
- openingTimes: true,
108
- closingTimes: true,
109
- facebookProfile: true,
110
- instagramProfile: true,
111
- xProfile: true,
112
- })
113
- .partial()
114
- .openapi("UpdateOrganizationConfiguration");
115
- //# sourceMappingURL=organization-configuration.schema.js.map
1
+ import{z as e}from"@hono/zod-openapi";import{currency as i}from"../../schemas/currency.schema";import{locale as o}from"../../schemas/locales.schema";export const TimeScheduleSchema=e.object({monday:e.string().nullable().openapi({example:"09:00",description:"Opening time for Monday"}),tuesday:e.string().nullable().openapi({example:"09:00",description:"Opening time for Tuesday"}),wednesday:e.string().nullable().openapi({example:"09:00",description:"Opening time for Wednesday"}),thursday:e.string().nullable().openapi({example:"09:00",description:"Opening time for Thursday"}),friday:e.string().nullable().openapi({example:"09:00",description:"Opening time for Friday"}),saturday:e.string().nullable().openapi({example:"09:00",description:"Opening time for Saturday"}),sunday:e.string().nullable().openapi({example:"09:00",description:"Opening time for Sunday"})}).openapi("TimeSchedule");export const OrganizationConfigurationSchema=e.object({id:e.string().openapi({example:"clm1234567890abcdef",description:"Unique identifier for the organization configuration"}),hostname:e.coerce.string().optional().openapi({example:"store.example.com",description:"Hostname associated with the organization"}),countriesShipping:e.array(e.string()).openapi({example:["US","CA"],description:"List of countries where shipping is available"}),stripeAccountId:e.coerce.string().optional().openapi({example:"acct_123456789",description:"Stripe account ID associated with the organization"}),enableHostCheckout:e.boolean().openapi({example:!0,description:"Indicates if host checkout is enabled"}),enableHostTracking:e.boolean().openapi({example:!0,description:"Indicates if host tracking is enabled"}),isAcceptingOrders:e.boolean().openapi({example:!0,description:"Indicates if the organization is currently accepting orders"}),isOpen:e.boolean().default(!1).openapi({example:!0,description:"Indicates if the organization is currently open"}),defaultLocale:o,supportedLocales:e.array(o).openapi({description:"List of supported locales for the organization"}),openingTimes:TimeScheduleSchema.optional(),closingTimes:TimeScheduleSchema.optional(),facebookProfile:e.string().nullable().optional().openapi({example:"https://www.facebook.com/example",description:"Facebook profile URL for the organization"}),instagramProfile:e.string().nullable().optional().openapi({example:"https://www.instagram.com/example",description:"Instagram profile URL for the organization"}),xProfile:e.string().nullable().optional().openapi({example:"https://www.x.com/example",description:"X profile URL for the organization"}),defaultCurrency:i.openapi({example:"USD",description:"Default currency for the organization"}),createdAt:e.date().openapi({description:"Timestamp when the organization configuration was created"})}).openapi("OrganizationConfiguration");export const UpdateOrganizationConfigurationSchema=OrganizationConfigurationSchema.pick({hostname:!0,countriesShipping:!0,stripeAccountId:!0,enableHostCheckout:!0,enableHostTracking:!0,isAcceptingOrders:!0,defaultLocale:!0,supportedLocales:!0,defaultCurrency:!0,openingTimes:!0,closingTimes:!0,facebookProfile:!0,instagramProfile:!0,xProfile:!0}).partial().openapi("UpdateOrganizationConfiguration");
@@ -1,48 +1 @@
1
- import { __awaiter } from "tslib";
2
- import { createApiRouter } from "../../core/hono/hono";
3
- import { organizationRoute } from "./organization.route";
4
- import { OrganizationService } from "./organization.service";
5
- export const buildOrganizationHandler = (prisma, googleMapsApiKey) => {
6
- const app = createApiRouter();
7
- app.openapi(organizationRoute.getOrganizations, (c) => __awaiter(void 0, void 0, void 0, function* () {
8
- const auth = c.get("auth");
9
- const query = c.req.valid("query");
10
- const user = yield auth.getCurrentUser();
11
- const service = new OrganizationService(prisma, googleMapsApiKey);
12
- const result = yield service.getOrganizations(user.id, query);
13
- return c.json(result, 200);
14
- }));
15
- app.openapi(organizationRoute.getOrganization, (c) => __awaiter(void 0, void 0, void 0, function* () {
16
- const params = c.req.valid("param");
17
- const service = new OrganizationService(prisma, googleMapsApiKey);
18
- const organization = yield service.getOrganization(params.organizationId);
19
- return c.json(organization, 200);
20
- }));
21
- app.openapi(organizationRoute.createOrganization, (c) => __awaiter(void 0, void 0, void 0, function* () {
22
- const auth = c.get("auth");
23
- const body = c.req.valid("json");
24
- const user = yield auth.getCurrentUser();
25
- const service = new OrganizationService(prisma, googleMapsApiKey);
26
- const organization = yield service.createOrganization(user.id, body);
27
- return c.json(organization, 201);
28
- }));
29
- app.openapi(organizationRoute.updateOrganization, (c) => __awaiter(void 0, void 0, void 0, function* () {
30
- const auth = c.get("auth");
31
- const params = c.req.valid("param");
32
- const body = c.req.valid("json");
33
- const user = yield auth.isGranted("update");
34
- const service = new OrganizationService(prisma, googleMapsApiKey);
35
- const organization = yield service.updateOrganization(params.organizationId, user.id, body);
36
- return c.json(organization, 200);
37
- }));
38
- app.openapi(organizationRoute.deleteOrganization, (c) => __awaiter(void 0, void 0, void 0, function* () {
39
- const auth = c.get("auth");
40
- const params = c.req.valid("param");
41
- const user = yield auth.isGranted("delete");
42
- const service = new OrganizationService(prisma, googleMapsApiKey);
43
- yield service.deleteOrganization(params.organizationId, user.id);
44
- return c.body(null, 204);
45
- }));
46
- return app;
47
- };
48
- //# sourceMappingURL=organization.handler.js.map
1
+ import{__awaiter as i}from"tslib";import{createApiRouter as n}from"../../core/hono/hono";import{organizationRoute as o}from"./organization.route";import{OrganizationService as e}from"./organization.service";export const buildOrganizationHandler=(t,a)=>{const r=n();return r.openapi(o.getOrganizations,n=>i(void 0,void 0,void 0,function*(){const i=n.get("auth"),o=n.req.valid("query"),r=yield i.getCurrentUser(),d=new e(t,a),g=yield d.getOrganizations(r.id,o);return n.json(g,200)})),r.openapi(o.getOrganization,n=>i(void 0,void 0,void 0,function*(){const i=n.req.valid("param"),o=new e(t,a),r=yield o.getOrganization(i.organizationId);return n.json(r,200)})),r.openapi(o.createOrganization,n=>i(void 0,void 0,void 0,function*(){const i=n.get("auth"),o=n.req.valid("json"),r=yield i.getCurrentUser(),d=new e(t,a),g=yield d.createOrganization(r.id,o);return n.json(g,201)})),r.openapi(o.updateOrganization,n=>i(void 0,void 0,void 0,function*(){const i=n.get("auth"),o=n.req.valid("param"),r=n.req.valid("json"),d=yield i.isGranted("update"),g=new e(t,a),u=yield g.updateOrganization(o.organizationId,d.id,r);return n.json(u,200)})),r.openapi(o.deleteOrganization,n=>i(void 0,void 0,void 0,function*(){const i=n.get("auth"),o=n.req.valid("param"),r=yield i.isGranted("delete"),d=new e(t,a);return yield d.deleteOrganization(o.organizationId,r.id),n.body(null,204)})),r};
@@ -1,84 +1 @@
1
- import { z } from "@hono/zod-openapi";
2
- import { createApiRoute } from "../../core/hono/hono";
3
- import { CreateOrganizationSchema, ErrorSchema, HeaderSchema, OrganizationParams, OrganizationSchema, PaginationMetaSchema, PaginationQuerySchema, UpdateOrganizationSchema, } from "../../schemas";
4
- const getOrganizationsRoute = createApiRoute({
5
- description: "Fetches a paginated list of organizations",
6
- headers: HeaderSchema,
7
- method: "GET",
8
- operationId: "getOrganizations",
9
- path: "/organizations",
10
- query: PaginationQuerySchema,
11
- responses: {
12
- 200: z.object({
13
- list: z.array(OrganizationSchema),
14
- meta: PaginationMetaSchema,
15
- }),
16
- },
17
- summary: "Get Organizations",
18
- tags: ["Organization"],
19
- });
20
- const getOrganizationRoute = createApiRoute({
21
- description: "Fetches a specific organization by ID",
22
- headers: HeaderSchema,
23
- method: "GET",
24
- operationId: "getOrganization",
25
- path: "/organizations/:organizationId",
26
- pathParams: OrganizationParams,
27
- responses: {
28
- 200: OrganizationSchema,
29
- 404: ErrorSchema,
30
- },
31
- summary: "Get Organization",
32
- tags: ["Organization"],
33
- });
34
- const createOrganizationRoute = createApiRoute({
35
- body: CreateOrganizationSchema,
36
- description: "Creates a new organization",
37
- headers: HeaderSchema,
38
- method: "POST",
39
- operationId: "createOrganization",
40
- path: "/organizations",
41
- responses: {
42
- 201: OrganizationSchema,
43
- 400: ErrorSchema,
44
- },
45
- summary: "Create Organization",
46
- tags: ["Organization"],
47
- });
48
- const updateOrganizationRoute = createApiRoute({
49
- body: UpdateOrganizationSchema,
50
- description: "Updates a specific organization by ID",
51
- headers: HeaderSchema,
52
- method: "PATCH",
53
- operationId: "updateOrganization",
54
- path: "/organizations/:organizationId",
55
- pathParams: OrganizationParams,
56
- responses: {
57
- 200: OrganizationSchema,
58
- 404: ErrorSchema,
59
- },
60
- summary: "Update Organization",
61
- tags: ["Organization"],
62
- });
63
- const deleteOrganizationRoute = createApiRoute({
64
- description: "Deletes a specific organization by ID",
65
- headers: HeaderSchema,
66
- method: "DELETE",
67
- operationId: "deleteOrganization",
68
- path: "/organizations/:organizationId",
69
- pathParams: OrganizationParams,
70
- responses: {
71
- 204: null,
72
- 404: ErrorSchema,
73
- },
74
- summary: "Delete Organization",
75
- tags: ["Organization"],
76
- });
77
- export const organizationRoute = {
78
- getOrganizations: getOrganizationsRoute,
79
- getOrganization: getOrganizationRoute,
80
- createOrganization: createOrganizationRoute,
81
- updateOrganization: updateOrganizationRoute,
82
- deleteOrganization: deleteOrganizationRoute,
83
- };
84
- //# sourceMappingURL=organization.route.js.map
1
+ import{z as a}from"@hono/zod-openapi";import{createApiRoute as i}from"../../core/hono/hono";import{CreateOrganizationSchema as o,ErrorSchema as t,HeaderSchema as n,OrganizationParams as e,OrganizationSchema as r,PaginationMetaSchema as s,PaginationQuerySchema as g,UpdateOrganizationSchema as p}from"../../schemas";const z=i({description:"Fetches a paginated list of organizations",headers:n,method:"GET",operationId:"getOrganizations",path:"/organizations",query:g,responses:{200:a.object({list:a.array(r),meta:s})},summary:"Get Organizations",tags:["Organization"]}),d=i({description:"Fetches a specific organization by ID",headers:n,method:"GET",operationId:"getOrganization",path:"/organizations/:organizationId",pathParams:e,responses:{200:r,404:t},summary:"Get Organization",tags:["Organization"]}),m=i({body:o,description:"Creates a new organization",headers:n,method:"POST",operationId:"createOrganization",path:"/organizations",responses:{201:r,400:t},summary:"Create Organization",tags:["Organization"]}),h=i({body:p,description:"Updates a specific organization by ID",headers:n,method:"PATCH",operationId:"updateOrganization",path:"/organizations/:organizationId",pathParams:e,responses:{200:r,404:t},summary:"Update Organization",tags:["Organization"]}),O=i({description:"Deletes a specific organization by ID",headers:n,method:"DELETE",operationId:"deleteOrganization",path:"/organizations/:organizationId",pathParams:e,responses:{204:null,404:t},summary:"Delete Organization",tags:["Organization"]});export const organizationRoute={getOrganizations:z,getOrganization:d,createOrganization:m,updateOrganization:h,deleteOrganization:O};
@@ -1,64 +1 @@
1
- import { z } from "@hono/zod-openapi";
2
- import { AddressSchema, CreateAddressSchema, UpdateAddressSchema, } from "../../schemas/address.schema";
3
- import { FileSchema } from "../file/file.schema";
4
- import { OrganizationConfigurationSchema, UpdateOrganizationConfigurationSchema, } from "./organization-configuration.schema";
5
- export const OrganizationSchema = z
6
- .object({
7
- id: z.string().openapi({
8
- example: "clm1234567890abcdef",
9
- description: "The unique identifier of the organization",
10
- }),
11
- name: z.string().openapi({
12
- example: "Acme Store",
13
- description: "The name of the organization",
14
- }),
15
- phone: z.string().min(1, "Phone number is required").openapi({
16
- example: "+48123456890",
17
- description: "The phone number of the organization",
18
- }),
19
- email: z.string().email().optional().openapi({
20
- example: "john.doe@example.com",
21
- description: "The email address of the organization",
22
- }),
23
- createdAt: z.date().openapi({
24
- example: "2022-01-01T00:00:00.000Z",
25
- description: "The date and time the organization was created",
26
- }),
27
- legalEntityId: z.string().nullable().openapi({
28
- example: "clm1234567890abcdef",
29
- description: "The unique identifier of the legal entity associated with the organization",
30
- }),
31
- address: AddressSchema,
32
- configuration: OrganizationConfigurationSchema.openapi({
33
- description: "The configuration settings for the organization",
34
- }),
35
- logo: z.string().url().optional().nullable().openapi({
36
- example: "https://example.com/logo.jpg",
37
- description: "The logo of the organization",
38
- }),
39
- logoFile: FileSchema.optional().nullable().openapi({
40
- description: "The logo of the organization",
41
- }),
42
- })
43
- .openapi("Organization");
44
- export const CreateOrganizationSchema = OrganizationSchema.pick({
45
- name: true,
46
- phone: true,
47
- email: true,
48
- logoFile: true,
49
- })
50
- .extend({
51
- logoId: z.string().optional().nullable().openapi({
52
- example: "clm1234567890abcdef",
53
- description: "The unique identifier of the thumbnail image associated with the organization",
54
- }),
55
- address: CreateAddressSchema,
56
- })
57
- .openapi("CreateOrganization");
58
- export const UpdateOrganizationSchema = CreateOrganizationSchema.extend({
59
- address: UpdateAddressSchema,
60
- configuration: UpdateOrganizationConfigurationSchema,
61
- })
62
- .partial()
63
- .openapi("UpdateOrganization");
64
- //# sourceMappingURL=organization.schema.js.map
1
+ import{z as e}from"@hono/zod-openapi";import{AddressSchema as i,CreateAddressSchema as o,UpdateAddressSchema as a}from"../../schemas/address.schema";import{FileSchema as n}from"../file/file.schema";import{OrganizationConfigurationSchema as t,UpdateOrganizationConfigurationSchema as r}from"./organization-configuration.schema";export const OrganizationSchema=e.object({id:e.string().openapi({example:"clm1234567890abcdef",description:"The unique identifier of the organization"}),name:e.string().openapi({example:"Acme Store",description:"The name of the organization"}),phone:e.string().min(1,"Phone number is required").openapi({example:"+48123456890",description:"The phone number of the organization"}),email:e.string().email().optional().openapi({example:"john.doe@example.com",description:"The email address of the organization"}),createdAt:e.date().openapi({example:"2022-01-01T00:00:00.000Z",description:"The date and time the organization was created"}),legalEntityId:e.string().nullable().openapi({example:"clm1234567890abcdef",description:"The unique identifier of the legal entity associated with the organization"}),address:i,configuration:t.openapi({description:"The configuration settings for the organization"}),logo:e.string().url().optional().nullable().openapi({example:"https://example.com/logo.jpg",description:"The logo of the organization"}),logoFile:n.optional().nullable().openapi({description:"The logo of the organization"})}).openapi("Organization");export const CreateOrganizationSchema=OrganizationSchema.pick({name:!0,phone:!0,email:!0,logoFile:!0}).extend({logoId:e.string().optional().nullable().openapi({example:"clm1234567890abcdef",description:"The unique identifier of the thumbnail image associated with the organization"}),address:o}).openapi("CreateOrganization");export const UpdateOrganizationSchema=CreateOrganizationSchema.extend({address:a,configuration:r}).partial().openapi("UpdateOrganization");
@@ -5,9 +5,6 @@ declare class OrganizationService {
5
5
  private readonly prisma;
6
6
  private locationService;
7
7
  constructor(prisma: PrismaClientType, googleMapsApiKey: string);
8
- /**
9
- * Get a paginated list of organizations
10
- */
11
8
  getOrganizations(userId: string, query: {
12
9
  page: number;
13
10
  limit: number;
@@ -89,9 +86,6 @@ declare class OrganizationService {
89
86
  }>;
90
87
  private convertToTimeString;
91
88
  private formatDateScheduleToTimeString;
92
- /**
93
- * Get a specific organization by ID
94
- */
95
89
  getOrganization(organizationId: string): Promise<{
96
90
  id: string;
97
91
  name: string;
@@ -157,9 +151,6 @@ declare class OrganizationService {
157
151
  filename: string;
158
152
  } | null | undefined;
159
153
  }>;
160
- /**
161
- * Create a new organization
162
- */
163
154
  createOrganization(userId: string, body: z.infer<typeof CreateOrganizationSchema>): Promise<{
164
155
  id: string;
165
156
  name: string;
@@ -225,9 +216,6 @@ declare class OrganizationService {
225
216
  filename: string;
226
217
  } | null | undefined;
227
218
  }>;
228
- /**
229
- * Update an existing organization
230
- */
231
219
  updateOrganization(organizationId: string, userId: string, body: z.infer<typeof UpdateOrganizationSchema>): Promise<{
232
220
  id: string;
233
221
  name: string;
@@ -293,9 +281,6 @@ declare class OrganizationService {
293
281
  filename: string;
294
282
  } | null | undefined;
295
283
  }>;
296
- /**
297
- * Delete an organization (soft delete)
298
- */
299
284
  deleteOrganization(organizationId: string, userId: string): Promise<void>;
300
285
  }
301
286
  export { OrganizationService };