@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,225 @@
|
|
|
1
|
+
import { type InvoiceRecord } from "../schemas.js";
|
|
2
|
+
export interface CreateInvoiceInput {
|
|
3
|
+
invoiceNumber: string;
|
|
4
|
+
bookingId: string;
|
|
5
|
+
personId?: string | null;
|
|
6
|
+
organizationId?: string | null;
|
|
7
|
+
status?: InvoiceRecord["status"];
|
|
8
|
+
currency: string;
|
|
9
|
+
subtotalCents?: number;
|
|
10
|
+
taxCents?: number;
|
|
11
|
+
totalCents?: number;
|
|
12
|
+
paidCents?: number;
|
|
13
|
+
balanceDueCents?: number;
|
|
14
|
+
issueDate: string;
|
|
15
|
+
dueDate: string;
|
|
16
|
+
notes?: string | null;
|
|
17
|
+
}
|
|
18
|
+
export type UpdateInvoiceInput = Partial<CreateInvoiceInput>;
|
|
19
|
+
export interface VoidInvoiceInput {
|
|
20
|
+
reason?: string | null;
|
|
21
|
+
}
|
|
22
|
+
export declare function useInvoiceMutation(): {
|
|
23
|
+
create: import("@tanstack/react-query").UseMutationResult<{
|
|
24
|
+
[x: string]: unknown;
|
|
25
|
+
id: string;
|
|
26
|
+
invoiceNumber: string;
|
|
27
|
+
bookingId: string;
|
|
28
|
+
personId: string | null;
|
|
29
|
+
organizationId: string | null;
|
|
30
|
+
status: "draft" | "pending_external_allocation" | "issued" | "partially_paid" | "paid" | "overdue" | "void";
|
|
31
|
+
currency: string;
|
|
32
|
+
subtotalCents: number;
|
|
33
|
+
taxCents: number;
|
|
34
|
+
totalCents: number;
|
|
35
|
+
paidCents: number;
|
|
36
|
+
balanceDueCents: number;
|
|
37
|
+
issueDate: string;
|
|
38
|
+
dueDate: string;
|
|
39
|
+
notes: string | null;
|
|
40
|
+
createdAt: string;
|
|
41
|
+
updatedAt: string;
|
|
42
|
+
invoiceType?: "invoice" | "proforma" | "credit_note" | undefined;
|
|
43
|
+
voidedAt?: string | null | undefined;
|
|
44
|
+
voidReason?: string | null | undefined;
|
|
45
|
+
bookingPaymentScheduleIds?: string[] | undefined;
|
|
46
|
+
convertedToInvoiceId?: string | null | undefined;
|
|
47
|
+
convertedToInvoiceNumber?: string | null | undefined;
|
|
48
|
+
}, Error, CreateInvoiceInput, unknown>;
|
|
49
|
+
createFromBooking: import("@tanstack/react-query").UseMutationResult<{
|
|
50
|
+
[x: string]: unknown;
|
|
51
|
+
id: string;
|
|
52
|
+
invoiceNumber: string;
|
|
53
|
+
bookingId: string;
|
|
54
|
+
personId: string | null;
|
|
55
|
+
organizationId: string | null;
|
|
56
|
+
status: "draft" | "pending_external_allocation" | "issued" | "partially_paid" | "paid" | "overdue" | "void";
|
|
57
|
+
currency: string;
|
|
58
|
+
subtotalCents: number;
|
|
59
|
+
taxCents: number;
|
|
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
|
+
invoiceType?: "invoice" | "proforma" | "credit_note" | undefined;
|
|
69
|
+
voidedAt?: string | null | undefined;
|
|
70
|
+
voidReason?: string | null | undefined;
|
|
71
|
+
bookingPaymentScheduleIds?: string[] | undefined;
|
|
72
|
+
convertedToInvoiceId?: string | null | undefined;
|
|
73
|
+
convertedToInvoiceNumber?: string | null | undefined;
|
|
74
|
+
}, Error, CreateInvoiceFromBookingInput, unknown>;
|
|
75
|
+
convertToInvoice: import("@tanstack/react-query").UseMutationResult<{
|
|
76
|
+
[x: string]: unknown;
|
|
77
|
+
id: string;
|
|
78
|
+
invoiceNumber: string;
|
|
79
|
+
bookingId: string;
|
|
80
|
+
personId: string | null;
|
|
81
|
+
organizationId: string | null;
|
|
82
|
+
status: "draft" | "pending_external_allocation" | "issued" | "partially_paid" | "paid" | "overdue" | "void";
|
|
83
|
+
currency: string;
|
|
84
|
+
subtotalCents: number;
|
|
85
|
+
taxCents: number;
|
|
86
|
+
totalCents: number;
|
|
87
|
+
paidCents: number;
|
|
88
|
+
balanceDueCents: number;
|
|
89
|
+
issueDate: string;
|
|
90
|
+
dueDate: string;
|
|
91
|
+
notes: string | null;
|
|
92
|
+
createdAt: string;
|
|
93
|
+
updatedAt: string;
|
|
94
|
+
invoiceType?: "invoice" | "proforma" | "credit_note" | undefined;
|
|
95
|
+
voidedAt?: string | null | undefined;
|
|
96
|
+
voidReason?: string | null | undefined;
|
|
97
|
+
bookingPaymentScheduleIds?: string[] | undefined;
|
|
98
|
+
convertedToInvoiceId?: string | null | undefined;
|
|
99
|
+
convertedToInvoiceNumber?: string | null | undefined;
|
|
100
|
+
}, Error, {
|
|
101
|
+
id: string;
|
|
102
|
+
input?: ConvertProformaInput;
|
|
103
|
+
}, unknown>;
|
|
104
|
+
render: import("@tanstack/react-query").UseMutationResult<{
|
|
105
|
+
[x: string]: unknown;
|
|
106
|
+
id: string;
|
|
107
|
+
}, Error, {
|
|
108
|
+
id: string;
|
|
109
|
+
input?: RenderInvoiceInput;
|
|
110
|
+
}, unknown>;
|
|
111
|
+
update: import("@tanstack/react-query").UseMutationResult<{
|
|
112
|
+
[x: string]: unknown;
|
|
113
|
+
id: string;
|
|
114
|
+
invoiceNumber: string;
|
|
115
|
+
bookingId: string;
|
|
116
|
+
personId: string | null;
|
|
117
|
+
organizationId: string | null;
|
|
118
|
+
status: "draft" | "pending_external_allocation" | "issued" | "partially_paid" | "paid" | "overdue" | "void";
|
|
119
|
+
currency: string;
|
|
120
|
+
subtotalCents: number;
|
|
121
|
+
taxCents: number;
|
|
122
|
+
totalCents: number;
|
|
123
|
+
paidCents: number;
|
|
124
|
+
balanceDueCents: number;
|
|
125
|
+
issueDate: string;
|
|
126
|
+
dueDate: string;
|
|
127
|
+
notes: string | null;
|
|
128
|
+
createdAt: string;
|
|
129
|
+
updatedAt: string;
|
|
130
|
+
invoiceType?: "invoice" | "proforma" | "credit_note" | undefined;
|
|
131
|
+
voidedAt?: string | null | undefined;
|
|
132
|
+
voidReason?: string | null | undefined;
|
|
133
|
+
bookingPaymentScheduleIds?: string[] | undefined;
|
|
134
|
+
convertedToInvoiceId?: string | null | undefined;
|
|
135
|
+
convertedToInvoiceNumber?: string | null | undefined;
|
|
136
|
+
}, Error, {
|
|
137
|
+
id: string;
|
|
138
|
+
input: UpdateInvoiceInput;
|
|
139
|
+
}, unknown>;
|
|
140
|
+
remove: import("@tanstack/react-query").UseMutationResult<{
|
|
141
|
+
success: boolean;
|
|
142
|
+
}, Error, string, unknown>;
|
|
143
|
+
voidInvoice: import("@tanstack/react-query").UseMutationResult<{
|
|
144
|
+
[x: string]: unknown;
|
|
145
|
+
id: string;
|
|
146
|
+
invoiceNumber: string;
|
|
147
|
+
bookingId: string;
|
|
148
|
+
personId: string | null;
|
|
149
|
+
organizationId: string | null;
|
|
150
|
+
status: "draft" | "pending_external_allocation" | "issued" | "partially_paid" | "paid" | "overdue" | "void";
|
|
151
|
+
currency: string;
|
|
152
|
+
subtotalCents: number;
|
|
153
|
+
taxCents: number;
|
|
154
|
+
totalCents: number;
|
|
155
|
+
paidCents: number;
|
|
156
|
+
balanceDueCents: number;
|
|
157
|
+
issueDate: string;
|
|
158
|
+
dueDate: string;
|
|
159
|
+
notes: string | null;
|
|
160
|
+
createdAt: string;
|
|
161
|
+
updatedAt: string;
|
|
162
|
+
invoiceType?: "invoice" | "proforma" | "credit_note" | undefined;
|
|
163
|
+
voidedAt?: string | null | undefined;
|
|
164
|
+
voidReason?: string | null | undefined;
|
|
165
|
+
bookingPaymentScheduleIds?: string[] | undefined;
|
|
166
|
+
convertedToInvoiceId?: string | null | undefined;
|
|
167
|
+
convertedToInvoiceNumber?: string | null | undefined;
|
|
168
|
+
}, Error, {
|
|
169
|
+
id: string;
|
|
170
|
+
input?: VoidInvoiceInput;
|
|
171
|
+
}, unknown>;
|
|
172
|
+
};
|
|
173
|
+
export interface ConvertProformaInput {
|
|
174
|
+
/** Optional override; server derives from the proforma number when omitted. */
|
|
175
|
+
invoiceNumber?: string;
|
|
176
|
+
issueDate?: string;
|
|
177
|
+
dueDate?: string;
|
|
178
|
+
}
|
|
179
|
+
export interface CreateInvoiceFromBookingInput {
|
|
180
|
+
bookingId: string;
|
|
181
|
+
bookingPaymentScheduleId?: string;
|
|
182
|
+
invoiceNumber?: string;
|
|
183
|
+
issueDate: string;
|
|
184
|
+
dueDate: string;
|
|
185
|
+
notes?: string | null;
|
|
186
|
+
currency?: string;
|
|
187
|
+
baseCurrency?: string;
|
|
188
|
+
fxRateSetId?: string;
|
|
189
|
+
subtotalCents?: number;
|
|
190
|
+
taxCents?: number;
|
|
191
|
+
totalCents?: number;
|
|
192
|
+
lineItems?: CreateInvoiceFromBookingLineItemInput[];
|
|
193
|
+
externalRefs?: CreateInvoiceFromBookingExternalRefInput[];
|
|
194
|
+
/** Defaults to `invoice` on the server. Pass `proforma` for placeholders. */
|
|
195
|
+
invoiceType?: "invoice" | "proforma";
|
|
196
|
+
/**
|
|
197
|
+
* When `true`, downstream e-invoicing plugins (e.g. SmartBill) skip
|
|
198
|
+
* the auto-sync triggered by `invoice.issued`. The event still fires
|
|
199
|
+
* so other subscribers (ledgers, audit, etc.) see it.
|
|
200
|
+
*/
|
|
201
|
+
skipExternalSync?: boolean;
|
|
202
|
+
}
|
|
203
|
+
export interface CreateInvoiceFromBookingExternalRefInput {
|
|
204
|
+
provider: string;
|
|
205
|
+
externalId?: string | null;
|
|
206
|
+
externalNumber?: string | null;
|
|
207
|
+
externalUrl?: string | null;
|
|
208
|
+
status?: string | null;
|
|
209
|
+
metadata?: Record<string, unknown> | null;
|
|
210
|
+
syncedAt?: string | null;
|
|
211
|
+
syncError?: string | null;
|
|
212
|
+
}
|
|
213
|
+
export interface CreateInvoiceFromBookingLineItemInput {
|
|
214
|
+
description: string;
|
|
215
|
+
quantity: number;
|
|
216
|
+
unitAmountCents: number;
|
|
217
|
+
taxRateBps?: number | null;
|
|
218
|
+
taxAmountCents?: number | null;
|
|
219
|
+
}
|
|
220
|
+
export interface RenderInvoiceInput {
|
|
221
|
+
format?: "pdf" | "html";
|
|
222
|
+
/** Optional invoice-template id; server falls back to the default. */
|
|
223
|
+
templateId?: string | null;
|
|
224
|
+
}
|
|
225
|
+
//# sourceMappingURL=use-invoice-mutation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-invoice-mutation.d.ts","sourceRoot":"","sources":["../../src/hooks/use-invoice-mutation.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,KAAK,aAAa,EAA0C,MAAM,eAAe,CAAA;AAE1F,MAAM,WAAW,kBAAkB;IACjC,aAAa,EAAE,MAAM,CAAA;IACrB,SAAS,EAAE,MAAM,CAAA;IACjB,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IACxB,cAAc,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IAC9B,MAAM,CAAC,EAAE,aAAa,CAAC,QAAQ,CAAC,CAAA;IAChC,QAAQ,EAAE,MAAM,CAAA;IAChB,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,eAAe,CAAC,EAAE,MAAM,CAAA;IACxB,SAAS,EAAE,MAAM,CAAA;IACjB,OAAO,EAAE,MAAM,CAAA;IACf,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;CACtB;AAED,MAAM,MAAM,kBAAkB,GAAG,OAAO,CAAC,kBAAkB,CAAC,CAAA;AAE5D,MAAM,WAAW,gBAAgB;IAC/B,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;CACvB;AAED,wBAAgB,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;YAqGU,MAAM;gBAAU,oBAAoB;;;;;;YA+BpC,MAAM;gBAAU,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;YA/GlC,MAAM;eAAS,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;YAoCjC,MAAM;gBAAU,gBAAgB;;EA6F3E;AAED,MAAM,WAAW,oBAAoB;IACnC,+EAA+E;IAC/E,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,OAAO,CAAC,EAAE,MAAM,CAAA;CACjB;AAED,MAAM,WAAW,6BAA6B;IAC5C,SAAS,EAAE,MAAM,CAAA;IACjB,wBAAwB,CAAC,EAAE,MAAM,CAAA;IACjC,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,SAAS,EAAE,MAAM,CAAA;IACjB,OAAO,EAAE,MAAM,CAAA;IACf,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IACrB,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,SAAS,CAAC,EAAE,qCAAqC,EAAE,CAAA;IACnD,YAAY,CAAC,EAAE,wCAAwC,EAAE,CAAA;IACzD,6EAA6E;IAC7E,WAAW,CAAC,EAAE,SAAS,GAAG,UAAU,CAAA;IACpC;;;;OAIG;IACH,gBAAgB,CAAC,EAAE,OAAO,CAAA;CAC3B;AAED,MAAM,WAAW,wCAAwC;IACvD,QAAQ,EAAE,MAAM,CAAA;IAChB,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IAC1B,cAAc,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IAC9B,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IAC3B,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IACtB,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAAA;IACzC,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IACxB,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;CAC1B;AAED,MAAM,WAAW,qCAAqC;IACpD,WAAW,EAAE,MAAM,CAAA;IACnB,QAAQ,EAAE,MAAM,CAAA;IAChB,eAAe,EAAE,MAAM,CAAA;IACvB,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IAC1B,cAAc,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;CAC/B;AAED,MAAM,WAAW,kBAAkB;IACjC,MAAM,CAAC,EAAE,KAAK,GAAG,MAAM,CAAA;IACvB,sEAAsE;IACtE,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;CAC3B"}
|
|
@@ -0,0 +1,121 @@
|
|
|
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 { invoiceSingleResponse, successEnvelope } from "../schemas.js";
|
|
8
|
+
export function useInvoiceMutation() {
|
|
9
|
+
const { baseUrl, fetcher } = useVoyantFinanceContext();
|
|
10
|
+
const queryClient = useQueryClient();
|
|
11
|
+
const create = useMutation({
|
|
12
|
+
mutationFn: async (input) => {
|
|
13
|
+
const { data } = await fetchWithValidation("/v1/admin/finance/invoices", invoiceSingleResponse, { baseUrl, fetcher }, { method: "POST", body: JSON.stringify(input) });
|
|
14
|
+
return data;
|
|
15
|
+
},
|
|
16
|
+
onSuccess: (data) => {
|
|
17
|
+
void queryClient.invalidateQueries({ queryKey: financeQueryKeys.invoices() });
|
|
18
|
+
queryClient.setQueryData(financeQueryKeys.invoice(data.id), { data });
|
|
19
|
+
},
|
|
20
|
+
});
|
|
21
|
+
const update = useMutation({
|
|
22
|
+
mutationFn: async ({ id, input }) => {
|
|
23
|
+
const { data } = await fetchWithValidation(`/v1/admin/finance/invoices/${id}`, invoiceSingleResponse, { baseUrl, fetcher }, { method: "PATCH", body: JSON.stringify(input) });
|
|
24
|
+
return data;
|
|
25
|
+
},
|
|
26
|
+
onSuccess: (data) => {
|
|
27
|
+
void queryClient.invalidateQueries({ queryKey: financeQueryKeys.invoices() });
|
|
28
|
+
queryClient.setQueryData(financeQueryKeys.invoice(data.id), { data });
|
|
29
|
+
},
|
|
30
|
+
});
|
|
31
|
+
const remove = useMutation({
|
|
32
|
+
mutationFn: async (id) => fetchWithValidation(`/v1/admin/finance/invoices/${id}`, successEnvelope, { baseUrl, fetcher }, {
|
|
33
|
+
method: "DELETE",
|
|
34
|
+
}),
|
|
35
|
+
onSuccess: (_data, id) => {
|
|
36
|
+
void queryClient.invalidateQueries({ queryKey: financeQueryKeys.invoices() });
|
|
37
|
+
queryClient.removeQueries({ queryKey: financeQueryKeys.invoice(id) });
|
|
38
|
+
queryClient.removeQueries({ queryKey: financeQueryKeys.lineItems(id) });
|
|
39
|
+
queryClient.removeQueries({ queryKey: financeQueryKeys.payments(id) });
|
|
40
|
+
queryClient.removeQueries({ queryKey: financeQueryKeys.creditNotes(id) });
|
|
41
|
+
queryClient.removeQueries({ queryKey: financeQueryKeys.notes(id) });
|
|
42
|
+
},
|
|
43
|
+
});
|
|
44
|
+
const voidInvoice = useMutation({
|
|
45
|
+
mutationFn: async ({ id, input }) => {
|
|
46
|
+
const { data } = await fetchWithValidation(`/v1/admin/finance/invoices/${id}/void`, invoiceSingleResponse, { baseUrl, fetcher }, { method: "POST", body: JSON.stringify(input ?? {}) });
|
|
47
|
+
return data;
|
|
48
|
+
},
|
|
49
|
+
onSuccess: (data) => {
|
|
50
|
+
void queryClient.invalidateQueries({ queryKey: financeQueryKeys.invoices() });
|
|
51
|
+
queryClient.setQueryData(financeQueryKeys.invoice(data.id), { data });
|
|
52
|
+
},
|
|
53
|
+
});
|
|
54
|
+
/**
|
|
55
|
+
* Create + issue an invoice (or proforma) from an existing booking. The
|
|
56
|
+
* server builds line items from either the booking items or a targeted
|
|
57
|
+
* payment schedule row, then emits an `invoice.issued` event post-commit.
|
|
58
|
+
*/
|
|
59
|
+
const createFromBooking = useMutation({
|
|
60
|
+
mutationFn: async (input) => {
|
|
61
|
+
const { data } = await fetchWithValidation("/v1/admin/finance/invoices/from-booking", invoiceSingleResponse, { baseUrl, fetcher }, { method: "POST", body: JSON.stringify(input) });
|
|
62
|
+
return data;
|
|
63
|
+
},
|
|
64
|
+
onSuccess: (data) => {
|
|
65
|
+
void queryClient.invalidateQueries({ queryKey: financeQueryKeys.invoices() });
|
|
66
|
+
queryClient.setQueryData(financeQueryKeys.invoice(data.id), { data });
|
|
67
|
+
},
|
|
68
|
+
});
|
|
69
|
+
/**
|
|
70
|
+
* Convert an issued proforma into a final invoice. Server-side this
|
|
71
|
+
* copies the proforma's line items + totals, marks the proforma as
|
|
72
|
+
* `void`, moves any payments onto the final invoice, and emits
|
|
73
|
+
* `invoice.proforma.converted` so downstream subscribers can preserve
|
|
74
|
+
* the original external linkage.
|
|
75
|
+
*/
|
|
76
|
+
const convertToInvoice = useMutation({
|
|
77
|
+
mutationFn: async ({ id, input }) => {
|
|
78
|
+
const { data } = await fetchWithValidation(`/v1/admin/finance/invoices/${id}/convert-to-invoice`, invoiceSingleResponse, { baseUrl, fetcher }, { method: "POST", body: JSON.stringify(input ?? {}) });
|
|
79
|
+
return data;
|
|
80
|
+
},
|
|
81
|
+
onSuccess: (data, variables) => {
|
|
82
|
+
void queryClient.invalidateQueries({ queryKey: financeQueryKeys.invoices() });
|
|
83
|
+
void queryClient.invalidateQueries({
|
|
84
|
+
queryKey: financeQueryKeys.adminBookingPayments(data.bookingId),
|
|
85
|
+
});
|
|
86
|
+
void queryClient.invalidateQueries({
|
|
87
|
+
queryKey: financeQueryKeys.publicBookingPayments(data.bookingId),
|
|
88
|
+
});
|
|
89
|
+
void queryClient.invalidateQueries({ queryKey: financeQueryKeys.invoice(variables.id) });
|
|
90
|
+
void queryClient.invalidateQueries({ queryKey: financeQueryKeys.payments(variables.id) });
|
|
91
|
+
queryClient.setQueryData(financeQueryKeys.invoice(data.id), { data });
|
|
92
|
+
void queryClient.invalidateQueries({ queryKey: financeQueryKeys.payments(data.id) });
|
|
93
|
+
},
|
|
94
|
+
});
|
|
95
|
+
/**
|
|
96
|
+
* Render (or re-render) a PDF for an existing invoice. Server-side this
|
|
97
|
+
* inserts an `invoice_rendition` row + emits `invoice.rendered`, which a
|
|
98
|
+
* downstream subscriber turns into a stored PDF attachment. Use this for
|
|
99
|
+
* the operator's "Generate" / "Regenerate" buttons.
|
|
100
|
+
*/
|
|
101
|
+
const render = useMutation({
|
|
102
|
+
mutationFn: async ({ id, input }) => {
|
|
103
|
+
const { data } = await fetchWithValidation(`/v1/admin/finance/invoices/${id}/render`, invoiceRenditionResponse, { baseUrl, fetcher }, { method: "POST", body: JSON.stringify(input ?? { format: "pdf" }) });
|
|
104
|
+
return data;
|
|
105
|
+
},
|
|
106
|
+
onSuccess: (_data, variables) => {
|
|
107
|
+
void queryClient.invalidateQueries({
|
|
108
|
+
queryKey: financeQueryKeys.invoice(variables.id),
|
|
109
|
+
});
|
|
110
|
+
void queryClient.invalidateQueries({ queryKey: financeQueryKeys.invoices() });
|
|
111
|
+
},
|
|
112
|
+
});
|
|
113
|
+
return { create, createFromBooking, convertToInvoice, render, update, remove, voidInvoice };
|
|
114
|
+
}
|
|
115
|
+
// Light envelope schema for the render endpoint — the server returns
|
|
116
|
+
// `{ data: rendition }` where rendition is { id, invoiceId, format, ... }.
|
|
117
|
+
// We only assert the wrapper so the hook stays portable across renditions
|
|
118
|
+
// shape changes; consumers that care can narrow on the data field.
|
|
119
|
+
const invoiceRenditionResponse = z.object({
|
|
120
|
+
data: z.object({ id: z.string() }).passthrough(),
|
|
121
|
+
});
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export interface CreateInvoiceNoteInput {
|
|
2
|
+
content: string;
|
|
3
|
+
}
|
|
4
|
+
export declare function useInvoiceNoteMutation(invoiceId: string): import("@tanstack/react-query").UseMutationResult<{
|
|
5
|
+
id: string;
|
|
6
|
+
invoiceId: string;
|
|
7
|
+
authorId: string;
|
|
8
|
+
content: string;
|
|
9
|
+
createdAt: string;
|
|
10
|
+
}, Error, CreateInvoiceNoteInput, unknown>;
|
|
11
|
+
//# sourceMappingURL=use-invoice-note-mutation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-invoice-note-mutation.d.ts","sourceRoot":"","sources":["../../src/hooks/use-invoice-note-mutation.ts"],"names":[],"mappings":"AAUA,MAAM,WAAW,sBAAsB;IACrC,OAAO,EAAE,MAAM,CAAA;CAChB;AAMD,wBAAgB,sBAAsB,CAAC,SAAS,EAAE,MAAM;;;;;;2CAkBvD"}
|
|
@@ -0,0 +1,23 @@
|
|
|
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 { financeNoteRecordSchema } from "../schemas.js";
|
|
8
|
+
const invoiceNoteSingleResponse = z.object({
|
|
9
|
+
data: financeNoteRecordSchema,
|
|
10
|
+
});
|
|
11
|
+
export function useInvoiceNoteMutation(invoiceId) {
|
|
12
|
+
const { baseUrl, fetcher } = useVoyantFinanceContext();
|
|
13
|
+
const queryClient = useQueryClient();
|
|
14
|
+
return useMutation({
|
|
15
|
+
mutationFn: async (input) => {
|
|
16
|
+
const { data } = await fetchWithValidation(`/v1/admin/finance/invoices/${invoiceId}/notes`, invoiceNoteSingleResponse, { baseUrl, fetcher }, { method: "POST", body: JSON.stringify(input) });
|
|
17
|
+
return data;
|
|
18
|
+
},
|
|
19
|
+
onSuccess: () => {
|
|
20
|
+
void queryClient.invalidateQueries({ queryKey: financeQueryKeys.notes(invoiceId) });
|
|
21
|
+
},
|
|
22
|
+
});
|
|
23
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export interface UseInvoiceNotesOptions {
|
|
2
|
+
enabled?: boolean;
|
|
3
|
+
}
|
|
4
|
+
export declare function useInvoiceNotes(invoiceId: string | null | undefined, options?: UseInvoiceNotesOptions): import("@tanstack/react-query").UseQueryResult<{
|
|
5
|
+
data: {
|
|
6
|
+
id: string;
|
|
7
|
+
invoiceId: string;
|
|
8
|
+
authorId: string;
|
|
9
|
+
content: string;
|
|
10
|
+
createdAt: string;
|
|
11
|
+
}[];
|
|
12
|
+
}, Error>;
|
|
13
|
+
//# sourceMappingURL=use-invoice-notes.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-invoice-notes.d.ts","sourceRoot":"","sources":["../../src/hooks/use-invoice-notes.ts"],"names":[],"mappings":"AAOA,MAAM,WAAW,sBAAsB;IACrC,OAAO,CAAC,EAAE,OAAO,CAAA;CAClB;AAED,wBAAgB,eAAe,CAC7B,SAAS,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,EACpC,OAAO,GAAE,sBAA2B;;;;;;;;UASrC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { useQuery } from "@tanstack/react-query";
|
|
3
|
+
import { useVoyantFinanceContext } from "../provider.js";
|
|
4
|
+
import { getInvoiceNotesQueryOptions } from "../query-options.js";
|
|
5
|
+
export function useInvoiceNotes(invoiceId, options = {}) {
|
|
6
|
+
const { baseUrl, fetcher } = useVoyantFinanceContext();
|
|
7
|
+
const { enabled = true } = options;
|
|
8
|
+
return useQuery({
|
|
9
|
+
...getInvoiceNotesQueryOptions({ baseUrl, fetcher }, invoiceId),
|
|
10
|
+
enabled: enabled && Boolean(invoiceId),
|
|
11
|
+
});
|
|
12
|
+
}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { type InvoiceNumberResetStrategy, type InvoiceNumberSeriesScope } from "../schemas.js";
|
|
2
|
+
export interface CreateInvoiceNumberSeriesInput {
|
|
3
|
+
code: string;
|
|
4
|
+
name: string;
|
|
5
|
+
prefix?: string;
|
|
6
|
+
separator?: string;
|
|
7
|
+
padLength?: number;
|
|
8
|
+
currentSequence?: number;
|
|
9
|
+
resetStrategy?: InvoiceNumberResetStrategy;
|
|
10
|
+
resetAt?: string | null;
|
|
11
|
+
scope?: InvoiceNumberSeriesScope;
|
|
12
|
+
isDefault?: boolean;
|
|
13
|
+
externalProvider?: string | null;
|
|
14
|
+
externalConfigKey?: string | null;
|
|
15
|
+
active?: boolean;
|
|
16
|
+
}
|
|
17
|
+
export type UpdateInvoiceNumberSeriesInput = Partial<CreateInvoiceNumberSeriesInput>;
|
|
18
|
+
export declare function useInvoiceNumberSeriesMutation(): {
|
|
19
|
+
create: import("@tanstack/react-query").UseMutationResult<{
|
|
20
|
+
id: string;
|
|
21
|
+
code: string;
|
|
22
|
+
name: string;
|
|
23
|
+
prefix: string;
|
|
24
|
+
separator: string;
|
|
25
|
+
padLength: number;
|
|
26
|
+
currentSequence: number;
|
|
27
|
+
resetStrategy: "never" | "annual" | "monthly";
|
|
28
|
+
resetAt: string | null;
|
|
29
|
+
scope: "invoice" | "proforma" | "credit_note";
|
|
30
|
+
isDefault: boolean;
|
|
31
|
+
externalProvider: string | null;
|
|
32
|
+
externalConfigKey: string | null;
|
|
33
|
+
active: boolean;
|
|
34
|
+
createdAt: string;
|
|
35
|
+
updatedAt: string;
|
|
36
|
+
}, Error, CreateInvoiceNumberSeriesInput, unknown>;
|
|
37
|
+
update: import("@tanstack/react-query").UseMutationResult<{
|
|
38
|
+
id: string;
|
|
39
|
+
code: string;
|
|
40
|
+
name: string;
|
|
41
|
+
prefix: string;
|
|
42
|
+
separator: string;
|
|
43
|
+
padLength: number;
|
|
44
|
+
currentSequence: number;
|
|
45
|
+
resetStrategy: "never" | "annual" | "monthly";
|
|
46
|
+
resetAt: string | null;
|
|
47
|
+
scope: "invoice" | "proforma" | "credit_note";
|
|
48
|
+
isDefault: boolean;
|
|
49
|
+
externalProvider: string | null;
|
|
50
|
+
externalConfigKey: string | null;
|
|
51
|
+
active: boolean;
|
|
52
|
+
createdAt: string;
|
|
53
|
+
updatedAt: string;
|
|
54
|
+
}, Error, {
|
|
55
|
+
id: string;
|
|
56
|
+
input: UpdateInvoiceNumberSeriesInput;
|
|
57
|
+
}, unknown>;
|
|
58
|
+
remove: import("@tanstack/react-query").UseMutationResult<{
|
|
59
|
+
success: boolean;
|
|
60
|
+
}, Error, string, unknown>;
|
|
61
|
+
};
|
|
62
|
+
//# sourceMappingURL=use-invoice-number-series-mutation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-invoice-number-series-mutation.d.ts","sourceRoot":"","sources":["../../src/hooks/use-invoice-number-series-mutation.ts"],"names":[],"mappings":"AAOA,OAAO,EACL,KAAK,0BAA0B,EAE/B,KAAK,wBAAwB,EAG9B,MAAM,eAAe,CAAA;AAEtB,MAAM,WAAW,8BAA8B;IAC7C,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,EAAE,MAAM,CAAA;IACZ,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,eAAe,CAAC,EAAE,MAAM,CAAA;IACxB,aAAa,CAAC,EAAE,0BAA0B,CAAA;IAC1C,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IACvB,KAAK,CAAC,EAAE,wBAAwB,CAAA;IAChC,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB,gBAAgB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IAChC,iBAAiB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IACjC,MAAM,CAAC,EAAE,OAAO,CAAA;CACjB;AAED,MAAM,MAAM,8BAA8B,GAAG,OAAO,CAAC,8BAA8B,CAAC,CAAA;AAEpF,wBAAgB,8BAA8B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;YAwBF,MAAM;eAAS,8BAA8B;;;;;EA8BxF"}
|
|
@@ -0,0 +1,39 @@
|
|
|
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 { invoiceNumberSeriesSingleResponse, successEnvelope, } from "../schemas.js";
|
|
7
|
+
export function useInvoiceNumberSeriesMutation() {
|
|
8
|
+
const { baseUrl, fetcher } = useVoyantFinanceContext();
|
|
9
|
+
const queryClient = useQueryClient();
|
|
10
|
+
const invalidateLists = () => queryClient.invalidateQueries({ queryKey: financeQueryKeys.invoiceNumberSeries() });
|
|
11
|
+
const create = useMutation({
|
|
12
|
+
mutationFn: async (input) => {
|
|
13
|
+
const { data } = await fetchWithValidation("/v1/admin/finance/invoice-number-series", invoiceNumberSeriesSingleResponse, { baseUrl, fetcher }, { method: "POST", body: JSON.stringify(input) });
|
|
14
|
+
return data;
|
|
15
|
+
},
|
|
16
|
+
onSuccess: (data) => {
|
|
17
|
+
invalidateLists();
|
|
18
|
+
queryClient.setQueryData(financeQueryKeys.invoiceNumberSeriesDetail(data.id), { data });
|
|
19
|
+
},
|
|
20
|
+
});
|
|
21
|
+
const update = useMutation({
|
|
22
|
+
mutationFn: async ({ id, input }) => {
|
|
23
|
+
const { data } = await fetchWithValidation(`/v1/admin/finance/invoice-number-series/${id}`, invoiceNumberSeriesSingleResponse, { baseUrl, fetcher }, { method: "PATCH", body: JSON.stringify(input) });
|
|
24
|
+
return data;
|
|
25
|
+
},
|
|
26
|
+
onSuccess: (data) => {
|
|
27
|
+
invalidateLists();
|
|
28
|
+
queryClient.setQueryData(financeQueryKeys.invoiceNumberSeriesDetail(data.id), { data });
|
|
29
|
+
},
|
|
30
|
+
});
|
|
31
|
+
const remove = useMutation({
|
|
32
|
+
mutationFn: async (id) => fetchWithValidation(`/v1/admin/finance/invoice-number-series/${id}`, successEnvelope, { baseUrl, fetcher }, { method: "DELETE" }),
|
|
33
|
+
onSuccess: (_data, id) => {
|
|
34
|
+
invalidateLists();
|
|
35
|
+
queryClient.removeQueries({ queryKey: financeQueryKeys.invoiceNumberSeriesDetail(id) });
|
|
36
|
+
},
|
|
37
|
+
});
|
|
38
|
+
return { create, update, remove };
|
|
39
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { FinanceInvoiceNumberSeriesListFilters } from "../query-keys.js";
|
|
2
|
+
export interface UseInvoiceNumberSeriesOptions extends FinanceInvoiceNumberSeriesListFilters {
|
|
3
|
+
enabled?: boolean;
|
|
4
|
+
}
|
|
5
|
+
export declare function useInvoiceNumberSeries(options?: UseInvoiceNumberSeriesOptions): import("@tanstack/react-query").UseQueryResult<{
|
|
6
|
+
data: {
|
|
7
|
+
id: string;
|
|
8
|
+
code: string;
|
|
9
|
+
name: string;
|
|
10
|
+
prefix: string;
|
|
11
|
+
separator: string;
|
|
12
|
+
padLength: number;
|
|
13
|
+
currentSequence: number;
|
|
14
|
+
resetStrategy: "never" | "annual" | "monthly";
|
|
15
|
+
resetAt: string | null;
|
|
16
|
+
scope: "invoice" | "proforma" | "credit_note";
|
|
17
|
+
isDefault: boolean;
|
|
18
|
+
externalProvider: string | null;
|
|
19
|
+
externalConfigKey: string | null;
|
|
20
|
+
active: boolean;
|
|
21
|
+
createdAt: string;
|
|
22
|
+
updatedAt: string;
|
|
23
|
+
}[];
|
|
24
|
+
total: number;
|
|
25
|
+
limit: number;
|
|
26
|
+
offset: number;
|
|
27
|
+
}, Error>;
|
|
28
|
+
//# sourceMappingURL=use-invoice-number-series.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-invoice-number-series.d.ts","sourceRoot":"","sources":["../../src/hooks/use-invoice-number-series.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,qCAAqC,EAAE,MAAM,kBAAkB,CAAA;AAG7E,MAAM,WAAW,6BAA8B,SAAQ,qCAAqC;IAC1F,OAAO,CAAC,EAAE,OAAO,CAAA;CAClB;AAED,wBAAgB,sBAAsB,CAAC,OAAO,GAAE,6BAAkC;;;;;;;;;;;;;;;;;;;;;;UAQjF"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { useQuery } from "@tanstack/react-query";
|
|
3
|
+
import { useVoyantFinanceContext } from "../provider.js";
|
|
4
|
+
import { getInvoiceNumberSeriesQueryOptions } from "../query-options.js";
|
|
5
|
+
export function useInvoiceNumberSeries(options = {}) {
|
|
6
|
+
const { baseUrl, fetcher } = useVoyantFinanceContext();
|
|
7
|
+
const { enabled = true, ...filters } = options;
|
|
8
|
+
return useQuery({
|
|
9
|
+
...getInvoiceNumberSeriesQueryOptions({ baseUrl, fetcher }, filters),
|
|
10
|
+
enabled,
|
|
11
|
+
});
|
|
12
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { type PaymentMethod, type PaymentStatus } from "../schemas.js";
|
|
2
|
+
export interface CreateInvoicePaymentInput {
|
|
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
|
+
export declare function useInvoicePaymentMutation(invoiceId: string): import("@tanstack/react-query").UseMutationResult<{
|
|
15
|
+
id: string;
|
|
16
|
+
invoiceId: string;
|
|
17
|
+
amountCents: number;
|
|
18
|
+
currency: string;
|
|
19
|
+
baseCurrency: string | null;
|
|
20
|
+
baseAmountCents: number | null;
|
|
21
|
+
paymentMethod: string;
|
|
22
|
+
status: "pending" | "completed" | "failed" | "refunded";
|
|
23
|
+
referenceNumber: string | null;
|
|
24
|
+
paymentDate: string;
|
|
25
|
+
notes: string | null;
|
|
26
|
+
createdAt: string;
|
|
27
|
+
fxRateSetId?: string | null | undefined;
|
|
28
|
+
}, Error, CreateInvoicePaymentInput, unknown>;
|
|
29
|
+
//# sourceMappingURL=use-invoice-payment-mutation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-invoice-payment-mutation.d.ts","sourceRoot":"","sources":["../../src/hooks/use-invoice-payment-mutation.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,KAAK,aAAa,EAAE,KAAK,aAAa,EAAuB,MAAM,eAAe,CAAA;AAE3F,MAAM,WAAW,yBAAyB;IACxC,WAAW,EAAE,MAAM,CAAA;IACnB,QAAQ,EAAE,MAAM,CAAA;IAChB,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,EAAE,aAAa,CAAA;IAC5B,MAAM,EAAE,aAAa,CAAA;IACrB,eAAe,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IAC/B,WAAW,EAAE,MAAM,CAAA;IACnB,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;CACtB;AAMD,wBAAgB,yBAAyB,CAAC,SAAS,EAAE,MAAM;;;;;;;;;;;;;;8CA8B1D"}
|
|
@@ -0,0 +1,35 @@
|
|
|
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 invoicePaymentSingleResponse = z.object({
|
|
9
|
+
data: paymentRecordSchema,
|
|
10
|
+
});
|
|
11
|
+
export function useInvoicePaymentMutation(invoiceId) {
|
|
12
|
+
const { baseUrl, fetcher } = useVoyantFinanceContext();
|
|
13
|
+
const queryClient = useQueryClient();
|
|
14
|
+
return useMutation({
|
|
15
|
+
mutationFn: async (input) => {
|
|
16
|
+
const { data } = await fetchWithValidation(`/v1/admin/finance/invoices/${invoiceId}/payments`, invoicePaymentSingleResponse, { baseUrl, fetcher }, { method: "POST", body: JSON.stringify(input) });
|
|
17
|
+
return data;
|
|
18
|
+
},
|
|
19
|
+
onSuccess: () => {
|
|
20
|
+
void queryClient.invalidateQueries({ queryKey: financeQueryKeys.payments(invoiceId) });
|
|
21
|
+
void queryClient.invalidateQueries({ queryKey: financeQueryKeys.invoice(invoiceId) });
|
|
22
|
+
void queryClient.invalidateQueries({ queryKey: financeQueryKeys.allPayments() });
|
|
23
|
+
// Booking-scoped payment lists (BookingPaymentsSummary in the
|
|
24
|
+
// operator/customer dashboards) are keyed by bookingId, which the
|
|
25
|
+
// POST response doesn't carry. Prefix-invalidate so every active
|
|
26
|
+
// per-booking query refetches — same approach as `usePaymentMutation`.
|
|
27
|
+
void queryClient.invalidateQueries({
|
|
28
|
+
queryKey: [...financeQueryKeys.all, "admin-booking-payments"],
|
|
29
|
+
});
|
|
30
|
+
void queryClient.invalidateQueries({
|
|
31
|
+
queryKey: [...financeQueryKeys.publicCheckout(), "booking-payments"],
|
|
32
|
+
});
|
|
33
|
+
},
|
|
34
|
+
});
|
|
35
|
+
}
|