@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.
- package/LICENSE +201 -0
- package/README.md +75 -0
- package/dist/admin/booking-invoices-widget.d.ts +19 -0
- package/dist/admin/booking-invoices-widget.d.ts.map +1 -0
- package/dist/admin/booking-invoices-widget.js +204 -0
- package/dist/admin/booking-payment-policy-widget.d.ts +21 -0
- package/dist/admin/booking-payment-policy-widget.d.ts.map +1 -0
- package/dist/admin/booking-payment-policy-widget.js +128 -0
- package/dist/admin/booking-pending-payment-sessions-widget.d.ts +24 -0
- package/dist/admin/booking-pending-payment-sessions-widget.d.ts.map +1 -0
- package/dist/admin/booking-pending-payment-sessions-widget.js +139 -0
- package/dist/admin/credit-note-dialog.d.ts +9 -0
- package/dist/admin/credit-note-dialog.d.ts.map +1 -0
- package/dist/admin/credit-note-dialog.js +70 -0
- package/dist/admin/finance-shared.d.ts +7 -0
- package/dist/admin/finance-shared.d.ts.map +1 -0
- package/dist/admin/finance-shared.js +30 -0
- package/dist/admin/index.d.ts +99 -0
- package/dist/admin/index.d.ts.map +1 -0
- package/dist/admin/index.js +286 -0
- package/dist/admin/invoice-detail-host.d.ts +19 -0
- package/dist/admin/invoice-detail-host.d.ts.map +1 -0
- package/dist/admin/invoice-detail-host.js +147 -0
- package/dist/admin/invoice-detail-sections.d.ts +31 -0
- package/dist/admin/invoice-detail-sections.d.ts.map +1 -0
- package/dist/admin/invoice-detail-sections.js +109 -0
- package/dist/admin/invoice-detail-skeleton.d.ts +11 -0
- package/dist/admin/invoice-detail-skeleton.d.ts.map +1 -0
- package/dist/admin/invoice-detail-skeleton.js +33 -0
- package/dist/admin/line-item-dialog.d.ts +10 -0
- package/dist/admin/line-item-dialog.d.ts.map +1 -0
- package/dist/admin/line-item-dialog.js +91 -0
- package/dist/admin/pages/invoice-detail.d.ts +8 -0
- package/dist/admin/pages/invoice-detail.d.ts.map +1 -0
- package/dist/admin/pages/invoice-detail.js +11 -0
- package/dist/admin/pages/invoices-index.d.ts +8 -0
- package/dist/admin/pages/invoices-index.d.ts.map +1 -0
- package/dist/admin/pages/invoices-index.js +14 -0
- package/dist/admin/pages/payment-detail.d.ts +8 -0
- package/dist/admin/pages/payment-detail.d.ts.map +1 -0
- package/dist/admin/pages/payment-detail.js +11 -0
- package/dist/admin/pages/payments-index.d.ts +9 -0
- package/dist/admin/pages/payments-index.d.ts.map +1 -0
- package/dist/admin/pages/payments-index.js +21 -0
- package/dist/admin/pages/profitability.d.ts +10 -0
- package/dist/admin/pages/profitability.d.ts.map +1 -0
- package/dist/admin/pages/profitability.js +32 -0
- package/dist/admin/pages/supplier-invoice-detail.d.ts +20 -0
- package/dist/admin/pages/supplier-invoice-detail.d.ts.map +1 -0
- package/dist/admin/pages/supplier-invoice-detail.js +102 -0
- package/dist/admin/pages/supplier-invoices-index.d.ts +9 -0
- package/dist/admin/pages/supplier-invoices-index.d.ts.map +1 -0
- package/dist/admin/pages/supplier-invoices-index.js +16 -0
- package/dist/admin/payment-detail-host.d.ts +12 -0
- package/dist/admin/payment-detail-host.d.ts.map +1 -0
- package/dist/admin/payment-detail-host.js +108 -0
- package/dist/admin/payment-detail-skeleton.d.ts +8 -0
- package/dist/admin/payment-detail-skeleton.d.ts.map +1 -0
- package/dist/admin/payment-detail-skeleton.js +15 -0
- package/dist/admin/payment-dialog.d.ts +9 -0
- package/dist/admin/payment-dialog.d.ts.map +1 -0
- package/dist/admin/payment-dialog.js +99 -0
- package/dist/admin/record-payment-dialog.d.ts +16 -0
- package/dist/admin/record-payment-dialog.d.ts.map +1 -0
- package/dist/admin/record-payment-dialog.js +219 -0
- package/dist/admin/supplier-payment-policy-widget.d.ts +18 -0
- package/dist/admin/supplier-payment-policy-widget.d.ts.map +1 -0
- package/dist/admin/supplier-payment-policy-widget.js +31 -0
- package/dist/admin/use-supplier-picker.d.ts +19 -0
- package/dist/admin/use-supplier-picker.d.ts.map +1 -0
- package/dist/admin/use-supplier-picker.js +30 -0
- package/dist/checkout-components/collect-payment-dialog.d.ts +45 -0
- package/dist/checkout-components/collect-payment-dialog.d.ts.map +1 -0
- package/dist/checkout-components/collect-payment-dialog.js +121 -0
- package/dist/checkout-components/payment-link-landing-page.d.ts +76 -0
- package/dist/checkout-components/payment-link-landing-page.d.ts.map +1 -0
- package/dist/checkout-components/payment-link-landing-page.js +173 -0
- package/dist/checkout-components/payment-step.d.ts +42 -0
- package/dist/checkout-components/payment-step.d.ts.map +1 -0
- package/dist/checkout-components/payment-step.js +113 -0
- package/dist/checkout-hooks/index.d.ts +5 -0
- package/dist/checkout-hooks/index.d.ts.map +1 -0
- package/dist/checkout-hooks/index.js +4 -0
- package/dist/checkout-hooks/use-checkout-payment-link-config.d.ts +20 -0
- package/dist/checkout-hooks/use-checkout-payment-link-config.d.ts.map +1 -0
- package/dist/checkout-hooks/use-checkout-payment-link-config.js +26 -0
- package/dist/checkout-hooks/use-collect-payment.d.ts +227 -0
- package/dist/checkout-hooks/use-collect-payment.d.ts.map +1 -0
- package/dist/checkout-hooks/use-collect-payment.js +80 -0
- package/dist/checkout-hooks/use-initiate-checkout-collection.d.ts +308 -0
- package/dist/checkout-hooks/use-initiate-checkout-collection.d.ts.map +1 -0
- package/dist/checkout-hooks/use-initiate-checkout-collection.js +35 -0
- package/dist/checkout-hooks/use-preview-checkout-collection.d.ts +65 -0
- package/dist/checkout-hooks/use-preview-checkout-collection.d.ts.map +1 -0
- package/dist/checkout-hooks/use-preview-checkout-collection.js +27 -0
- package/dist/checkout-i18n/en.d.ts +3 -0
- package/dist/checkout-i18n/en.d.ts.map +1 -0
- package/dist/checkout-i18n/en.js +127 -0
- package/dist/checkout-i18n/index.d.ts +5 -0
- package/dist/checkout-i18n/index.d.ts.map +1 -0
- package/dist/checkout-i18n/index.js +3 -0
- package/dist/checkout-i18n/messages.d.ts +121 -0
- package/dist/checkout-i18n/messages.d.ts.map +1 -0
- package/dist/checkout-i18n/messages.js +1 -0
- package/dist/checkout-i18n/provider.d.ts +26 -0
- package/dist/checkout-i18n/provider.d.ts.map +1 -0
- package/dist/checkout-i18n/provider.js +41 -0
- package/dist/checkout-i18n/ro.d.ts +3 -0
- package/dist/checkout-i18n/ro.d.ts.map +1 -0
- package/dist/checkout-i18n/ro.js +127 -0
- package/dist/checkout-types.d.ts +53 -0
- package/dist/checkout-types.d.ts.map +1 -0
- package/dist/checkout-types.js +1 -0
- package/dist/checkout-ui.d.ts +7 -0
- package/dist/checkout-ui.d.ts.map +1 -0
- package/dist/checkout-ui.js +4 -0
- package/dist/checkout.d.ts +5 -0
- package/dist/checkout.d.ts.map +1 -0
- package/dist/checkout.js +3 -0
- package/dist/client.d.ts +16 -0
- package/dist/client.d.ts.map +1 -0
- package/dist/client.js +79 -0
- package/dist/components/accountant-portal/body.d.ts +8 -0
- package/dist/components/accountant-portal/body.d.ts.map +1 -0
- package/dist/components/accountant-portal/body.js +114 -0
- package/dist/components/accountant-portal/widgets.d.ts +13 -0
- package/dist/components/accountant-portal/widgets.d.ts.map +1 -0
- package/dist/components/accountant-portal/widgets.js +27 -0
- package/dist/components/accountant-portal.d.ts +10 -0
- package/dist/components/accountant-portal.d.ts.map +1 -0
- package/dist/components/accountant-portal.js +22 -0
- package/dist/components/accountant-share-dialog.d.ts +6 -0
- package/dist/components/accountant-share-dialog.d.ts.map +1 -0
- package/dist/components/accountant-share-dialog.js +53 -0
- package/dist/components/async-combobox.d.ts +33 -0
- package/dist/components/async-combobox.d.ts.map +1 -0
- package/dist/components/async-combobox.js +100 -0
- package/dist/components/booking-invoice-dialog.d.ts +63 -0
- package/dist/components/booking-invoice-dialog.d.ts.map +1 -0
- package/dist/components/booking-invoice-dialog.js +383 -0
- package/dist/components/cost-categories-page.d.ts +5 -0
- package/dist/components/cost-categories-page.d.ts.map +1 -0
- package/dist/components/cost-categories-page.js +30 -0
- package/dist/components/invoice-action-ledger-card.d.ts +15 -0
- package/dist/components/invoice-action-ledger-card.d.ts.map +1 -0
- package/dist/components/invoice-action-ledger-card.js +76 -0
- package/dist/components/invoice-bulk-actions.d.ts +10 -0
- package/dist/components/invoice-bulk-actions.d.ts.map +1 -0
- package/dist/components/invoice-bulk-actions.js +19 -0
- package/dist/components/invoice-detail-page/cards.d.ts +44 -0
- package/dist/components/invoice-detail-page/cards.d.ts.map +1 -0
- package/dist/components/invoice-detail-page/cards.js +43 -0
- package/dist/components/invoice-detail-page/header.d.ts +15 -0
- package/dist/components/invoice-detail-page/header.d.ts.map +1 -0
- package/dist/components/invoice-detail-page/header.js +30 -0
- package/dist/components/invoice-detail-page/notes-dialogs.d.ts +28 -0
- package/dist/components/invoice-detail-page/notes-dialogs.d.ts.map +1 -0
- package/dist/components/invoice-detail-page/notes-dialogs.js +104 -0
- package/dist/components/invoice-detail-page/primitives.d.ts +47 -0
- package/dist/components/invoice-detail-page/primitives.d.ts.map +1 -0
- package/dist/components/invoice-detail-page/primitives.js +76 -0
- package/dist/components/invoice-detail-page-with-action-ledger.d.ts +7 -0
- package/dist/components/invoice-detail-page-with-action-ledger.d.ts.map +1 -0
- package/dist/components/invoice-detail-page-with-action-ledger.js +11 -0
- package/dist/components/invoice-detail-page.d.ts +46 -0
- package/dist/components/invoice-detail-page.d.ts.map +1 -0
- package/dist/components/invoice-detail-page.js +134 -0
- package/dist/components/invoice-dialog.d.ts +9 -0
- package/dist/components/invoice-dialog.d.ts.map +1 -0
- package/dist/components/invoice-dialog.js +145 -0
- package/dist/components/invoice-number-series-dialog.d.ts +9 -0
- package/dist/components/invoice-number-series-dialog.d.ts.map +1 -0
- package/dist/components/invoice-number-series-dialog.js +134 -0
- package/dist/components/invoice-number-series-format.d.ts +3 -0
- package/dist/components/invoice-number-series-format.d.ts.map +1 -0
- package/dist/components/invoice-number-series-format.js +4 -0
- package/dist/components/invoice-number-series-page.d.ts +5 -0
- package/dist/components/invoice-number-series-page.d.ts.map +1 -0
- package/dist/components/invoice-number-series-page.js +55 -0
- package/dist/components/invoice-table-parts.d.ts +25 -0
- package/dist/components/invoice-table-parts.d.ts.map +1 -0
- package/dist/components/invoice-table-parts.js +32 -0
- package/dist/components/invoices-page-skeleton.d.ts +5 -0
- package/dist/components/invoices-page-skeleton.d.ts.map +1 -0
- package/dist/components/invoices-page-skeleton.js +13 -0
- package/dist/components/invoices-page.d.ts +6 -0
- package/dist/components/invoices-page.d.ts.map +1 -0
- package/dist/components/invoices-page.js +145 -0
- package/dist/components/payment-detail-page.d.ts +47 -0
- package/dist/components/payment-detail-page.d.ts.map +1 -0
- package/dist/components/payment-detail-page.js +90 -0
- package/dist/components/payment-policy-form.d.ts +49 -0
- package/dist/components/payment-policy-form.d.ts.map +1 -0
- package/dist/components/payment-policy-form.js +82 -0
- package/dist/components/payments-page/controls.d.ts +23 -0
- package/dist/components/payments-page/controls.d.ts.map +1 -0
- package/dist/components/payments-page/controls.js +20 -0
- package/dist/components/payments-page-skeleton.d.ts +5 -0
- package/dist/components/payments-page-skeleton.d.ts.map +1 -0
- package/dist/components/payments-page-skeleton.js +13 -0
- package/dist/components/payments-page.d.ts +20 -0
- package/dist/components/payments-page.d.ts.map +1 -0
- package/dist/components/payments-page.js +143 -0
- package/dist/components/profitability-page/sections.d.ts +24 -0
- package/dist/components/profitability-page/sections.d.ts.map +1 -0
- package/dist/components/profitability-page/sections.js +43 -0
- package/dist/components/profitability-page.d.ts +13 -0
- package/dist/components/profitability-page.d.ts.map +1 -0
- package/dist/components/profitability-page.js +175 -0
- package/dist/components/record-booking-payment-dialog/shared.d.ts +54 -0
- package/dist/components/record-booking-payment-dialog/shared.d.ts.map +1 -0
- package/dist/components/record-booking-payment-dialog/shared.js +47 -0
- package/dist/components/record-booking-payment-dialog.d.ts +4 -0
- package/dist/components/record-booking-payment-dialog.d.ts.map +1 -0
- package/dist/components/record-booking-payment-dialog.js +256 -0
- package/dist/components/supplier-invoice-detail-page/dialogs.d.ts +34 -0
- package/dist/components/supplier-invoice-detail-page/dialogs.d.ts.map +1 -0
- package/dist/components/supplier-invoice-detail-page/dialogs.js +119 -0
- package/dist/components/supplier-invoice-detail-page/shared.d.ts +64 -0
- package/dist/components/supplier-invoice-detail-page/shared.d.ts.map +1 -0
- package/dist/components/supplier-invoice-detail-page/shared.js +70 -0
- package/dist/components/supplier-invoice-detail-page.d.ts +4 -0
- package/dist/components/supplier-invoice-detail-page.d.ts.map +1 -0
- package/dist/components/supplier-invoice-detail-page.js +101 -0
- package/dist/components/supplier-invoice-form-dialog.d.ts +45 -0
- package/dist/components/supplier-invoice-form-dialog.d.ts.map +1 -0
- package/dist/components/supplier-invoice-form-dialog.js +102 -0
- package/dist/components/supplier-invoices-page.d.ts +14 -0
- package/dist/components/supplier-invoices-page.d.ts.map +1 -0
- package/dist/components/supplier-invoices-page.js +69 -0
- package/dist/components/supplier-payment-dialog.d.ts +7 -0
- package/dist/components/supplier-payment-dialog.d.ts.map +1 -0
- package/dist/components/supplier-payment-dialog.js +103 -0
- package/dist/components/taxes-page/policy-profile-sheet.d.ts +8 -0
- package/dist/components/taxes-page/policy-profile-sheet.d.ts.map +1 -0
- package/dist/components/taxes-page/policy-profile-sheet.js +52 -0
- package/dist/components/taxes-page/policy-rule-sheet.d.ts +10 -0
- package/dist/components/taxes-page/policy-rule-sheet.d.ts.map +1 -0
- package/dist/components/taxes-page/policy-rule-sheet.js +137 -0
- package/dist/components/taxes-page/shared.d.ts +128 -0
- package/dist/components/taxes-page/shared.d.ts.map +1 -0
- package/dist/components/taxes-page/shared.js +288 -0
- package/dist/components/taxes-page/sheets.d.ts +4 -0
- package/dist/components/taxes-page/sheets.d.ts.map +1 -0
- package/dist/components/taxes-page/sheets.js +3 -0
- package/dist/components/taxes-page/tax-sheet.d.ts +9 -0
- package/dist/components/taxes-page/tax-sheet.d.ts.map +1 -0
- package/dist/components/taxes-page/tax-sheet.js +108 -0
- package/dist/components/taxes-page.d.ts +4 -0
- package/dist/components/taxes-page.d.ts.map +1 -0
- package/dist/components/taxes-page.js +165 -0
- package/dist/hooks/index.d.ts +53 -0
- package/dist/hooks/index.d.ts.map +1 -0
- package/dist/hooks/index.js +52 -0
- package/dist/hooks/use-accountant-share-mutation.d.ts +20 -0
- package/dist/hooks/use-accountant-share-mutation.d.ts.map +1 -0
- package/dist/hooks/use-accountant-share-mutation.js +27 -0
- package/dist/hooks/use-accountant-shares.d.ts +13 -0
- package/dist/hooks/use-accountant-shares.d.ts.map +1 -0
- package/dist/hooks/use-accountant-shares.js +8 -0
- package/dist/hooks/use-admin-booking-payments.d.ts +30 -0
- package/dist/hooks/use-admin-booking-payments.d.ts.map +1 -0
- package/dist/hooks/use-admin-booking-payments.js +18 -0
- package/dist/hooks/use-all-payments.d.ts +35 -0
- package/dist/hooks/use-all-payments.d.ts.map +1 -0
- package/dist/hooks/use-all-payments.js +12 -0
- package/dist/hooks/use-booking-guarantees.d.ts +82 -0
- package/dist/hooks/use-booking-guarantees.d.ts.map +1 -0
- package/dist/hooks/use-booking-guarantees.js +46 -0
- package/dist/hooks/use-booking-payment-schedule-regenerate-mutation.d.ts +44 -0
- package/dist/hooks/use-booking-payment-schedule-regenerate-mutation.d.ts.map +1 -0
- package/dist/hooks/use-booking-payment-schedule-regenerate-mutation.js +27 -0
- package/dist/hooks/use-booking-payment-schedules.d.ts +63 -0
- package/dist/hooks/use-booking-payment-schedules.d.ts.map +1 -0
- package/dist/hooks/use-booking-payment-schedules.js +47 -0
- package/dist/hooks/use-cost-categories.d.ts +14 -0
- package/dist/hooks/use-cost-categories.d.ts.map +1 -0
- package/dist/hooks/use-cost-categories.js +9 -0
- package/dist/hooks/use-cost-category-mutation.d.ts +31 -0
- package/dist/hooks/use-cost-category-mutation.d.ts.map +1 -0
- package/dist/hooks/use-cost-category-mutation.js +27 -0
- package/dist/hooks/use-departure-profitability.d.ts +56 -0
- package/dist/hooks/use-departure-profitability.d.ts.map +1 -0
- package/dist/hooks/use-departure-profitability.js +12 -0
- package/dist/hooks/use-finance-action-ledger.d.ts +94 -0
- package/dist/hooks/use-finance-action-ledger.d.ts.map +1 -0
- package/dist/hooks/use-finance-action-ledger.js +20 -0
- package/dist/hooks/use-invoice-attachment-mutation.d.ts +43 -0
- package/dist/hooks/use-invoice-attachment-mutation.d.ts.map +1 -0
- package/dist/hooks/use-invoice-attachment-mutation.js +39 -0
- package/dist/hooks/use-invoice-attachments.d.ts +18 -0
- package/dist/hooks/use-invoice-attachments.d.ts.map +1 -0
- package/dist/hooks/use-invoice-attachments.js +12 -0
- package/dist/hooks/use-invoice-bulk-status-mutation.d.ts +51 -0
- package/dist/hooks/use-invoice-bulk-status-mutation.d.ts.map +1 -0
- package/dist/hooks/use-invoice-bulk-status-mutation.js +66 -0
- package/dist/hooks/use-invoice-credit-note-mutation.d.ts +38 -0
- package/dist/hooks/use-invoice-credit-note-mutation.d.ts.map +1 -0
- package/dist/hooks/use-invoice-credit-note-mutation.js +35 -0
- package/dist/hooks/use-invoice-credit-notes.d.ts +17 -0
- package/dist/hooks/use-invoice-credit-notes.d.ts.map +1 -0
- package/dist/hooks/use-invoice-credit-notes.js +12 -0
- package/dist/hooks/use-invoice-fx-rate.d.ts +19 -0
- package/dist/hooks/use-invoice-fx-rate.d.ts.map +1 -0
- package/dist/hooks/use-invoice-fx-rate.js +13 -0
- package/dist/hooks/use-invoice-line-item-mutation.d.ts +40 -0
- package/dist/hooks/use-invoice-line-item-mutation.d.ts.map +1 -0
- package/dist/hooks/use-invoice-line-item-mutation.js +42 -0
- package/dist/hooks/use-invoice-line-items.d.ts +17 -0
- package/dist/hooks/use-invoice-line-items.d.ts.map +1 -0
- package/dist/hooks/use-invoice-line-items.js +12 -0
- package/dist/hooks/use-invoice-mutation.d.ts +225 -0
- package/dist/hooks/use-invoice-mutation.d.ts.map +1 -0
- package/dist/hooks/use-invoice-mutation.js +121 -0
- package/dist/hooks/use-invoice-note-mutation.d.ts +11 -0
- package/dist/hooks/use-invoice-note-mutation.d.ts.map +1 -0
- package/dist/hooks/use-invoice-note-mutation.js +23 -0
- package/dist/hooks/use-invoice-notes.d.ts +13 -0
- package/dist/hooks/use-invoice-notes.d.ts.map +1 -0
- package/dist/hooks/use-invoice-notes.js +12 -0
- package/dist/hooks/use-invoice-number-series-mutation.d.ts +62 -0
- package/dist/hooks/use-invoice-number-series-mutation.d.ts.map +1 -0
- package/dist/hooks/use-invoice-number-series-mutation.js +39 -0
- package/dist/hooks/use-invoice-number-series.d.ts +28 -0
- package/dist/hooks/use-invoice-number-series.d.ts.map +1 -0
- package/dist/hooks/use-invoice-number-series.js +12 -0
- package/dist/hooks/use-invoice-payment-mutation.d.ts +29 -0
- package/dist/hooks/use-invoice-payment-mutation.d.ts.map +1 -0
- package/dist/hooks/use-invoice-payment-mutation.js +35 -0
- package/dist/hooks/use-invoice-payments.d.ts +21 -0
- package/dist/hooks/use-invoice-payments.d.ts.map +1 -0
- package/dist/hooks/use-invoice-payments.js +12 -0
- package/dist/hooks/use-invoice.d.ts +32 -0
- package/dist/hooks/use-invoice.d.ts.map +1 -0
- package/dist/hooks/use-invoice.js +12 -0
- package/dist/hooks/use-invoices.d.ts +36 -0
- package/dist/hooks/use-invoices.d.ts.map +1 -0
- package/dist/hooks/use-invoices.js +12 -0
- package/dist/hooks/use-payment-mutation.d.ts +57 -0
- package/dist/hooks/use-payment-mutation.d.ts.map +1 -0
- package/dist/hooks/use-payment-mutation.js +59 -0
- package/dist/hooks/use-payment-session-mutation.d.ts +205 -0
- package/dist/hooks/use-payment-session-mutation.d.ts.map +1 -0
- package/dist/hooks/use-payment-session-mutation.js +38 -0
- package/dist/hooks/use-payment-sessions.d.ts +97 -0
- package/dist/hooks/use-payment-sessions.d.ts.map +1 -0
- package/dist/hooks/use-payment-sessions.js +17 -0
- package/dist/hooks/use-payment.d.ts +31 -0
- package/dist/hooks/use-payment.d.ts.map +1 -0
- package/dist/hooks/use-payment.js +12 -0
- package/dist/hooks/use-product-profitability.d.ts +52 -0
- package/dist/hooks/use-product-profitability.d.ts.map +1 -0
- package/dist/hooks/use-product-profitability.js +12 -0
- package/dist/hooks/use-public-booking-documents.d.ts +29 -0
- package/dist/hooks/use-public-booking-documents.d.ts.map +1 -0
- package/dist/hooks/use-public-booking-documents.js +12 -0
- package/dist/hooks/use-public-booking-payment-options.d.ts +47 -0
- package/dist/hooks/use-public-booking-payment-options.d.ts.map +1 -0
- package/dist/hooks/use-public-booking-payment-options.js +12 -0
- package/dist/hooks/use-public-booking-payments.d.ts +24 -0
- package/dist/hooks/use-public-booking-payments.d.ts.map +1 -0
- package/dist/hooks/use-public-booking-payments.js +12 -0
- package/dist/hooks/use-public-finance-document-by-reference.d.ts +27 -0
- package/dist/hooks/use-public-finance-document-by-reference.d.ts.map +1 -0
- package/dist/hooks/use-public-finance-document-by-reference.js +12 -0
- package/dist/hooks/use-public-payment-session-mutation.d.ts +82 -0
- package/dist/hooks/use-public-payment-session-mutation.d.ts.map +1 -0
- package/dist/hooks/use-public-payment-session-mutation.js +33 -0
- package/dist/hooks/use-public-payment-session.d.ts +73 -0
- package/dist/hooks/use-public-payment-session.d.ts.map +1 -0
- package/dist/hooks/use-public-payment-session.js +12 -0
- package/dist/hooks/use-public-voucher-validation-mutation.d.ts +23 -0
- package/dist/hooks/use-public-voucher-validation-mutation.d.ts.map +1 -0
- package/dist/hooks/use-public-voucher-validation-mutation.js +17 -0
- package/dist/hooks/use-supplier-invoice-attachments.d.ts +17 -0
- package/dist/hooks/use-supplier-invoice-attachments.d.ts.map +1 -0
- package/dist/hooks/use-supplier-invoice-attachments.js +12 -0
- package/dist/hooks/use-supplier-invoice-mutation.d.ts +353 -0
- package/dist/hooks/use-supplier-invoice-mutation.d.ts.map +1 -0
- package/dist/hooks/use-supplier-invoice-mutation.js +81 -0
- package/dist/hooks/use-supplier-invoice-payments.d.ts +26 -0
- package/dist/hooks/use-supplier-invoice-payments.d.ts.map +1 -0
- package/dist/hooks/use-supplier-invoice-payments.js +12 -0
- package/dist/hooks/use-supplier-invoice.d.ts +65 -0
- package/dist/hooks/use-supplier-invoice.d.ts.map +1 -0
- package/dist/hooks/use-supplier-invoice.js +12 -0
- package/dist/hooks/use-supplier-invoices.d.ts +36 -0
- package/dist/hooks/use-supplier-invoices.d.ts.map +1 -0
- package/dist/hooks/use-supplier-invoices.js +12 -0
- package/dist/hooks/use-supplier-payment-mutation.d.ts +55 -0
- package/dist/hooks/use-supplier-payment-mutation.d.ts.map +1 -0
- package/dist/hooks/use-supplier-payment-mutation.js +35 -0
- package/dist/hooks/use-supplier-payments.d.ts +27 -0
- package/dist/hooks/use-supplier-payments.d.ts.map +1 -0
- package/dist/hooks/use-supplier-payments.js +12 -0
- package/dist/hooks/use-traveler-profitability.d.ts +24 -0
- package/dist/hooks/use-traveler-profitability.d.ts.map +1 -0
- package/dist/hooks/use-traveler-profitability.js +11 -0
- package/dist/hooks/use-voucher-mutation.d.ts +105 -0
- package/dist/hooks/use-voucher-mutation.d.ts.map +1 -0
- package/dist/hooks/use-voucher-mutation.js +50 -0
- package/dist/hooks/use-voucher.d.ts +38 -0
- package/dist/hooks/use-voucher.d.ts.map +1 -0
- package/dist/hooks/use-voucher.js +17 -0
- package/dist/hooks/use-vouchers.d.ts +34 -0
- package/dist/hooks/use-vouchers.d.ts.map +1 -0
- package/dist/hooks/use-vouchers.js +18 -0
- package/dist/i18n/en/invoices.d.ts +278 -0
- package/dist/i18n/en/invoices.d.ts.map +1 -0
- package/dist/i18n/en/invoices.js +277 -0
- package/dist/i18n/en/numberingAndPayments.d.ts +387 -0
- package/dist/i18n/en/numberingAndPayments.d.ts.map +1 -0
- package/dist/i18n/en/numberingAndPayments.js +386 -0
- package/dist/i18n/en/profitability.d.ts +147 -0
- package/dist/i18n/en/profitability.d.ts.map +1 -0
- package/dist/i18n/en/profitability.js +146 -0
- package/dist/i18n/en/suppliers.d.ts +187 -0
- package/dist/i18n/en/suppliers.d.ts.map +1 -0
- package/dist/i18n/en/suppliers.js +186 -0
- package/dist/i18n/en.d.ts +998 -0
- package/dist/i18n/en.d.ts.map +1 -0
- package/dist/i18n/en.js +22 -0
- package/dist/i18n/index.d.ts +5 -0
- package/dist/i18n/index.d.ts.map +1 -0
- package/dist/i18n/index.js +3 -0
- package/dist/i18n/messages/core.d.ts +18 -0
- package/dist/i18n/messages/core.d.ts.map +1 -0
- package/dist/i18n/messages/core.js +30 -0
- package/dist/i18n/messages/invoices.d.ts +252 -0
- package/dist/i18n/messages/invoices.d.ts.map +1 -0
- package/dist/i18n/messages/invoices.js +1 -0
- package/dist/i18n/messages/numberingAndPayments.d.ts +277 -0
- package/dist/i18n/messages/numberingAndPayments.d.ts.map +1 -0
- package/dist/i18n/messages/numberingAndPayments.js +1 -0
- package/dist/i18n/messages/profitability.d.ts +151 -0
- package/dist/i18n/messages/profitability.d.ts.map +1 -0
- package/dist/i18n/messages/profitability.js +1 -0
- package/dist/i18n/messages/suppliers.d.ts +167 -0
- package/dist/i18n/messages/suppliers.d.ts.map +1 -0
- package/dist/i18n/messages/suppliers.js +1 -0
- package/dist/i18n/messages.d.ts +29 -0
- package/dist/i18n/messages.d.ts.map +1 -0
- package/dist/i18n/messages.js +1 -0
- package/dist/i18n/provider.d.ts +2018 -0
- package/dist/i18n/provider.d.ts.map +1 -0
- package/dist/i18n/provider.js +44 -0
- package/dist/i18n/ro/invoices.d.ts +278 -0
- package/dist/i18n/ro/invoices.d.ts.map +1 -0
- package/dist/i18n/ro/invoices.js +277 -0
- package/dist/i18n/ro/numberingAndPayments.d.ts +387 -0
- package/dist/i18n/ro/numberingAndPayments.d.ts.map +1 -0
- package/dist/i18n/ro/numberingAndPayments.js +386 -0
- package/dist/i18n/ro/profitability.d.ts +147 -0
- package/dist/i18n/ro/profitability.d.ts.map +1 -0
- package/dist/i18n/ro/profitability.js +146 -0
- package/dist/i18n/ro/suppliers.d.ts +187 -0
- package/dist/i18n/ro/suppliers.d.ts.map +1 -0
- package/dist/i18n/ro/suppliers.js +186 -0
- package/dist/i18n/ro.d.ts +998 -0
- package/dist/i18n/ro.d.ts.map +1 -0
- package/dist/i18n/ro.js +22 -0
- package/dist/index.d.ts +11 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +9 -0
- package/dist/operations.d.ts +484 -0
- package/dist/operations.d.ts.map +1 -0
- package/dist/operations.js +52 -0
- package/dist/provider.d.ts +2 -0
- package/dist/provider.d.ts.map +1 -0
- package/dist/provider.js +1 -0
- package/dist/query-keys.d.ts +195 -0
- package/dist/query-keys.d.ts.map +1 -0
- package/dist/query-keys.js +49 -0
- package/dist/query-options/public-reporting.d.ts +2129 -0
- package/dist/query-options/public-reporting.d.ts.map +1 -0
- package/dist/query-options/public-reporting.js +193 -0
- package/dist/query-options-action-ledger.d.ts +382 -0
- package/dist/query-options-action-ledger.d.ts.map +1 -0
- package/dist/query-options-action-ledger.js +36 -0
- package/dist/query-options.d.ts +2057 -0
- package/dist/query-options.d.ts.map +1 -0
- package/dist/query-options.js +328 -0
- package/dist/schemas/accountant.d.ts +168 -0
- package/dist/schemas/accountant.d.ts.map +1 -0
- package/dist/schemas/accountant.js +53 -0
- package/dist/schemas/action-ledger.d.ts +206 -0
- package/dist/schemas/action-ledger.d.ts.map +1 -0
- package/dist/schemas/action-ledger.js +83 -0
- package/dist/schemas/common.d.ts +17 -0
- package/dist/schemas/common.d.ts.map +1 -0
- package/dist/schemas/common.js +10 -0
- package/dist/schemas/invoice.d.ts +1451 -0
- package/dist/schemas/invoice.d.ts.map +1 -0
- package/dist/schemas/invoice.js +438 -0
- package/dist/schemas/profitability.d.ts +333 -0
- package/dist/schemas/profitability.d.ts.map +1 -0
- package/dist/schemas/profitability.js +84 -0
- package/dist/schemas/public.d.ts +481 -0
- package/dist/schemas/public.d.ts.map +1 -0
- package/dist/schemas/public.js +9 -0
- package/dist/schemas/responses.d.ts +632 -0
- package/dist/schemas/responses.d.ts.map +1 -0
- package/dist/schemas/responses.js +27 -0
- package/dist/schemas/supplier.d.ts +226 -0
- package/dist/schemas/supplier.d.ts.map +1 -0
- package/dist/schemas/supplier.js +103 -0
- package/dist/schemas/vouchers.d.ts +283 -0
- package/dist/schemas/vouchers.d.ts.map +1 -0
- package/dist/schemas/vouchers.js +49 -0
- package/dist/schemas.d.ts +10 -0
- package/dist/schemas.d.ts.map +1 -0
- package/dist/schemas.js +9 -0
- package/dist/ui.d.ts +27 -0
- package/dist/ui.d.ts.map +1 -0
- package/dist/ui.js +26 -0
- package/package.json +181 -0
- package/src/styles.css +12 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export interface UseInvoicePaymentsOptions {
|
|
2
|
+
enabled?: boolean;
|
|
3
|
+
}
|
|
4
|
+
export declare function useInvoicePayments(invoiceId: string | null | undefined, options?: UseInvoicePaymentsOptions): import("@tanstack/react-query").UseQueryResult<{
|
|
5
|
+
data: {
|
|
6
|
+
id: string;
|
|
7
|
+
invoiceId: string;
|
|
8
|
+
amountCents: number;
|
|
9
|
+
currency: string;
|
|
10
|
+
baseCurrency: string | null;
|
|
11
|
+
baseAmountCents: number | null;
|
|
12
|
+
paymentMethod: string;
|
|
13
|
+
status: "pending" | "completed" | "failed" | "refunded";
|
|
14
|
+
referenceNumber: string | null;
|
|
15
|
+
paymentDate: string;
|
|
16
|
+
notes: string | null;
|
|
17
|
+
createdAt: string;
|
|
18
|
+
fxRateSetId?: string | null | undefined;
|
|
19
|
+
}[];
|
|
20
|
+
}, Error>;
|
|
21
|
+
//# sourceMappingURL=use-invoice-payments.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-invoice-payments.d.ts","sourceRoot":"","sources":["../../src/hooks/use-invoice-payments.ts"],"names":[],"mappings":"AAOA,MAAM,WAAW,yBAAyB;IACxC,OAAO,CAAC,EAAE,OAAO,CAAA;CAClB;AAED,wBAAgB,kBAAkB,CAChC,SAAS,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,EACpC,OAAO,GAAE,yBAA8B;;;;;;;;;;;;;;;;UASxC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { useQuery } from "@tanstack/react-query";
|
|
3
|
+
import { useVoyantFinanceContext } from "../provider.js";
|
|
4
|
+
import { getInvoicePaymentsQueryOptions } from "../query-options.js";
|
|
5
|
+
export function useInvoicePayments(invoiceId, options = {}) {
|
|
6
|
+
const { baseUrl, fetcher } = useVoyantFinanceContext();
|
|
7
|
+
const { enabled = true } = options;
|
|
8
|
+
return useQuery({
|
|
9
|
+
...getInvoicePaymentsQueryOptions({ baseUrl, fetcher }, invoiceId),
|
|
10
|
+
enabled: enabled && Boolean(invoiceId),
|
|
11
|
+
});
|
|
12
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
export interface UseInvoiceOptions {
|
|
2
|
+
enabled?: boolean;
|
|
3
|
+
}
|
|
4
|
+
export declare function useInvoice(id: string | null | undefined, options?: UseInvoiceOptions): import("@tanstack/react-query").UseQueryResult<{
|
|
5
|
+
data: {
|
|
6
|
+
[x: string]: unknown;
|
|
7
|
+
id: string;
|
|
8
|
+
invoiceNumber: string;
|
|
9
|
+
bookingId: string;
|
|
10
|
+
personId: string | null;
|
|
11
|
+
organizationId: string | null;
|
|
12
|
+
status: "draft" | "pending_external_allocation" | "issued" | "partially_paid" | "paid" | "overdue" | "void";
|
|
13
|
+
currency: string;
|
|
14
|
+
subtotalCents: number;
|
|
15
|
+
taxCents: number;
|
|
16
|
+
totalCents: number;
|
|
17
|
+
paidCents: number;
|
|
18
|
+
balanceDueCents: number;
|
|
19
|
+
issueDate: string;
|
|
20
|
+
dueDate: string;
|
|
21
|
+
notes: string | null;
|
|
22
|
+
createdAt: string;
|
|
23
|
+
updatedAt: string;
|
|
24
|
+
invoiceType?: "invoice" | "proforma" | "credit_note" | undefined;
|
|
25
|
+
voidedAt?: string | null | undefined;
|
|
26
|
+
voidReason?: string | null | undefined;
|
|
27
|
+
bookingPaymentScheduleIds?: string[] | undefined;
|
|
28
|
+
convertedToInvoiceId?: string | null | undefined;
|
|
29
|
+
convertedToInvoiceNumber?: string | null | undefined;
|
|
30
|
+
};
|
|
31
|
+
}, Error>;
|
|
32
|
+
//# sourceMappingURL=use-invoice.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-invoice.d.ts","sourceRoot":"","sources":["../../src/hooks/use-invoice.ts"],"names":[],"mappings":"AAOA,MAAM,WAAW,iBAAiB;IAChC,OAAO,CAAC,EAAE,OAAO,CAAA;CAClB;AAED,wBAAgB,UAAU,CAAC,EAAE,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,EAAE,OAAO,GAAE,iBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;UAQxF"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { useQuery } from "@tanstack/react-query";
|
|
3
|
+
import { useVoyantFinanceContext } from "../provider.js";
|
|
4
|
+
import { getInvoiceQueryOptions } from "../query-options.js";
|
|
5
|
+
export function useInvoice(id, options = {}) {
|
|
6
|
+
const { baseUrl, fetcher } = useVoyantFinanceContext();
|
|
7
|
+
const { enabled = true } = options;
|
|
8
|
+
return useQuery({
|
|
9
|
+
...getInvoiceQueryOptions({ baseUrl, fetcher }, id),
|
|
10
|
+
enabled: enabled && Boolean(id),
|
|
11
|
+
});
|
|
12
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import type { FinanceInvoiceListFilters } from "../query-keys.js";
|
|
2
|
+
export interface UseInvoicesOptions extends FinanceInvoiceListFilters {
|
|
3
|
+
enabled?: boolean;
|
|
4
|
+
}
|
|
5
|
+
export declare function useInvoices(options?: UseInvoicesOptions): import("@tanstack/react-query").UseQueryResult<{
|
|
6
|
+
data: {
|
|
7
|
+
[x: string]: unknown;
|
|
8
|
+
id: string;
|
|
9
|
+
invoiceNumber: string;
|
|
10
|
+
bookingId: string;
|
|
11
|
+
personId: string | null;
|
|
12
|
+
organizationId: string | null;
|
|
13
|
+
status: "draft" | "pending_external_allocation" | "issued" | "partially_paid" | "paid" | "overdue" | "void";
|
|
14
|
+
currency: string;
|
|
15
|
+
subtotalCents: number;
|
|
16
|
+
taxCents: number;
|
|
17
|
+
totalCents: number;
|
|
18
|
+
paidCents: number;
|
|
19
|
+
balanceDueCents: number;
|
|
20
|
+
issueDate: string;
|
|
21
|
+
dueDate: string;
|
|
22
|
+
notes: string | null;
|
|
23
|
+
createdAt: string;
|
|
24
|
+
updatedAt: string;
|
|
25
|
+
invoiceType?: "invoice" | "proforma" | "credit_note" | undefined;
|
|
26
|
+
voidedAt?: string | null | undefined;
|
|
27
|
+
voidReason?: string | null | undefined;
|
|
28
|
+
bookingPaymentScheduleIds?: string[] | undefined;
|
|
29
|
+
convertedToInvoiceId?: string | null | undefined;
|
|
30
|
+
convertedToInvoiceNumber?: string | null | undefined;
|
|
31
|
+
}[];
|
|
32
|
+
total: number;
|
|
33
|
+
limit: number;
|
|
34
|
+
offset: number;
|
|
35
|
+
}, Error>;
|
|
36
|
+
//# sourceMappingURL=use-invoices.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-invoices.d.ts","sourceRoot":"","sources":["../../src/hooks/use-invoices.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,kBAAkB,CAAA;AAGjE,MAAM,WAAW,kBAAmB,SAAQ,yBAAyB;IACnE,OAAO,CAAC,EAAE,OAAO,CAAA;CAClB;AAED,wBAAgB,WAAW,CAAC,OAAO,GAAE,kBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;UAQ3D"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { useQuery } from "@tanstack/react-query";
|
|
3
|
+
import { useVoyantFinanceContext } from "../provider.js";
|
|
4
|
+
import { getInvoicesQueryOptions } from "../query-options.js";
|
|
5
|
+
export function useInvoices(options = {}) {
|
|
6
|
+
const { baseUrl, fetcher } = useVoyantFinanceContext();
|
|
7
|
+
const { enabled = true, ...filters } = options;
|
|
8
|
+
return useQuery({
|
|
9
|
+
...getInvoicesQueryOptions({ baseUrl, fetcher }, filters),
|
|
10
|
+
enabled,
|
|
11
|
+
});
|
|
12
|
+
}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { type PaymentMethod, type PaymentStatus } from "../schemas.js";
|
|
2
|
+
export interface UpdatePaymentInput {
|
|
3
|
+
amountCents?: number;
|
|
4
|
+
currency?: string;
|
|
5
|
+
baseCurrency?: string | null;
|
|
6
|
+
baseAmountCents?: number | null;
|
|
7
|
+
fxRateSetId?: string | null;
|
|
8
|
+
paymentMethod?: PaymentMethod;
|
|
9
|
+
status?: PaymentStatus;
|
|
10
|
+
referenceNumber?: string | null;
|
|
11
|
+
paymentDate?: string;
|
|
12
|
+
notes?: string | null;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Mutations for an already-recorded customer payment.
|
|
16
|
+
*
|
|
17
|
+
* `useInvoicePaymentMutation(invoiceId)` covers create; update + delete
|
|
18
|
+
* route through `/v1/admin/finance/payments/:id` and recompute invoice totals
|
|
19
|
+
* server-side, so callers don't need to refresh the invoice manually —
|
|
20
|
+
* onSuccess invalidates the invoice and payment list queries.
|
|
21
|
+
*/
|
|
22
|
+
export declare function usePaymentMutation(): {
|
|
23
|
+
update: import("@tanstack/react-query").UseMutationResult<{
|
|
24
|
+
id: string;
|
|
25
|
+
invoiceId: string;
|
|
26
|
+
amountCents: number;
|
|
27
|
+
currency: string;
|
|
28
|
+
baseCurrency: string | null;
|
|
29
|
+
baseAmountCents: number | null;
|
|
30
|
+
paymentMethod: string;
|
|
31
|
+
status: "pending" | "completed" | "failed" | "refunded";
|
|
32
|
+
referenceNumber: string | null;
|
|
33
|
+
paymentDate: string;
|
|
34
|
+
notes: string | null;
|
|
35
|
+
createdAt: string;
|
|
36
|
+
fxRateSetId?: string | null | undefined;
|
|
37
|
+
}, Error, {
|
|
38
|
+
id: string;
|
|
39
|
+
input: UpdatePaymentInput;
|
|
40
|
+
}, unknown>;
|
|
41
|
+
remove: import("@tanstack/react-query").UseMutationResult<{
|
|
42
|
+
id: string;
|
|
43
|
+
invoiceId: string;
|
|
44
|
+
amountCents: number;
|
|
45
|
+
currency: string;
|
|
46
|
+
baseCurrency: string | null;
|
|
47
|
+
baseAmountCents: number | null;
|
|
48
|
+
paymentMethod: string;
|
|
49
|
+
status: "pending" | "completed" | "failed" | "refunded";
|
|
50
|
+
referenceNumber: string | null;
|
|
51
|
+
paymentDate: string;
|
|
52
|
+
notes: string | null;
|
|
53
|
+
createdAt: string;
|
|
54
|
+
fxRateSetId?: string | null | undefined;
|
|
55
|
+
}, Error, string, unknown>;
|
|
56
|
+
};
|
|
57
|
+
//# sourceMappingURL=use-payment-mutation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-payment-mutation.d.ts","sourceRoot":"","sources":["../../src/hooks/use-payment-mutation.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,KAAK,aAAa,EAAE,KAAK,aAAa,EAAuB,MAAM,eAAe,CAAA;AAE3F,MAAM,WAAW,kBAAkB;IACjC,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,YAAY,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IAC5B,eAAe,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IAC/B,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IAC3B,aAAa,CAAC,EAAE,aAAa,CAAA;IAC7B,MAAM,CAAC,EAAE,aAAa,CAAA;IACtB,eAAe,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IAC/B,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;CACtB;AA6BD;;;;;;;GAOG;AACH,wBAAgB,kBAAkB;;;;;;;;;;;;;;;;YAKU,MAAM;eAAS,kBAAkB;;;;;;;;;;;;;;;;;EA8B5E"}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { useMutation, useQueryClient } from "@tanstack/react-query";
|
|
3
|
+
import { z } from "zod";
|
|
4
|
+
import { fetchWithValidation } from "../client.js";
|
|
5
|
+
import { useVoyantFinanceContext } from "../provider.js";
|
|
6
|
+
import { financeQueryKeys } from "../query-keys.js";
|
|
7
|
+
import { paymentRecordSchema } from "../schemas.js";
|
|
8
|
+
const paymentSingleResponse = z.object({
|
|
9
|
+
data: paymentRecordSchema,
|
|
10
|
+
});
|
|
11
|
+
function invalidatePaymentScopes(queryClient, invoiceId, paymentId) {
|
|
12
|
+
void queryClient.invalidateQueries({ queryKey: financeQueryKeys.allPayments() });
|
|
13
|
+
void queryClient.invalidateQueries({ queryKey: financeQueryKeys.payment(paymentId) });
|
|
14
|
+
if (invoiceId) {
|
|
15
|
+
void queryClient.invalidateQueries({ queryKey: financeQueryKeys.payments(invoiceId) });
|
|
16
|
+
void queryClient.invalidateQueries({ queryKey: financeQueryKeys.invoice(invoiceId) });
|
|
17
|
+
}
|
|
18
|
+
// The BookingPaymentsSummary card on the booking detail page is keyed
|
|
19
|
+
// by bookingId, which the PATCH/DELETE response doesn't surface. Use
|
|
20
|
+
// prefix invalidation so every booking-payments query refetches —
|
|
21
|
+
// cheap because each query is per-booking and short.
|
|
22
|
+
void queryClient.invalidateQueries({
|
|
23
|
+
queryKey: [...financeQueryKeys.all, "admin-booking-payments"],
|
|
24
|
+
});
|
|
25
|
+
void queryClient.invalidateQueries({
|
|
26
|
+
queryKey: [...financeQueryKeys.publicCheckout(), "booking-payments"],
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Mutations for an already-recorded customer payment.
|
|
31
|
+
*
|
|
32
|
+
* `useInvoicePaymentMutation(invoiceId)` covers create; update + delete
|
|
33
|
+
* route through `/v1/admin/finance/payments/:id` and recompute invoice totals
|
|
34
|
+
* server-side, so callers don't need to refresh the invoice manually —
|
|
35
|
+
* onSuccess invalidates the invoice and payment list queries.
|
|
36
|
+
*/
|
|
37
|
+
export function usePaymentMutation() {
|
|
38
|
+
const { baseUrl, fetcher } = useVoyantFinanceContext();
|
|
39
|
+
const queryClient = useQueryClient();
|
|
40
|
+
const update = useMutation({
|
|
41
|
+
mutationFn: async ({ id, input }) => {
|
|
42
|
+
const { data } = await fetchWithValidation(`/v1/admin/finance/payments/${id}`, paymentSingleResponse, { baseUrl, fetcher }, { method: "PATCH", body: JSON.stringify(input) });
|
|
43
|
+
return data;
|
|
44
|
+
},
|
|
45
|
+
onSuccess: (data) => {
|
|
46
|
+
invalidatePaymentScopes(queryClient, data.invoiceId, data.id);
|
|
47
|
+
},
|
|
48
|
+
});
|
|
49
|
+
const remove = useMutation({
|
|
50
|
+
mutationFn: async (id) => {
|
|
51
|
+
const { data } = await fetchWithValidation(`/v1/admin/finance/payments/${id}`, paymentSingleResponse, { baseUrl, fetcher }, { method: "DELETE" });
|
|
52
|
+
return data;
|
|
53
|
+
},
|
|
54
|
+
onSuccess: (data) => {
|
|
55
|
+
invalidatePaymentScopes(queryClient, data.invoiceId, data.id);
|
|
56
|
+
},
|
|
57
|
+
});
|
|
58
|
+
return { update, remove };
|
|
59
|
+
}
|
|
@@ -0,0 +1,205 @@
|
|
|
1
|
+
import { type PaymentMethod } from "../schemas.js";
|
|
2
|
+
export interface CompletePaymentSessionInput {
|
|
3
|
+
/** Defaults to `"paid"` server-side. */
|
|
4
|
+
status?: "authorized" | "paid";
|
|
5
|
+
/** Defaults to `"manual"` server-side. */
|
|
6
|
+
captureMode?: "automatic" | "manual";
|
|
7
|
+
paymentMethod?: PaymentMethod | null;
|
|
8
|
+
paymentInstrumentId?: string | null;
|
|
9
|
+
providerSessionId?: string | null;
|
|
10
|
+
providerPaymentId?: string | null;
|
|
11
|
+
externalReference?: string | null;
|
|
12
|
+
referenceNumber?: string | null;
|
|
13
|
+
paymentDate?: string | null;
|
|
14
|
+
authorizedAt?: string | null;
|
|
15
|
+
capturedAt?: string | null;
|
|
16
|
+
settledAt?: string | null;
|
|
17
|
+
notes?: string | null;
|
|
18
|
+
metadata?: Record<string, unknown> | null;
|
|
19
|
+
}
|
|
20
|
+
export interface CancelPaymentSessionInput {
|
|
21
|
+
notes?: string | null;
|
|
22
|
+
cancelledAt?: string | null;
|
|
23
|
+
metadata?: Record<string, unknown> | null;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Admin payment-session transitions
|
|
27
|
+
* (`POST /v1/admin/finance/payment-sessions/:id/complete` and `/cancel`).
|
|
28
|
+
* Completing a session settles its invoice/payment side effects
|
|
29
|
+
* server-side, so payment + invoice lists are invalidated alongside the
|
|
30
|
+
* session list; callers that render booking-scoped surfaces should also
|
|
31
|
+
* invalidate their booking keys on success.
|
|
32
|
+
*/
|
|
33
|
+
export declare function usePaymentSessionMutation(): {
|
|
34
|
+
complete: import("@tanstack/react-query").UseMutationResult<{
|
|
35
|
+
legacyOrderId: string | null;
|
|
36
|
+
target: {
|
|
37
|
+
type: "booking";
|
|
38
|
+
bookingId: string;
|
|
39
|
+
} | {
|
|
40
|
+
type: "invoice";
|
|
41
|
+
invoiceId: string;
|
|
42
|
+
} | {
|
|
43
|
+
type: "booking_payment_schedule";
|
|
44
|
+
bookingPaymentScheduleId: string;
|
|
45
|
+
} | {
|
|
46
|
+
type: "booking_guarantee";
|
|
47
|
+
bookingGuaranteeId: string;
|
|
48
|
+
} | {
|
|
49
|
+
type: "flight_order";
|
|
50
|
+
flightOrderId: string;
|
|
51
|
+
} | {
|
|
52
|
+
type: "program";
|
|
53
|
+
programId: string;
|
|
54
|
+
} | {
|
|
55
|
+
type: "supplier_settlement";
|
|
56
|
+
supplierSettlementId: string;
|
|
57
|
+
} | {
|
|
58
|
+
type: "channel_settlement";
|
|
59
|
+
channelSettlementId: string;
|
|
60
|
+
} | {
|
|
61
|
+
type: "provider_reference";
|
|
62
|
+
provider: string;
|
|
63
|
+
reference: string;
|
|
64
|
+
} | {
|
|
65
|
+
type: "legacy_order";
|
|
66
|
+
legacyOrderId: string;
|
|
67
|
+
} | null;
|
|
68
|
+
provenance: {
|
|
69
|
+
source: "other" | "operator" | "storefront" | "customer_portal" | "payment_provider" | "supplier_channel" | "migration";
|
|
70
|
+
provider?: string | null | undefined;
|
|
71
|
+
reference?: string | null | undefined;
|
|
72
|
+
idempotencyKey?: string | null | undefined;
|
|
73
|
+
} | null;
|
|
74
|
+
id: string;
|
|
75
|
+
targetType: string;
|
|
76
|
+
targetId: string | null;
|
|
77
|
+
bookingId: string | null;
|
|
78
|
+
invoiceId: string | null;
|
|
79
|
+
bookingPaymentScheduleId: string | null;
|
|
80
|
+
bookingGuaranteeId: string | null;
|
|
81
|
+
paymentInstrumentId: string | null;
|
|
82
|
+
paymentAuthorizationId: string | null;
|
|
83
|
+
paymentCaptureId: string | null;
|
|
84
|
+
paymentId: string | null;
|
|
85
|
+
status: "paid" | "pending" | "failed" | "requires_redirect" | "processing" | "authorized" | "cancelled" | "expired";
|
|
86
|
+
provider: string | null;
|
|
87
|
+
providerSessionId: string | null;
|
|
88
|
+
providerPaymentId: string | null;
|
|
89
|
+
externalReference: string | null;
|
|
90
|
+
idempotencyKey: string | null;
|
|
91
|
+
clientReference: string | null;
|
|
92
|
+
currency: string;
|
|
93
|
+
amountCents: number;
|
|
94
|
+
paymentMethod: "bank_transfer" | "credit_card" | "debit_card" | "cash" | "cheque" | "wallet" | "direct_bill" | "voucher" | "other" | null;
|
|
95
|
+
payerPersonId: string | null;
|
|
96
|
+
payerOrganizationId: string | null;
|
|
97
|
+
payerEmail: string | null;
|
|
98
|
+
payerName: string | null;
|
|
99
|
+
redirectUrl: string | null;
|
|
100
|
+
returnUrl: string | null;
|
|
101
|
+
cancelUrl: string | null;
|
|
102
|
+
callbackUrl: string | null;
|
|
103
|
+
expiresAt: string | null;
|
|
104
|
+
completedAt: string | null;
|
|
105
|
+
failedAt: string | null;
|
|
106
|
+
cancelledAt: string | null;
|
|
107
|
+
expiredAt: string | null;
|
|
108
|
+
failureCode: string | null;
|
|
109
|
+
failureMessage: string | null;
|
|
110
|
+
notes: string | null;
|
|
111
|
+
providerPayload: Record<string, unknown> | null;
|
|
112
|
+
metadata: Record<string, unknown> | null;
|
|
113
|
+
createdAt: string;
|
|
114
|
+
updatedAt: string;
|
|
115
|
+
}, Error, {
|
|
116
|
+
id: string;
|
|
117
|
+
input?: CompletePaymentSessionInput;
|
|
118
|
+
}, unknown>;
|
|
119
|
+
cancel: import("@tanstack/react-query").UseMutationResult<{
|
|
120
|
+
legacyOrderId: string | null;
|
|
121
|
+
target: {
|
|
122
|
+
type: "booking";
|
|
123
|
+
bookingId: string;
|
|
124
|
+
} | {
|
|
125
|
+
type: "invoice";
|
|
126
|
+
invoiceId: string;
|
|
127
|
+
} | {
|
|
128
|
+
type: "booking_payment_schedule";
|
|
129
|
+
bookingPaymentScheduleId: string;
|
|
130
|
+
} | {
|
|
131
|
+
type: "booking_guarantee";
|
|
132
|
+
bookingGuaranteeId: string;
|
|
133
|
+
} | {
|
|
134
|
+
type: "flight_order";
|
|
135
|
+
flightOrderId: string;
|
|
136
|
+
} | {
|
|
137
|
+
type: "program";
|
|
138
|
+
programId: string;
|
|
139
|
+
} | {
|
|
140
|
+
type: "supplier_settlement";
|
|
141
|
+
supplierSettlementId: string;
|
|
142
|
+
} | {
|
|
143
|
+
type: "channel_settlement";
|
|
144
|
+
channelSettlementId: string;
|
|
145
|
+
} | {
|
|
146
|
+
type: "provider_reference";
|
|
147
|
+
provider: string;
|
|
148
|
+
reference: string;
|
|
149
|
+
} | {
|
|
150
|
+
type: "legacy_order";
|
|
151
|
+
legacyOrderId: string;
|
|
152
|
+
} | null;
|
|
153
|
+
provenance: {
|
|
154
|
+
source: "other" | "operator" | "storefront" | "customer_portal" | "payment_provider" | "supplier_channel" | "migration";
|
|
155
|
+
provider?: string | null | undefined;
|
|
156
|
+
reference?: string | null | undefined;
|
|
157
|
+
idempotencyKey?: string | null | undefined;
|
|
158
|
+
} | null;
|
|
159
|
+
id: string;
|
|
160
|
+
targetType: string;
|
|
161
|
+
targetId: string | null;
|
|
162
|
+
bookingId: string | null;
|
|
163
|
+
invoiceId: string | null;
|
|
164
|
+
bookingPaymentScheduleId: string | null;
|
|
165
|
+
bookingGuaranteeId: string | null;
|
|
166
|
+
paymentInstrumentId: string | null;
|
|
167
|
+
paymentAuthorizationId: string | null;
|
|
168
|
+
paymentCaptureId: string | null;
|
|
169
|
+
paymentId: string | null;
|
|
170
|
+
status: "paid" | "pending" | "failed" | "requires_redirect" | "processing" | "authorized" | "cancelled" | "expired";
|
|
171
|
+
provider: string | null;
|
|
172
|
+
providerSessionId: string | null;
|
|
173
|
+
providerPaymentId: string | null;
|
|
174
|
+
externalReference: string | null;
|
|
175
|
+
idempotencyKey: string | null;
|
|
176
|
+
clientReference: string | null;
|
|
177
|
+
currency: string;
|
|
178
|
+
amountCents: number;
|
|
179
|
+
paymentMethod: "bank_transfer" | "credit_card" | "debit_card" | "cash" | "cheque" | "wallet" | "direct_bill" | "voucher" | "other" | null;
|
|
180
|
+
payerPersonId: string | null;
|
|
181
|
+
payerOrganizationId: string | null;
|
|
182
|
+
payerEmail: string | null;
|
|
183
|
+
payerName: string | null;
|
|
184
|
+
redirectUrl: string | null;
|
|
185
|
+
returnUrl: string | null;
|
|
186
|
+
cancelUrl: string | null;
|
|
187
|
+
callbackUrl: string | null;
|
|
188
|
+
expiresAt: string | null;
|
|
189
|
+
completedAt: string | null;
|
|
190
|
+
failedAt: string | null;
|
|
191
|
+
cancelledAt: string | null;
|
|
192
|
+
expiredAt: string | null;
|
|
193
|
+
failureCode: string | null;
|
|
194
|
+
failureMessage: string | null;
|
|
195
|
+
notes: string | null;
|
|
196
|
+
providerPayload: Record<string, unknown> | null;
|
|
197
|
+
metadata: Record<string, unknown> | null;
|
|
198
|
+
createdAt: string;
|
|
199
|
+
updatedAt: string;
|
|
200
|
+
}, Error, {
|
|
201
|
+
id: string;
|
|
202
|
+
input?: CancelPaymentSessionInput;
|
|
203
|
+
}, unknown>;
|
|
204
|
+
};
|
|
205
|
+
//# sourceMappingURL=use-payment-session-mutation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-payment-session-mutation.d.ts","sourceRoot":"","sources":["../../src/hooks/use-payment-session-mutation.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,KAAK,aAAa,EAAgC,MAAM,eAAe,CAAA;AAEhF,MAAM,WAAW,2BAA2B;IAC1C,wCAAwC;IACxC,MAAM,CAAC,EAAE,YAAY,GAAG,MAAM,CAAA;IAC9B,0CAA0C;IAC1C,WAAW,CAAC,EAAE,WAAW,GAAG,QAAQ,CAAA;IACpC,aAAa,CAAC,EAAE,aAAa,GAAG,IAAI,CAAA;IACpC,mBAAmB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IACnC,iBAAiB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IACjC,iBAAiB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IACjC,iBAAiB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IACjC,eAAe,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IAC/B,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IAC3B,YAAY,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IAC5B,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IAC1B,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IACzB,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IACrB,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAAA;CAC1C;AAED,MAAM,WAAW,yBAAyB;IACxC,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IACrB,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IAC3B,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAAA;CAC1C;AAED;;;;;;;GAOG;AACH,wBAAgB,yBAAyB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;YAWQ,MAAM;gBAAU,2BAA2B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;YAa3C,MAAM;gBAAU,yBAAyB;;EAazF"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { useMutation, useQueryClient } from "@tanstack/react-query";
|
|
3
|
+
import { fetchWithValidation } from "../client.js";
|
|
4
|
+
import { useVoyantFinanceContext } from "../provider.js";
|
|
5
|
+
import { financeQueryKeys } from "../query-keys.js";
|
|
6
|
+
import { paymentSessionSingleResponse } from "../schemas.js";
|
|
7
|
+
/**
|
|
8
|
+
* Admin payment-session transitions
|
|
9
|
+
* (`POST /v1/admin/finance/payment-sessions/:id/complete` and `/cancel`).
|
|
10
|
+
* Completing a session settles its invoice/payment side effects
|
|
11
|
+
* server-side, so payment + invoice lists are invalidated alongside the
|
|
12
|
+
* session list; callers that render booking-scoped surfaces should also
|
|
13
|
+
* invalidate their booking keys on success.
|
|
14
|
+
*/
|
|
15
|
+
export function usePaymentSessionMutation() {
|
|
16
|
+
const { baseUrl, fetcher } = useVoyantFinanceContext();
|
|
17
|
+
const queryClient = useQueryClient();
|
|
18
|
+
const invalidate = () => {
|
|
19
|
+
void queryClient.invalidateQueries({ queryKey: financeQueryKeys.paymentSessions() });
|
|
20
|
+
void queryClient.invalidateQueries({ queryKey: financeQueryKeys.allPayments() });
|
|
21
|
+
void queryClient.invalidateQueries({ queryKey: financeQueryKeys.invoices() });
|
|
22
|
+
};
|
|
23
|
+
const complete = useMutation({
|
|
24
|
+
mutationFn: async ({ id, input = {} }) => {
|
|
25
|
+
const { data } = await fetchWithValidation(`/v1/admin/finance/payment-sessions/${id}/complete`, paymentSessionSingleResponse, { baseUrl, fetcher }, { method: "POST", body: JSON.stringify(input) });
|
|
26
|
+
return data;
|
|
27
|
+
},
|
|
28
|
+
onSuccess: invalidate,
|
|
29
|
+
});
|
|
30
|
+
const cancel = useMutation({
|
|
31
|
+
mutationFn: async ({ id, input = {} }) => {
|
|
32
|
+
const { data } = await fetchWithValidation(`/v1/admin/finance/payment-sessions/${id}/cancel`, paymentSessionSingleResponse, { baseUrl, fetcher }, { method: "POST", body: JSON.stringify(input) });
|
|
33
|
+
return data;
|
|
34
|
+
},
|
|
35
|
+
onSuccess: invalidate,
|
|
36
|
+
});
|
|
37
|
+
return { complete, cancel };
|
|
38
|
+
}
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import type { FinancePaymentSessionListFilters } from "../query-keys.js";
|
|
2
|
+
export interface UsePaymentSessionsOptions extends FinancePaymentSessionListFilters {
|
|
3
|
+
enabled?: boolean;
|
|
4
|
+
}
|
|
5
|
+
/**
|
|
6
|
+
* Admin payment-session list (`GET /v1/admin/finance/payment-sessions`).
|
|
7
|
+
* Filter by `bookingId` + `status: "pending"` to drive the booking detail
|
|
8
|
+
* page's payment-links card.
|
|
9
|
+
*/
|
|
10
|
+
export declare function usePaymentSessions(options?: UsePaymentSessionsOptions): import("@tanstack/react-query").UseQueryResult<{
|
|
11
|
+
data: {
|
|
12
|
+
legacyOrderId: string | null;
|
|
13
|
+
target: {
|
|
14
|
+
type: "booking";
|
|
15
|
+
bookingId: string;
|
|
16
|
+
} | {
|
|
17
|
+
type: "invoice";
|
|
18
|
+
invoiceId: string;
|
|
19
|
+
} | {
|
|
20
|
+
type: "booking_payment_schedule";
|
|
21
|
+
bookingPaymentScheduleId: string;
|
|
22
|
+
} | {
|
|
23
|
+
type: "booking_guarantee";
|
|
24
|
+
bookingGuaranteeId: string;
|
|
25
|
+
} | {
|
|
26
|
+
type: "flight_order";
|
|
27
|
+
flightOrderId: string;
|
|
28
|
+
} | {
|
|
29
|
+
type: "program";
|
|
30
|
+
programId: string;
|
|
31
|
+
} | {
|
|
32
|
+
type: "supplier_settlement";
|
|
33
|
+
supplierSettlementId: string;
|
|
34
|
+
} | {
|
|
35
|
+
type: "channel_settlement";
|
|
36
|
+
channelSettlementId: string;
|
|
37
|
+
} | {
|
|
38
|
+
type: "provider_reference";
|
|
39
|
+
provider: string;
|
|
40
|
+
reference: string;
|
|
41
|
+
} | {
|
|
42
|
+
type: "legacy_order";
|
|
43
|
+
legacyOrderId: string;
|
|
44
|
+
} | null;
|
|
45
|
+
provenance: {
|
|
46
|
+
source: "other" | "operator" | "storefront" | "customer_portal" | "payment_provider" | "supplier_channel" | "migration";
|
|
47
|
+
provider?: string | null | undefined;
|
|
48
|
+
reference?: string | null | undefined;
|
|
49
|
+
idempotencyKey?: string | null | undefined;
|
|
50
|
+
} | null;
|
|
51
|
+
id: string;
|
|
52
|
+
targetType: string;
|
|
53
|
+
targetId: string | null;
|
|
54
|
+
bookingId: string | null;
|
|
55
|
+
invoiceId: string | null;
|
|
56
|
+
bookingPaymentScheduleId: string | null;
|
|
57
|
+
bookingGuaranteeId: string | null;
|
|
58
|
+
paymentInstrumentId: string | null;
|
|
59
|
+
paymentAuthorizationId: string | null;
|
|
60
|
+
paymentCaptureId: string | null;
|
|
61
|
+
paymentId: string | null;
|
|
62
|
+
status: "paid" | "pending" | "failed" | "requires_redirect" | "processing" | "authorized" | "cancelled" | "expired";
|
|
63
|
+
provider: string | null;
|
|
64
|
+
providerSessionId: string | null;
|
|
65
|
+
providerPaymentId: string | null;
|
|
66
|
+
externalReference: string | null;
|
|
67
|
+
idempotencyKey: string | null;
|
|
68
|
+
clientReference: string | null;
|
|
69
|
+
currency: string;
|
|
70
|
+
amountCents: number;
|
|
71
|
+
paymentMethod: "bank_transfer" | "credit_card" | "debit_card" | "cash" | "cheque" | "wallet" | "direct_bill" | "voucher" | "other" | null;
|
|
72
|
+
payerPersonId: string | null;
|
|
73
|
+
payerOrganizationId: string | null;
|
|
74
|
+
payerEmail: string | null;
|
|
75
|
+
payerName: string | null;
|
|
76
|
+
redirectUrl: string | null;
|
|
77
|
+
returnUrl: string | null;
|
|
78
|
+
cancelUrl: string | null;
|
|
79
|
+
callbackUrl: string | null;
|
|
80
|
+
expiresAt: string | null;
|
|
81
|
+
completedAt: string | null;
|
|
82
|
+
failedAt: string | null;
|
|
83
|
+
cancelledAt: string | null;
|
|
84
|
+
expiredAt: string | null;
|
|
85
|
+
failureCode: string | null;
|
|
86
|
+
failureMessage: string | null;
|
|
87
|
+
notes: string | null;
|
|
88
|
+
providerPayload: Record<string, unknown> | null;
|
|
89
|
+
metadata: Record<string, unknown> | null;
|
|
90
|
+
createdAt: string;
|
|
91
|
+
updatedAt: string;
|
|
92
|
+
}[];
|
|
93
|
+
total: number;
|
|
94
|
+
limit: number;
|
|
95
|
+
offset: number;
|
|
96
|
+
}, Error>;
|
|
97
|
+
//# sourceMappingURL=use-payment-sessions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-payment-sessions.d.ts","sourceRoot":"","sources":["../../src/hooks/use-payment-sessions.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,gCAAgC,EAAE,MAAM,kBAAkB,CAAA;AAGxE,MAAM,WAAW,yBAA0B,SAAQ,gCAAgC;IACjF,OAAO,CAAC,EAAE,OAAO,CAAA;CAClB;AAED;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,GAAE,yBAA8B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;UAQzE"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { useQuery } from "@tanstack/react-query";
|
|
3
|
+
import { useVoyantFinanceContext } from "../provider.js";
|
|
4
|
+
import { getPaymentSessionsQueryOptions } from "../query-options.js";
|
|
5
|
+
/**
|
|
6
|
+
* Admin payment-session list (`GET /v1/admin/finance/payment-sessions`).
|
|
7
|
+
* Filter by `bookingId` + `status: "pending"` to drive the booking detail
|
|
8
|
+
* page's payment-links card.
|
|
9
|
+
*/
|
|
10
|
+
export function usePaymentSessions(options = {}) {
|
|
11
|
+
const { baseUrl, fetcher } = useVoyantFinanceContext();
|
|
12
|
+
const { enabled = true, ...filters } = options;
|
|
13
|
+
return useQuery({
|
|
14
|
+
...getPaymentSessionsQueryOptions({ baseUrl, fetcher }, filters),
|
|
15
|
+
enabled,
|
|
16
|
+
});
|
|
17
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
export interface UsePaymentOptions {
|
|
2
|
+
enabled?: boolean;
|
|
3
|
+
}
|
|
4
|
+
export declare function usePayment(id: string | null | undefined, options?: UsePaymentOptions): import("@tanstack/react-query").UseQueryResult<{
|
|
5
|
+
data: {
|
|
6
|
+
kind: "supplier" | "customer";
|
|
7
|
+
id: string;
|
|
8
|
+
invoiceId: string | null;
|
|
9
|
+
invoiceNumber: string | null;
|
|
10
|
+
bookingId: string | null;
|
|
11
|
+
bookingNumber: string | null;
|
|
12
|
+
supplierId: string | null;
|
|
13
|
+
supplierName: string | null;
|
|
14
|
+
personId: string | null;
|
|
15
|
+
personName: string | null;
|
|
16
|
+
organizationId: string | null;
|
|
17
|
+
organizationName: string | null;
|
|
18
|
+
amountCents: number;
|
|
19
|
+
currency: string;
|
|
20
|
+
baseCurrency: string | null;
|
|
21
|
+
baseAmountCents: number | null;
|
|
22
|
+
paymentMethod: string;
|
|
23
|
+
status: "pending" | "completed" | "failed" | "refunded";
|
|
24
|
+
referenceNumber: string | null;
|
|
25
|
+
paymentDate: string;
|
|
26
|
+
notes: string | null;
|
|
27
|
+
createdAt: string;
|
|
28
|
+
updatedAt: string;
|
|
29
|
+
};
|
|
30
|
+
}, Error>;
|
|
31
|
+
//# sourceMappingURL=use-payment.d.ts.map
|