@voyant-travel/finance-react 0.119.5

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 (517) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +75 -0
  3. package/dist/admin/booking-invoices-widget.d.ts +19 -0
  4. package/dist/admin/booking-invoices-widget.d.ts.map +1 -0
  5. package/dist/admin/booking-invoices-widget.js +204 -0
  6. package/dist/admin/booking-payment-policy-widget.d.ts +21 -0
  7. package/dist/admin/booking-payment-policy-widget.d.ts.map +1 -0
  8. package/dist/admin/booking-payment-policy-widget.js +128 -0
  9. package/dist/admin/booking-pending-payment-sessions-widget.d.ts +24 -0
  10. package/dist/admin/booking-pending-payment-sessions-widget.d.ts.map +1 -0
  11. package/dist/admin/booking-pending-payment-sessions-widget.js +139 -0
  12. package/dist/admin/credit-note-dialog.d.ts +9 -0
  13. package/dist/admin/credit-note-dialog.d.ts.map +1 -0
  14. package/dist/admin/credit-note-dialog.js +70 -0
  15. package/dist/admin/finance-shared.d.ts +7 -0
  16. package/dist/admin/finance-shared.d.ts.map +1 -0
  17. package/dist/admin/finance-shared.js +30 -0
  18. package/dist/admin/index.d.ts +99 -0
  19. package/dist/admin/index.d.ts.map +1 -0
  20. package/dist/admin/index.js +286 -0
  21. package/dist/admin/invoice-detail-host.d.ts +19 -0
  22. package/dist/admin/invoice-detail-host.d.ts.map +1 -0
  23. package/dist/admin/invoice-detail-host.js +147 -0
  24. package/dist/admin/invoice-detail-sections.d.ts +31 -0
  25. package/dist/admin/invoice-detail-sections.d.ts.map +1 -0
  26. package/dist/admin/invoice-detail-sections.js +109 -0
  27. package/dist/admin/invoice-detail-skeleton.d.ts +11 -0
  28. package/dist/admin/invoice-detail-skeleton.d.ts.map +1 -0
  29. package/dist/admin/invoice-detail-skeleton.js +33 -0
  30. package/dist/admin/line-item-dialog.d.ts +10 -0
  31. package/dist/admin/line-item-dialog.d.ts.map +1 -0
  32. package/dist/admin/line-item-dialog.js +91 -0
  33. package/dist/admin/pages/invoice-detail.d.ts +8 -0
  34. package/dist/admin/pages/invoice-detail.d.ts.map +1 -0
  35. package/dist/admin/pages/invoice-detail.js +11 -0
  36. package/dist/admin/pages/invoices-index.d.ts +8 -0
  37. package/dist/admin/pages/invoices-index.d.ts.map +1 -0
  38. package/dist/admin/pages/invoices-index.js +14 -0
  39. package/dist/admin/pages/payment-detail.d.ts +8 -0
  40. package/dist/admin/pages/payment-detail.d.ts.map +1 -0
  41. package/dist/admin/pages/payment-detail.js +11 -0
  42. package/dist/admin/pages/payments-index.d.ts +9 -0
  43. package/dist/admin/pages/payments-index.d.ts.map +1 -0
  44. package/dist/admin/pages/payments-index.js +21 -0
  45. package/dist/admin/pages/profitability.d.ts +10 -0
  46. package/dist/admin/pages/profitability.d.ts.map +1 -0
  47. package/dist/admin/pages/profitability.js +32 -0
  48. package/dist/admin/pages/supplier-invoice-detail.d.ts +20 -0
  49. package/dist/admin/pages/supplier-invoice-detail.d.ts.map +1 -0
  50. package/dist/admin/pages/supplier-invoice-detail.js +102 -0
  51. package/dist/admin/pages/supplier-invoices-index.d.ts +9 -0
  52. package/dist/admin/pages/supplier-invoices-index.d.ts.map +1 -0
  53. package/dist/admin/pages/supplier-invoices-index.js +16 -0
  54. package/dist/admin/payment-detail-host.d.ts +12 -0
  55. package/dist/admin/payment-detail-host.d.ts.map +1 -0
  56. package/dist/admin/payment-detail-host.js +108 -0
  57. package/dist/admin/payment-detail-skeleton.d.ts +8 -0
  58. package/dist/admin/payment-detail-skeleton.d.ts.map +1 -0
  59. package/dist/admin/payment-detail-skeleton.js +15 -0
  60. package/dist/admin/payment-dialog.d.ts +9 -0
  61. package/dist/admin/payment-dialog.d.ts.map +1 -0
  62. package/dist/admin/payment-dialog.js +99 -0
  63. package/dist/admin/record-payment-dialog.d.ts +16 -0
  64. package/dist/admin/record-payment-dialog.d.ts.map +1 -0
  65. package/dist/admin/record-payment-dialog.js +219 -0
  66. package/dist/admin/supplier-payment-policy-widget.d.ts +18 -0
  67. package/dist/admin/supplier-payment-policy-widget.d.ts.map +1 -0
  68. package/dist/admin/supplier-payment-policy-widget.js +31 -0
  69. package/dist/admin/use-supplier-picker.d.ts +19 -0
  70. package/dist/admin/use-supplier-picker.d.ts.map +1 -0
  71. package/dist/admin/use-supplier-picker.js +30 -0
  72. package/dist/checkout-components/collect-payment-dialog.d.ts +45 -0
  73. package/dist/checkout-components/collect-payment-dialog.d.ts.map +1 -0
  74. package/dist/checkout-components/collect-payment-dialog.js +121 -0
  75. package/dist/checkout-components/payment-link-landing-page.d.ts +76 -0
  76. package/dist/checkout-components/payment-link-landing-page.d.ts.map +1 -0
  77. package/dist/checkout-components/payment-link-landing-page.js +173 -0
  78. package/dist/checkout-components/payment-step.d.ts +42 -0
  79. package/dist/checkout-components/payment-step.d.ts.map +1 -0
  80. package/dist/checkout-components/payment-step.js +113 -0
  81. package/dist/checkout-hooks/index.d.ts +5 -0
  82. package/dist/checkout-hooks/index.d.ts.map +1 -0
  83. package/dist/checkout-hooks/index.js +4 -0
  84. package/dist/checkout-hooks/use-checkout-payment-link-config.d.ts +20 -0
  85. package/dist/checkout-hooks/use-checkout-payment-link-config.d.ts.map +1 -0
  86. package/dist/checkout-hooks/use-checkout-payment-link-config.js +26 -0
  87. package/dist/checkout-hooks/use-collect-payment.d.ts +227 -0
  88. package/dist/checkout-hooks/use-collect-payment.d.ts.map +1 -0
  89. package/dist/checkout-hooks/use-collect-payment.js +80 -0
  90. package/dist/checkout-hooks/use-initiate-checkout-collection.d.ts +308 -0
  91. package/dist/checkout-hooks/use-initiate-checkout-collection.d.ts.map +1 -0
  92. package/dist/checkout-hooks/use-initiate-checkout-collection.js +35 -0
  93. package/dist/checkout-hooks/use-preview-checkout-collection.d.ts +65 -0
  94. package/dist/checkout-hooks/use-preview-checkout-collection.d.ts.map +1 -0
  95. package/dist/checkout-hooks/use-preview-checkout-collection.js +27 -0
  96. package/dist/checkout-i18n/en.d.ts +3 -0
  97. package/dist/checkout-i18n/en.d.ts.map +1 -0
  98. package/dist/checkout-i18n/en.js +127 -0
  99. package/dist/checkout-i18n/index.d.ts +5 -0
  100. package/dist/checkout-i18n/index.d.ts.map +1 -0
  101. package/dist/checkout-i18n/index.js +3 -0
  102. package/dist/checkout-i18n/messages.d.ts +121 -0
  103. package/dist/checkout-i18n/messages.d.ts.map +1 -0
  104. package/dist/checkout-i18n/messages.js +1 -0
  105. package/dist/checkout-i18n/provider.d.ts +26 -0
  106. package/dist/checkout-i18n/provider.d.ts.map +1 -0
  107. package/dist/checkout-i18n/provider.js +41 -0
  108. package/dist/checkout-i18n/ro.d.ts +3 -0
  109. package/dist/checkout-i18n/ro.d.ts.map +1 -0
  110. package/dist/checkout-i18n/ro.js +127 -0
  111. package/dist/checkout-types.d.ts +53 -0
  112. package/dist/checkout-types.d.ts.map +1 -0
  113. package/dist/checkout-types.js +1 -0
  114. package/dist/checkout-ui.d.ts +7 -0
  115. package/dist/checkout-ui.d.ts.map +1 -0
  116. package/dist/checkout-ui.js +4 -0
  117. package/dist/checkout.d.ts +5 -0
  118. package/dist/checkout.d.ts.map +1 -0
  119. package/dist/checkout.js +3 -0
  120. package/dist/client.d.ts +16 -0
  121. package/dist/client.d.ts.map +1 -0
  122. package/dist/client.js +79 -0
  123. package/dist/components/accountant-portal/body.d.ts +8 -0
  124. package/dist/components/accountant-portal/body.d.ts.map +1 -0
  125. package/dist/components/accountant-portal/body.js +114 -0
  126. package/dist/components/accountant-portal/widgets.d.ts +13 -0
  127. package/dist/components/accountant-portal/widgets.d.ts.map +1 -0
  128. package/dist/components/accountant-portal/widgets.js +27 -0
  129. package/dist/components/accountant-portal.d.ts +10 -0
  130. package/dist/components/accountant-portal.d.ts.map +1 -0
  131. package/dist/components/accountant-portal.js +22 -0
  132. package/dist/components/accountant-share-dialog.d.ts +6 -0
  133. package/dist/components/accountant-share-dialog.d.ts.map +1 -0
  134. package/dist/components/accountant-share-dialog.js +53 -0
  135. package/dist/components/async-combobox.d.ts +33 -0
  136. package/dist/components/async-combobox.d.ts.map +1 -0
  137. package/dist/components/async-combobox.js +100 -0
  138. package/dist/components/booking-invoice-dialog.d.ts +63 -0
  139. package/dist/components/booking-invoice-dialog.d.ts.map +1 -0
  140. package/dist/components/booking-invoice-dialog.js +383 -0
  141. package/dist/components/cost-categories-page.d.ts +5 -0
  142. package/dist/components/cost-categories-page.d.ts.map +1 -0
  143. package/dist/components/cost-categories-page.js +30 -0
  144. package/dist/components/invoice-action-ledger-card.d.ts +15 -0
  145. package/dist/components/invoice-action-ledger-card.d.ts.map +1 -0
  146. package/dist/components/invoice-action-ledger-card.js +76 -0
  147. package/dist/components/invoice-bulk-actions.d.ts +10 -0
  148. package/dist/components/invoice-bulk-actions.d.ts.map +1 -0
  149. package/dist/components/invoice-bulk-actions.js +19 -0
  150. package/dist/components/invoice-detail-page/cards.d.ts +44 -0
  151. package/dist/components/invoice-detail-page/cards.d.ts.map +1 -0
  152. package/dist/components/invoice-detail-page/cards.js +43 -0
  153. package/dist/components/invoice-detail-page/header.d.ts +15 -0
  154. package/dist/components/invoice-detail-page/header.d.ts.map +1 -0
  155. package/dist/components/invoice-detail-page/header.js +30 -0
  156. package/dist/components/invoice-detail-page/notes-dialogs.d.ts +28 -0
  157. package/dist/components/invoice-detail-page/notes-dialogs.d.ts.map +1 -0
  158. package/dist/components/invoice-detail-page/notes-dialogs.js +104 -0
  159. package/dist/components/invoice-detail-page/primitives.d.ts +47 -0
  160. package/dist/components/invoice-detail-page/primitives.d.ts.map +1 -0
  161. package/dist/components/invoice-detail-page/primitives.js +76 -0
  162. package/dist/components/invoice-detail-page-with-action-ledger.d.ts +7 -0
  163. package/dist/components/invoice-detail-page-with-action-ledger.d.ts.map +1 -0
  164. package/dist/components/invoice-detail-page-with-action-ledger.js +11 -0
  165. package/dist/components/invoice-detail-page.d.ts +46 -0
  166. package/dist/components/invoice-detail-page.d.ts.map +1 -0
  167. package/dist/components/invoice-detail-page.js +134 -0
  168. package/dist/components/invoice-dialog.d.ts +9 -0
  169. package/dist/components/invoice-dialog.d.ts.map +1 -0
  170. package/dist/components/invoice-dialog.js +145 -0
  171. package/dist/components/invoice-number-series-dialog.d.ts +9 -0
  172. package/dist/components/invoice-number-series-dialog.d.ts.map +1 -0
  173. package/dist/components/invoice-number-series-dialog.js +134 -0
  174. package/dist/components/invoice-number-series-format.d.ts +3 -0
  175. package/dist/components/invoice-number-series-format.d.ts.map +1 -0
  176. package/dist/components/invoice-number-series-format.js +4 -0
  177. package/dist/components/invoice-number-series-page.d.ts +5 -0
  178. package/dist/components/invoice-number-series-page.d.ts.map +1 -0
  179. package/dist/components/invoice-number-series-page.js +55 -0
  180. package/dist/components/invoice-table-parts.d.ts +25 -0
  181. package/dist/components/invoice-table-parts.d.ts.map +1 -0
  182. package/dist/components/invoice-table-parts.js +32 -0
  183. package/dist/components/invoices-page-skeleton.d.ts +5 -0
  184. package/dist/components/invoices-page-skeleton.d.ts.map +1 -0
  185. package/dist/components/invoices-page-skeleton.js +13 -0
  186. package/dist/components/invoices-page.d.ts +6 -0
  187. package/dist/components/invoices-page.d.ts.map +1 -0
  188. package/dist/components/invoices-page.js +145 -0
  189. package/dist/components/payment-detail-page.d.ts +47 -0
  190. package/dist/components/payment-detail-page.d.ts.map +1 -0
  191. package/dist/components/payment-detail-page.js +90 -0
  192. package/dist/components/payment-policy-form.d.ts +49 -0
  193. package/dist/components/payment-policy-form.d.ts.map +1 -0
  194. package/dist/components/payment-policy-form.js +82 -0
  195. package/dist/components/payments-page/controls.d.ts +23 -0
  196. package/dist/components/payments-page/controls.d.ts.map +1 -0
  197. package/dist/components/payments-page/controls.js +20 -0
  198. package/dist/components/payments-page-skeleton.d.ts +5 -0
  199. package/dist/components/payments-page-skeleton.d.ts.map +1 -0
  200. package/dist/components/payments-page-skeleton.js +13 -0
  201. package/dist/components/payments-page.d.ts +20 -0
  202. package/dist/components/payments-page.d.ts.map +1 -0
  203. package/dist/components/payments-page.js +143 -0
  204. package/dist/components/profitability-page/sections.d.ts +24 -0
  205. package/dist/components/profitability-page/sections.d.ts.map +1 -0
  206. package/dist/components/profitability-page/sections.js +43 -0
  207. package/dist/components/profitability-page.d.ts +13 -0
  208. package/dist/components/profitability-page.d.ts.map +1 -0
  209. package/dist/components/profitability-page.js +175 -0
  210. package/dist/components/record-booking-payment-dialog/shared.d.ts +54 -0
  211. package/dist/components/record-booking-payment-dialog/shared.d.ts.map +1 -0
  212. package/dist/components/record-booking-payment-dialog/shared.js +47 -0
  213. package/dist/components/record-booking-payment-dialog.d.ts +4 -0
  214. package/dist/components/record-booking-payment-dialog.d.ts.map +1 -0
  215. package/dist/components/record-booking-payment-dialog.js +256 -0
  216. package/dist/components/supplier-invoice-detail-page/dialogs.d.ts +34 -0
  217. package/dist/components/supplier-invoice-detail-page/dialogs.d.ts.map +1 -0
  218. package/dist/components/supplier-invoice-detail-page/dialogs.js +119 -0
  219. package/dist/components/supplier-invoice-detail-page/shared.d.ts +64 -0
  220. package/dist/components/supplier-invoice-detail-page/shared.d.ts.map +1 -0
  221. package/dist/components/supplier-invoice-detail-page/shared.js +70 -0
  222. package/dist/components/supplier-invoice-detail-page.d.ts +4 -0
  223. package/dist/components/supplier-invoice-detail-page.d.ts.map +1 -0
  224. package/dist/components/supplier-invoice-detail-page.js +101 -0
  225. package/dist/components/supplier-invoice-form-dialog.d.ts +45 -0
  226. package/dist/components/supplier-invoice-form-dialog.d.ts.map +1 -0
  227. package/dist/components/supplier-invoice-form-dialog.js +102 -0
  228. package/dist/components/supplier-invoices-page.d.ts +14 -0
  229. package/dist/components/supplier-invoices-page.d.ts.map +1 -0
  230. package/dist/components/supplier-invoices-page.js +69 -0
  231. package/dist/components/supplier-payment-dialog.d.ts +7 -0
  232. package/dist/components/supplier-payment-dialog.d.ts.map +1 -0
  233. package/dist/components/supplier-payment-dialog.js +103 -0
  234. package/dist/components/taxes-page/policy-profile-sheet.d.ts +8 -0
  235. package/dist/components/taxes-page/policy-profile-sheet.d.ts.map +1 -0
  236. package/dist/components/taxes-page/policy-profile-sheet.js +52 -0
  237. package/dist/components/taxes-page/policy-rule-sheet.d.ts +10 -0
  238. package/dist/components/taxes-page/policy-rule-sheet.d.ts.map +1 -0
  239. package/dist/components/taxes-page/policy-rule-sheet.js +137 -0
  240. package/dist/components/taxes-page/shared.d.ts +128 -0
  241. package/dist/components/taxes-page/shared.d.ts.map +1 -0
  242. package/dist/components/taxes-page/shared.js +288 -0
  243. package/dist/components/taxes-page/sheets.d.ts +4 -0
  244. package/dist/components/taxes-page/sheets.d.ts.map +1 -0
  245. package/dist/components/taxes-page/sheets.js +3 -0
  246. package/dist/components/taxes-page/tax-sheet.d.ts +9 -0
  247. package/dist/components/taxes-page/tax-sheet.d.ts.map +1 -0
  248. package/dist/components/taxes-page/tax-sheet.js +108 -0
  249. package/dist/components/taxes-page.d.ts +4 -0
  250. package/dist/components/taxes-page.d.ts.map +1 -0
  251. package/dist/components/taxes-page.js +165 -0
  252. package/dist/hooks/index.d.ts +53 -0
  253. package/dist/hooks/index.d.ts.map +1 -0
  254. package/dist/hooks/index.js +52 -0
  255. package/dist/hooks/use-accountant-share-mutation.d.ts +20 -0
  256. package/dist/hooks/use-accountant-share-mutation.d.ts.map +1 -0
  257. package/dist/hooks/use-accountant-share-mutation.js +27 -0
  258. package/dist/hooks/use-accountant-shares.d.ts +13 -0
  259. package/dist/hooks/use-accountant-shares.d.ts.map +1 -0
  260. package/dist/hooks/use-accountant-shares.js +8 -0
  261. package/dist/hooks/use-admin-booking-payments.d.ts +30 -0
  262. package/dist/hooks/use-admin-booking-payments.d.ts.map +1 -0
  263. package/dist/hooks/use-admin-booking-payments.js +18 -0
  264. package/dist/hooks/use-all-payments.d.ts +35 -0
  265. package/dist/hooks/use-all-payments.d.ts.map +1 -0
  266. package/dist/hooks/use-all-payments.js +12 -0
  267. package/dist/hooks/use-booking-guarantees.d.ts +82 -0
  268. package/dist/hooks/use-booking-guarantees.d.ts.map +1 -0
  269. package/dist/hooks/use-booking-guarantees.js +46 -0
  270. package/dist/hooks/use-booking-payment-schedule-regenerate-mutation.d.ts +44 -0
  271. package/dist/hooks/use-booking-payment-schedule-regenerate-mutation.d.ts.map +1 -0
  272. package/dist/hooks/use-booking-payment-schedule-regenerate-mutation.js +27 -0
  273. package/dist/hooks/use-booking-payment-schedules.d.ts +63 -0
  274. package/dist/hooks/use-booking-payment-schedules.d.ts.map +1 -0
  275. package/dist/hooks/use-booking-payment-schedules.js +47 -0
  276. package/dist/hooks/use-cost-categories.d.ts +14 -0
  277. package/dist/hooks/use-cost-categories.d.ts.map +1 -0
  278. package/dist/hooks/use-cost-categories.js +9 -0
  279. package/dist/hooks/use-cost-category-mutation.d.ts +31 -0
  280. package/dist/hooks/use-cost-category-mutation.d.ts.map +1 -0
  281. package/dist/hooks/use-cost-category-mutation.js +27 -0
  282. package/dist/hooks/use-departure-profitability.d.ts +56 -0
  283. package/dist/hooks/use-departure-profitability.d.ts.map +1 -0
  284. package/dist/hooks/use-departure-profitability.js +12 -0
  285. package/dist/hooks/use-finance-action-ledger.d.ts +94 -0
  286. package/dist/hooks/use-finance-action-ledger.d.ts.map +1 -0
  287. package/dist/hooks/use-finance-action-ledger.js +20 -0
  288. package/dist/hooks/use-invoice-attachment-mutation.d.ts +43 -0
  289. package/dist/hooks/use-invoice-attachment-mutation.d.ts.map +1 -0
  290. package/dist/hooks/use-invoice-attachment-mutation.js +39 -0
  291. package/dist/hooks/use-invoice-attachments.d.ts +18 -0
  292. package/dist/hooks/use-invoice-attachments.d.ts.map +1 -0
  293. package/dist/hooks/use-invoice-attachments.js +12 -0
  294. package/dist/hooks/use-invoice-bulk-status-mutation.d.ts +51 -0
  295. package/dist/hooks/use-invoice-bulk-status-mutation.d.ts.map +1 -0
  296. package/dist/hooks/use-invoice-bulk-status-mutation.js +66 -0
  297. package/dist/hooks/use-invoice-credit-note-mutation.d.ts +38 -0
  298. package/dist/hooks/use-invoice-credit-note-mutation.d.ts.map +1 -0
  299. package/dist/hooks/use-invoice-credit-note-mutation.js +35 -0
  300. package/dist/hooks/use-invoice-credit-notes.d.ts +17 -0
  301. package/dist/hooks/use-invoice-credit-notes.d.ts.map +1 -0
  302. package/dist/hooks/use-invoice-credit-notes.js +12 -0
  303. package/dist/hooks/use-invoice-fx-rate.d.ts +19 -0
  304. package/dist/hooks/use-invoice-fx-rate.d.ts.map +1 -0
  305. package/dist/hooks/use-invoice-fx-rate.js +13 -0
  306. package/dist/hooks/use-invoice-line-item-mutation.d.ts +40 -0
  307. package/dist/hooks/use-invoice-line-item-mutation.d.ts.map +1 -0
  308. package/dist/hooks/use-invoice-line-item-mutation.js +42 -0
  309. package/dist/hooks/use-invoice-line-items.d.ts +17 -0
  310. package/dist/hooks/use-invoice-line-items.d.ts.map +1 -0
  311. package/dist/hooks/use-invoice-line-items.js +12 -0
  312. package/dist/hooks/use-invoice-mutation.d.ts +225 -0
  313. package/dist/hooks/use-invoice-mutation.d.ts.map +1 -0
  314. package/dist/hooks/use-invoice-mutation.js +121 -0
  315. package/dist/hooks/use-invoice-note-mutation.d.ts +11 -0
  316. package/dist/hooks/use-invoice-note-mutation.d.ts.map +1 -0
  317. package/dist/hooks/use-invoice-note-mutation.js +23 -0
  318. package/dist/hooks/use-invoice-notes.d.ts +13 -0
  319. package/dist/hooks/use-invoice-notes.d.ts.map +1 -0
  320. package/dist/hooks/use-invoice-notes.js +12 -0
  321. package/dist/hooks/use-invoice-number-series-mutation.d.ts +62 -0
  322. package/dist/hooks/use-invoice-number-series-mutation.d.ts.map +1 -0
  323. package/dist/hooks/use-invoice-number-series-mutation.js +39 -0
  324. package/dist/hooks/use-invoice-number-series.d.ts +28 -0
  325. package/dist/hooks/use-invoice-number-series.d.ts.map +1 -0
  326. package/dist/hooks/use-invoice-number-series.js +12 -0
  327. package/dist/hooks/use-invoice-payment-mutation.d.ts +29 -0
  328. package/dist/hooks/use-invoice-payment-mutation.d.ts.map +1 -0
  329. package/dist/hooks/use-invoice-payment-mutation.js +35 -0
  330. package/dist/hooks/use-invoice-payments.d.ts +21 -0
  331. package/dist/hooks/use-invoice-payments.d.ts.map +1 -0
  332. package/dist/hooks/use-invoice-payments.js +12 -0
  333. package/dist/hooks/use-invoice.d.ts +32 -0
  334. package/dist/hooks/use-invoice.d.ts.map +1 -0
  335. package/dist/hooks/use-invoice.js +12 -0
  336. package/dist/hooks/use-invoices.d.ts +36 -0
  337. package/dist/hooks/use-invoices.d.ts.map +1 -0
  338. package/dist/hooks/use-invoices.js +12 -0
  339. package/dist/hooks/use-payment-mutation.d.ts +57 -0
  340. package/dist/hooks/use-payment-mutation.d.ts.map +1 -0
  341. package/dist/hooks/use-payment-mutation.js +59 -0
  342. package/dist/hooks/use-payment-session-mutation.d.ts +205 -0
  343. package/dist/hooks/use-payment-session-mutation.d.ts.map +1 -0
  344. package/dist/hooks/use-payment-session-mutation.js +38 -0
  345. package/dist/hooks/use-payment-sessions.d.ts +97 -0
  346. package/dist/hooks/use-payment-sessions.d.ts.map +1 -0
  347. package/dist/hooks/use-payment-sessions.js +17 -0
  348. package/dist/hooks/use-payment.d.ts +31 -0
  349. package/dist/hooks/use-payment.d.ts.map +1 -0
  350. package/dist/hooks/use-payment.js +12 -0
  351. package/dist/hooks/use-product-profitability.d.ts +52 -0
  352. package/dist/hooks/use-product-profitability.d.ts.map +1 -0
  353. package/dist/hooks/use-product-profitability.js +12 -0
  354. package/dist/hooks/use-public-booking-documents.d.ts +29 -0
  355. package/dist/hooks/use-public-booking-documents.d.ts.map +1 -0
  356. package/dist/hooks/use-public-booking-documents.js +12 -0
  357. package/dist/hooks/use-public-booking-payment-options.d.ts +47 -0
  358. package/dist/hooks/use-public-booking-payment-options.d.ts.map +1 -0
  359. package/dist/hooks/use-public-booking-payment-options.js +12 -0
  360. package/dist/hooks/use-public-booking-payments.d.ts +24 -0
  361. package/dist/hooks/use-public-booking-payments.d.ts.map +1 -0
  362. package/dist/hooks/use-public-booking-payments.js +12 -0
  363. package/dist/hooks/use-public-finance-document-by-reference.d.ts +27 -0
  364. package/dist/hooks/use-public-finance-document-by-reference.d.ts.map +1 -0
  365. package/dist/hooks/use-public-finance-document-by-reference.js +12 -0
  366. package/dist/hooks/use-public-payment-session-mutation.d.ts +82 -0
  367. package/dist/hooks/use-public-payment-session-mutation.d.ts.map +1 -0
  368. package/dist/hooks/use-public-payment-session-mutation.js +33 -0
  369. package/dist/hooks/use-public-payment-session.d.ts +73 -0
  370. package/dist/hooks/use-public-payment-session.d.ts.map +1 -0
  371. package/dist/hooks/use-public-payment-session.js +12 -0
  372. package/dist/hooks/use-public-voucher-validation-mutation.d.ts +23 -0
  373. package/dist/hooks/use-public-voucher-validation-mutation.d.ts.map +1 -0
  374. package/dist/hooks/use-public-voucher-validation-mutation.js +17 -0
  375. package/dist/hooks/use-supplier-invoice-attachments.d.ts +17 -0
  376. package/dist/hooks/use-supplier-invoice-attachments.d.ts.map +1 -0
  377. package/dist/hooks/use-supplier-invoice-attachments.js +12 -0
  378. package/dist/hooks/use-supplier-invoice-mutation.d.ts +353 -0
  379. package/dist/hooks/use-supplier-invoice-mutation.d.ts.map +1 -0
  380. package/dist/hooks/use-supplier-invoice-mutation.js +81 -0
  381. package/dist/hooks/use-supplier-invoice-payments.d.ts +26 -0
  382. package/dist/hooks/use-supplier-invoice-payments.d.ts.map +1 -0
  383. package/dist/hooks/use-supplier-invoice-payments.js +12 -0
  384. package/dist/hooks/use-supplier-invoice.d.ts +65 -0
  385. package/dist/hooks/use-supplier-invoice.d.ts.map +1 -0
  386. package/dist/hooks/use-supplier-invoice.js +12 -0
  387. package/dist/hooks/use-supplier-invoices.d.ts +36 -0
  388. package/dist/hooks/use-supplier-invoices.d.ts.map +1 -0
  389. package/dist/hooks/use-supplier-invoices.js +12 -0
  390. package/dist/hooks/use-supplier-payment-mutation.d.ts +55 -0
  391. package/dist/hooks/use-supplier-payment-mutation.d.ts.map +1 -0
  392. package/dist/hooks/use-supplier-payment-mutation.js +35 -0
  393. package/dist/hooks/use-supplier-payments.d.ts +27 -0
  394. package/dist/hooks/use-supplier-payments.d.ts.map +1 -0
  395. package/dist/hooks/use-supplier-payments.js +12 -0
  396. package/dist/hooks/use-traveler-profitability.d.ts +24 -0
  397. package/dist/hooks/use-traveler-profitability.d.ts.map +1 -0
  398. package/dist/hooks/use-traveler-profitability.js +11 -0
  399. package/dist/hooks/use-voucher-mutation.d.ts +105 -0
  400. package/dist/hooks/use-voucher-mutation.d.ts.map +1 -0
  401. package/dist/hooks/use-voucher-mutation.js +50 -0
  402. package/dist/hooks/use-voucher.d.ts +38 -0
  403. package/dist/hooks/use-voucher.d.ts.map +1 -0
  404. package/dist/hooks/use-voucher.js +17 -0
  405. package/dist/hooks/use-vouchers.d.ts +34 -0
  406. package/dist/hooks/use-vouchers.d.ts.map +1 -0
  407. package/dist/hooks/use-vouchers.js +18 -0
  408. package/dist/i18n/en/invoices.d.ts +278 -0
  409. package/dist/i18n/en/invoices.d.ts.map +1 -0
  410. package/dist/i18n/en/invoices.js +277 -0
  411. package/dist/i18n/en/numberingAndPayments.d.ts +387 -0
  412. package/dist/i18n/en/numberingAndPayments.d.ts.map +1 -0
  413. package/dist/i18n/en/numberingAndPayments.js +386 -0
  414. package/dist/i18n/en/profitability.d.ts +147 -0
  415. package/dist/i18n/en/profitability.d.ts.map +1 -0
  416. package/dist/i18n/en/profitability.js +146 -0
  417. package/dist/i18n/en/suppliers.d.ts +187 -0
  418. package/dist/i18n/en/suppliers.d.ts.map +1 -0
  419. package/dist/i18n/en/suppliers.js +186 -0
  420. package/dist/i18n/en.d.ts +998 -0
  421. package/dist/i18n/en.d.ts.map +1 -0
  422. package/dist/i18n/en.js +22 -0
  423. package/dist/i18n/index.d.ts +5 -0
  424. package/dist/i18n/index.d.ts.map +1 -0
  425. package/dist/i18n/index.js +3 -0
  426. package/dist/i18n/messages/core.d.ts +18 -0
  427. package/dist/i18n/messages/core.d.ts.map +1 -0
  428. package/dist/i18n/messages/core.js +30 -0
  429. package/dist/i18n/messages/invoices.d.ts +252 -0
  430. package/dist/i18n/messages/invoices.d.ts.map +1 -0
  431. package/dist/i18n/messages/invoices.js +1 -0
  432. package/dist/i18n/messages/numberingAndPayments.d.ts +277 -0
  433. package/dist/i18n/messages/numberingAndPayments.d.ts.map +1 -0
  434. package/dist/i18n/messages/numberingAndPayments.js +1 -0
  435. package/dist/i18n/messages/profitability.d.ts +151 -0
  436. package/dist/i18n/messages/profitability.d.ts.map +1 -0
  437. package/dist/i18n/messages/profitability.js +1 -0
  438. package/dist/i18n/messages/suppliers.d.ts +167 -0
  439. package/dist/i18n/messages/suppliers.d.ts.map +1 -0
  440. package/dist/i18n/messages/suppliers.js +1 -0
  441. package/dist/i18n/messages.d.ts +29 -0
  442. package/dist/i18n/messages.d.ts.map +1 -0
  443. package/dist/i18n/messages.js +1 -0
  444. package/dist/i18n/provider.d.ts +2018 -0
  445. package/dist/i18n/provider.d.ts.map +1 -0
  446. package/dist/i18n/provider.js +44 -0
  447. package/dist/i18n/ro/invoices.d.ts +278 -0
  448. package/dist/i18n/ro/invoices.d.ts.map +1 -0
  449. package/dist/i18n/ro/invoices.js +277 -0
  450. package/dist/i18n/ro/numberingAndPayments.d.ts +387 -0
  451. package/dist/i18n/ro/numberingAndPayments.d.ts.map +1 -0
  452. package/dist/i18n/ro/numberingAndPayments.js +386 -0
  453. package/dist/i18n/ro/profitability.d.ts +147 -0
  454. package/dist/i18n/ro/profitability.d.ts.map +1 -0
  455. package/dist/i18n/ro/profitability.js +146 -0
  456. package/dist/i18n/ro/suppliers.d.ts +187 -0
  457. package/dist/i18n/ro/suppliers.d.ts.map +1 -0
  458. package/dist/i18n/ro/suppliers.js +186 -0
  459. package/dist/i18n/ro.d.ts +998 -0
  460. package/dist/i18n/ro.d.ts.map +1 -0
  461. package/dist/i18n/ro.js +22 -0
  462. package/dist/index.d.ts +11 -0
  463. package/dist/index.d.ts.map +1 -0
  464. package/dist/index.js +9 -0
  465. package/dist/operations.d.ts +484 -0
  466. package/dist/operations.d.ts.map +1 -0
  467. package/dist/operations.js +52 -0
  468. package/dist/provider.d.ts +2 -0
  469. package/dist/provider.d.ts.map +1 -0
  470. package/dist/provider.js +1 -0
  471. package/dist/query-keys.d.ts +195 -0
  472. package/dist/query-keys.d.ts.map +1 -0
  473. package/dist/query-keys.js +49 -0
  474. package/dist/query-options/public-reporting.d.ts +2129 -0
  475. package/dist/query-options/public-reporting.d.ts.map +1 -0
  476. package/dist/query-options/public-reporting.js +193 -0
  477. package/dist/query-options-action-ledger.d.ts +382 -0
  478. package/dist/query-options-action-ledger.d.ts.map +1 -0
  479. package/dist/query-options-action-ledger.js +36 -0
  480. package/dist/query-options.d.ts +2057 -0
  481. package/dist/query-options.d.ts.map +1 -0
  482. package/dist/query-options.js +328 -0
  483. package/dist/schemas/accountant.d.ts +168 -0
  484. package/dist/schemas/accountant.d.ts.map +1 -0
  485. package/dist/schemas/accountant.js +53 -0
  486. package/dist/schemas/action-ledger.d.ts +206 -0
  487. package/dist/schemas/action-ledger.d.ts.map +1 -0
  488. package/dist/schemas/action-ledger.js +83 -0
  489. package/dist/schemas/common.d.ts +17 -0
  490. package/dist/schemas/common.d.ts.map +1 -0
  491. package/dist/schemas/common.js +10 -0
  492. package/dist/schemas/invoice.d.ts +1451 -0
  493. package/dist/schemas/invoice.d.ts.map +1 -0
  494. package/dist/schemas/invoice.js +438 -0
  495. package/dist/schemas/profitability.d.ts +333 -0
  496. package/dist/schemas/profitability.d.ts.map +1 -0
  497. package/dist/schemas/profitability.js +84 -0
  498. package/dist/schemas/public.d.ts +481 -0
  499. package/dist/schemas/public.d.ts.map +1 -0
  500. package/dist/schemas/public.js +9 -0
  501. package/dist/schemas/responses.d.ts +632 -0
  502. package/dist/schemas/responses.d.ts.map +1 -0
  503. package/dist/schemas/responses.js +27 -0
  504. package/dist/schemas/supplier.d.ts +226 -0
  505. package/dist/schemas/supplier.d.ts.map +1 -0
  506. package/dist/schemas/supplier.js +103 -0
  507. package/dist/schemas/vouchers.d.ts +283 -0
  508. package/dist/schemas/vouchers.d.ts.map +1 -0
  509. package/dist/schemas/vouchers.js +49 -0
  510. package/dist/schemas.d.ts +10 -0
  511. package/dist/schemas.d.ts.map +1 -0
  512. package/dist/schemas.js +9 -0
  513. package/dist/ui.d.ts +27 -0
  514. package/dist/ui.d.ts.map +1 -0
  515. package/dist/ui.js +26 -0
  516. package/package.json +181 -0
  517. package/src/styles.css +12 -0
