@burdenoff/microfe-billing 2026.510.114

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 (636) hide show
  1. package/README.md +12 -0
  2. package/dist/billing/BillingAdminRoutes.d.ts +6 -0
  3. package/dist/billing/BillingAdminRoutes.d.ts.map +1 -0
  4. package/dist/billing/BillingAdminRoutes.js +359 -0
  5. package/dist/billing/BillingAdminRoutes.js.map +1 -0
  6. package/dist/billing/BillingRoot.d.ts +37 -0
  7. package/dist/billing/BillingRoot.d.ts.map +1 -0
  8. package/dist/billing/BillingRoot.js +190 -0
  9. package/dist/billing/BillingRoot.js.map +1 -0
  10. package/dist/billing/BillingUserRoutes.d.ts +7 -0
  11. package/dist/billing/BillingUserRoutes.d.ts.map +1 -0
  12. package/dist/billing/BillingUserRoutes.js +479 -0
  13. package/dist/billing/BillingUserRoutes.js.map +1 -0
  14. package/dist/billing/constants/permissions.d.ts +18 -0
  15. package/dist/billing/constants/permissions.d.ts.map +1 -0
  16. package/dist/billing/hooks/useBillingAccountSelection.d.ts +36 -0
  17. package/dist/billing/hooks/useBillingAccountSelection.d.ts.map +1 -0
  18. package/dist/billing/hooks/useBillingAccountSelection.js +81 -0
  19. package/dist/billing/hooks/useBillingAccountSelection.js.map +1 -0
  20. package/dist/billing/hooks/useBillingEventEmitter.d.ts +8 -0
  21. package/dist/billing/hooks/useBillingEventEmitter.d.ts.map +1 -0
  22. package/dist/billing/hooks/useBillingEventEmitter.js +15 -0
  23. package/dist/billing/hooks/useBillingEventEmitter.js.map +1 -0
  24. package/dist/billing/hooks/useBillingNavigate.d.ts +30 -0
  25. package/dist/billing/hooks/useBillingNavigate.d.ts.map +1 -0
  26. package/dist/billing/hooks/useBillingNavigate.js +23 -0
  27. package/dist/billing/hooks/useBillingNavigate.js.map +1 -0
  28. package/dist/billing/hooks/useBillingPermissions.d.ts +94 -0
  29. package/dist/billing/hooks/useBillingPermissions.d.ts.map +1 -0
  30. package/dist/billing/hooks/useBillingPermissions.js +78 -0
  31. package/dist/billing/hooks/useBillingPermissions.js.map +1 -0
  32. package/dist/billing/hooks/useDefaultBillingCurrency.d.ts +14 -0
  33. package/dist/billing/hooks/useDefaultBillingCurrency.d.ts.map +1 -0
  34. package/dist/billing/hooks/useDefaultBillingCurrency.js +23 -0
  35. package/dist/billing/hooks/useDefaultBillingCurrency.js.map +1 -0
  36. package/dist/billing/index.d.ts +31 -0
  37. package/dist/billing/index.d.ts.map +1 -0
  38. package/dist/billing/lib/native-purchases.d.ts +51 -0
  39. package/dist/billing/lib/native-purchases.d.ts.map +1 -0
  40. package/dist/billing/lib/native-purchases.js +44 -0
  41. package/dist/billing/lib/native-purchases.js.map +1 -0
  42. package/dist/billing/modules/addons/components/FloatingCartDrawer.d.ts +4 -0
  43. package/dist/billing/modules/addons/components/FloatingCartDrawer.d.ts.map +1 -0
  44. package/dist/billing/modules/addons/components/FloatingCartDrawer.js +179 -0
  45. package/dist/billing/modules/addons/components/FloatingCartDrawer.js.map +1 -0
  46. package/dist/billing/modules/addons/components/index.d.ts +5 -0
  47. package/dist/billing/modules/addons/components/index.d.ts.map +1 -0
  48. package/dist/billing/modules/addons/hooks/index.d.ts +6 -0
  49. package/dist/billing/modules/addons/hooks/index.d.ts.map +1 -0
  50. package/dist/billing/modules/addons/hooks/index.js +1 -0
  51. package/dist/billing/modules/addons/hooks/useAddons.d.ts +55 -0
  52. package/dist/billing/modules/addons/hooks/useAddons.d.ts.map +1 -0
  53. package/dist/billing/modules/addons/hooks/useAddons.js +77 -0
  54. package/dist/billing/modules/addons/hooks/useAddons.js.map +1 -0
  55. package/dist/billing/modules/addons/index.d.ts +7 -0
  56. package/dist/billing/modules/addons/index.d.ts.map +1 -0
  57. package/dist/billing/modules/addons/index.js +10 -0
  58. package/dist/billing/modules/addons/pages/AddonBrowseDetailPage.d.ts +4 -0
  59. package/dist/billing/modules/addons/pages/AddonBrowseDetailPage.d.ts.map +1 -0
  60. package/dist/billing/modules/addons/pages/AddonBrowseDetailPage.js +266 -0
  61. package/dist/billing/modules/addons/pages/AddonBrowseDetailPage.js.map +1 -0
  62. package/dist/billing/modules/addons/pages/AddonCreatePage.d.ts +4 -0
  63. package/dist/billing/modules/addons/pages/AddonCreatePage.d.ts.map +1 -0
  64. package/dist/billing/modules/addons/pages/AddonCreatePage.js +369 -0
  65. package/dist/billing/modules/addons/pages/AddonCreatePage.js.map +1 -0
  66. package/dist/billing/modules/addons/pages/AddonDetailPage.d.ts +4 -0
  67. package/dist/billing/modules/addons/pages/AddonDetailPage.d.ts.map +1 -0
  68. package/dist/billing/modules/addons/pages/AddonDetailPage.js +280 -0
  69. package/dist/billing/modules/addons/pages/AddonDetailPage.js.map +1 -0
  70. package/dist/billing/modules/addons/pages/AddonEditPage.d.ts +4 -0
  71. package/dist/billing/modules/addons/pages/AddonEditPage.d.ts.map +1 -0
  72. package/dist/billing/modules/addons/pages/AddonEditPage.js +396 -0
  73. package/dist/billing/modules/addons/pages/AddonEditPage.js.map +1 -0
  74. package/dist/billing/modules/addons/pages/AddonsBrowsePage.d.ts +4 -0
  75. package/dist/billing/modules/addons/pages/AddonsBrowsePage.d.ts.map +1 -0
  76. package/dist/billing/modules/addons/pages/AddonsBrowsePage.js +582 -0
  77. package/dist/billing/modules/addons/pages/AddonsBrowsePage.js.map +1 -0
  78. package/dist/billing/modules/addons/pages/AddonsListPage.d.ts +4 -0
  79. package/dist/billing/modules/addons/pages/AddonsListPage.d.ts.map +1 -0
  80. package/dist/billing/modules/addons/pages/AddonsListPage.js +744 -0
  81. package/dist/billing/modules/addons/pages/AddonsListPage.js.map +1 -0
  82. package/dist/billing/modules/addons/pages/index.d.ts +11 -0
  83. package/dist/billing/modules/addons/pages/index.d.ts.map +1 -0
  84. package/dist/billing/modules/addons/pages/index.js +6 -0
  85. package/dist/billing/modules/addons/store/addonCartStore.d.ts +38 -0
  86. package/dist/billing/modules/addons/store/addonCartStore.d.ts.map +1 -0
  87. package/dist/billing/modules/addons/store/addonCartStore.js +74 -0
  88. package/dist/billing/modules/addons/store/addonCartStore.js.map +1 -0
  89. package/dist/billing/modules/affiliate/api.d.ts +101 -0
  90. package/dist/billing/modules/affiliate/api.d.ts.map +1 -0
  91. package/dist/billing/modules/affiliate/api.js +38 -0
  92. package/dist/billing/modules/affiliate/api.js.map +1 -0
  93. package/dist/billing/modules/affiliate/index.d.ts +2 -0
  94. package/dist/billing/modules/affiliate/index.d.ts.map +1 -0
  95. package/dist/billing/modules/affiliate/index.js +2 -0
  96. package/dist/billing/modules/affiliate/pages/AffiliateDashboardPage.d.ts +4 -0
  97. package/dist/billing/modules/affiliate/pages/AffiliateDashboardPage.d.ts.map +1 -0
  98. package/dist/billing/modules/affiliate/pages/AffiliateDashboardPage.js +464 -0
  99. package/dist/billing/modules/affiliate/pages/AffiliateDashboardPage.js.map +1 -0
  100. package/dist/billing/modules/analytics/index.d.ts +5 -0
  101. package/dist/billing/modules/analytics/index.d.ts.map +1 -0
  102. package/dist/billing/modules/analytics/index.js +3 -0
  103. package/dist/billing/modules/analytics/pages/AnalyticsPage.d.ts +4 -0
  104. package/dist/billing/modules/analytics/pages/AnalyticsPage.d.ts.map +1 -0
  105. package/dist/billing/modules/analytics/pages/AnalyticsPage.js +469 -0
  106. package/dist/billing/modules/analytics/pages/AnalyticsPage.js.map +1 -0
  107. package/dist/billing/modules/analytics/pages/index.d.ts +5 -0
  108. package/dist/billing/modules/analytics/pages/index.d.ts.map +1 -0
  109. package/dist/billing/modules/analytics/pages/index.js +1 -0
  110. package/dist/billing/modules/billing/hooks/index.d.ts +10 -0
  111. package/dist/billing/modules/billing/hooks/index.d.ts.map +1 -0
  112. package/dist/billing/modules/billing/hooks/index.js +4 -0
  113. package/dist/billing/modules/billing/hooks/useInvoices.d.ts +67 -0
  114. package/dist/billing/modules/billing/hooks/useInvoices.d.ts.map +1 -0
  115. package/dist/billing/modules/billing/hooks/useInvoices.js +87 -0
  116. package/dist/billing/modules/billing/hooks/useInvoices.js.map +1 -0
  117. package/dist/billing/modules/billing/hooks/usePayments.d.ts +62 -0
  118. package/dist/billing/modules/billing/hooks/usePayments.d.ts.map +1 -0
  119. package/dist/billing/modules/billing/hooks/usePayments.js +3 -0
  120. package/dist/billing/modules/billing/hooks/useRefunds.d.ts +191 -0
  121. package/dist/billing/modules/billing/hooks/useRefunds.d.ts.map +1 -0
  122. package/dist/billing/modules/billing/hooks/useRefunds.js +162 -0
  123. package/dist/billing/modules/billing/hooks/useRefunds.js.map +1 -0
  124. package/dist/billing/modules/billing/hooks/useTransactions.d.ts +41 -0
  125. package/dist/billing/modules/billing/hooks/useTransactions.d.ts.map +1 -0
  126. package/dist/billing/modules/billing/hooks/useTransactions.js +55 -0
  127. package/dist/billing/modules/billing/hooks/useTransactions.js.map +1 -0
  128. package/dist/billing/modules/billing/index.d.ts +7 -0
  129. package/dist/billing/modules/billing/index.d.ts.map +1 -0
  130. package/dist/billing/modules/billing/index.js +11 -0
  131. package/dist/billing/modules/billing/pages/InvoiceDetailPage.d.ts +4 -0
  132. package/dist/billing/modules/billing/pages/InvoiceDetailPage.d.ts.map +1 -0
  133. package/dist/billing/modules/billing/pages/InvoiceDetailPage.js +631 -0
  134. package/dist/billing/modules/billing/pages/InvoiceDetailPage.js.map +1 -0
  135. package/dist/billing/modules/billing/pages/InvoicesListPage.d.ts +4 -0
  136. package/dist/billing/modules/billing/pages/InvoicesListPage.d.ts.map +1 -0
  137. package/dist/billing/modules/billing/pages/InvoicesListPage.js +382 -0
  138. package/dist/billing/modules/billing/pages/InvoicesListPage.js.map +1 -0
  139. package/dist/billing/modules/billing/pages/PaymentMethodsPage.d.ts +4 -0
  140. package/dist/billing/modules/billing/pages/PaymentMethodsPage.d.ts.map +1 -0
  141. package/dist/billing/modules/billing/pages/PaymentMethodsPage.js +147 -0
  142. package/dist/billing/modules/billing/pages/PaymentMethodsPage.js.map +1 -0
  143. package/dist/billing/modules/billing/pages/RefundsPage.d.ts +4 -0
  144. package/dist/billing/modules/billing/pages/RefundsPage.d.ts.map +1 -0
  145. package/dist/billing/modules/billing/pages/RefundsPage.js +1074 -0
  146. package/dist/billing/modules/billing/pages/RefundsPage.js.map +1 -0
  147. package/dist/billing/modules/billing/pages/TransactionsPage.d.ts +4 -0
  148. package/dist/billing/modules/billing/pages/TransactionsPage.d.ts.map +1 -0
  149. package/dist/billing/modules/billing/pages/TransactionsPage.js +587 -0
  150. package/dist/billing/modules/billing/pages/TransactionsPage.js.map +1 -0
  151. package/dist/billing/modules/billing/pages/index.d.ts +10 -0
  152. package/dist/billing/modules/billing/pages/index.d.ts.map +1 -0
  153. package/dist/billing/modules/billing/pages/index.js +5 -0
  154. package/dist/billing/modules/checkout/components/AutoPayToggle.d.ts +14 -0
  155. package/dist/billing/modules/checkout/components/AutoPayToggle.d.ts.map +1 -0
  156. package/dist/billing/modules/checkout/components/AutoPayToggle.js +3 -0
  157. package/dist/billing/modules/checkout/components/BillingAccountSelector.d.ts +14 -0
  158. package/dist/billing/modules/checkout/components/BillingAccountSelector.d.ts.map +1 -0
  159. package/dist/billing/modules/checkout/components/BillingAccountSelector.js +151 -0
  160. package/dist/billing/modules/checkout/components/BillingAccountSelector.js.map +1 -0
  161. package/dist/billing/modules/checkout/components/CompactAutoPayToggle.d.ts +14 -0
  162. package/dist/billing/modules/checkout/components/CompactAutoPayToggle.d.ts.map +1 -0
  163. package/dist/billing/modules/checkout/components/CompactAutoPayToggle.js +4 -0
  164. package/dist/billing/modules/checkout/components/CreditsAmountInput.d.ts +14 -0
  165. package/dist/billing/modules/checkout/components/CreditsAmountInput.d.ts.map +1 -0
  166. package/dist/billing/modules/checkout/components/CreditsAmountInput.js +130 -0
  167. package/dist/billing/modules/checkout/components/CreditsAmountInput.js.map +1 -0
  168. package/dist/billing/modules/checkout/components/CreditsPaymentOption.d.ts +16 -0
  169. package/dist/billing/modules/checkout/components/CreditsPaymentOption.d.ts.map +1 -0
  170. package/dist/billing/modules/checkout/components/CreditsPaymentOption.js +5 -0
  171. package/dist/billing/modules/checkout/components/CurrencySelector.d.ts +19 -0
  172. package/dist/billing/modules/checkout/components/CurrencySelector.d.ts.map +1 -0
  173. package/dist/billing/modules/checkout/components/CurrencySelector.js +5 -0
  174. package/dist/billing/modules/checkout/components/NativeCheckoutView.d.ts +14 -0
  175. package/dist/billing/modules/checkout/components/NativeCheckoutView.d.ts.map +1 -0
  176. package/dist/billing/modules/checkout/components/NativeCheckoutView.js +273 -0
  177. package/dist/billing/modules/checkout/components/NativeCheckoutView.js.map +1 -0
  178. package/dist/billing/modules/checkout/components/OrderSummary.d.ts +22 -0
  179. package/dist/billing/modules/checkout/components/OrderSummary.d.ts.map +1 -0
  180. package/dist/billing/modules/checkout/components/OrderSummary.js +293 -0
  181. package/dist/billing/modules/checkout/components/OrderSummary.js.map +1 -0
  182. package/dist/billing/modules/checkout/components/PaymentProviderSelector.d.ts +19 -0
  183. package/dist/billing/modules/checkout/components/PaymentProviderSelector.d.ts.map +1 -0
  184. package/dist/billing/modules/checkout/components/PaymentProviderSelector.js +3 -0
  185. package/dist/billing/modules/checkout/components/PromoCodeInput.d.ts +19 -0
  186. package/dist/billing/modules/checkout/components/PromoCodeInput.d.ts.map +1 -0
  187. package/dist/billing/modules/checkout/components/PromoCodeInput.js +102 -0
  188. package/dist/billing/modules/checkout/components/PromoCodeInput.js.map +1 -0
  189. package/dist/billing/modules/checkout/components/RazorpayPaymentButton.d.ts +25 -0
  190. package/dist/billing/modules/checkout/components/RazorpayPaymentButton.d.ts.map +1 -0
  191. package/dist/billing/modules/checkout/components/RazorpayPaymentButton.js +169 -0
  192. package/dist/billing/modules/checkout/components/RazorpayPaymentButton.js.map +1 -0
  193. package/dist/billing/modules/checkout/components/SavedCardSelector.d.ts +13 -0
  194. package/dist/billing/modules/checkout/components/SavedCardSelector.d.ts.map +1 -0
  195. package/dist/billing/modules/checkout/components/SavedCardSelector.js +4 -0
  196. package/dist/billing/modules/checkout/components/SimpleAutoPayToggle.d.ts +13 -0
  197. package/dist/billing/modules/checkout/components/SimpleAutoPayToggle.d.ts.map +1 -0
  198. package/dist/billing/modules/checkout/components/SimpleAutoPayToggle.js +78 -0
  199. package/dist/billing/modules/checkout/components/SimpleAutoPayToggle.js.map +1 -0
  200. package/dist/billing/modules/checkout/components/StripePaymentForm.d.ts +16 -0
  201. package/dist/billing/modules/checkout/components/StripePaymentForm.d.ts.map +1 -0
  202. package/dist/billing/modules/checkout/components/StripePaymentForm.js +253 -0
  203. package/dist/billing/modules/checkout/components/StripePaymentForm.js.map +1 -0
  204. package/dist/billing/modules/checkout/components/SubscriptionSelector.d.ts +26 -0
  205. package/dist/billing/modules/checkout/components/SubscriptionSelector.d.ts.map +1 -0
  206. package/dist/billing/modules/checkout/components/SubscriptionSelector.js +84 -0
  207. package/dist/billing/modules/checkout/components/SubscriptionSelector.js.map +1 -0
  208. package/dist/billing/modules/checkout/components/UnifiedPaymentMethodSelector.d.ts +23 -0
  209. package/dist/billing/modules/checkout/components/UnifiedPaymentMethodSelector.d.ts.map +1 -0
  210. package/dist/billing/modules/checkout/components/UnifiedPaymentMethodSelector.js +229 -0
  211. package/dist/billing/modules/checkout/components/UnifiedPaymentMethodSelector.js.map +1 -0
  212. package/dist/billing/modules/checkout/components/index.d.ts +20 -0
  213. package/dist/billing/modules/checkout/components/index.d.ts.map +1 -0
  214. package/dist/billing/modules/checkout/components/index.js +16 -0
  215. package/dist/billing/modules/checkout/graphql/index.d.ts +6 -0
  216. package/dist/billing/modules/checkout/graphql/index.d.ts.map +1 -0
  217. package/dist/billing/modules/checkout/hooks/index.d.ts +9 -0
  218. package/dist/billing/modules/checkout/hooks/index.d.ts.map +1 -0
  219. package/dist/billing/modules/checkout/hooks/index.js +4 -0
  220. package/dist/billing/modules/checkout/hooks/useCheckout.d.ts +69 -0
  221. package/dist/billing/modules/checkout/hooks/useCheckout.d.ts.map +1 -0
  222. package/dist/billing/modules/checkout/hooks/useCheckout.js +377 -0
  223. package/dist/billing/modules/checkout/hooks/useCheckout.js.map +1 -0
  224. package/dist/billing/modules/checkout/hooks/useNativeCheckout.d.ts +26 -0
  225. package/dist/billing/modules/checkout/hooks/useNativeCheckout.d.ts.map +1 -0
  226. package/dist/billing/modules/checkout/hooks/useNativeCheckout.js +88 -0
  227. package/dist/billing/modules/checkout/hooks/useNativeCheckout.js.map +1 -0
  228. package/dist/billing/modules/checkout/hooks/usePaymentProviders.d.ts +19 -0
  229. package/dist/billing/modules/checkout/hooks/usePaymentProviders.d.ts.map +1 -0
  230. package/dist/billing/modules/checkout/hooks/usePaymentProviders.js +16 -0
  231. package/dist/billing/modules/checkout/hooks/usePaymentProviders.js.map +1 -0
  232. package/dist/billing/modules/checkout/hooks/usePaymentStatusPolling.d.ts +59 -0
  233. package/dist/billing/modules/checkout/hooks/usePaymentStatusPolling.d.ts.map +1 -0
  234. package/dist/billing/modules/checkout/hooks/usePaymentStatusPolling.js +107 -0
  235. package/dist/billing/modules/checkout/hooks/usePaymentStatusPolling.js.map +1 -0
  236. package/dist/billing/modules/checkout/index.d.ts +24 -0
  237. package/dist/billing/modules/checkout/index.d.ts.map +1 -0
  238. package/dist/billing/modules/checkout/index.js +19 -0
  239. package/dist/billing/modules/checkout/pages/CheckoutPage.d.ts +4 -0
  240. package/dist/billing/modules/checkout/pages/CheckoutPage.d.ts.map +1 -0
  241. package/dist/billing/modules/checkout/pages/CheckoutPage.js +1248 -0
  242. package/dist/billing/modules/checkout/pages/CheckoutPage.js.map +1 -0
  243. package/dist/billing/modules/checkout/pages/index.d.ts +5 -0
  244. package/dist/billing/modules/checkout/pages/index.d.ts.map +1 -0
  245. package/dist/billing/modules/checkout/pages/index.js +1 -0
  246. package/dist/billing/modules/checkout/types/index.d.ts +270 -0
  247. package/dist/billing/modules/checkout/types/index.d.ts.map +1 -0
  248. package/dist/billing/modules/checkout/utils/storeOrder.d.ts +20 -0
  249. package/dist/billing/modules/checkout/utils/storeOrder.d.ts.map +1 -0
  250. package/dist/billing/modules/checkout/utils/storeOrder.js +27 -0
  251. package/dist/billing/modules/checkout/utils/storeOrder.js.map +1 -0
  252. package/dist/billing/modules/coupons/index.d.ts +5 -0
  253. package/dist/billing/modules/coupons/index.d.ts.map +1 -0
  254. package/dist/billing/modules/coupons/index.js +6 -0
  255. package/dist/billing/modules/coupons/pages/CouponDetailPage.d.ts +4 -0
  256. package/dist/billing/modules/coupons/pages/CouponDetailPage.d.ts.map +1 -0
  257. package/dist/billing/modules/coupons/pages/CouponDetailPage.js +489 -0
  258. package/dist/billing/modules/coupons/pages/CouponDetailPage.js.map +1 -0
  259. package/dist/billing/modules/coupons/pages/CouponsListPage.d.ts +4 -0
  260. package/dist/billing/modules/coupons/pages/CouponsListPage.d.ts.map +1 -0
  261. package/dist/billing/modules/coupons/pages/CouponsListPage.js +544 -0
  262. package/dist/billing/modules/coupons/pages/CouponsListPage.js.map +1 -0
  263. package/dist/billing/modules/coupons/pages/CreateCouponPage.d.ts +4 -0
  264. package/dist/billing/modules/coupons/pages/CreateCouponPage.d.ts.map +1 -0
  265. package/dist/billing/modules/coupons/pages/CreateCouponPage.js +421 -0
  266. package/dist/billing/modules/coupons/pages/CreateCouponPage.js.map +1 -0
  267. package/dist/billing/modules/coupons/pages/EditCouponPage.d.ts +4 -0
  268. package/dist/billing/modules/coupons/pages/EditCouponPage.d.ts.map +1 -0
  269. package/dist/billing/modules/coupons/pages/EditCouponPage.js +379 -0
  270. package/dist/billing/modules/coupons/pages/EditCouponPage.js.map +1 -0
  271. package/dist/billing/modules/coupons/pages/index.d.ts +8 -0
  272. package/dist/billing/modules/coupons/pages/index.d.ts.map +1 -0
  273. package/dist/billing/modules/coupons/pages/index.js +4 -0
  274. package/dist/billing/modules/credits/hooks/index.d.ts +5 -0
  275. package/dist/billing/modules/credits/hooks/index.d.ts.map +1 -0
  276. package/dist/billing/modules/credits/hooks/index.js +1 -0
  277. package/dist/billing/modules/credits/hooks/useCredits.d.ts +75 -0
  278. package/dist/billing/modules/credits/hooks/useCredits.d.ts.map +1 -0
  279. package/dist/billing/modules/credits/hooks/useCredits.js +78 -0
  280. package/dist/billing/modules/credits/hooks/useCredits.js.map +1 -0
  281. package/dist/billing/modules/credits/index.d.ts +6 -0
  282. package/dist/billing/modules/credits/index.d.ts.map +1 -0
  283. package/dist/billing/modules/credits/index.js +8 -0
  284. package/dist/billing/modules/credits/pages/AdminCreditsPage.d.ts +4 -0
  285. package/dist/billing/modules/credits/pages/AdminCreditsPage.d.ts.map +1 -0
  286. package/dist/billing/modules/credits/pages/AdminCreditsPage.js +140 -0
  287. package/dist/billing/modules/credits/pages/AdminCreditsPage.js.map +1 -0
  288. package/dist/billing/modules/credits/pages/CreditTransactionsPage.d.ts +4 -0
  289. package/dist/billing/modules/credits/pages/CreditTransactionsPage.d.ts.map +1 -0
  290. package/dist/billing/modules/credits/pages/CreditTransactionsPage.js +331 -0
  291. package/dist/billing/modules/credits/pages/CreditTransactionsPage.js.map +1 -0
  292. package/dist/billing/modules/credits/pages/CreditWithdrawalPage.d.ts +4 -0
  293. package/dist/billing/modules/credits/pages/CreditWithdrawalPage.d.ts.map +1 -0
  294. package/dist/billing/modules/credits/pages/CreditWithdrawalPage.js +770 -0
  295. package/dist/billing/modules/credits/pages/CreditWithdrawalPage.js.map +1 -0
  296. package/dist/billing/modules/credits/pages/CreditsPage.d.ts +4 -0
  297. package/dist/billing/modules/credits/pages/CreditsPage.d.ts.map +1 -0
  298. package/dist/billing/modules/credits/pages/CreditsPage.js +324 -0
  299. package/dist/billing/modules/credits/pages/CreditsPage.js.map +1 -0
  300. package/dist/billing/modules/credits/pages/index.d.ts +8 -0
  301. package/dist/billing/modules/credits/pages/index.d.ts.map +1 -0
  302. package/dist/billing/modules/credits/pages/index.js +4 -0
  303. package/dist/billing/modules/dashboard/components/ActiveSubscriptionCard.d.ts +14 -0
  304. package/dist/billing/modules/dashboard/components/ActiveSubscriptionCard.d.ts.map +1 -0
  305. package/dist/billing/modules/dashboard/components/ActiveSubscriptionCard.js +185 -0
  306. package/dist/billing/modules/dashboard/components/ActiveSubscriptionCard.js.map +1 -0
  307. package/dist/billing/modules/dashboard/components/AddPaymentMethodModal.d.ts +111 -0
  308. package/dist/billing/modules/dashboard/components/AddPaymentMethodModal.d.ts.map +1 -0
  309. package/dist/billing/modules/dashboard/components/AddPaymentMethodModal.js +388 -0
  310. package/dist/billing/modules/dashboard/components/AddPaymentMethodModal.js.map +1 -0
  311. package/dist/billing/modules/dashboard/components/BillingAccountCard.d.ts +16 -0
  312. package/dist/billing/modules/dashboard/components/BillingAccountCard.d.ts.map +1 -0
  313. package/dist/billing/modules/dashboard/components/BillingAccountCard.js +146 -0
  314. package/dist/billing/modules/dashboard/components/BillingAccountCard.js.map +1 -0
  315. package/dist/billing/modules/dashboard/components/CreateBillingAccountModal.d.ts +13 -0
  316. package/dist/billing/modules/dashboard/components/CreateBillingAccountModal.d.ts.map +1 -0
  317. package/dist/billing/modules/dashboard/components/CreateBillingAccountModal.js +1044 -0
  318. package/dist/billing/modules/dashboard/components/CreateBillingAccountModal.js.map +1 -0
  319. package/dist/billing/modules/dashboard/components/PaymentMethodsSection.d.ts +15 -0
  320. package/dist/billing/modules/dashboard/components/PaymentMethodsSection.d.ts.map +1 -0
  321. package/dist/billing/modules/dashboard/components/PaymentMethodsSection.js +216 -0
  322. package/dist/billing/modules/dashboard/components/PaymentMethodsSection.js.map +1 -0
  323. package/dist/billing/modules/dashboard/components/RecommendedAddonsSection.d.ts +27 -0
  324. package/dist/billing/modules/dashboard/components/RecommendedAddonsSection.d.ts.map +1 -0
  325. package/dist/billing/modules/dashboard/components/RecommendedAddonsSection.js +193 -0
  326. package/dist/billing/modules/dashboard/components/RecommendedAddonsSection.js.map +1 -0
  327. package/dist/billing/modules/dashboard/components/index.d.ts +10 -0
  328. package/dist/billing/modules/dashboard/components/index.d.ts.map +1 -0
  329. package/dist/billing/modules/dashboard/components/index.js +6 -0
  330. package/dist/billing/modules/dashboard/hooks/index.d.ts +6 -0
  331. package/dist/billing/modules/dashboard/hooks/index.d.ts.map +1 -0
  332. package/dist/billing/modules/dashboard/hooks/index.js +2 -0
  333. package/dist/billing/modules/dashboard/hooks/useBillingOverviewData.d.ts +17 -0
  334. package/dist/billing/modules/dashboard/hooks/useBillingOverviewData.d.ts.map +1 -0
  335. package/dist/billing/modules/dashboard/hooks/useBillingOverviewData.js +42 -0
  336. package/dist/billing/modules/dashboard/hooks/useBillingOverviewData.js.map +1 -0
  337. package/dist/billing/modules/dashboard/hooks/useDashboard.d.ts +145 -0
  338. package/dist/billing/modules/dashboard/hooks/useDashboard.d.ts.map +1 -0
  339. package/dist/billing/modules/dashboard/hooks/useDashboard.js +118 -0
  340. package/dist/billing/modules/dashboard/hooks/useDashboard.js.map +1 -0
  341. package/dist/billing/modules/dashboard/index.d.ts +8 -0
  342. package/dist/billing/modules/dashboard/index.d.ts.map +1 -0
  343. package/dist/billing/modules/dashboard/index.js +12 -0
  344. package/dist/billing/modules/dashboard/pages/OverviewPage.d.ts +4 -0
  345. package/dist/billing/modules/dashboard/pages/OverviewPage.d.ts.map +1 -0
  346. package/dist/billing/modules/dashboard/pages/OverviewPage.js +478 -0
  347. package/dist/billing/modules/dashboard/pages/OverviewPage.js.map +1 -0
  348. package/dist/billing/modules/dashboard/pages/index.d.ts +5 -0
  349. package/dist/billing/modules/dashboard/pages/index.d.ts.map +1 -0
  350. package/dist/billing/modules/dashboard/pages/index.js +1 -0
  351. package/dist/billing/modules/discounts/index.d.ts +6 -0
  352. package/dist/billing/modules/discounts/index.d.ts.map +1 -0
  353. package/dist/billing/modules/discounts/index.js +3 -0
  354. package/dist/billing/modules/discounts/pages/DiscountsListPage.d.ts +4 -0
  355. package/dist/billing/modules/discounts/pages/DiscountsListPage.d.ts.map +1 -0
  356. package/dist/billing/modules/discounts/pages/DiscountsListPage.js +1009 -0
  357. package/dist/billing/modules/discounts/pages/DiscountsListPage.js.map +1 -0
  358. package/dist/billing/modules/discounts/pages/index.d.ts +6 -0
  359. package/dist/billing/modules/discounts/pages/index.d.ts.map +1 -0
  360. package/dist/billing/modules/discounts/pages/index.js +1 -0
  361. package/dist/billing/modules/earnings/api.d.ts +131 -0
  362. package/dist/billing/modules/earnings/api.d.ts.map +1 -0
  363. package/dist/billing/modules/earnings/api.js +122 -0
  364. package/dist/billing/modules/earnings/api.js.map +1 -0
  365. package/dist/billing/modules/earnings/index.d.ts +4 -0
  366. package/dist/billing/modules/earnings/index.d.ts.map +1 -0
  367. package/dist/billing/modules/earnings/index.js +4 -0
  368. package/dist/billing/modules/earnings/pages/EarningsPage.d.ts +4 -0
  369. package/dist/billing/modules/earnings/pages/EarningsPage.d.ts.map +1 -0
  370. package/dist/billing/modules/earnings/pages/EarningsPage.js +435 -0
  371. package/dist/billing/modules/earnings/pages/EarningsPage.js.map +1 -0
  372. package/dist/billing/modules/earnings/pages/PayoutAdminPage.d.ts +4 -0
  373. package/dist/billing/modules/earnings/pages/PayoutAdminPage.d.ts.map +1 -0
  374. package/dist/billing/modules/earnings/pages/PayoutAdminPage.js +273 -0
  375. package/dist/billing/modules/earnings/pages/PayoutAdminPage.js.map +1 -0
  376. package/dist/billing/modules/earnings/pages/PayoutsPage.d.ts +4 -0
  377. package/dist/billing/modules/earnings/pages/PayoutsPage.d.ts.map +1 -0
  378. package/dist/billing/modules/earnings/pages/PayoutsPage.js +480 -0
  379. package/dist/billing/modules/earnings/pages/PayoutsPage.js.map +1 -0
  380. package/dist/billing/modules/plans/hooks/index.d.ts +7 -0
  381. package/dist/billing/modules/plans/hooks/index.d.ts.map +1 -0
  382. package/dist/billing/modules/plans/hooks/index.js +2 -0
  383. package/dist/billing/modules/plans/hooks/usePlans.d.ts +46 -0
  384. package/dist/billing/modules/plans/hooks/usePlans.d.ts.map +1 -0
  385. package/dist/billing/modules/plans/hooks/usePlans.js +77 -0
  386. package/dist/billing/modules/plans/hooks/usePlans.js.map +1 -0
  387. package/dist/billing/modules/plans/hooks/useQuotas.d.ts +27 -0
  388. package/dist/billing/modules/plans/hooks/useQuotas.d.ts.map +1 -0
  389. package/dist/billing/modules/plans/hooks/useQuotas.js +21 -0
  390. package/dist/billing/modules/plans/hooks/useQuotas.js.map +1 -0
  391. package/dist/billing/modules/plans/index.d.ts +7 -0
  392. package/dist/billing/modules/plans/index.d.ts.map +1 -0
  393. package/dist/billing/modules/plans/index.js +11 -0
  394. package/dist/billing/modules/plans/pages/PlanBrowseDetailPage.d.ts +4 -0
  395. package/dist/billing/modules/plans/pages/PlanBrowseDetailPage.d.ts.map +1 -0
  396. package/dist/billing/modules/plans/pages/PlanBrowseDetailPage.js +264 -0
  397. package/dist/billing/modules/plans/pages/PlanBrowseDetailPage.js.map +1 -0
  398. package/dist/billing/modules/plans/pages/PlanCreatePage.d.ts +4 -0
  399. package/dist/billing/modules/plans/pages/PlanCreatePage.d.ts.map +1 -0
  400. package/dist/billing/modules/plans/pages/PlanCreatePage.js +368 -0
  401. package/dist/billing/modules/plans/pages/PlanCreatePage.js.map +1 -0
  402. package/dist/billing/modules/plans/pages/PlanDetailPage.d.ts +4 -0
  403. package/dist/billing/modules/plans/pages/PlanDetailPage.d.ts.map +1 -0
  404. package/dist/billing/modules/plans/pages/PlanDetailPage.js +356 -0
  405. package/dist/billing/modules/plans/pages/PlanDetailPage.js.map +1 -0
  406. package/dist/billing/modules/plans/pages/PlanEditPage.d.ts +4 -0
  407. package/dist/billing/modules/plans/pages/PlanEditPage.d.ts.map +1 -0
  408. package/dist/billing/modules/plans/pages/PlanEditPage.js +395 -0
  409. package/dist/billing/modules/plans/pages/PlanEditPage.js.map +1 -0
  410. package/dist/billing/modules/plans/pages/PlansBrowsePage.d.ts +4 -0
  411. package/dist/billing/modules/plans/pages/PlansBrowsePage.d.ts.map +1 -0
  412. package/dist/billing/modules/plans/pages/PlansBrowsePage.js +314 -0
  413. package/dist/billing/modules/plans/pages/PlansBrowsePage.js.map +1 -0
  414. package/dist/billing/modules/plans/pages/PlansListPage.d.ts +4 -0
  415. package/dist/billing/modules/plans/pages/PlansListPage.d.ts.map +1 -0
  416. package/dist/billing/modules/plans/pages/PlansListPage.js +438 -0
  417. package/dist/billing/modules/plans/pages/PlansListPage.js.map +1 -0
  418. package/dist/billing/modules/plans/pages/index.d.ts +11 -0
  419. package/dist/billing/modules/plans/pages/index.d.ts.map +1 -0
  420. package/dist/billing/modules/plans/pages/index.js +6 -0
  421. package/dist/billing/modules/quota/hooks/index.d.ts +6 -0
  422. package/dist/billing/modules/quota/hooks/index.d.ts.map +1 -0
  423. package/dist/billing/modules/quota/hooks/index.js +2 -0
  424. package/dist/billing/modules/quota/hooks/useQuota.d.ts +102 -0
  425. package/dist/billing/modules/quota/hooks/useQuota.d.ts.map +1 -0
  426. package/dist/billing/modules/quota/hooks/useQuota.js +63 -0
  427. package/dist/billing/modules/quota/hooks/useQuota.js.map +1 -0
  428. package/dist/billing/modules/quota/hooks/useQuotaTemplates.d.ts +39 -0
  429. package/dist/billing/modules/quota/hooks/useQuotaTemplates.d.ts.map +1 -0
  430. package/dist/billing/modules/quota/hooks/useQuotaTemplates.js +67 -0
  431. package/dist/billing/modules/quota/hooks/useQuotaTemplates.js.map +1 -0
  432. package/dist/billing/modules/quota/index.d.ts +6 -0
  433. package/dist/billing/modules/quota/index.d.ts.map +1 -0
  434. package/dist/billing/modules/quota/index.js +10 -0
  435. package/dist/billing/modules/quota/pages/QuotaPage.d.ts +4 -0
  436. package/dist/billing/modules/quota/pages/QuotaPage.d.ts.map +1 -0
  437. package/dist/billing/modules/quota/pages/QuotaPage.js +337 -0
  438. package/dist/billing/modules/quota/pages/QuotaPage.js.map +1 -0
  439. package/dist/billing/modules/quota/pages/QuotaTemplateCreatePage.d.ts +4 -0
  440. package/dist/billing/modules/quota/pages/QuotaTemplateCreatePage.d.ts.map +1 -0
  441. package/dist/billing/modules/quota/pages/QuotaTemplateCreatePage.js +273 -0
  442. package/dist/billing/modules/quota/pages/QuotaTemplateCreatePage.js.map +1 -0
  443. package/dist/billing/modules/quota/pages/QuotaTemplateDetailPage.d.ts +4 -0
  444. package/dist/billing/modules/quota/pages/QuotaTemplateDetailPage.d.ts.map +1 -0
  445. package/dist/billing/modules/quota/pages/QuotaTemplateDetailPage.js +272 -0
  446. package/dist/billing/modules/quota/pages/QuotaTemplateDetailPage.js.map +1 -0
  447. package/dist/billing/modules/quota/pages/QuotaTemplateEditPage.d.ts +4 -0
  448. package/dist/billing/modules/quota/pages/QuotaTemplateEditPage.d.ts.map +1 -0
  449. package/dist/billing/modules/quota/pages/QuotaTemplateEditPage.js +316 -0
  450. package/dist/billing/modules/quota/pages/QuotaTemplateEditPage.js.map +1 -0
  451. package/dist/billing/modules/quota/pages/QuotaTemplatesListPage.d.ts +4 -0
  452. package/dist/billing/modules/quota/pages/QuotaTemplatesListPage.d.ts.map +1 -0
  453. package/dist/billing/modules/quota/pages/QuotaTemplatesListPage.js +401 -0
  454. package/dist/billing/modules/quota/pages/QuotaTemplatesListPage.js.map +1 -0
  455. package/dist/billing/modules/quota/pages/index.d.ts +9 -0
  456. package/dist/billing/modules/quota/pages/index.d.ts.map +1 -0
  457. package/dist/billing/modules/quota/pages/index.js +5 -0
  458. package/dist/billing/modules/settings/index.d.ts +5 -0
  459. package/dist/billing/modules/settings/index.d.ts.map +1 -0
  460. package/dist/billing/modules/settings/index.js +4 -0
  461. package/dist/billing/modules/settings/pages/SettingsPage.d.ts +4 -0
  462. package/dist/billing/modules/settings/pages/SettingsPage.d.ts.map +1 -0
  463. package/dist/billing/modules/settings/pages/SettingsPage.js +632 -0
  464. package/dist/billing/modules/settings/pages/SettingsPage.js.map +1 -0
  465. package/dist/billing/modules/settings/pages/TeamPermissionsPage.d.ts +4 -0
  466. package/dist/billing/modules/settings/pages/TeamPermissionsPage.d.ts.map +1 -0
  467. package/dist/billing/modules/settings/pages/TeamPermissionsPage.js +270 -0
  468. package/dist/billing/modules/settings/pages/TeamPermissionsPage.js.map +1 -0
  469. package/dist/billing/modules/settings/pages/index.d.ts +6 -0
  470. package/dist/billing/modules/settings/pages/index.d.ts.map +1 -0
  471. package/dist/billing/modules/settings/pages/index.js +2 -0
  472. package/dist/billing/modules/store/graphql/index.d.ts +6 -0
  473. package/dist/billing/modules/store/graphql/index.d.ts.map +1 -0
  474. package/dist/billing/modules/store/graphql/index.js +1 -0
  475. package/dist/billing/modules/store/index.d.ts +6 -0
  476. package/dist/billing/modules/store/index.d.ts.map +1 -0
  477. package/dist/billing/modules/store/index.js +3 -0
  478. package/dist/billing/modules/store/pages/StoreCheckoutPage.d.ts +11 -0
  479. package/dist/billing/modules/store/pages/StoreCheckoutPage.d.ts.map +1 -0
  480. package/dist/billing/modules/store/pages/StoreCheckoutPage.js +18 -0
  481. package/dist/billing/modules/store/pages/StoreCheckoutPage.js.map +1 -0
  482. package/dist/billing/modules/subscriptions/components/ManageSeatsModal.d.ts +12 -0
  483. package/dist/billing/modules/subscriptions/components/ManageSeatsModal.d.ts.map +1 -0
  484. package/dist/billing/modules/subscriptions/components/ManageSeatsModal.js +167 -0
  485. package/dist/billing/modules/subscriptions/components/ManageSeatsModal.js.map +1 -0
  486. package/dist/billing/modules/subscriptions/hooks/index.d.ts +6 -0
  487. package/dist/billing/modules/subscriptions/hooks/index.d.ts.map +1 -0
  488. package/dist/billing/modules/subscriptions/hooks/index.js +1 -0
  489. package/dist/billing/modules/subscriptions/hooks/useSubscriptions.d.ts +92 -0
  490. package/dist/billing/modules/subscriptions/hooks/useSubscriptions.d.ts.map +1 -0
  491. package/dist/billing/modules/subscriptions/hooks/useSubscriptions.js +136 -0
  492. package/dist/billing/modules/subscriptions/hooks/useSubscriptions.js.map +1 -0
  493. package/dist/billing/modules/subscriptions/index.d.ts +7 -0
  494. package/dist/billing/modules/subscriptions/index.d.ts.map +1 -0
  495. package/dist/billing/modules/subscriptions/index.js +7 -0
  496. package/dist/billing/modules/subscriptions/pages/SubscriptionDetailPage.d.ts +4 -0
  497. package/dist/billing/modules/subscriptions/pages/SubscriptionDetailPage.d.ts.map +1 -0
  498. package/dist/billing/modules/subscriptions/pages/SubscriptionDetailPage.js +551 -0
  499. package/dist/billing/modules/subscriptions/pages/SubscriptionDetailPage.js.map +1 -0
  500. package/dist/billing/modules/subscriptions/pages/SubscriptionsListPage.d.ts +4 -0
  501. package/dist/billing/modules/subscriptions/pages/SubscriptionsListPage.d.ts.map +1 -0
  502. package/dist/billing/modules/subscriptions/pages/SubscriptionsListPage.js +529 -0
  503. package/dist/billing/modules/subscriptions/pages/SubscriptionsListPage.js.map +1 -0
  504. package/dist/billing/modules/subscriptions/pages/UpgradeSubscriptionPage.d.ts +4 -0
  505. package/dist/billing/modules/subscriptions/pages/UpgradeSubscriptionPage.d.ts.map +1 -0
  506. package/dist/billing/modules/subscriptions/pages/UpgradeSubscriptionPage.js +430 -0
  507. package/dist/billing/modules/subscriptions/pages/UpgradeSubscriptionPage.js.map +1 -0
  508. package/dist/billing/modules/subscriptions/pages/index.d.ts +8 -0
  509. package/dist/billing/modules/subscriptions/pages/index.d.ts.map +1 -0
  510. package/dist/billing/modules/subscriptions/pages/index.js +3 -0
  511. package/dist/billing/modules/usage/hooks/index.d.ts +6 -0
  512. package/dist/billing/modules/usage/hooks/index.d.ts.map +1 -0
  513. package/dist/billing/modules/usage/hooks/index.js +1 -0
  514. package/dist/billing/modules/usage/hooks/useUsage.d.ts +203 -0
  515. package/dist/billing/modules/usage/hooks/useUsage.d.ts.map +1 -0
  516. package/dist/billing/modules/usage/hooks/useUsage.js +271 -0
  517. package/dist/billing/modules/usage/hooks/useUsage.js.map +1 -0
  518. package/dist/billing/modules/usage/index.d.ts +6 -0
  519. package/dist/billing/modules/usage/index.d.ts.map +1 -0
  520. package/dist/billing/modules/usage/index.js +5 -0
  521. package/dist/billing/modules/usage/pages/UsagePage.d.ts +4 -0
  522. package/dist/billing/modules/usage/pages/UsagePage.d.ts.map +1 -0
  523. package/dist/billing/modules/usage/pages/UsagePage.js +817 -0
  524. package/dist/billing/modules/usage/pages/UsagePage.js.map +1 -0
  525. package/dist/billing/modules/usage/pages/index.d.ts +5 -0
  526. package/dist/billing/modules/usage/pages/index.d.ts.map +1 -0
  527. package/dist/billing/modules/usage/pages/index.js +1 -0
  528. package/dist/billing/providers/BillingProvider.d.ts +16 -0
  529. package/dist/billing/providers/BillingProvider.d.ts.map +1 -0
  530. package/dist/billing/providers/BillingProvider.js +40 -0
  531. package/dist/billing/providers/BillingProvider.js.map +1 -0
  532. package/dist/billing/shared/components/AccessDenied.d.ts +8 -0
  533. package/dist/billing/shared/components/AccessDenied.d.ts.map +1 -0
  534. package/dist/billing/shared/components/AccessDenied.js +44 -0
  535. package/dist/billing/shared/components/AccessDenied.js.map +1 -0
  536. package/dist/billing/shared/components/CurrencyPriceOverridesEditor.d.ts +11 -0
  537. package/dist/billing/shared/components/CurrencyPriceOverridesEditor.d.ts.map +1 -0
  538. package/dist/billing/shared/components/CurrencyPriceOverridesEditor.js +230 -0
  539. package/dist/billing/shared/components/CurrencyPriceOverridesEditor.js.map +1 -0
  540. package/dist/billing/shared/components/EmptyState.d.ts +11 -0
  541. package/dist/billing/shared/components/EmptyState.d.ts.map +1 -0
  542. package/dist/billing/shared/components/EmptyState.js +27 -0
  543. package/dist/billing/shared/components/EmptyState.js.map +1 -0
  544. package/dist/billing/shared/components/GeoPricingOverridesEditor.d.ts +11 -0
  545. package/dist/billing/shared/components/GeoPricingOverridesEditor.d.ts.map +1 -0
  546. package/dist/billing/shared/components/GeoPricingOverridesEditor.js +1 -0
  547. package/dist/billing/shared/components/PageHeader.d.ts +11 -0
  548. package/dist/billing/shared/components/PageHeader.d.ts.map +1 -0
  549. package/dist/billing/shared/components/PageHeader.js +25 -0
  550. package/dist/billing/shared/components/PageHeader.js.map +1 -0
  551. package/dist/billing/shared/components/ServerError.d.ts +11 -0
  552. package/dist/billing/shared/components/ServerError.d.ts.map +1 -0
  553. package/dist/billing/shared/components/ServerError.js +75 -0
  554. package/dist/billing/shared/components/ServerError.js.map +1 -0
  555. package/dist/billing/shared/components/StatCard.d.ts +15 -0
  556. package/dist/billing/shared/components/StatCard.d.ts.map +1 -0
  557. package/dist/billing/shared/components/StatCard.js +37 -0
  558. package/dist/billing/shared/components/StatCard.js.map +1 -0
  559. package/dist/billing/shared/components/index.d.ts +11 -0
  560. package/dist/billing/shared/components/index.d.ts.map +1 -0
  561. package/dist/billing/shared/components/index.js +7 -0
  562. package/dist/billing/shared/index.d.ts +8 -0
  563. package/dist/billing/shared/index.d.ts.map +1 -0
  564. package/dist/billing/shared/types/graphql.d.ts +926 -0
  565. package/dist/billing/shared/types/graphql.d.ts.map +1 -0
  566. package/dist/billing/shared/types/graphql.js +30 -0
  567. package/dist/billing/shared/types/graphql.js.map +1 -0
  568. package/dist/billing/shared/types/index.d.ts +96 -0
  569. package/dist/billing/shared/types/index.d.ts.map +1 -0
  570. package/dist/billing/shared/utils/directActivityGraphql.d.ts +13 -0
  571. package/dist/billing/shared/utils/directActivityGraphql.d.ts.map +1 -0
  572. package/dist/billing/shared/utils/directActivityGraphql.js +2 -0
  573. package/dist/billing/shared/utils/directBillingGraphql.d.ts +13 -0
  574. package/dist/billing/shared/utils/directBillingGraphql.d.ts.map +1 -0
  575. package/dist/billing/shared/utils/directBillingGraphql.js +22 -0
  576. package/dist/billing/shared/utils/directBillingGraphql.js.map +1 -0
  577. package/dist/billing/shared/utils/error.d.ts +30 -0
  578. package/dist/billing/shared/utils/error.d.ts.map +1 -0
  579. package/dist/billing/shared/utils/error.js +16 -0
  580. package/dist/billing/shared/utils/error.js.map +1 -0
  581. package/dist/billing/shared/utils/format.d.ts +28 -0
  582. package/dist/billing/shared/utils/format.d.ts.map +1 -0
  583. package/dist/billing/shared/utils/format.js +65 -0
  584. package/dist/billing/shared/utils/format.js.map +1 -0
  585. package/dist/billing/shared/utils/gatewayGraphql.d.ts +15 -0
  586. package/dist/billing/shared/utils/gatewayGraphql.d.ts.map +1 -0
  587. package/dist/billing/shared/utils/gatewayGraphql.js +27 -0
  588. package/dist/billing/shared/utils/gatewayGraphql.js.map +1 -0
  589. package/dist/billing/shared/utils/index.d.ts +13 -0
  590. package/dist/billing/shared/utils/index.d.ts.map +1 -0
  591. package/dist/billing/shared/utils/index.js +8 -0
  592. package/dist/billing/shared/utils/navigation.d.ts +2 -0
  593. package/dist/billing/shared/utils/navigation.d.ts.map +1 -0
  594. package/dist/billing/shared/utils/navigation.js +8 -0
  595. package/dist/billing/shared/utils/navigation.js.map +1 -0
  596. package/dist/billing/shared/utils/paymentTheme.d.ts +18 -0
  597. package/dist/billing/shared/utils/paymentTheme.d.ts.map +1 -0
  598. package/dist/billing/shared/utils/paymentTheme.js +32 -0
  599. package/dist/billing/shared/utils/paymentTheme.js.map +1 -0
  600. package/dist/billing/shared/utils/status.d.ts +28 -0
  601. package/dist/billing/shared/utils/status.d.ts.map +1 -0
  602. package/dist/billing/shared/utils/status.js +57 -0
  603. package/dist/billing/shared/utils/status.js.map +1 -0
  604. package/dist/billing/shared/utils/tokens.d.ts +156 -0
  605. package/dist/billing/shared/utils/tokens.d.ts.map +1 -0
  606. package/dist/billing/shared/utils/tokens.js +128 -0
  607. package/dist/billing/shared/utils/tokens.js.map +1 -0
  608. package/dist/billing/types/index.d.ts +268 -0
  609. package/dist/billing/types/index.d.ts.map +1 -0
  610. package/dist/billing/utils/index.d.ts +128 -0
  611. package/dist/billing/utils/index.d.ts.map +1 -0
  612. package/dist/dev/main.d.ts +2 -0
  613. package/dist/dev/main.d.ts.map +1 -0
  614. package/dist/generated/global-operations.d.ts +9544 -0
  615. package/dist/generated/global-operations.d.ts.map +1 -0
  616. package/dist/generated/global-operations.js +3542 -0
  617. package/dist/generated/global-operations.js.map +1 -0
  618. package/dist/generated/global-types.d.ts +22208 -0
  619. package/dist/generated/global-types.d.ts.map +1 -0
  620. package/dist/generated/global-types.js +12 -0
  621. package/dist/generated/global-types.js.map +1 -0
  622. package/dist/generated/wspace-operations.d.ts +61 -0
  623. package/dist/generated/wspace-operations.d.ts.map +1 -0
  624. package/dist/generated/wspace-operations.js +35 -0
  625. package/dist/generated/wspace-operations.js.map +1 -0
  626. package/dist/generated/wspace-types.d.ts +48578 -0
  627. package/dist/generated/wspace-types.d.ts.map +1 -0
  628. package/dist/index.d.ts +8 -0
  629. package/dist/index.d.ts.map +1 -0
  630. package/dist/index.js +2 -0
  631. package/dist/node_modules/@capacitor/core/dist/index.js +270 -0
  632. package/dist/node_modules/@capacitor/core/dist/index.js.map +1 -0
  633. package/dist/utils/nativeBridge.d.ts +3 -0
  634. package/dist/utils/nativeBridge.d.ts.map +1 -0
  635. package/dist/utils/nativeBridge.js +2 -0
  636. package/package.json +112 -0