@@ -0,0 +1,227 @@
1
+ import type { PaymentChoice } from "../checkout-types.js";
2
+ export interface UseCollectPaymentOptions {
3
+ /**
4
+ * Provider id registered in checkout's `paymentStarters` map. Only used
5
+ * when the choice is `send_link`. Defaults to `"netopia"` since that's
6
+ * the only processor in tree today; pass explicitly when adding others.
7
+ */
8
+ cardProvider?: string;
9
+ /** Payer email — used as the recipient for the payment-link notification. */
10
+ payerEmail?: string | null;
11
+ /** Payer name — passed through to the payment session (display only). */
12
+ payerName?: string | null;
13
+ /**
14
+ * Customer-facing language for the processor's hosted payment page (e.g.
15
+ * the picked CRM person's `preferredLanguage`, the booking locale, or the
16
+ * operator's current locale). When omitted, falls back to the processor's
17
+ * deploy-wide default (e.g. `NETOPIA_LANGUAGE`).
18
+ *
19
+ * Forwarded to `startProvider.payload.language` — Netopia honors it for
20
+ * its hosted page; other processors map their own equivalent field.
21
+ */
22
+ payerLanguage?: string | null;
23
+ /**
24
+ * Where the customer's browser should land after a successful (or
25
+ * cancelled) payment on the processor's hosted page. Storefronts pass
26
+ * their own confirmation route; operator-initiated send-link flows
27
+ * typically leave this unset and let the deploy-wide
28
+ * `NETOPIA_REDIRECT_URL` point at the public `/pay/:sessionId` landing.
29
+ */
30
+ returnUrl?: string | null;
31
+ cancelUrl?: string | null;
32
+ /** Optional vertical-supplied notes attached to the collection. */
33
+ notes?: string | null;
34
+ }
35
+ export interface CollectPaymentInput {
36
+ choice: PaymentChoice;
37
+ amountCents: number;
38
+ }
39
+ /**
40
+ * Higher-level collection hook: takes a `PaymentChoice` from `<PaymentStep>`
41
+ * and translates it into the appropriate `initiateCheckoutCollection` call.
42
+ *
43
+ * Routes:
44
+ * - `hold` → creates a payment session, starts the configured card
45
+ * processor (so `redirectUrl` is populated), and returns the result.
46
+ * The customer-facing card vs bank-transfer choice happens later on
47
+ * the public `/pay/:sessionId` landing page; the admin's job is just
48
+ * to produce that link and share it.
49
+ * - any other → throws. `saved_method` / `new_card` / `extra` are
50
+ * vertical-specific (immediate-charge or vertical action) and the
51
+ * parent handles them by calling `useInitiateCheckoutCollection`
52
+ * directly with its own request body.
53
+ */
54
+ export declare function useCollectPayment(bookingId: string, options?: UseCollectPaymentOptions): import("@tanstack/react-query").UseMutationResult<{
55
+ plan: {
56
+ bookingId: string;
57
+ method: "bank_transfer" | "card";
58
+ stage: "manual" | "initial" | "reminder";
59
+ paymentSessionTarget: "schedule" | "invoice" | null;
60
+ documentType: "invoice" | "proforma" | null;
61
+ willCreateDefaultPaymentPlan: boolean;
62
+ selectedSchedule: {
63
+ id: string;
64
+ bookingId: string;
65
+ bookingItemId: string | null;
66
+ scheduleType: string;
67
+ status: string;
68
+ dueDate: string;
69
+ currency: string;
70
+ amountCents: number;
71
+ notes: string | null;
72
+ } | null;
73
+ selectedInvoice: {
74
+ id: string;
75
+ invoiceNumber: string;
76
+ invoiceType: string;
77
+ bookingId: string;
78
+ personId: string | null;
79
+ organizationId: string | null;
80
+ status: string;
81
+ currency: string;
82
+ totalCents: number;
83
+ paidCents: number;
84
+ balanceDueCents: number;
85
+ issueDate: string;
86
+ dueDate: string;
87
+ notes: string | null;
88
+ createdAt: string;
89
+ updatedAt: string;
90
+ } | null;
91
+ amountCents: number;
92
+ currency: string;
93
+ recommendedAction: "none" | "create_bank_transfer_document" | "create_payment_session" | "create_invoice_then_payment_session";
94
+ };
95
+ invoice: {
96
+ id: string;
97
+ invoiceNumber: string;
98
+ invoiceType: string;
99
+ bookingId: string;
100
+ personId: string | null;
101
+ organizationId: string | null;
102
+ status: string;
103
+ currency: string;
104
+ totalCents: number;
105
+ paidCents: number;
106
+ balanceDueCents: number;
107
+ issueDate: string;
108
+ dueDate: string;
109
+ notes: string | null;
110
+ createdAt: string;
111
+ updatedAt: string;
112
+ } | null;
113
+ paymentSession: {
114
+ legacyOrderId: string | null;
115
+ target: {
116
+ type: "booking";
117
+ bookingId: string;
118
+ } | {
119
+ type: "invoice";
120
+ invoiceId: string;
121
+ } | {
122
+ type: "booking_payment_schedule";
123
+ bookingPaymentScheduleId: string;
124
+ } | {
125
+ type: "booking_guarantee";
126
+ bookingGuaranteeId: string;
127
+ } | {
128
+ type: "flight_order";
129
+ flightOrderId: string;
130
+ } | {
131
+ type: "program";
132
+ programId: string;
133
+ } | {
134
+ type: "supplier_settlement";
135
+ supplierSettlementId: string;
136
+ } | {
137
+ type: "channel_settlement";
138
+ channelSettlementId: string;
139
+ } | {
140
+ type: "provider_reference";
141
+ provider: string;
142
+ reference: string;
143
+ } | {
144
+ type: "legacy_order";
145
+ legacyOrderId: string;
146
+ } | null;
147
+ provenance: {
148
+ source: "other" | "operator" | "storefront" | "customer_portal" | "payment_provider" | "supplier_channel" | "migration";
149
+ provider?: string | null | undefined;
150
+ reference?: string | null | undefined;
151
+ idempotencyKey?: string | null | undefined;
152
+ } | null;
153
+ id: string;
154
+ targetType: "other" | "booking" | "invoice" | "order" | "booking_payment_schedule" | "booking_guarantee" | "flight_order";
155
+ targetId: string | null;
156
+ bookingId: string | null;
157
+ invoiceId: string | null;
158
+ bookingPaymentScheduleId: string | null;
159
+ bookingGuaranteeId: string | null;
160
+ status: "pending" | "failed" | "cancelled" | "expired" | "paid" | "authorized" | "requires_redirect" | "processing";
161
+ provider: string | null;
162
+ providerSessionId: string | null;
163
+ providerPaymentId: string | null;
164
+ externalReference: string | null;
165
+ clientReference: string | null;
166
+ currency: string;
167
+ amountCents: number;
168
+ paymentMethod: "other" | "voucher" | "wallet" | "bank_transfer" | "credit_card" | "debit_card" | "cash" | "cheque" | "direct_bill" | null;
169
+ payerEmail: string | null;
170
+ payerName: string | null;
171
+ redirectUrl: string | null;
172
+ returnUrl: string | null;
173
+ cancelUrl: string | null;
174
+ expiresAt: string | null;
175
+ completedAt: string | null;
176
+ failureCode: string | null;
177
+ failureMessage: string | null;
178
+ notes: string | null;
179
+ } | null;
180
+ invoiceNotification: {
181
+ id: string;
182
+ templateSlug: string | null;
183
+ channel: "email" | "sms";
184
+ provider: string;
185
+ status: "pending" | "failed" | "cancelled" | "sent";
186
+ toAddress: string;
187
+ subject: string | null;
188
+ sentAt: string | null;
189
+ failedAt: string | null;
190
+ errorMessage: string | null;
191
+ } | null;
192
+ paymentSessionNotification: {
193
+ id: string;
194
+ templateSlug: string | null;
195
+ channel: "email" | "sms";
196
+ provider: string;
197
+ status: "pending" | "failed" | "cancelled" | "sent";
198
+ toAddress: string;
199
+ subject: string | null;
200
+ sentAt: string | null;
201
+ failedAt: string | null;
202
+ errorMessage: string | null;
203
+ } | null;
204
+ bankTransferInstructions: {
205
+ provider: string | null;
206
+ invoiceId: string;
207
+ invoiceNumber: string;
208
+ documentType: "invoice" | "proforma";
209
+ amountCents: number;
210
+ currency: string;
211
+ dueDate: string | null;
212
+ beneficiary: string;
213
+ iban: string;
214
+ bankName: string | null;
215
+ notes: string | null;
216
+ } | null;
217
+ providerStart: {
218
+ provider: string;
219
+ paymentSessionId: string;
220
+ redirectUrl: string | null;
221
+ externalReference: string | null;
222
+ providerSessionId: string | null;
223
+ providerPaymentId: string | null;
224
+ response: Record<string, unknown> | null;
225
+ } | null;
226
+ }, Error, CollectPaymentInput, unknown>;
227
+ //# sourceMappingURL=use-collect-payment.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use-collect-payment.d.ts","sourceRoot":"","sources":["../../src/checkout-hooks/use-collect-payment.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAA;AAGzD,MAAM,WAAW,wBAAwB;IACvC;;;;OAIG;IACH,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,6EAA6E;IAC7E,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IAC1B,yEAAyE;IACzE,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IACzB;;;;;;;;OAQG;IACH,aAAa,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IAC7B;;;;;;OAMG;IACH,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IACzB,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IACzB,mEAAmE;IACnE,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;CACtB;AAED,MAAM,WAAW,mBAAmB;IAClC,MAAM,EAAE,aAAa,CAAA;IACrB,WAAW,EAAE,MAAM,CAAA;CACpB;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,iBAAiB,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,GAAE,wBAA6B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wCAiD1F"}
@@ -0,0 +1,80 @@
1
+ "use client";
2
+ import { useMutation, useQueryClient } from "@tanstack/react-query";
3
+ import { useVoyantFinanceContext } from "../provider.js";
4
+ /**
5
+ * Higher-level collection hook: takes a `PaymentChoice` from `<PaymentStep>`
6
+ * and translates it into the appropriate `initiateCheckoutCollection` call.
7
+ *
8
+ * Routes:
9
+ * - `hold` → creates a payment session, starts the configured card
10
+ * processor (so `redirectUrl` is populated), and returns the result.
11
+ * The customer-facing card vs bank-transfer choice happens later on
12
+ * the public `/pay/:sessionId` landing page; the admin's job is just
13
+ * to produce that link and share it.
14
+ * - any other → throws. `saved_method` / `new_card` / `extra` are
15
+ * vertical-specific (immediate-charge or vertical action) and the
16
+ * parent handles them by calling `useInitiateCheckoutCollection`
17
+ * directly with its own request body.
18
+ */
19
+ export function useCollectPayment(bookingId, options = {}) {
20
+ const { baseUrl, fetcher } = useVoyantFinanceContext();
21
+ const qc = useQueryClient();
22
+ const { cardProvider = "netopia", payerEmail, payerName, payerLanguage, returnUrl, cancelUrl, notes, } = options;
23
+ return useMutation({
24
+ mutationFn: async ({ choice, amountCents, }) => {
25
+ const body = mapChoiceToRequest(choice, amountCents, {
26
+ cardProvider,
27
+ payerEmail,
28
+ payerName,
29
+ payerLanguage,
30
+ returnUrl,
31
+ cancelUrl,
32
+ notes,
33
+ });
34
+ const response = await fetcher(`${baseUrl}/v1/admin/finance/bookings/${bookingId}/initiate-collection`, {
35
+ method: "POST",
36
+ headers: { "Content-Type": "application/json" },
37
+ body: JSON.stringify(body),
38
+ });
39
+ const json = (await response.json());
40
+ if (!response.ok) {
41
+ const message = "error" in json ? json.error : `Collection failed: ${response.status}`;
42
+ throw new Error(message);
43
+ }
44
+ return json.data;
45
+ },
46
+ onSuccess: () => {
47
+ qc.invalidateQueries({ queryKey: ["bookings", bookingId] });
48
+ qc.invalidateQueries({ queryKey: ["public-booking-payments", bookingId] });
49
+ },
50
+ });
51
+ }
52
+ function mapChoiceToRequest(choice, amountCents, ctx) {
53
+ if (choice.type === "hold") {
54
+ // Deliberately no `startProvider` here. Processors like Netopia
55
+ // require a real billing block at provider-start time, which the
56
+ // admin doesn't have at link-generation time. The customer-facing
57
+ // `/pay/:sessionId` landing lazy-starts the processor (via the
58
+ // template's `POST /v1/public/payment-link/:sessionId/start-card`
59
+ // endpoint) with synthesized placeholder billing — the processor's
60
+ // hosted form then collects the real billing from the customer.
61
+ return {
62
+ method: "card",
63
+ stage: "manual",
64
+ amountCents,
65
+ ensureDefaultPaymentPlan: true,
66
+ paymentSession: {
67
+ provider: ctx.cardProvider,
68
+ payerEmail: ctx.payerEmail ?? undefined,
69
+ payerName: ctx.payerName ?? undefined,
70
+ returnUrl: ctx.returnUrl ?? undefined,
71
+ cancelUrl: ctx.cancelUrl ?? undefined,
72
+ },
73
+ // No auto-email by design — the admin shares the link manually.
74
+ // Starters that want auto-email back can call
75
+ // `useInitiateCheckoutCollection` directly with `paymentSessionNotification`.
76
+ notes: ctx.notes ?? undefined,
77
+ };
78
+ }
79
+ throw new Error(`useCollectPayment doesn't handle choice type "${choice.type}" — call useInitiateCheckoutCollection directly with a vertical-specific request.`);
80
+ }
@@ -0,0 +1,308 @@
1
+ /**
2
+ * Admin-side: kick off a checkout collection against a booking. Mounts at
3
+ * `/v1/admin/finance/bookings/:bookingId/initiate-collection` (the public
4
+ * mirror is gated behind `actor=customer` and only reachable from a public
5
+ * storefront / customer portal).
6
+ *
7
+ * Invalidates booking + public-booking-payments queries on success so the
8
+ * caller's payments summary re-fetches automatically.
9
+ */
10
+ export declare function useInitiateCheckoutCollection(bookingId: string): import("@tanstack/react-query").UseMutationResult<{
11
+ plan: {
12
+ bookingId: string;
13
+ method: "bank_transfer" | "card";
14
+ stage: "manual" | "initial" | "reminder";
15
+ paymentSessionTarget: "schedule" | "invoice" | null;
16
+ documentType: "invoice" | "proforma" | null;
17
+ willCreateDefaultPaymentPlan: boolean;
18
+ selectedSchedule: {
19
+ id: string;
20
+ bookingId: string;
21
+ bookingItemId: string | null;
22
+ scheduleType: string;
23
+ status: string;
24
+ dueDate: string;
25
+ currency: string;
26
+ amountCents: number;
27
+ notes: string | null;
28
+ } | null;
29
+ selectedInvoice: {
30
+ id: string;
31
+ invoiceNumber: string;
32
+ invoiceType: string;
33
+ bookingId: string;
34
+ personId: string | null;
35
+ organizationId: string | null;
36
+ status: string;
37
+ currency: string;
38
+ totalCents: number;
39
+ paidCents: number;
40
+ balanceDueCents: number;
41
+ issueDate: string;
42
+ dueDate: string;
43
+ notes: string | null;
44
+ createdAt: string;
45
+ updatedAt: string;
46
+ } | null;
47
+ amountCents: number;
48
+ currency: string;
49
+ recommendedAction: "none" | "create_bank_transfer_document" | "create_payment_session" | "create_invoice_then_payment_session";
50
+ };
51
+ invoice: {
52
+ id: string;
53
+ invoiceNumber: string;
54
+ invoiceType: string;
55
+ bookingId: string;
56
+ personId: string | null;
57
+ organizationId: string | null;
58
+ status: string;
59
+ currency: string;
60
+ totalCents: number;
61
+ paidCents: number;
62
+ balanceDueCents: number;
63
+ issueDate: string;
64
+ dueDate: string;
65
+ notes: string | null;
66
+ createdAt: string;
67
+ updatedAt: string;
68
+ } | null;
69
+ paymentSession: {
70
+ legacyOrderId: string | null;
71
+ target: {
72
+ type: "booking";
73
+ bookingId: string;
74
+ } | {
75
+ type: "invoice";
76
+ invoiceId: string;
77
+ } | {
78
+ type: "booking_payment_schedule";
79
+ bookingPaymentScheduleId: string;
80
+ } | {
81
+ type: "booking_guarantee";
82
+ bookingGuaranteeId: string;
83
+ } | {
84
+ type: "flight_order";
85
+ flightOrderId: string;
86
+ } | {
87
+ type: "program";
88
+ programId: string;
89
+ } | {
90
+ type: "supplier_settlement";
91
+ supplierSettlementId: string;
92
+ } | {
93
+ type: "channel_settlement";
94
+ channelSettlementId: string;
95
+ } | {
96
+ type: "provider_reference";
97
+ provider: string;
98
+ reference: string;
99
+ } | {
100
+ type: "legacy_order";
101
+ legacyOrderId: string;
102
+ } | null;
103
+ provenance: {
104
+ source: "other" | "operator" | "storefront" | "customer_portal" | "payment_provider" | "supplier_channel" | "migration";
105
+ provider?: string | null | undefined;
106
+ reference?: string | null | undefined;
107
+ idempotencyKey?: string | null | undefined;
108
+ } | null;
109
+ id: string;
110
+ targetType: "other" | "booking" | "invoice" | "order" | "booking_payment_schedule" | "booking_guarantee" | "flight_order";
111
+ targetId: string | null;
112
+ bookingId: string | null;
113
+ invoiceId: string | null;
114
+ bookingPaymentScheduleId: string | null;
115
+ bookingGuaranteeId: string | null;
116
+ status: "pending" | "failed" | "cancelled" | "expired" | "paid" | "authorized" | "requires_redirect" | "processing";
117
+ provider: string | null;
118
+ providerSessionId: string | null;
119
+ providerPaymentId: string | null;
120
+ externalReference: string | null;
121
+ clientReference: string | null;
122
+ currency: string;
123
+ amountCents: number;
124
+ paymentMethod: "other" | "voucher" | "wallet" | "bank_transfer" | "credit_card" | "debit_card" | "cash" | "cheque" | "direct_bill" | null;
125
+ payerEmail: string | null;
126
+ payerName: string | null;
127
+ redirectUrl: string | null;
128
+ returnUrl: string | null;
129
+ cancelUrl: string | null;
130
+ expiresAt: string | null;
131
+ completedAt: string | null;
132
+ failureCode: string | null;
133
+ failureMessage: string | null;
134
+ notes: string | null;
135
+ } | null;
136
+ invoiceNotification: {
137
+ id: string;
138
+ templateSlug: string | null;
139
+ channel: "email" | "sms";
140
+ provider: string;
141
+ status: "pending" | "failed" | "cancelled" | "sent";
142
+ toAddress: string;
143
+ subject: string | null;
144
+ sentAt: string | null;
145
+ failedAt: string | null;
146
+ errorMessage: string | null;
147
+ } | null;
148
+ paymentSessionNotification: {
149
+ id: string;
150
+ templateSlug: string | null;
151
+ channel: "email" | "sms";
152
+ provider: string;
153
+ status: "pending" | "failed" | "cancelled" | "sent";
154
+ toAddress: string;
155
+ subject: string | null;
156
+ sentAt: string | null;
157
+ failedAt: string | null;
158
+ errorMessage: string | null;
159
+ } | null;
160
+ bankTransferInstructions: {
161
+ provider: string | null;
162
+ invoiceId: string;
163
+ invoiceNumber: string;
164
+ documentType: "invoice" | "proforma";
165
+ amountCents: number;
166
+ currency: string;
167
+ dueDate: string | null;
168
+ beneficiary: string;
169
+ iban: string;
170
+ bankName: string | null;
171
+ notes: string | null;
172
+ } | null;
173
+ providerStart: {
174
+ provider: string;
175
+ paymentSessionId: string;
176
+ redirectUrl: string | null;
177
+ externalReference: string | null;
178
+ providerSessionId: string | null;
179
+ providerPaymentId: string | null;
180
+ response: Record<string, unknown> | null;
181
+ } | null;
182
+ }, Error, {
183
+ method: "bank_transfer" | "card";
184
+ stage: "manual" | "initial" | "reminder";
185
+ ensureDefaultPaymentPlan: boolean;
186
+ scheduleId?: string | undefined;
187
+ invoiceId?: string | undefined;
188
+ amountCents?: number | undefined;
189
+ paymentSessionTarget?: "schedule" | "invoice" | undefined;
190
+ paymentPlan?: {
191
+ depositMode?: "none" | "percentage" | "fixed_amount" | undefined;
192
+ depositValue?: number | undefined;
193
+ depositDueDate?: string | null | undefined;
194
+ balanceDueDaysBeforeStart?: number | undefined;
195
+ clearExistingPending?: boolean | undefined;
196
+ createGuarantee?: boolean | undefined;
197
+ guaranteeType?: "other" | "deposit" | "voucher" | "bank_transfer" | "credit_card" | "preauth" | "card_on_file" | "agency_letter" | undefined;
198
+ notes?: string | null | undefined;
199
+ } | undefined;
200
+ paymentSession?: {
201
+ target?: {
202
+ type: "booking";
203
+ bookingId: string;
204
+ } | {
205
+ type: "invoice";
206
+ invoiceId: string;
207
+ } | {
208
+ type: "booking_payment_schedule";
209
+ bookingPaymentScheduleId: string;
210
+ } | {
211
+ type: "booking_guarantee";
212
+ bookingGuaranteeId: string;
213
+ } | {
214
+ type: "flight_order";
215
+ flightOrderId: string;
216
+ } | {
217
+ type: "program";
218
+ programId: string;
219
+ } | {
220
+ type: "supplier_settlement";
221
+ supplierSettlementId: string;
222
+ } | {
223
+ type: "channel_settlement";
224
+ channelSettlementId: string;
225
+ } | {
226
+ type: "provider_reference";
227
+ provider: string;
228
+ reference: string;
229
+ } | {
230
+ type: "legacy_order";
231
+ legacyOrderId: string;
232
+ } | undefined;
233
+ provenance?: {
234
+ source: "other" | "operator" | "storefront" | "customer_portal" | "payment_provider" | "supplier_channel" | "migration";
235
+ provider?: string | null | undefined;
236
+ reference?: string | null | undefined;
237
+ idempotencyKey?: string | null | undefined;
238
+ } | undefined;
239
+ provider?: string | null | undefined;
240
+ paymentMethod?: "other" | "voucher" | "wallet" | "bank_transfer" | "credit_card" | "debit_card" | "cash" | "cheque" | "direct_bill" | null | undefined;
241
+ payerPersonId?: string | null | undefined;
242
+ payerOrganizationId?: string | null | undefined;
243
+ payerEmail?: string | null | undefined;
244
+ payerName?: string | null | undefined;
245
+ externalReference?: string | null | undefined;
246
+ idempotencyKey?: string | null | undefined;
247
+ clientReference?: string | null | undefined;
248
+ returnUrl?: string | null | undefined;
249
+ cancelUrl?: string | null | undefined;
250
+ callbackUrl?: string | null | undefined;
251
+ expiresAt?: string | null | undefined;
252
+ notes?: string | null | undefined;
253
+ providerPayload?: Record<string, unknown> | null | undefined;
254
+ metadata?: Record<string, unknown> | null | undefined;
255
+ } | undefined;
256
+ paymentSessionNotification?: {
257
+ channel: "email" | "sms";
258
+ templateId?: string | null | undefined;
259
+ templateSlug?: string | null | undefined;
260
+ provider?: string | null | undefined;
261
+ to?: string | null | undefined;
262
+ from?: string | null | undefined;
263
+ subject?: string | null | undefined;
264
+ html?: string | null | undefined;
265
+ text?: string | null | undefined;
266
+ attachments?: {
267
+ filename: string;
268
+ contentBase64?: string | null | undefined;
269
+ path?: string | null | undefined;
270
+ contentType?: string | null | undefined;
271
+ disposition?: "inline" | "attachment" | null | undefined;
272
+ contentId?: string | null | undefined;
273
+ }[] | null | undefined;
274
+ data?: Record<string, unknown> | null | undefined;
275
+ metadata?: Record<string, unknown> | null | undefined;
276
+ scheduledFor?: string | null | undefined;
277
+ paymentLinkBaseUrl?: string | null | undefined;
278
+ } | undefined;
279
+ invoiceNotification?: {
280
+ channel: "email" | "sms";
281
+ templateId?: string | null | undefined;
282
+ templateSlug?: string | null | undefined;
283
+ provider?: string | null | undefined;
284
+ to?: string | null | undefined;
285
+ from?: string | null | undefined;
286
+ subject?: string | null | undefined;
287
+ html?: string | null | undefined;
288
+ text?: string | null | undefined;
289
+ attachments?: {
290
+ filename: string;
291
+ contentBase64?: string | null | undefined;
292
+ path?: string | null | undefined;
293
+ contentType?: string | null | undefined;
294
+ disposition?: "inline" | "attachment" | null | undefined;
295
+ contentId?: string | null | undefined;
296
+ }[] | null | undefined;
297
+ data?: Record<string, unknown> | null | undefined;
298
+ metadata?: Record<string, unknown> | null | undefined;
299
+ scheduledFor?: string | null | undefined;
300
+ paymentLinkBaseUrl?: string | null | undefined;
301
+ } | undefined;
302
+ startProvider?: {
303
+ provider: string;
304
+ payload?: Record<string, unknown> | null | undefined;
305
+ } | undefined;
306
+ notes?: string | null | undefined;
307
+ }, unknown>;
308
+ //# sourceMappingURL=use-initiate-checkout-collection.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use-initiate-checkout-collection.d.ts","sourceRoot":"","sources":["../../src/checkout-hooks/use-initiate-checkout-collection.ts"],"names":[],"mappings":"AAcA;;;;;;;;GAQG;AACH,wBAAgB,6BAA6B,CAAC,SAAS,EAAE,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;YA8B9D"}
@@ -0,0 +1,35 @@
1
+ "use client";
2
+ import { useMutation, useQueryClient } from "@tanstack/react-query";
3
+ import { useVoyantFinanceContext } from "../provider.js";
4
+ /**
5
+ * Admin-side: kick off a checkout collection against a booking. Mounts at
6
+ * `/v1/admin/finance/bookings/:bookingId/initiate-collection` (the public
7
+ * mirror is gated behind `actor=customer` and only reachable from a public
8
+ * storefront / customer portal).
9
+ *
10
+ * Invalidates booking + public-booking-payments queries on success so the
11
+ * caller's payments summary re-fetches automatically.
12
+ */
13
+ export function useInitiateCheckoutCollection(bookingId) {
14
+ const { baseUrl, fetcher } = useVoyantFinanceContext();
15
+ const qc = useQueryClient();
16
+ return useMutation({
17
+ mutationFn: async (input) => {
18
+ const response = await fetcher(`${baseUrl}/v1/admin/finance/bookings/${bookingId}/initiate-collection`, {
19
+ method: "POST",
20
+ headers: { "Content-Type": "application/json" },
21
+ body: JSON.stringify(input),
22
+ });
23
+ const body = (await response.json());
24
+ if (!response.ok) {
25
+ const message = "error" in body ? body.error : `Checkout failed: ${response.status}`;
26
+ throw new Error(message);
27
+ }
28
+ return body.data;
29
+ },
30
+ onSuccess: () => {
31
+ qc.invalidateQueries({ queryKey: ["bookings", bookingId] });
32
+ qc.invalidateQueries({ queryKey: ["public-booking-payments", bookingId] });
33
+ },
34
+ });
35
+ }