@@ -0,0 +1,87 @@
1
+ import { GetInvoicesDocument as e, useGenerateInvoiceMutation as t, useGetInvoiceQuery as n, useGetInvoicesQuery as r, usePayInvoiceMutation as i, useVoidInvoiceMutation as a } from "../../../../generated/global-operations.js";
2
+ import { useCallback as o, useMemo as s } from "react";
3
+ import { useApolloClient as c } from "@apollo/client/react";
4
+ //#region src/billing/modules/billing/hooks/useInvoices.ts
5
+ function l(e = {}) {
6
+ let { status: t, billingAccountId: n } = e, { data: i, loading: a, error: c, refetch: l } = r({
7
+ variables: {
8
+ status: t,
9
+ billingAccountId: n
10
+ },
11
+ fetchPolicy: "cache-and-network"
12
+ }), u = s(() => i?.getInvoices || [], [i?.getInvoices]);
13
+ return {
14
+ invoices: u,
15
+ openInvoices: s(() => u.filter((e) => e.status === "OPEN"), [u]),
16
+ paidInvoices: s(() => u.filter((e) => e.status === "PAID"), [u]),
17
+ isLoading: a,
18
+ error: c,
19
+ refetch: o(async () => {
20
+ await l();
21
+ }, [l])
22
+ };
23
+ }
24
+ function u(e, t) {
25
+ let { data: r, loading: i, error: a, refetch: s } = n({
26
+ variables: {
27
+ id: e,
28
+ billingAccountId: t
29
+ },
30
+ skip: !e || !t,
31
+ fetchPolicy: "cache-and-network"
32
+ }), c = o(async () => {
33
+ await s();
34
+ }, [s]);
35
+ return {
36
+ invoice: r?.getInvoice || null,
37
+ isLoading: i,
38
+ error: a,
39
+ refetch: c
40
+ };
41
+ }
42
+ function d() {
43
+ let n = c(), [r, { loading: s }] = t(), [l, { loading: u }] = i(), [d, { loading: f }] = a();
44
+ return {
45
+ generateInvoice: o(async (t, i) => {
46
+ try {
47
+ let { data: a } = await r({ variables: {
48
+ subscriptionId: t,
49
+ billingAccountId: i
50
+ } });
51
+ return await n.refetchQueries({ include: [e] }), a.generateInvoice;
52
+ } catch (e) {
53
+ throw console.error("Failed to generate invoice:", e), e;
54
+ }
55
+ }, [r, n]),
56
+ payInvoice: o(async (t, r, i) => {
57
+ try {
58
+ let { data: a } = await l({ variables: {
59
+ invoiceId: t,
60
+ paymentMethodId: r,
61
+ billingAccountId: i
62
+ } });
63
+ return await n.refetchQueries({ include: [e] }), a.payInvoice;
64
+ } catch (e) {
65
+ throw console.error("Failed to pay invoice:", e), e;
66
+ }
67
+ }, [l, n]),
68
+ voidInvoice: o(async (t, r) => {
69
+ try {
70
+ let { data: i } = await d({ variables: {
71
+ invoiceId: t,
72
+ billingAccountId: r
73
+ } });
74
+ return await n.refetchQueries({ include: [e] }), i.voidInvoice;
75
+ } catch (e) {
76
+ throw console.error("Failed to void invoice:", e), e;
77
+ }
78
+ }, [d, n]),
79
+ isGenerating: s,
80
+ isPaying: u,
81
+ isVoiding: f
82
+ };
83
+ }
84
+ //#endregion
85
+ export { u as useInvoice, d as useInvoiceMutations, l as useInvoices };
86
+
87
+ //# sourceMappingURL=useInvoices.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useInvoices.js","names":[],"sources":["../../../../../src/billing/modules/billing/hooks/useInvoices.ts"],"sourcesContent":["/**\n * Billing Module - useInvoices Hook\n * Provides access to invoice data and mutations\n */\n\nimport { useApolloClient } from '@apollo/client/react';\nimport { useCallback, useMemo } from 'react';\nimport {\n useGetInvoicesQuery,\n useGetInvoiceQuery,\n useGetInvoiceByNumberQuery,\n useGenerateInvoiceMutation,\n usePayInvoiceMutation,\n useVoidInvoiceMutation,\n GetInvoicesDocument,\n useGetPaginatedInvoicesQuery,\n} from '../../../../generated/global-operations';\nimport type { Invoice, InvoiceStatus } from '../../../shared/types';\n\ninterface UseInvoicesOptions {\n status?: InvoiceStatus;\n billingAccountId?: string;\n}\n\ninterface UseInvoicesResult {\n invoices: Invoice[];\n openInvoices: Invoice[];\n paidInvoices: Invoice[];\n isLoading: boolean;\n error: Error | undefined;\n refetch: () => Promise<void>;\n}\n\ninterface UsePaginatedInvoicesOptions {\n status?: InvoiceStatus;\n billingAccountId?: string;\n page?: number;\n pageSize?: number;\n}\n\ninterface UsePaginatedInvoicesResult {\n invoices: Invoice[];\n totalCount: number;\n hasMore: boolean;\n page: number;\n pageSize: number;\n totalPages: number;\n isLoading: boolean;\n error: Error | undefined;\n refetch: () => Promise<void>;\n}\n\ninterface UseInvoiceResult {\n invoice: Invoice | null;\n isLoading: boolean;\n error: Error | undefined;\n refetch: () => Promise<void>;\n}\n\ninterface UseInvoiceMutationsResult {\n generateInvoice: (subscriptionId: string, billingAccountId: string) => Promise<Invoice>;\n payInvoice: (\n invoiceId: string,\n paymentMethodId: string,\n billingAccountId: string\n ) => Promise<Invoice>;\n voidInvoice: (invoiceId: string, billingAccountId: string) => Promise<Invoice>;\n isGenerating: boolean;\n isPaying: boolean;\n isVoiding: boolean;\n}\n\n/**\n * Hook for fetching invoices\n */\nexport function useInvoices(options: UseInvoicesOptions = {}): UseInvoicesResult {\n const { status, billingAccountId } = options;\n\n const { data, loading, error, refetch } = useGetInvoicesQuery({\n variables: { status, billingAccountId },\n fetchPolicy: 'cache-and-network',\n });\n\n const invoices = useMemo<Invoice[]>(() => data?.getInvoices || [], [data?.getInvoices]);\n\n const openInvoices = useMemo(() => {\n return invoices.filter((inv) => inv.status === ('OPEN' as InvoiceStatus));\n }, [invoices]);\n\n const paidInvoices = useMemo(() => {\n return invoices.filter((inv) => inv.status === ('PAID' as InvoiceStatus));\n }, [invoices]);\n\n const handleRefetch = useCallback(async () => {\n await refetch();\n }, [refetch]);\n\n return {\n invoices,\n openInvoices,\n paidInvoices,\n isLoading: loading,\n error: error as Error | undefined,\n refetch: handleRefetch,\n };\n}\n\n/**\n * Hook for fetching paginated invoices\n */\nexport function usePaginatedInvoices(\n options: UsePaginatedInvoicesOptions = {}\n): UsePaginatedInvoicesResult {\n const { status, billingAccountId, page = 1, pageSize = 20 } = options;\n\n const { data, loading, error, refetch } = useGetPaginatedInvoicesQuery({\n variables: { status, billingAccountId, page, pageSize },\n fetchPolicy: 'cache-and-network',\n });\n\n const handleRefetch = useCallback(async () => {\n await refetch();\n }, [refetch]);\n\n return {\n invoices: data?.getPaginatedInvoices?.invoices || [],\n totalCount: data?.getPaginatedInvoices?.totalCount || 0,\n hasMore: data?.getPaginatedInvoices?.hasMore || false,\n page: data?.getPaginatedInvoices?.page || 1,\n pageSize: data?.getPaginatedInvoices?.pageSize || pageSize,\n totalPages: data?.getPaginatedInvoices?.totalPages || 0,\n isLoading: loading,\n error: error as Error | undefined,\n refetch: handleRefetch,\n };\n}\n\n/**\n * Hook for fetching a single invoice by ID\n */\nexport function useInvoice(\n id: string | undefined,\n billingAccountId: string | undefined\n): UseInvoiceResult {\n const { data, loading, error, refetch } = useGetInvoiceQuery({\n variables: { id: id!, billingAccountId: billingAccountId! },\n skip: !id || !billingAccountId,\n fetchPolicy: 'cache-and-network',\n });\n\n const handleRefetch = useCallback(async () => {\n await refetch();\n }, [refetch]);\n\n return {\n invoice: data?.getInvoice || null,\n isLoading: loading,\n error: error as Error | undefined,\n refetch: handleRefetch,\n };\n}\n\n/**\n * Hook for fetching an invoice by number\n */\nexport function useInvoiceByNumber(\n invoiceNumber: string | undefined,\n billingAccountId: string | undefined\n): UseInvoiceResult {\n const { data, loading, error, refetch } = useGetInvoiceByNumberQuery({\n variables: { invoiceNumber: invoiceNumber!, billingAccountId: billingAccountId! },\n skip: !invoiceNumber || !billingAccountId,\n fetchPolicy: 'cache-and-network',\n });\n\n const handleRefetch = useCallback(async () => {\n await refetch();\n }, [refetch]);\n\n return {\n invoice: data?.getInvoiceByNumber || null,\n isLoading: loading,\n error: error as Error | undefined,\n refetch: handleRefetch,\n };\n}\n\n/**\n * Hook for invoice mutations\n */\nexport function useInvoiceMutations(): UseInvoiceMutationsResult {\n const client = useApolloClient();\n\n const [generateInvoiceMutation, { loading: isGenerating }] = useGenerateInvoiceMutation();\n const [payInvoiceMutation, { loading: isPaying }] = usePayInvoiceMutation();\n const [voidInvoiceMutation, { loading: isVoiding }] = useVoidInvoiceMutation();\n\n const generateInvoice = useCallback(\n async (subscriptionId: string, billingAccountId: string): Promise<Invoice> => {\n try {\n const { data } = await generateInvoiceMutation({\n variables: { subscriptionId, billingAccountId },\n });\n await client.refetchQueries({ include: [GetInvoicesDocument] });\n return data!.generateInvoice;\n } catch (error) {\n console.error('Failed to generate invoice:', error);\n throw error;\n }\n },\n [generateInvoiceMutation, client]\n );\n\n const payInvoice = useCallback(\n async (\n invoiceId: string,\n paymentMethodId: string,\n billingAccountId: string\n ): Promise<Invoice> => {\n try {\n const { data } = await payInvoiceMutation({\n variables: { invoiceId, paymentMethodId, billingAccountId },\n });\n await client.refetchQueries({ include: [GetInvoicesDocument] });\n return data!.payInvoice;\n } catch (error) {\n console.error('Failed to pay invoice:', error);\n throw error;\n }\n },\n [payInvoiceMutation, client]\n );\n\n const voidInvoice = useCallback(\n async (invoiceId: string, billingAccountId: string): Promise<Invoice> => {\n try {\n const { data } = await voidInvoiceMutation({\n variables: { invoiceId, billingAccountId },\n });\n await client.refetchQueries({ include: [GetInvoicesDocument] });\n return data!.voidInvoice;\n } catch (error) {\n console.error('Failed to void invoice:', error);\n throw error;\n }\n },\n [voidInvoiceMutation, client]\n );\n\n return {\n generateInvoice,\n payInvoice,\n voidInvoice,\n isGenerating,\n isPaying,\n isVoiding,\n };\n}\n"],"mappings":";;;;AA2EA,SAAgB,EAAY,IAA8B,EAAE,EAAqB;CAC/E,IAAM,EAAE,WAAQ,wBAAqB,GAE/B,EAAE,SAAM,YAAS,UAAO,eAAY,EAAoB;EAC5D,WAAW;GAAE;GAAQ;GAAkB;EACvC,aAAa;EACd,CAAC,EAEI,IAAW,Q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C,WAAW;KAAE;KAAW;KAAiB;KAAkB,EAC5D,CAAC;AAEF,WADA,MAAM,EAAO,eAAe,EAAE,SAAS,CAAC,EAAoB,EAAE,CAAC,EACxD,EAAM;YACN,GAAO;AAEd,UADA,QAAQ,MAAM,0BAA0B,EAAM,EACxC;;KAGV,CAAC,GAAoB,EAAO,CAC7B;EAqBC,aAnBkB,EAClB,OAAO,GAAmB,MAA+C;AACvE,OAAI;IACF,IAAM,EAAE,YAAS,MAAM,EAAoB,EACzC,WAAW;KAAE;KAAW;KAAkB,EAC3C,CAAC;AAEF,WADA,MAAM,EAAO,eAAe,EAAE,SAAS,CAAC,EAAoB,EAAE,CAAC,EACxD,EAAM;YACN,GAAO;AAEd,UADA,QAAQ,MAAM,2BAA2B,EAAM,EACzC;;KAGV,CAAC,GAAqB,EAAO,CAC9B;EAMC;EACA;EACA;EACD"}
@@ -0,0 +1,62 @@
1
+ import { Payment, PaymentMethod, PaymentStatus, CreatePaymentMethodInput } from '../../../shared/types';
2
+
3
+ interface UsePaymentsOptions {
4
+ status?: PaymentStatus;
5
+ }
6
+ interface UsePaymentsResult {
7
+ payments: Payment[];
8
+ successfulPayments: Payment[];
9
+ pendingPayments: Payment[];
10
+ failedPayments: Payment[];
11
+ isLoading: boolean;
12
+ error: Error | undefined;
13
+ refetch: () => Promise<void>;
14
+ }
15
+ interface UsePaymentResult {
16
+ payment: Payment | null;
17
+ isLoading: boolean;
18
+ error: Error | undefined;
19
+ refetch: () => Promise<void>;
20
+ }
21
+ interface UsePaymentMethodsResult {
22
+ paymentMethods: PaymentMethod[];
23
+ defaultPaymentMethod: PaymentMethod | null;
24
+ isLoading: boolean;
25
+ error: Error | undefined;
26
+ refetch: () => Promise<void>;
27
+ }
28
+ interface UsePaymentMethodMutationsResult {
29
+ addPaymentMethod: (input: CreatePaymentMethodInput) => Promise<PaymentMethod>;
30
+ setDefaultPaymentMethod: (id: string, billingAccountId: string) => Promise<PaymentMethod>;
31
+ deletePaymentMethod: (id: string, billingAccountId: string) => Promise<boolean>;
32
+ isAdding: boolean;
33
+ isUpdating: boolean;
34
+ isDeleting: boolean;
35
+ }
36
+ /**
37
+ * Hook for fetching payments
38
+ */
39
+ export declare function usePayments(options?: UsePaymentsOptions): UsePaymentsResult;
40
+ /**
41
+ * Hook for fetching a single payment by ID
42
+ */
43
+ export declare function usePayment(id: string | undefined, billingAccountId: string | undefined): UsePaymentResult;
44
+ /**
45
+ * Hook for fetching payment methods
46
+ */
47
+ export declare function usePaymentMethods(billingAccountId: string | undefined): UsePaymentMethodsResult;
48
+ /**
49
+ * Hook for fetching default payment method
50
+ */
51
+ export declare function useDefaultPaymentMethod(billingAccountId: string | undefined): {
52
+ defaultPaymentMethod: any;
53
+ isLoading: boolean;
54
+ error: Error | undefined;
55
+ refetch: () => Promise<void>;
56
+ };
57
+ /**
58
+ * Hook for payment method mutations
59
+ */
60
+ export declare function usePaymentMethodMutations(): UsePaymentMethodMutationsResult;
61
+ export {};
62
+ //# sourceMappingURL=usePayments.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"usePayments.d.ts","sourceRoot":"","sources":["../../../../../src/billing/modules/billing/hooks/usePayments.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAeH,OAAO,KAAK,EACV,OAAO,EACP,aAAa,EACb,aAAa,EACb,wBAAwB,EACzB,MAAM,uBAAuB,CAAC;AAE/B,UAAU,kBAAkB;IAC1B,MAAM,CAAC,EAAE,aAAa,CAAC;CACxB;AAED,UAAU,iBAAiB;IACzB,QAAQ,EAAE,OAAO,EAAE,CAAC;IACpB,kBAAkB,EAAE,OAAO,EAAE,CAAC;IAC9B,eAAe,EAAE,OAAO,EAAE,CAAC;IAC3B,cAAc,EAAE,OAAO,EAAE,CAAC;IAC1B,SAAS,EAAE,OAAO,CAAC;IACnB,KAAK,EAAE,KAAK,GAAG,SAAS,CAAC;IACzB,OAAO,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;CAC9B;AAED,UAAU,gBAAg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S;;EAGpC;AAED;;GAEG;AACH,wBAAgB,yBAAyB,IAAI,+BAA+B,CAiE3E"}
@@ -0,0 +1,3 @@
1
+ import "../../../../generated/global-operations.js";
2
+ import "react";
3
+ import "@apollo/client/react";
@@ -0,0 +1,191 @@
1
+ /**
2
+ * Billing Module - useRefunds Hook
3
+ * Provides access to refund records, statistics, and mutations
4
+ */
5
+ export type RefundRecordStatus = 'PENDING' | 'PROCESSING' | 'COMPLETED' | 'FAILED' | 'SKIPPED';
6
+ export type RefundSource = 'MANUAL' | 'WEBHOOK_RECOVERY' | 'SUBSCRIPTION_CANCEL' | 'DUPLICATE_PAYMENT';
7
+ export interface RefundRecord {
8
+ id: string;
9
+ orgId: string;
10
+ billingAccountId: string | null;
11
+ source: RefundSource;
12
+ status: RefundRecordStatus;
13
+ provider: string;
14
+ gatewayPaymentId: string;
15
+ gatewayOrderId: string | null;
16
+ amount: number;
17
+ currency: string;
18
+ purchaseType: string | null;
19
+ purchaseDetail: string | null;
20
+ reason: string | null;
21
+ notes: string | null;
22
+ webhookLogId: string | null;
23
+ transactionId: string | null;
24
+ processedBy: string | null;
25
+ processedAt: string | null;
26
+ gatewayRefundId: string | null;
27
+ errorMessage: string | null;
28
+ retryCount: number;
29
+ metadata: Record<string, unknown> | null;
30
+ createdAt: string;
31
+ updatedAt: string;
32
+ }
33
+ export interface RefundStats {
34
+ pending: number;
35
+ processing: number;
36
+ completed: number;
37
+ failed: number;
38
+ skipped: number;
39
+ totalPendingAmount: number;
40
+ totalCompletedAmount: number;
41
+ }
42
+ export interface WebhookLog {
43
+ id: string;
44
+ event: string;
45
+ provider: string;
46
+ payload: Record<string, unknown>;
47
+ processed: boolean;
48
+ error: string | null;
49
+ createdAt: string;
50
+ }
51
+ export interface RefundRecordFilters {
52
+ status?: RefundRecordStatus;
53
+ source?: RefundSource;
54
+ provider?: string;
55
+ billingAccountId?: string;
56
+ fromDate?: string;
57
+ toDate?: string;
58
+ }
59
+ export interface CreateRefundRecordInput {
60
+ billingAccountId?: string;
61
+ provider: string;
62
+ gatewayPaymentId: string;
63
+ gatewayOrderId?: string;
64
+ amount: number;
65
+ currency: string;
66
+ purchaseType?: string;
67
+ purchaseDetail?: string;
68
+ reason?: string;
69
+ notes?: string;
70
+ transactionId?: string;
71
+ metadata?: Record<string, unknown>;
72
+ }
73
+ export interface ProcessRefundResult {
74
+ success: boolean;
75
+ refundRecord: RefundRecord | null;
76
+ gatewayRefundId: string | null;
77
+ error: string | null;
78
+ }
79
+ interface PaginationInfo {
80
+ totalCount: number;
81
+ hasMore: boolean;
82
+ page: number;
83
+ pageSize: number;
84
+ hasPrevious: boolean;
85
+ }
86
+ interface UseRefundRecordsOptions {
87
+ pageSize?: number;
88
+ filters?: RefundRecordFilters;
89
+ }
90
+ interface UseRefundRecordsResult {
91
+ records: RefundRecord[];
92
+ pagination: PaginationInfo;
93
+ isLoading: boolean;
94
+ error: Error | undefined;
95
+ refetch: () => Promise<void>;
96
+ goToNextPage: () => void;
97
+ goToPreviousPage: () => void;
98
+ goToPage: (page: number) => void;
99
+ setFilters: (filters: RefundRecordFilters) => void;
100
+ }
101
+ interface UseRefundStatsResult {
102
+ stats: RefundStats | null;
103
+ isLoading: boolean;
104
+ error: Error | undefined;
105
+ refetch: () => Promise<void>;
106
+ }
107
+ interface UseRefundRecordResult {
108
+ record: RefundRecord | null;
109
+ isLoading: boolean;
110
+ error: Error | undefined;
111
+ refetch: () => Promise<void>;
112
+ }
113
+ interface UseUnprocessedWebhooksResult {
114
+ webhooks: WebhookLog[];
115
+ isLoading: boolean;
116
+ error: Error | undefined;
117
+ refetch: () => Promise<void>;
118
+ }
119
+ interface UseRefundMutationsResult {
120
+ createRefundRecord: (input: CreateRefundRecordInput) => Promise<RefundRecord>;
121
+ processRefund: (id: string, notes?: string) => Promise<ProcessRefundResult>;
122
+ skipRefund: (id: string, reason: string) => Promise<RefundRecord>;
123
+ retryRefund: (id: string) => Promise<ProcessRefundResult>;
124
+ createRefundRecordsFromFailedWebhooks: () => Promise<RefundRecord[]>;
125
+ createRefundRecordFromWebhook: (webhookLogId: string) => Promise<RefundRecord | null>;
126
+ isCreating: boolean;
127
+ isProcessing: boolean;
128
+ isSkipping: boolean;
129
+ isRetrying: boolean;
130
+ isCreatingFromWebhooks: boolean;
131
+ isCreatingFromWebhook: boolean;
132
+ }
133
+ /**
134
+ * Hook for fetching paginated refund records with filters
135
+ */
136
+ export declare function useRefundRecords(options?: UseRefundRecordsOptions): UseRefundRecordsResult;
137
+ /**
138
+ * Hook for fetching pending refund records (shortcut)
139
+ */
140
+ export declare function usePendingRefunds(pageSize?: number): UseRefundRecordsResult;
141
+ /**
142
+ * Hook for fetching refund statistics
143
+ */
144
+ export declare function useRefundStats(): UseRefundStatsResult;
145
+ /**
146
+ * Hook for fetching a single refund record by ID
147
+ */
148
+ export declare function useRefundRecord(id: string | undefined): UseRefundRecordResult;
149
+ /**
150
+ * Hook for fetching unprocessed failed webhooks
151
+ */
152
+ export declare function useUnprocessedFailedWebhooks(): UseUnprocessedWebhooksResult;
153
+ /**
154
+ * Hook for refund mutations
155
+ */
156
+ export declare function useRefundMutations(): UseRefundMutationsResult;
157
+ /**
158
+ * Combined hook for refund page with all data and mutations
159
+ */
160
+ export declare function useRefunds(options?: UseRefundRecordsOptions): {
161
+ refetch: () => Promise<void>;
162
+ refetchRecords: () => Promise<void>;
163
+ refetchStats: () => Promise<void>;
164
+ refetchWebhooks: () => Promise<void>;
165
+ createRefundRecord: (input: CreateRefundRecordInput) => Promise<RefundRecord>;
166
+ processRefund: (id: string, notes?: string) => Promise<ProcessRefundResult>;
167
+ skipRefund: (id: string, reason: string) => Promise<RefundRecord>;
168
+ retryRefund: (id: string) => Promise<ProcessRefundResult>;
169
+ createRefundRecordsFromFailedWebhooks: () => Promise<RefundRecord[]>;
170
+ createRefundRecordFromWebhook: (webhookLogId: string) => Promise<RefundRecord | null>;
171
+ isCreating: boolean;
172
+ isProcessing: boolean;
173
+ isSkipping: boolean;
174
+ isRetrying: boolean;
175
+ isCreatingFromWebhooks: boolean;
176
+ isCreatingFromWebhook: boolean;
177
+ records: RefundRecord[];
178
+ pagination: PaginationInfo;
179
+ goToNextPage: () => void;
180
+ goToPreviousPage: () => void;
181
+ goToPage: (page: number) => void;
182
+ setFilters: (filters: RefundRecordFilters) => void;
183
+ stats: RefundStats | null;
184
+ unprocessedWebhooks: WebhookLog[];
185
+ webhooksLoading: boolean;
186
+ isLoading: boolean;
187
+ recordsError: Error | undefined;
188
+ statsError: Error | undefined;
189
+ };
190
+ export {};
191
+ //# sourceMappingURL=useRefunds.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useRefunds.d.ts","sourceRoot":"","sources":["../../../../../src/billing/modules/billing/hooks/useRefunds.ts"],"names":[],"mappings":"AAAA;;;GAGG;AA0BH,MAAM,MAAM,kBAAkB,GAAG,SAAS,GAAG,YAAY,GAAG,WAAW,GAAG,QAAQ,GAAG,SAAS,CAAC;AAC/F,MAAM,MAAM,YAAY,GACpB,QAAQ,GACR,kBAAkB,GAClB,qBAAqB,GACrB,mBAAmB,CAAC;AAExB,MAAM,WAAW,YAAY;IAC3B,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,gBAAgB,EAAE,MAAM,GAAG,IAAI,CAAC;IAChC,MAAM,EAAE,YAAY,CAAC;IACrB,MAAM,EAAE,kBAAkB,CAAC;IAC3B,QAAQ,EAAE,MAAM,CAAC;IACjB,gBAAgB,EAAE,MAAM,CAAC;IACzB,cAAc,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9B,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,cAAc,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9B,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,YAAY,EAAE,MAAM,GAAG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BACK,OAAO;2BACR,OAAO;;;wBAvCV,IAAI;4BACA,IAAI;qBACX,MAAM,KAAK,IAAI;0BACV,mBAAmB,KAAK,IAAI;;;;;;;EAiZnD"}
@@ -0,0 +1,162 @@
1
+ import { GetPendingRefundsDocument as e, GetRefundRecordsDocument as t, GetRefundStatsDocument as n, GetUnprocessedFailedWebhooksDocument as r, useCreateRefundRecordFromWebhookMutation as i, useCreateRefundRecordMutation as a, useCreateRefundRecordsFromFailedWebhooksMutation as o, useGetRefundRecordsQuery as s, useGetRefundStatsQuery as c, useGetUnprocessedFailedWebhooksQuery as l, useProcessRefundMutation as u, useRetryRefundMutation as d, useSkipRefundMutation as f } from "../../../../generated/global-operations.js";
2
+ import { useCallback as p, useEffect as m, useMemo as h, useState as g } from "react";
3
+ import { useApolloClient as _ } from "@apollo/client/react";
4
+ //#region src/billing/modules/billing/hooks/useRefunds.ts
5
+ var v = 20;
6
+ function y(e = {}) {
7
+ let t = e.pageSize || v, [n, r] = g(0), [i, a] = g(e.filters || {});
8
+ m(() => {
9
+ a(e.filters || {}), r(0);
10
+ }, [e.filters]);
11
+ let { data: o, loading: c, error: l, refetch: u } = s({
12
+ variables: {
13
+ ...i,
14
+ page: n,
15
+ pageSize: t
16
+ },
17
+ fetchPolicy: "cache-and-network"
18
+ }), d = p(async () => {
19
+ await u();
20
+ }, [u]), f = o?.getRefundRecords, h = p(() => {
21
+ f?.hasMore && r((e) => e + 1);
22
+ }, [f?.hasMore]), _ = p(() => {
23
+ n > 0 && r((e) => e - 1);
24
+ }, [n]), y = p((e) => {
25
+ let n = f ? Math.ceil(f.totalCount / t) : 0;
26
+ e >= 0 && e < n && r(e);
27
+ }, [f, t]), b = p((e) => {
28
+ a(e), r(0);
29
+ }, []);
30
+ return {
31
+ records: f?.records || [],
32
+ pagination: {
33
+ totalCount: f?.totalCount || 0,
34
+ hasMore: f?.hasMore || !1,
35
+ page: n,
36
+ pageSize: t,
37
+ hasPrevious: n > 0
38
+ },
39
+ isLoading: c,
40
+ error: l,
41
+ refetch: d,
42
+ goToNextPage: h,
43
+ goToPreviousPage: _,
44
+ goToPage: y,
45
+ setFilters: b
46
+ };
47
+ }
48
+ function b() {
49
+ let { data: e, loading: t, error: n, refetch: r } = c({ fetchPolicy: "cache-and-network" }), i = p(async () => {
50
+ await r();
51
+ }, [r]);
52
+ return {
53
+ stats: e?.getRefundStats || null,
54
+ isLoading: t,
55
+ error: n,
56
+ refetch: i
57
+ };
58
+ }
59
+ function x() {
60
+ let { data: e, loading: t, error: n, refetch: r } = l({ fetchPolicy: "cache-and-network" }), i = p(async () => {
61
+ await r();
62
+ }, [r]);
63
+ return {
64
+ webhooks: e?.getUnprocessedFailedWebhooks || [],
65
+ isLoading: t,
66
+ error: n,
67
+ refetch: i
68
+ };
69
+ }
70
+ function S() {
71
+ let s = _(), [c, { loading: l }] = a(), [m, { loading: h }] = u(), [g, { loading: v }] = f(), [y, { loading: b }] = d(), [x, { loading: S }] = o(), [C, { loading: w }] = i(), T = p(async () => {
72
+ await s.refetchQueries({ include: [
73
+ t,
74
+ e,
75
+ n
76
+ ] });
77
+ }, [s]);
78
+ return {
79
+ createRefundRecord: p(async (e) => {
80
+ let { data: t } = await c({ variables: e });
81
+ return await T(), t.createRefundRecord;
82
+ }, [c, T]),
83
+ processRefund: p(async (e, t) => {
84
+ let { data: n } = await m({ variables: {
85
+ id: e,
86
+ notes: t
87
+ } });
88
+ return await T(), n.processRefund;
89
+ }, [m, T]),
90
+ skipRefund: p(async (e, t) => {
91
+ let { data: n } = await g({ variables: {
92
+ id: e,
93
+ reason: t
94
+ } });
95
+ return await T(), n.skipRefund;
96
+ }, [g, T]),
97
+ retryRefund: p(async (e) => {
98
+ let { data: t } = await y({ variables: { id: e } });
99
+ return await T(), t.retryRefund;
100
+ }, [y, T]),
101
+ createRefundRecordsFromFailedWebhooks: p(async () => {
102
+ let { data: i } = await x();
103
+ return await s.refetchQueries({ include: [
104
+ t,
105
+ e,
106
+ n,
107
+ r
108
+ ] }), i.createRefundRecordsFromFailedWebhooks;
109
+ }, [x, s]),
110
+ createRefundRecordFromWebhook: p(async (i) => {
111
+ let { data: a } = await C({ variables: { webhookLogId: i } });
112
+ return await s.refetchQueries({ include: [
113
+ t,
114
+ e,
115
+ n,
116
+ r
117
+ ] }), a.createRefundRecordFromWebhook;
118
+ }, [C, s]),
119
+ isCreating: l,
120
+ isProcessing: h,
121
+ isSkipping: v,
122
+ isRetrying: b,
123
+ isCreatingFromWebhooks: S,
124
+ isCreatingFromWebhook: w
125
+ };
126
+ }
127
+ function C(e = {}) {
128
+ let t = y(e), n = b(), r = S(), i = x(), a = h(() => t.isLoading || n.isLoading, [t.isLoading, n.isLoading]), o = p(async () => {
129
+ await Promise.all([
130
+ t.refetch(),
131
+ n.refetch(),
132
+ i.refetch()
133
+ ]);
134
+ }, [
135
+ t.refetch,
136
+ n.refetch,
137
+ i.refetch
138
+ ]);
139
+ return {
140
+ records: t.records,
141
+ pagination: t.pagination,
142
+ goToNextPage: t.goToNextPage,
143
+ goToPreviousPage: t.goToPreviousPage,
144
+ goToPage: t.goToPage,
145
+ setFilters: t.setFilters,
146
+ stats: n.stats,
147
+ unprocessedWebhooks: i.webhooks,
148
+ webhooksLoading: i.isLoading,
149
+ isLoading: a,
150
+ recordsError: t.error,
151
+ statsError: n.error,
152
+ ...r,
153
+ refetch: o,
154
+ refetchRecords: t.refetch,
155
+ refetchStats: n.refetch,
156
+ refetchWebhooks: i.refetch
157
+ };
158
+ }
159
+ //#endregion
160
+ export { S as useRefundMutations, y as useRefundRecords, b as useRefundStats, C as useRefunds, x as useUnprocessedFailedWebhooks };
161
+
162
+ //# sourceMappingURL=useRefunds.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useRefunds.js","names":[],"sources":["../../../../../src/billing/modules/billing/hooks/useRefunds.ts"],"sourcesContent":["/**\n * Billing Module - useRefunds Hook\n * Provides access to refund records, statistics, and mutations\n */\n\nimport { useApolloClient } from '@apollo/client/react';\nimport { useCallback, useState, useMemo, useEffect } from 'react';\nimport {\n useGetRefundRecordsQuery,\n useGetPendingRefundsQuery,\n useGetRefundRecordQuery,\n useGetRefundStatsQuery,\n useGetUnprocessedFailedWebhooksQuery,\n useCreateRefundRecordMutation,\n useProcessRefundMutation,\n useSkipRefundMutation,\n useRetryRefundMutation,\n useCreateRefundRecordsFromFailedWebhooksMutation,\n useCreateRefundRecordFromWebhookMutation,\n GetRefundRecordsDocument,\n GetPendingRefundsDocument,\n GetRefundStatsDocument,\n GetUnprocessedFailedWebhooksDocument,\n} from '../../../../generated/global-operations';\n\n// ============================================================================\n// Types\n// ============================================================================\n\nexport type RefundRecordStatus = 'PENDING' | 'PROCESSING' | 'COMPLETED' | 'FAILED' | 'SKIPPED';\nexport type RefundSource =\n | 'MANUAL'\n | 'WEBHOOK_RECOVERY'\n | 'SUBSCRIPTION_CANCEL'\n | 'DUPLICATE_PAYMENT';\n\nexport interface RefundRecord {\n id: string;\n orgId: string;\n billingAccountId: string | null;\n source: RefundSource;\n status: RefundRecordStatus;\n provider: string;\n gatewayPaymentId: string;\n gatewayOrderId: string | null;\n amount: number;\n currency: string;\n purchaseType: string | null;\n purchaseDetail: string | null;\n reason: string | null;\n notes: string | null;\n webhookLogId: string | null;\n transactionId: string | null;\n processedBy: string | null;\n processedAt: string | null;\n gatewayRefundId: string | null;\n errorMessage: string | null;\n retryCount: number;\n metadata: Record<string, unknown> | null;\n createdAt: string;\n updatedAt: string;\n}\n\nexport interface RefundStats {\n pending: number;\n processing: number;\n completed: number;\n failed: number;\n skipped: number;\n totalPendingAmount: number;\n totalCompletedAmount: number;\n}\n\nexport interface WebhookLog {\n id: string;\n event: string;\n provider: string;\n payload: Record<string, unknown>;\n processed: boolean;\n error: string | null;\n createdAt: string;\n}\n\nexport interface RefundRecordFilters {\n status?: RefundRecordStatus;\n source?: RefundSource;\n provider?: string;\n billingAccountId?: string;\n fromDate?: string;\n toDate?: string;\n}\n\nexport interface CreateRefundRecordInput {\n billingAccountId?: string;\n provider: string;\n gatewayPaymentId: string;\n gatewayOrderId?: string;\n amount: number;\n currency: string;\n purchaseType?: string;\n purchaseDetail?: string;\n reason?: string;\n notes?: string;\n transactionId?: string;\n metadata?: Record<string, unknown>;\n}\n\nexport interface ProcessRefundResult {\n success: boolean;\n refundRecord: RefundRecord | null;\n gatewayRefundId: string | null;\n error: string | null;\n}\n\ninterface PaginationInfo {\n totalCount: number;\n hasMore: boolean;\n page: number;\n pageSize: number;\n hasPrevious: boolean;\n}\n\n// ============================================================================\n// Hook Results\n// ============================================================================\n\ninterface UseRefundRecordsOptions {\n pageSize?: number;\n filters?: RefundRecordFilters;\n}\n\ninterface UseRefundRecordsResult {\n records: RefundRecord[];\n pagination: PaginationInfo;\n isLoading: boolean;\n error: Error | undefined;\n refetch: () => Promise<void>;\n goToNextPage: () => void;\n goToPreviousPage: () => void;\n goToPage: (page: number) => void;\n setFilters: (filters: RefundRecordFilters) => void;\n}\n\ninterface UseRefundStatsResult {\n stats: RefundStats | null;\n isLoading: boolean;\n error: Error | undefined;\n refetch: () => Promise<void>;\n}\n\ninterface UseRefundRecordResult {\n record: RefundRecord | null;\n isLoading: boolean;\n error: Error | undefined;\n refetch: () => Promise<void>;\n}\n\ninterface UseUnprocessedWebhooksResult {\n webhooks: WebhookLog[];\n isLoading: boolean;\n error: Error | undefined;\n refetch: () => Promise<void>;\n}\n\ninterface UseRefundMutationsResult {\n createRefundRecord: (input: CreateRefundRecordInput) => Promise<RefundRecord>;\n processRefund: (id: string, notes?: string) => Promise<ProcessRefundResult>;\n skipRefund: (id: string, reason: string) => Promise<RefundRecord>;\n retryRefund: (id: string) => Promise<ProcessRefundResult>;\n createRefundRecordsFromFailedWebhooks: () => Promise<RefundRecord[]>;\n createRefundRecordFromWebhook: (webhookLogId: string) => Promise<RefundRecord | null>;\n isCreating: boolean;\n isProcessing: boolean;\n isSkipping: boolean;\n isRetrying: boolean;\n isCreatingFromWebhooks: boolean;\n isCreatingFromWebhook: boolean;\n}\n\n// ============================================================================\n// Hooks\n// ============================================================================\n\nconst DEFAULT_PAGE_SIZE = 20;\n\n/**\n * Hook for fetching paginated refund records with filters\n */\nexport function useRefundRecords(options: UseRefundRecordsOptions = {}): UseRefundRecordsResult {\n const pageSize = options.pageSize || DEFAULT_PAGE_SIZE;\n const [currentPage, setCurrentPage] = useState(0);\n const [filters, setFilters] = useState<RefundRecordFilters>(options.filters || {});\n\n // Update filters when options change (e.g., when tab changes)\n useEffect(() => {\n setFilters(options.filters || {});\n setCurrentPage(0); // Reset to first page when filters change externally\n }, [options.filters]);\n\n const { data, loading, error, refetch } = useGetRefundRecordsQuery({\n variables: {\n ...filters,\n page: currentPage,\n pageSize,\n },\n fetchPolicy: 'cache-and-network',\n });\n\n const handleRefetch = useCallback(async () => {\n await refetch();\n }, [refetch]);\n\n const result = data?.getRefundRecords;\n\n const goToNextPage = useCallback(() => {\n if (result?.hasMore) {\n setCurrentPage((prev) => prev + 1);\n }\n }, [result?.hasMore]);\n\n const goToPreviousPage = useCallback(() => {\n if (currentPage > 0) {\n setCurrentPage((prev) => prev - 1);\n }\n }, [currentPage]);\n\n const goToPage = useCallback(\n (page: number) => {\n const totalPages = result ? Math.ceil(result.totalCount / pageSize) : 0;\n if (page >= 0 && page < totalPages) {\n setCurrentPage(page);\n }\n },\n [result, pageSize]\n );\n\n const handleSetFilters = useCallback((newFilters: RefundRecordFilters) => {\n setFilters(newFilters);\n setCurrentPage(0); // Reset to first page when filters change\n }, []);\n\n return {\n records: result?.records || [],\n pagination: {\n totalCount: result?.totalCount || 0,\n hasMore: result?.hasMore || false,\n page: currentPage,\n pageSize,\n hasPrevious: currentPage > 0,\n },\n isLoading: loading,\n error: error as Error | undefined,\n refetch: handleRefetch,\n goToNextPage,\n goToPreviousPage,\n goToPage,\n setFilters: handleSetFilters,\n };\n}\n\n/**\n * Hook for fetching pending refund records (shortcut)\n */\nexport function usePendingRefunds(pageSize = DEFAULT_PAGE_SIZE): UseRefundRecordsResult {\n const [currentPage, setCurrentPage] = useState(0);\n\n const { data, loading, error, refetch } = useGetPendingRefundsQuery({\n variables: { page: currentPage, pageSize },\n fetchPolicy: 'cache-and-network',\n });\n\n const handleRefetch = useCallback(async () => {\n await refetch();\n }, [refetch]);\n\n const result = data?.getPendingRefunds;\n\n const goToNextPage = useCallback(() => {\n if (result?.hasMore) {\n setCurrentPage((prev) => prev + 1);\n }\n }, [result?.hasMore]);\n\n const goToPreviousPage = useCallback(() => {\n if (currentPage > 0) {\n setCurrentPage((prev) => prev - 1);\n }\n }, [currentPage]);\n\n const goToPage = useCallback(\n (page: number) => {\n const totalPages = result ? Math.ceil(result.totalCount / pageSize) : 0;\n if (page >= 0 && page < totalPages) {\n setCurrentPage(page);\n }\n },\n [result, pageSize]\n );\n\n return {\n records: result?.records || [],\n pagination: {\n totalCount: result?.totalCount || 0,\n hasMore: result?.hasMore || false,\n page: currentPage,\n pageSize,\n hasPrevious: currentPage > 0,\n },\n isLoading: loading,\n error: error as Error | undefined,\n refetch: handleRefetch,\n goToNextPage,\n goToPreviousPage,\n goToPage,\n setFilters: () => {}, // No-op for pending refunds\n };\n}\n\n/**\n * Hook for fetching refund statistics\n */\nexport function useRefundStats(): UseRefundStatsResult {\n const { data, loading, error, refetch } = useGetRefundStatsQuery({\n fetchPolicy: 'cache-and-network',\n });\n\n const handleRefetch = useCallback(async () => {\n await refetch();\n }, [refetch]);\n\n return {\n stats: data?.getRefundStats || null,\n isLoading: loading,\n error: error as Error | undefined,\n refetch: handleRefetch,\n };\n}\n\n/**\n * Hook for fetching a single refund record by ID\n */\nexport function useRefundRecord(id: string | undefined): UseRefundRecordResult {\n const { data, loading, error, refetch } = useGetRefundRecordQuery({\n variables: { id: id! },\n skip: !id,\n fetchPolicy: 'cache-and-network',\n });\n\n const handleRefetch = useCallback(async () => {\n await refetch();\n }, [refetch]);\n\n return {\n record: data?.getRefundRecord || null,\n isLoading: loading,\n error: error as Error | undefined,\n refetch: handleRefetch,\n };\n}\n\n/**\n * Hook for fetching unprocessed failed webhooks\n */\nexport function useUnprocessedFailedWebhooks(): UseUnprocessedWebhooksResult {\n const { data, loading, error, refetch } = useGetUnprocessedFailedWebhooksQuery({\n fetchPolicy: 'cache-and-network',\n });\n\n const handleRefetch = useCallback(async () => {\n await refetch();\n }, [refetch]);\n\n return {\n webhooks: data?.getUnprocessedFailedWebhooks || [],\n isLoading: loading,\n error: error as Error | undefined,\n refetch: handleRefetch,\n };\n}\n\n/**\n * Hook for refund mutations\n */\nexport function useRefundMutations(): UseRefundMutationsResult {\n const client = useApolloClient();\n\n const [createRefundRecordMutation, { loading: isCreating }] = useCreateRefundRecordMutation();\n const [processRefundMutation, { loading: isProcessing }] = useProcessRefundMutation();\n const [skipRefundMutation, { loading: isSkipping }] = useSkipRefundMutation();\n const [retryRefundMutation, { loading: isRetrying }] = useRetryRefundMutation();\n const [createFromWebhooksMutation, { loading: isCreatingFromWebhooks }] =\n useCreateRefundRecordsFromFailedWebhooksMutation();\n const [createFromWebhookMutation, { loading: isCreatingFromWebhook }] =\n useCreateRefundRecordFromWebhookMutation();\n\n const refetchQueries = useCallback(async () => {\n await client.refetchQueries({\n include: [GetRefundRecordsDocument, GetPendingRefundsDocument, GetRefundStatsDocument],\n });\n }, [client]);\n\n const createRefundRecord = useCallback(\n async (input: CreateRefundRecordInput): Promise<RefundRecord> => {\n const { data } = await createRefundRecordMutation({\n variables: input,\n });\n await refetchQueries();\n return data.createRefundRecord;\n },\n [createRefundRecordMutation, refetchQueries]\n );\n\n const processRefund = useCallback(\n async (id: string, notes?: string): Promise<ProcessRefundResult> => {\n const { data } = await processRefundMutation({\n variables: { id, notes },\n });\n await refetchQueries();\n return data.processRefund;\n },\n [processRefundMutation, refetchQueries]\n );\n\n const skipRefund = useCallback(\n async (id: string, reason: string): Promise<RefundRecord> => {\n const { data } = await skipRefundMutation({\n variables: { id, reason },\n });\n await refetchQueries();\n return data.skipRefund;\n },\n [skipRefundMutation, refetchQueries]\n );\n\n const retryRefund = useCallback(\n async (id: string): Promise<ProcessRefundResult> => {\n const { data } = await retryRefundMutation({\n variables: { id },\n });\n await refetchQueries();\n return data.retryRefund;\n },\n [retryRefundMutation, refetchQueries]\n );\n\n const createRefundRecordsFromFailedWebhooks = useCallback(async (): Promise<RefundRecord[]> => {\n const { data } = await createFromWebhooksMutation();\n await client.refetchQueries({\n include: [\n GetRefundRecordsDocument,\n GetPendingRefundsDocument,\n GetRefundStatsDocument,\n GetUnprocessedFailedWebhooksDocument,\n ],\n });\n return data!.createRefundRecordsFromFailedWebhooks;\n }, [createFromWebhooksMutation, client]);\n\n const createRefundRecordFromWebhook = useCallback(\n async (webhookLogId: string): Promise<RefundRecord | null> => {\n const { data } = await createFromWebhookMutation({\n variables: { webhookLogId },\n });\n await client.refetchQueries({\n include: [\n GetRefundRecordsDocument,\n GetPendingRefundsDocument,\n GetRefundStatsDocument,\n GetUnprocessedFailedWebhooksDocument,\n ],\n });\n return data!.createRefundRecordFromWebhook;\n },\n [createFromWebhookMutation, client]\n );\n\n return {\n createRefundRecord,\n processRefund,\n skipRefund,\n retryRefund,\n createRefundRecordsFromFailedWebhooks,\n createRefundRecordFromWebhook,\n isCreating,\n isProcessing,\n isSkipping,\n isRetrying,\n isCreatingFromWebhooks,\n isCreatingFromWebhook,\n };\n}\n\n/**\n * Combined hook for refund page with all data and mutations\n */\nexport function useRefunds(options: UseRefundRecordsOptions = {}) {\n const recordsHook = useRefundRecords(options);\n const statsHook = useRefundStats();\n const mutationsHook = useRefundMutations();\n const webhooksHook = useUnprocessedFailedWebhooks();\n\n const isLoading = useMemo(\n () => recordsHook.isLoading || statsHook.isLoading,\n [recordsHook.isLoading, statsHook.isLoading]\n );\n\n const refetchAll = useCallback(async () => {\n await Promise.all([recordsHook.refetch(), statsHook.refetch(), webhooksHook.refetch()]);\n // eslint-disable-next-line react-hooks/exhaustive-deps -- Intentional: accessing stable refetch methods from hooks\n }, [recordsHook.refetch, statsHook.refetch, webhooksHook.refetch]);\n\n return {\n // Records\n records: recordsHook.records,\n pagination: recordsHook.pagination,\n goToNextPage: recordsHook.goToNextPage,\n goToPreviousPage: recordsHook.goToPreviousPage,\n goToPage: recordsHook.goToPage,\n setFilters: recordsHook.setFilters,\n\n // Stats\n stats: statsHook.stats,\n\n // Failed webhooks\n unprocessedWebhooks: webhooksHook.webhooks,\n webhooksLoading: webhooksHook.isLoading,\n\n // Loading states\n isLoading,\n recordsError: recordsHook.error,\n statsError: statsHook.error,\n\n // Mutations\n ...mutationsHook,\n\n // Refetch\n refetch: refetchAll,\n refetchRecords: recordsHook.refetch,\n refetchStats: statsHook.refetch,\n refetchWebhooks: webhooksHook.refetch,\n };\n}\n"],"mappings":";;;;AAuLA,IAAM,IAAoB;AAK1B,SAAgB,EAAiB,IAAmC,EAAE,EAA0B;CAC9F,IAAM,IAAW,EAAQ,YAAY,GAC/B,CAAC,GAAa,KAAkB,EAAS,EAAE,EAC3C,CAAC,GAAS,KAAc,EAA8B,EAAQ,WAAW,EAAE,CAAC;AAGlF,SAAgB;AAEd,EADA,EAAW,EAAQ,WAAW,EAAE,CAAC,EACjC,EAAe,EAAE;IAChB,CAAC,EAAQ,QAAQ,CAAC;CAErB,IAAM,EAAE,SAAM,YAAS,UAAO,eAAY,EAAyB;EACjE,WAAW;GACT,GAAG;GACH,MAAM;GACN;GACD;EACD,aAAa;EACd,CAAC,EAEI,IAAgB,EAAY,YAAY;AAC5C,QAAM,GAAS;IACd,CAAC,EAAQ,CAAC,EAEP,IAAS,GAAM,kBAEf,IAAe,QAAkB;AACrC,EAAI,GAAQ,WACV,GAAgB,MAAS,IAAO,EAAE;IAEnC,CAAC,GAAQ,QAAQ,CAAC,EAEf,IAAmB,QAAkB;AACzC,EAAI,IAAc,KAChB,GAAgB,MAAS,IAAO,EAAE;IAEnC,CAAC,EAAY,CAAC,EAEX,IAAW,GACd,MAAiB;EAChB,IAAM,IAAa,IAAS,KAAK,KAAK,EAAO,aAAa,EAAS,GAAG;AACtE,EAAI,KAAQ,KAAK,IAAO,K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H,SAAgB,EAAW,IAAmC,EAAE,EAAE;CAChE,IAAM,IAAc,EAAiB,EAAQ,EACvC,IAAY,GAAgB,EAC5B,IAAgB,GAAoB,EACpC,IAAe,GAA8B,EAE7C,IAAY,QACV,EAAY,aAAa,EAAU,WACzC,CAAC,EAAY,WAAW,EAAU,UAAU,CAC7C,EAEK,IAAa,EAAY,YAAY;AACzC,QAAM,QAAQ,IAAI;GAAC,EAAY,SAAS;GAAE,EAAU,SAAS;GAAE,EAAa,SAAS;GAAC,CAAC;IAEtF;EAAC,EAAY;EAAS,EAAU;EAAS,EAAa;EAAQ,CAAC;AAElE,QAAO;EAEL,SAAS,EAAY;EACrB,YAAY,EAAY;EACxB,cAAc,EAAY;EAC1B,kBAAkB,EAAY;EAC9B,UAAU,EAAY;EACtB,YAAY,EAAY;EAGxB,OAAO,EAAU;EAGjB,qBAAqB,EAAa;EAClC,iBAAiB,EAAa;EAG9B;EACA,cAAc,EAAY;EAC1B,YAAY,EAAU;EAGtB,GAAG;EAGH,SAAS;EACT,gBAAgB,EAAY;EAC5B,cAAc,EAAU;EACxB,iBAAiB,EAAa;EAC/B"}
@@ -0,0 +1,41 @@
1
+ import { Transaction } from '../../../shared/types';
2
+
3
+ interface BillingAccountInfo {
4
+ id: string;
5
+ name: string;
6
+ email: string;
7
+ billingEmail: string | null;
8
+ currency: string;
9
+ creditAmount: number;
10
+ isActive: boolean;
11
+ taxId: string | null;
12
+ createdAt: string;
13
+ }
14
+ interface PaginationInfo {
15
+ totalCount: number;
16
+ hasMore: boolean;
17
+ page: number;
18
+ pageSize: number;
19
+ hasPrevious: boolean;
20
+ }
21
+ interface UseTransactionsOptions {
22
+ pageSize?: number;
23
+ }
24
+ interface UseTransactionsResult {
25
+ billingAccount: BillingAccountInfo | null;
26
+ transactions: Transaction[];
27
+ pagination: PaginationInfo;
28
+ isLoading: boolean;
29
+ error: Error | undefined;
30
+ refetch: () => Promise<void>;
31
+ goToNextPage: () => void;
32
+ goToPreviousPage: () => void;
33
+ goToPage: (page: number) => void;
34
+ }
35
+ /**
36
+ * Hook for fetching paginated transactions for a billing account
37
+ * Uses the optimized getTransactionsByBillingAccount query
38
+ */
39
+ export declare function useTransactions(billingAccountId: string | undefined, options?: UseTransactionsOptions): UseTransactionsResult;
40
+ export {};
41
+ //# sourceMappingURL=useTransactions.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useTransactions.d.ts","sourceRoot":"","sources":["../../../../../src/billing/modules/billing/hooks/useTransactions.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAEzD,UAAU,kBAAkB;IAC1B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,QAAQ,EAAE,MAAM,CAAC;IACjB,YAAY,EAAE,MAAM,CAAC;IACrB,QAAQ,EAAE,OAAO,CAAC;IAClB,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,UAAU,cAAc;IACtB,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,OAAO,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,OAAO,CAAC;CACtB;AAED,UAAU,sBAAsB;IAC9B,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,UAAU,qBAAqB;IAC7B,cAAc,EAAE,kBAAkB,GAAG,IAAI,CAAC;IAC1C,YAAY,EAAE,WAAW,EAAE,CAAC;IAC5B,UAAU,EAAE,cAAc,CAAC;IAC3B,SAAS,EAAE,OAAO,CAAC;IACnB,KAAK,EAAE,KAAK,GAAG,SAAS,CAAC;IACzB,OAAO,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IAC7B,YAAY,E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