@voyant-travel/bookings-react 0.119.3
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 +87 -0
- package/dist/admin/booking-contract-dialog.d.ts +22 -0
- package/dist/admin/booking-contract-dialog.d.ts.map +1 -0
- package/dist/admin/booking-contract-dialog.js +161 -0
- package/dist/admin/booking-detail-host.d.ts +103 -0
- package/dist/admin/booking-detail-host.d.ts.map +1 -0
- package/dist/admin/booking-detail-host.js +127 -0
- package/dist/admin/booking-detail-skeleton.d.ts +7 -0
- package/dist/admin/booking-detail-skeleton.d.ts.map +1 -0
- package/dist/admin/booking-detail-skeleton.js +24 -0
- package/dist/admin/booking-documents-table.d.ts +13 -0
- package/dist/admin/booking-documents-table.d.ts.map +1 -0
- package/dist/admin/booking-documents-table.js +259 -0
- package/dist/admin/booking-invoice-sheet.d.ts +18 -0
- package/dist/admin/booking-invoice-sheet.d.ts.map +1 -0
- package/dist/admin/booking-invoice-sheet.js +101 -0
- package/dist/admin/booking-journey-host.d.ts +24 -0
- package/dist/admin/booking-journey-host.d.ts.map +1 -0
- package/dist/admin/booking-journey-host.js +278 -0
- package/dist/admin/bookings-host.d.ts +26 -0
- package/dist/admin/bookings-host.d.ts.map +1 -0
- package/dist/admin/bookings-host.js +18 -0
- package/dist/admin/bookings-list-skeleton.d.ts +10 -0
- package/dist/admin/bookings-list-skeleton.d.ts.map +1 -0
- package/dist/admin/bookings-list-skeleton.js +25 -0
- package/dist/admin/index.d.ts +273 -0
- package/dist/admin/index.d.ts.map +1 -0
- package/dist/admin/index.js +331 -0
- package/dist/admin/journey-billing-duplicate-warning.d.ts +3 -0
- package/dist/admin/journey-billing-duplicate-warning.d.ts.map +1 -0
- package/dist/admin/journey-billing-duplicate-warning.js +26 -0
- package/dist/admin/journey-departure-picker.d.ts +7 -0
- package/dist/admin/journey-departure-picker.d.ts.map +1 -0
- package/dist/admin/journey-departure-picker.js +100 -0
- package/dist/admin/journey-units-picker.d.ts +11 -0
- package/dist/admin/journey-units-picker.d.ts.map +1 -0
- package/dist/admin/journey-units-picker.js +60 -0
- package/dist/admin/journey-voucher-picker.d.ts +3 -0
- package/dist/admin/journey-voucher-picker.d.ts.map +1 -0
- package/dist/admin/journey-voucher-picker.js +71 -0
- package/dist/admin/pages/booking-compose-page.d.ts +9 -0
- package/dist/admin/pages/booking-compose-page.d.ts.map +1 -0
- package/dist/admin/pages/booking-compose-page.js +17 -0
- package/dist/admin/pages/booking-detail-page.d.ts +11 -0
- package/dist/admin/pages/booking-detail-page.d.ts.map +1 -0
- package/dist/admin/pages/booking-detail-page.js +14 -0
- package/dist/admin/pages/booking-journey-page.d.ts +12 -0
- package/dist/admin/pages/booking-journey-page.d.ts.map +1 -0
- package/dist/admin/pages/booking-journey-page.js +26 -0
- package/dist/admin/pages/booking-new-page.d.ts +15 -0
- package/dist/admin/pages/booking-new-page.d.ts.map +1 -0
- package/dist/admin/pages/booking-new-page.js +50 -0
- package/dist/admin/pages/bookings-index-page.d.ts +20 -0
- package/dist/admin/pages/bookings-index-page.d.ts.map +1 -0
- package/dist/admin/pages/bookings-index-page.js +18 -0
- package/dist/admin/person-bookings-widget.d.ts +13 -0
- package/dist/admin/person-bookings-widget.d.ts.map +1 -0
- package/dist/admin/person-bookings-widget.js +48 -0
- package/dist/admin/slots.d.ts +31 -0
- package/dist/admin/slots.d.ts.map +1 -0
- package/dist/admin/slots.js +30 -0
- package/dist/admin/use-booking-action-ledger-events.d.ts +15 -0
- package/dist/admin/use-booking-action-ledger-events.d.ts.map +1 -0
- package/dist/admin/use-booking-action-ledger-events.js +66 -0
- package/dist/client.d.ts +14 -0
- package/dist/client.d.ts.map +1 -0
- package/dist/client.js +59 -0
- package/dist/components/booking-activity-timeline.d.ts +32 -0
- package/dist/components/booking-activity-timeline.d.ts.map +1 -0
- package/dist/components/booking-activity-timeline.js +147 -0
- package/dist/components/booking-billing-dialog.d.ts +16 -0
- package/dist/components/booking-billing-dialog.d.ts.map +1 -0
- package/dist/components/booking-billing-dialog.js +315 -0
- package/dist/components/booking-cancellation-dialog.d.ts +18 -0
- package/dist/components/booking-cancellation-dialog.d.ts.map +1 -0
- package/dist/components/booking-cancellation-dialog.js +79 -0
- package/dist/components/booking-combobox.d.ts +13 -0
- package/dist/components/booking-combobox.d.ts.map +1 -0
- package/dist/components/booking-combobox.js +44 -0
- package/dist/components/booking-create-form-utils.d.ts +56 -0
- package/dist/components/booking-create-form-utils.d.ts.map +1 -0
- package/dist/components/booking-create-form-utils.js +216 -0
- package/dist/components/booking-create-page.d.ts +14 -0
- package/dist/components/booking-create-page.d.ts.map +1 -0
- package/dist/components/booking-create-page.js +11 -0
- package/dist/components/booking-create-preview-card.d.ts +26 -0
- package/dist/components/booking-create-preview-card.d.ts.map +1 -0
- package/dist/components/booking-create-preview-card.js +107 -0
- package/dist/components/booking-create-product-extras-picker.d.ts +18 -0
- package/dist/components/booking-create-product-extras-picker.d.ts.map +1 -0
- package/dist/components/booking-create-product-extras-picker.js +82 -0
- package/dist/components/booking-create-sheet.d.ts +34 -0
- package/dist/components/booking-create-sheet.d.ts.map +1 -0
- package/dist/components/booking-create-sheet.js +811 -0
- package/dist/components/booking-create-utils.d.ts +66 -0
- package/dist/components/booking-create-utils.d.ts.map +1 -0
- package/dist/components/booking-create-utils.js +185 -0
- package/dist/components/booking-detail-page.d.ts +126 -0
- package/dist/components/booking-detail-page.d.ts.map +1 -0
- package/dist/components/booking-detail-page.js +264 -0
- package/dist/components/booking-dialog.d.ts +28 -0
- package/dist/components/booking-dialog.d.ts.map +1 -0
- package/dist/components/booking-dialog.js +130 -0
- package/dist/components/booking-document-dialog.d.ts +8 -0
- package/dist/components/booking-document-dialog.d.ts.map +1 -0
- package/dist/components/booking-document-dialog.js +83 -0
- package/dist/components/booking-document-list.d.ts +5 -0
- package/dist/components/booking-document-list.d.ts.map +1 -0
- package/dist/components/booking-document-list.js +43 -0
- package/dist/components/booking-group-link-dialog.d.ts +10 -0
- package/dist/components/booking-group-link-dialog.d.ts.map +1 -0
- package/dist/components/booking-group-link-dialog.js +79 -0
- package/dist/components/booking-group-section.d.ts +27 -0
- package/dist/components/booking-group-section.d.ts.map +1 -0
- package/dist/components/booking-group-section.js +51 -0
- package/dist/components/booking-guarantee-dialog.d.ts +10 -0
- package/dist/components/booking-guarantee-dialog.d.ts.map +1 -0
- package/dist/components/booking-guarantee-dialog.js +123 -0
- package/dist/components/booking-guarantee-list.d.ts +5 -0
- package/dist/components/booking-guarantee-list.d.ts.map +1 -0
- package/dist/components/booking-guarantee-list.js +86 -0
- package/dist/components/booking-item-dialog.d.ts +10 -0
- package/dist/components/booking-item-dialog.d.ts.map +1 -0
- package/dist/components/booking-item-dialog.js +155 -0
- package/dist/components/booking-item-list.d.ts +12 -0
- package/dist/components/booking-item-list.d.ts.map +1 -0
- package/dist/components/booking-item-list.js +191 -0
- package/dist/components/booking-item-travelers.d.ts +6 -0
- package/dist/components/booking-item-travelers.d.ts.map +1 -0
- package/dist/components/booking-item-travelers.js +57 -0
- package/dist/components/booking-list-filters.d.ts +43 -0
- package/dist/components/booking-list-filters.d.ts.map +1 -0
- package/dist/components/booking-list-filters.js +192 -0
- package/dist/components/booking-list.d.ts +50 -0
- package/dist/components/booking-list.d.ts.map +1 -0
- package/dist/components/booking-list.js +352 -0
- package/dist/components/booking-note-dialog.d.ts +16 -0
- package/dist/components/booking-note-dialog.d.ts.map +1 -0
- package/dist/components/booking-note-dialog.js +41 -0
- package/dist/components/booking-notes.d.ts +5 -0
- package/dist/components/booking-notes.d.ts.map +1 -0
- package/dist/components/booking-notes.js +45 -0
- package/dist/components/booking-payment-reconciliation-banner.d.ts +5 -0
- package/dist/components/booking-payment-reconciliation-banner.d.ts.map +1 -0
- package/dist/components/booking-payment-reconciliation-banner.js +91 -0
- package/dist/components/booking-payment-schedule-dialog.d.ts +10 -0
- package/dist/components/booking-payment-schedule-dialog.d.ts.map +1 -0
- package/dist/components/booking-payment-schedule-dialog.js +117 -0
- package/dist/components/booking-payment-schedule-list.d.ts +10 -0
- package/dist/components/booking-payment-schedule-list.d.ts.map +1 -0
- package/dist/components/booking-payment-schedule-list.js +217 -0
- package/dist/components/booking-payments-summary.d.ts +83 -0
- package/dist/components/booking-payments-summary.d.ts.map +1 -0
- package/dist/components/booking-payments-summary.js +176 -0
- package/dist/components/booking-quick-view-sheet.d.ts +14 -0
- package/dist/components/booking-quick-view-sheet.d.ts.map +1 -0
- package/dist/components/booking-quick-view-sheet.js +283 -0
- package/dist/components/bookings-page.d.ts +19 -0
- package/dist/components/bookings-page.d.ts.map +1 -0
- package/dist/components/bookings-page.js +9 -0
- package/dist/components/file-dropzone.d.ts +25 -0
- package/dist/components/file-dropzone.d.ts.map +1 -0
- package/dist/components/file-dropzone.js +102 -0
- package/dist/components/icon-action-button.d.ts +18 -0
- package/dist/components/icon-action-button.d.ts.map +1 -0
- package/dist/components/icon-action-button.js +13 -0
- package/dist/components/option-units-stepper-section.d.ts +111 -0
- package/dist/components/option-units-stepper-section.d.ts.map +1 -0
- package/dist/components/option-units-stepper-section.js +276 -0
- package/dist/components/payment-schedule-section.d.ts +91 -0
- package/dist/components/payment-schedule-section.d.ts.map +1 -0
- package/dist/components/payment-schedule-section.js +206 -0
- package/dist/components/person-picker-section.d.ts +71 -0
- package/dist/components/person-picker-section.d.ts.map +1 -0
- package/dist/components/person-picker-section.js +160 -0
- package/dist/components/price-breakdown-section.d.ts +83 -0
- package/dist/components/price-breakdown-section.d.ts.map +1 -0
- package/dist/components/price-breakdown-section.js +278 -0
- package/dist/components/product-picker-section.d.ts +29 -0
- package/dist/components/product-picker-section.d.ts.map +1 -0
- package/dist/components/product-picker-section.js +74 -0
- package/dist/components/shared-room-section.d.ts +40 -0
- package/dist/components/shared-room-section.d.ts.map +1 -0
- package/dist/components/shared-room-section.js +99 -0
- package/dist/components/status-badge.d.ts +24 -0
- package/dist/components/status-badge.d.ts.map +1 -0
- package/dist/components/status-badge.js +65 -0
- package/dist/components/status-change-dialog.d.ts +10 -0
- package/dist/components/status-change-dialog.d.ts.map +1 -0
- package/dist/components/status-change-dialog.js +57 -0
- package/dist/components/supplier-status-dialog.d.ts +10 -0
- package/dist/components/supplier-status-dialog.d.ts.map +1 -0
- package/dist/components/supplier-status-dialog.js +98 -0
- package/dist/components/supplier-status-list.d.ts +5 -0
- package/dist/components/supplier-status-list.d.ts.map +1 -0
- package/dist/components/supplier-status-list.js +115 -0
- package/dist/components/traveler-category-buttons.d.ts +26 -0
- package/dist/components/traveler-category-buttons.d.ts.map +1 -0
- package/dist/components/traveler-category-buttons.js +35 -0
- package/dist/components/traveler-dialog.d.ts +10 -0
- package/dist/components/traveler-dialog.d.ts.map +1 -0
- package/dist/components/traveler-dialog.js +256 -0
- package/dist/components/traveler-list.d.ts +6 -0
- package/dist/components/traveler-list.d.ts.map +1 -0
- package/dist/components/traveler-list.js +295 -0
- package/dist/components/travelers-section-controls.d.ts +52 -0
- package/dist/components/travelers-section-controls.d.ts.map +1 -0
- package/dist/components/travelers-section-controls.js +206 -0
- package/dist/components/travelers-section.d.ts +159 -0
- package/dist/components/travelers-section.d.ts.map +1 -0
- package/dist/components/travelers-section.js +355 -0
- package/dist/components/voucher-picker-section.d.ts +50 -0
- package/dist/components/voucher-picker-section.d.ts.map +1 -0
- package/dist/components/voucher-picker-section.js +79 -0
- package/dist/extras/client.d.ts +14 -0
- package/dist/extras/client.d.ts.map +1 -0
- package/dist/extras/client.js +58 -0
- package/dist/extras/components/extra-catalog-card.d.ts +13 -0
- package/dist/extras/components/extra-catalog-card.d.ts.map +1 -0
- package/dist/extras/components/extra-catalog-card.js +52 -0
- package/dist/extras/components/product-combobox.d.ts +9 -0
- package/dist/extras/components/product-combobox.d.ts.map +1 -0
- package/dist/extras/components/product-combobox.js +46 -0
- package/dist/extras/components/slot-extras-manifest-panel.d.ts +6 -0
- package/dist/extras/components/slot-extras-manifest-panel.d.ts.map +1 -0
- package/dist/extras/components/slot-extras-manifest-panel.js +108 -0
- package/dist/extras/hooks/index.d.ts +5 -0
- package/dist/extras/hooks/index.d.ts.map +1 -0
- package/dist/extras/hooks/index.js +4 -0
- package/dist/extras/hooks/use-product-extra.d.ts +24 -0
- package/dist/extras/hooks/use-product-extra.d.ts.map +1 -0
- package/dist/extras/hooks/use-product-extra.js +12 -0
- package/dist/extras/hooks/use-product-extras.d.ts +30 -0
- package/dist/extras/hooks/use-product-extras.d.ts.map +1 -0
- package/dist/extras/hooks/use-product-extras.js +12 -0
- package/dist/extras/hooks/use-slot-extra-manifest-mutation.d.ts +48 -0
- package/dist/extras/hooks/use-slot-extra-manifest-mutation.d.ts.map +1 -0
- package/dist/extras/hooks/use-slot-extra-manifest-mutation.js +26 -0
- package/dist/extras/hooks/use-slot-extra-manifest.d.ts +68 -0
- package/dist/extras/hooks/use-slot-extra-manifest.d.ts.map +1 -0
- package/dist/extras/hooks/use-slot-extra-manifest.js +11 -0
- package/dist/extras/i18n/en.d.ts +52 -0
- package/dist/extras/i18n/en.d.ts.map +1 -0
- package/dist/extras/i18n/en.js +51 -0
- package/dist/extras/i18n/index.d.ts +5 -0
- package/dist/extras/i18n/index.d.ts.map +1 -0
- package/dist/extras/i18n/index.js +3 -0
- package/dist/extras/i18n/messages.d.ts +37 -0
- package/dist/extras/i18n/messages.d.ts.map +1 -0
- package/dist/extras/i18n/messages.js +1 -0
- package/dist/extras/i18n/provider.d.ts +126 -0
- package/dist/extras/i18n/provider.d.ts.map +1 -0
- package/dist/extras/i18n/provider.js +44 -0
- package/dist/extras/i18n/ro.d.ts +52 -0
- package/dist/extras/i18n/ro.d.ts.map +1 -0
- package/dist/extras/i18n/ro.js +51 -0
- package/dist/extras/index.d.ts +7 -0
- package/dist/extras/index.d.ts.map +1 -0
- package/dist/extras/index.js +6 -0
- package/dist/extras/provider.d.ts +2 -0
- package/dist/extras/provider.d.ts.map +1 -0
- package/dist/extras/provider.js +1 -0
- package/dist/extras/query-keys.d.ts +16 -0
- package/dist/extras/query-keys.d.ts.map +1 -0
- package/dist/extras/query-keys.js +8 -0
- package/dist/extras/query-options.d.ts +455 -0
- package/dist/extras/query-options.d.ts.map +1 -0
- package/dist/extras/query-options.js +44 -0
- package/dist/extras/schemas.d.ts +416 -0
- package/dist/extras/schemas.d.ts.map +1 -0
- package/dist/extras/schemas.js +89 -0
- package/dist/extras/ui.d.ts +4 -0
- package/dist/extras/ui.d.ts.map +1 -0
- package/dist/extras/ui.js +3 -0
- package/dist/extras.d.ts +10 -0
- package/dist/extras.d.ts.map +1 -0
- package/dist/extras.js +9 -0
- package/dist/hooks/index.d.ts +36 -0
- package/dist/hooks/index.d.ts.map +1 -0
- package/dist/hooks/index.js +35 -0
- package/dist/hooks/use-booking-action-ledger.d.ts +63 -0
- package/dist/hooks/use-booking-action-ledger.d.ts.map +1 -0
- package/dist/hooks/use-booking-action-ledger.js +34 -0
- package/dist/hooks/use-booking-activity.d.ts +17 -0
- package/dist/hooks/use-booking-activity.d.ts.map +1 -0
- package/dist/hooks/use-booking-activity.js +12 -0
- package/dist/hooks/use-booking-cancel-mutation.d.ts +69 -0
- package/dist/hooks/use-booking-cancel-mutation.d.ts.map +1 -0
- package/dist/hooks/use-booking-cancel-mutation.js +24 -0
- package/dist/hooks/use-booking-contract-generation.d.ts +31 -0
- package/dist/hooks/use-booking-contract-generation.d.ts.map +1 -0
- package/dist/hooks/use-booking-contract-generation.js +36 -0
- package/dist/hooks/use-booking-convert-mutation.d.ts +81 -0
- package/dist/hooks/use-booking-convert-mutation.d.ts.map +1 -0
- package/dist/hooks/use-booking-convert-mutation.js +24 -0
- package/dist/hooks/use-booking-create-mutation.d.ts +337 -0
- package/dist/hooks/use-booking-create-mutation.d.ts.map +1 -0
- package/dist/hooks/use-booking-create-mutation.js +43 -0
- package/dist/hooks/use-booking-documents.d.ts +41 -0
- package/dist/hooks/use-booking-documents.d.ts.map +1 -0
- package/dist/hooks/use-booking-documents.js +46 -0
- package/dist/hooks/use-booking-dual-create-mutation.d.ts +338 -0
- package/dist/hooks/use-booking-dual-create-mutation.d.ts.map +1 -0
- package/dist/hooks/use-booking-dual-create-mutation.js +45 -0
- package/dist/hooks/use-booking-group-for-booking.d.ts +24 -0
- package/dist/hooks/use-booking-group-for-booking.d.ts.map +1 -0
- package/dist/hooks/use-booking-group-for-booking.js +12 -0
- package/dist/hooks/use-booking-group-member-mutation.d.ts +27 -0
- package/dist/hooks/use-booking-group-member-mutation.d.ts.map +1 -0
- package/dist/hooks/use-booking-group-member-mutation.js +38 -0
- package/dist/hooks/use-booking-group-mutation.d.ts +40 -0
- package/dist/hooks/use-booking-group-mutation.d.ts.map +1 -0
- package/dist/hooks/use-booking-group-mutation.js +32 -0
- package/dist/hooks/use-booking-group.d.ts +85 -0
- package/dist/hooks/use-booking-group.d.ts.map +1 -0
- package/dist/hooks/use-booking-group.js +12 -0
- package/dist/hooks/use-booking-groups.d.ts +21 -0
- package/dist/hooks/use-booking-groups.d.ts.map +1 -0
- package/dist/hooks/use-booking-groups.js +12 -0
- package/dist/hooks/use-booking-item-mutation.d.ts +101 -0
- package/dist/hooks/use-booking-item-mutation.d.ts.map +1 -0
- package/dist/hooks/use-booking-item-mutation.js +42 -0
- package/dist/hooks/use-booking-item-travelers.d.ts +32 -0
- package/dist/hooks/use-booking-item-travelers.d.ts.map +1 -0
- package/dist/hooks/use-booking-item-travelers.js +48 -0
- package/dist/hooks/use-booking-items.d.ts +36 -0
- package/dist/hooks/use-booking-items.d.ts.map +1 -0
- package/dist/hooks/use-booking-items.js +12 -0
- package/dist/hooks/use-booking-mutation.d.ts +158 -0
- package/dist/hooks/use-booking-mutation.d.ts.map +1 -0
- package/dist/hooks/use-booking-mutation.js +39 -0
- package/dist/hooks/use-booking-note-mutation.d.ts +39 -0
- package/dist/hooks/use-booking-note-mutation.d.ts.map +1 -0
- package/dist/hooks/use-booking-note-mutation.js +44 -0
- package/dist/hooks/use-booking-notes.d.ts +15 -0
- package/dist/hooks/use-booking-notes.d.ts.map +1 -0
- package/dist/hooks/use-booking-notes.js +12 -0
- package/dist/hooks/use-booking-primary-product.d.ts +28 -0
- package/dist/hooks/use-booking-primary-product.d.ts.map +1 -0
- package/dist/hooks/use-booking-primary-product.js +20 -0
- package/dist/hooks/use-booking-status-mutation.d.ts +156 -0
- package/dist/hooks/use-booking-status-mutation.d.ts.map +1 -0
- package/dist/hooks/use-booking-status-mutation.js +54 -0
- package/dist/hooks/use-booking-tax-preview.d.ts +29 -0
- package/dist/hooks/use-booking-tax-preview.d.ts.map +1 -0
- package/dist/hooks/use-booking-tax-preview.js +21 -0
- package/dist/hooks/use-booking.d.ts +67 -0
- package/dist/hooks/use-booking.d.ts.map +1 -0
- package/dist/hooks/use-booking.js +12 -0
- package/dist/hooks/use-bookings.d.ts +71 -0
- package/dist/hooks/use-bookings.d.ts.map +1 -0
- package/dist/hooks/use-bookings.js +12 -0
- package/dist/hooks/use-pricing-preview.d.ts +61 -0
- package/dist/hooks/use-pricing-preview.d.ts.map +1 -0
- package/dist/hooks/use-pricing-preview.js +18 -0
- package/dist/hooks/use-public-booking-session-flow-mutation.d.ts +148 -0
- package/dist/hooks/use-public-booking-session-flow-mutation.d.ts.map +1 -0
- package/dist/hooks/use-public-booking-session-flow-mutation.js +35 -0
- package/dist/hooks/use-public-booking-session-state.d.ts +16 -0
- package/dist/hooks/use-public-booking-session-state.d.ts.map +1 -0
- package/dist/hooks/use-public-booking-session-state.js +12 -0
- package/dist/hooks/use-public-booking-session.d.ts +101 -0
- package/dist/hooks/use-public-booking-session.d.ts.map +1 -0
- package/dist/hooks/use-public-booking-session.js +12 -0
- package/dist/hooks/use-reveal-traveler.d.ts +54 -0
- package/dist/hooks/use-reveal-traveler.d.ts.map +1 -0
- package/dist/hooks/use-reveal-traveler.js +18 -0
- package/dist/hooks/use-sharing-groups.d.ts +41 -0
- package/dist/hooks/use-sharing-groups.d.ts.map +1 -0
- package/dist/hooks/use-sharing-groups.js +20 -0
- package/dist/hooks/use-supplier-status-mutation.d.ts +46 -0
- package/dist/hooks/use-supplier-status-mutation.d.ts.map +1 -0
- package/dist/hooks/use-supplier-status-mutation.js +39 -0
- package/dist/hooks/use-supplier-statuses.d.ts +20 -0
- package/dist/hooks/use-supplier-statuses.d.ts.map +1 -0
- package/dist/hooks/use-supplier-statuses.js +12 -0
- package/dist/hooks/use-traveler-mutation.d.ts +55 -0
- package/dist/hooks/use-traveler-mutation.d.ts.map +1 -0
- package/dist/hooks/use-traveler-mutation.js +42 -0
- package/dist/hooks/use-traveler-with-travel-details-mutation.d.ts +120 -0
- package/dist/hooks/use-traveler-with-travel-details-mutation.d.ts.map +1 -0
- package/dist/hooks/use-traveler-with-travel-details-mutation.js +43 -0
- package/dist/hooks/use-travelers.d.ts +23 -0
- package/dist/hooks/use-travelers.d.ts.map +1 -0
- package/dist/hooks/use-travelers.js +12 -0
- package/dist/i18n/en-base.d.ts +295 -0
- package/dist/i18n/en-base.d.ts.map +1 -0
- package/dist/i18n/en-base.js +294 -0
- package/dist/i18n/en-create-list.d.ts +327 -0
- package/dist/i18n/en-create-list.d.ts.map +1 -0
- package/dist/i18n/en-create-list.js +326 -0
- package/dist/i18n/en-journey.d.ts +229 -0
- package/dist/i18n/en-journey.d.ts.map +1 -0
- package/dist/i18n/en-journey.js +228 -0
- package/dist/i18n/en-operations.d.ts +382 -0
- package/dist/i18n/en-operations.d.ts.map +1 -0
- package/dist/i18n/en-operations.js +381 -0
- package/dist/i18n/en-sections.d.ts +360 -0
- package/dist/i18n/en-sections.d.ts.map +1 -0
- package/dist/i18n/en-sections.js +359 -0
- package/dist/i18n/en.d.ts +1581 -0
- package/dist/i18n/en.d.ts.map +1 -0
- package/dist/i18n/en.js +12 -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-base.d.ts +251 -0
- package/dist/i18n/messages-base.d.ts.map +1 -0
- package/dist/i18n/messages-base.js +1 -0
- package/dist/i18n/messages-create-list.d.ts +310 -0
- package/dist/i18n/messages-create-list.d.ts.map +1 -0
- package/dist/i18n/messages-create-list.js +1 -0
- package/dist/i18n/messages-journey.d.ts +198 -0
- package/dist/i18n/messages-journey.d.ts.map +1 -0
- package/dist/i18n/messages-journey.js +1 -0
- package/dist/i18n/messages-operations.d.ts +362 -0
- package/dist/i18n/messages-operations.d.ts.map +1 -0
- package/dist/i18n/messages-operations.js +1 -0
- package/dist/i18n/messages-sections.d.ts +312 -0
- package/dist/i18n/messages-sections.d.ts.map +1 -0
- package/dist/i18n/messages-sections.js +1 -0
- package/dist/i18n/messages.d.ts +7 -0
- package/dist/i18n/messages.d.ts.map +1 -0
- package/dist/i18n/messages.js +1 -0
- package/dist/i18n/provider.d.ts +3185 -0
- package/dist/i18n/provider.d.ts.map +1 -0
- package/dist/i18n/provider.js +45 -0
- package/dist/i18n/ro-base.d.ts +295 -0
- package/dist/i18n/ro-base.d.ts.map +1 -0
- package/dist/i18n/ro-base.js +294 -0
- package/dist/i18n/ro-create-list.d.ts +327 -0
- package/dist/i18n/ro-create-list.d.ts.map +1 -0
- package/dist/i18n/ro-create-list.js +326 -0
- package/dist/i18n/ro-journey.d.ts +229 -0
- package/dist/i18n/ro-journey.d.ts.map +1 -0
- package/dist/i18n/ro-journey.js +228 -0
- package/dist/i18n/ro-operations.d.ts +382 -0
- package/dist/i18n/ro-operations.d.ts.map +1 -0
- package/dist/i18n/ro-operations.js +381 -0
- package/dist/i18n/ro-sections.d.ts +360 -0
- package/dist/i18n/ro-sections.d.ts.map +1 -0
- package/dist/i18n/ro-sections.js +359 -0
- package/dist/i18n/ro.d.ts +1581 -0
- package/dist/i18n/ro.d.ts.map +1 -0
- package/dist/i18n/ro.js +12 -0
- package/dist/index.d.ts +9 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +8 -0
- package/dist/journey/components/booking-journey-rules.d.ts +48 -0
- package/dist/journey/components/booking-journey-rules.d.ts.map +1 -0
- package/dist/journey/components/booking-journey-rules.js +235 -0
- package/dist/journey/components/booking-journey.d.ts +3 -0
- package/dist/journey/components/booking-journey.d.ts.map +1 -0
- package/dist/journey/components/booking-journey.js +368 -0
- package/dist/journey/components/configure-step-skeleton.d.ts +8 -0
- package/dist/journey/components/configure-step-skeleton.d.ts.map +1 -0
- package/dist/journey/components/configure-step-skeleton.js +11 -0
- package/dist/journey/components/contract-preview-dialog.d.ts +47 -0
- package/dist/journey/components/contract-preview-dialog.d.ts.map +1 -0
- package/dist/journey/components/contract-preview-dialog.js +124 -0
- package/dist/journey/components/journey-steps/accommodation-step.d.ts +3 -0
- package/dist/journey/components/journey-steps/accommodation-step.d.ts.map +1 -0
- package/dist/journey/components/journey-steps/accommodation-step.js +71 -0
- package/dist/journey/components/journey-steps/addons-step.d.ts +3 -0
- package/dist/journey/components/journey-steps/addons-step.d.ts.map +1 -0
- package/dist/journey/components/journey-steps/addons-step.js +40 -0
- package/dist/journey/components/journey-steps/billing-step.d.ts +8 -0
- package/dist/journey/components/journey-steps/billing-step.d.ts.map +1 -0
- package/dist/journey/components/journey-steps/billing-step.js +78 -0
- package/dist/journey/components/journey-steps/configure-steps.d.ts +28 -0
- package/dist/journey/components/journey-steps/configure-steps.d.ts.map +1 -0
- package/dist/journey/components/journey-steps/configure-steps.js +232 -0
- package/dist/journey/components/journey-steps/documents-step.d.ts +11 -0
- package/dist/journey/components/journey-steps/documents-step.d.ts.map +1 -0
- package/dist/journey/components/journey-steps/documents-step.js +36 -0
- package/dist/journey/components/journey-steps/payment-step.d.ts +29 -0
- package/dist/journey/components/journey-steps/payment-step.d.ts.map +1 -0
- package/dist/journey/components/journey-steps/payment-step.js +225 -0
- package/dist/journey/components/journey-steps/review-step.d.ts +27 -0
- package/dist/journey/components/journey-steps/review-step.d.ts.map +1 -0
- package/dist/journey/components/journey-steps/review-step.js +18 -0
- package/dist/journey/components/journey-steps/shared.d.ts +75 -0
- package/dist/journey/components/journey-steps/shared.d.ts.map +1 -0
- package/dist/journey/components/journey-steps/shared.js +108 -0
- package/dist/journey/components/journey-steps/travelers-step.d.ts +7 -0
- package/dist/journey/components/journey-steps/travelers-step.d.ts.map +1 -0
- package/dist/journey/components/journey-steps/travelers-step.js +201 -0
- package/dist/journey/components/journey-steps.d.ts +21 -0
- package/dist/journey/components/journey-steps.d.ts.map +1 -0
- package/dist/journey/components/journey-steps.js +20 -0
- package/dist/journey/components/side-panel.d.ts +17 -0
- package/dist/journey/components/side-panel.d.ts.map +1 -0
- package/dist/journey/components/side-panel.js +245 -0
- package/dist/journey/components/stacked-journey.d.ts +30 -0
- package/dist/journey/components/stacked-journey.d.ts.map +1 -0
- package/dist/journey/components/stacked-journey.js +50 -0
- package/dist/journey/components/step-header.d.ts +7 -0
- package/dist/journey/components/step-header.d.ts.map +1 -0
- package/dist/journey/components/step-header.js +12 -0
- package/dist/journey/index.d.ts +18 -0
- package/dist/journey/index.d.ts.map +1 -0
- package/dist/journey/index.js +17 -0
- package/dist/journey/lib/draft-state.d.ts +35 -0
- package/dist/journey/lib/draft-state.d.ts.map +1 -0
- package/dist/journey/lib/draft-state.js +57 -0
- package/dist/journey/lib/pax-band-dependencies.d.ts +27 -0
- package/dist/journey/lib/pax-band-dependencies.d.ts.map +1 -0
- package/dist/journey/lib/pax-band-dependencies.js +50 -0
- package/dist/journey/lib/payment-schedule.d.ts +19 -0
- package/dist/journey/lib/payment-schedule.d.ts.map +1 -0
- package/dist/journey/lib/payment-schedule.js +90 -0
- package/dist/journey/types.d.ts +403 -0
- package/dist/journey/types.d.ts.map +1 -0
- package/dist/journey/types.js +19 -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 +74 -0
- package/dist/query-keys.d.ts.map +1 -0
- package/dist/query-keys.js +26 -0
- package/dist/query-options.d.ts +2534 -0
- package/dist/query-options.d.ts.map +1 -0
- package/dist/query-options.js +233 -0
- package/dist/requirements/client.d.ts +14 -0
- package/dist/requirements/client.d.ts.map +1 -0
- package/dist/requirements/client.js +59 -0
- package/dist/requirements/components/booking-requirements-contact-tab.d.ts +8 -0
- package/dist/requirements/components/booking-requirements-contact-tab.d.ts.map +1 -0
- package/dist/requirements/components/booking-requirements-contact-tab.js +8 -0
- package/dist/requirements/components/booking-requirements-questions-tab.d.ts +14 -0
- package/dist/requirements/components/booking-requirements-questions-tab.d.ts.map +1 -0
- package/dist/requirements/components/booking-requirements-questions-tab.js +17 -0
- package/dist/requirements/constants.d.ts +114 -0
- package/dist/requirements/constants.d.ts.map +1 -0
- package/dist/requirements/constants.js +45 -0
- package/dist/requirements/hooks/index.d.ts +6 -0
- package/dist/requirements/hooks/index.d.ts.map +1 -0
- package/dist/requirements/hooks/index.js +6 -0
- package/dist/requirements/hooks/use-booking-questions.d.ts +24 -0
- package/dist/requirements/hooks/use-booking-questions.d.ts.map +1 -0
- package/dist/requirements/hooks/use-booking-questions.js +9 -0
- package/dist/requirements/hooks/use-contact-requirements.d.ts +22 -0
- package/dist/requirements/hooks/use-contact-requirements.d.ts.map +1 -0
- package/dist/requirements/hooks/use-contact-requirements.js +9 -0
- package/dist/requirements/hooks/use-products.d.ts +16 -0
- package/dist/requirements/hooks/use-products.d.ts.map +1 -0
- package/dist/requirements/hooks/use-products.js +9 -0
- package/dist/requirements/hooks/use-question-options.d.ts +19 -0
- package/dist/requirements/hooks/use-question-options.d.ts.map +1 -0
- package/dist/requirements/hooks/use-question-options.js +9 -0
- package/dist/requirements/hooks/use-transport-requirements.d.ts +30 -0
- package/dist/requirements/hooks/use-transport-requirements.d.ts.map +1 -0
- package/dist/requirements/hooks/use-transport-requirements.js +9 -0
- package/dist/requirements/i18n/en.d.ts +94 -0
- package/dist/requirements/i18n/en.d.ts.map +1 -0
- package/dist/requirements/i18n/en.js +93 -0
- package/dist/requirements/i18n/index.d.ts +5 -0
- package/dist/requirements/i18n/index.d.ts.map +1 -0
- package/dist/requirements/i18n/index.js +3 -0
- package/dist/requirements/i18n/messages.d.ts +59 -0
- package/dist/requirements/i18n/messages.d.ts.map +1 -0
- package/dist/requirements/i18n/messages.js +1 -0
- package/dist/requirements/i18n/provider.d.ts +210 -0
- package/dist/requirements/i18n/provider.d.ts.map +1 -0
- package/dist/requirements/i18n/provider.js +44 -0
- package/dist/requirements/i18n/ro.d.ts +94 -0
- package/dist/requirements/i18n/ro.d.ts.map +1 -0
- package/dist/requirements/i18n/ro.js +93 -0
- package/dist/requirements/index.d.ts +9 -0
- package/dist/requirements/index.d.ts.map +1 -0
- package/dist/requirements/index.js +8 -0
- package/dist/requirements/provider.d.ts +2 -0
- package/dist/requirements/provider.d.ts.map +1 -0
- package/dist/requirements/provider.js +1 -0
- package/dist/requirements/query-keys.d.ts +33 -0
- package/dist/requirements/query-keys.d.ts.map +1 -0
- package/dist/requirements/query-keys.js +13 -0
- package/dist/requirements/query-options.d.ts +371 -0
- package/dist/requirements/query-options.d.ts.map +1 -0
- package/dist/requirements/query-options.js +80 -0
- package/dist/requirements/schemas.d.ts +320 -0
- package/dist/requirements/schemas.d.ts.map +1 -0
- package/dist/requirements/schemas.js +121 -0
- package/dist/requirements/ui.d.ts +4 -0
- package/dist/requirements/ui.d.ts.map +1 -0
- package/dist/requirements/ui.js +3 -0
- package/dist/requirements/utils.d.ts +2 -0
- package/dist/requirements/utils.d.ts.map +1 -0
- package/dist/requirements/utils.js +4 -0
- package/dist/schemas.d.ts +2070 -0
- package/dist/schemas.d.ts.map +1 -0
- package/dist/schemas.js +507 -0
- package/dist/status-presentation.d.ts +34 -0
- package/dist/status-presentation.d.ts.map +1 -0
- package/dist/status-presentation.js +38 -0
- package/dist/ui.d.ts +43 -0
- package/dist/ui.d.ts.map +1 -0
- package/dist/ui.js +42 -0
- package/package.json +256 -0
- package/src/requirements/styles.css +1 -0
- package/src/styles.css +13 -0
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { useQuery } from "@tanstack/react-query";
|
|
3
|
+
import { useVoyantBookingsContext } from "../provider.js";
|
|
4
|
+
import { getBookingNotesQueryOptions } from "../query-options.js";
|
|
5
|
+
export function useBookingNotes(bookingId, options = {}) {
|
|
6
|
+
const { baseUrl, fetcher } = useVoyantBookingsContext();
|
|
7
|
+
const { enabled = true } = options;
|
|
8
|
+
return useQuery({
|
|
9
|
+
...getBookingNotesQueryOptions({ baseUrl, fetcher }, bookingId),
|
|
10
|
+
enabled: enabled && Boolean(bookingId),
|
|
11
|
+
});
|
|
12
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { type UseBookingItemsOptions } from "./use-booking-items.js";
|
|
2
|
+
export type UseBookingPrimaryProductOptions = UseBookingItemsOptions;
|
|
3
|
+
export interface UseBookingPrimaryProductResult {
|
|
4
|
+
/**
|
|
5
|
+
* The productId of the first booking item that has a non-null productId,
|
|
6
|
+
* or null if no item has one (or items haven't loaded yet).
|
|
7
|
+
*/
|
|
8
|
+
productId: string | null;
|
|
9
|
+
/**
|
|
10
|
+
* The optionUnitId from the same item the `productId` was sourced from,
|
|
11
|
+
* or null if that item has none (or no item resolved).
|
|
12
|
+
*/
|
|
13
|
+
optionUnitId: string | null;
|
|
14
|
+
/** True while the underlying items query has no data yet. */
|
|
15
|
+
isPending: boolean;
|
|
16
|
+
/** True while the underlying items query is loading for the first time. */
|
|
17
|
+
isLoading: boolean;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Derive the "primary product" of a booking from its items.
|
|
21
|
+
*
|
|
22
|
+
* Tour-operator-style bookings are almost always scoped to a single product,
|
|
23
|
+
* but the product association lives on `bookingItem`, not `booking`. This hook
|
|
24
|
+
* encapsulates the canonical resolution — "first item with a non-null
|
|
25
|
+
* productId" — so consumers don't duplicate it.
|
|
26
|
+
*/
|
|
27
|
+
export declare function useBookingPrimaryProduct(bookingId: string | null | undefined, options?: UseBookingPrimaryProductOptions): UseBookingPrimaryProductResult;
|
|
28
|
+
//# sourceMappingURL=use-booking-primary-product.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-booking-primary-product.d.ts","sourceRoot":"","sources":["../../src/hooks/use-booking-primary-product.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,sBAAsB,EAAmB,MAAM,wBAAwB,CAAA;AAErF,MAAM,MAAM,+BAA+B,GAAG,sBAAsB,CAAA;AAEpE,MAAM,WAAW,8BAA8B;IAC7C;;;OAGG;IACH,SAAS,EAAE,MAAM,GAAG,IAAI,CAAA;IACxB;;;OAGG;IACH,YAAY,EAAE,MAAM,GAAG,IAAI,CAAA;IAC3B,6DAA6D;IAC7D,SAAS,EAAE,OAAO,CAAA;IAClB,2EAA2E;IAC3E,SAAS,EAAE,OAAO,CAAA;CACnB;AAED;;;;;;;GAOG;AACH,wBAAgB,wBAAwB,CACtC,SAAS,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,EACpC,OAAO,GAAE,+BAAoC,GAC5C,8BAA8B,CAUhC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { useBookingItems } from "./use-booking-items.js";
|
|
3
|
+
/**
|
|
4
|
+
* Derive the "primary product" of a booking from its items.
|
|
5
|
+
*
|
|
6
|
+
* Tour-operator-style bookings are almost always scoped to a single product,
|
|
7
|
+
* but the product association lives on `bookingItem`, not `booking`. This hook
|
|
8
|
+
* encapsulates the canonical resolution — "first item with a non-null
|
|
9
|
+
* productId" — so consumers don't duplicate it.
|
|
10
|
+
*/
|
|
11
|
+
export function useBookingPrimaryProduct(bookingId, options = {}) {
|
|
12
|
+
const query = useBookingItems(bookingId, options);
|
|
13
|
+
const primary = query.data?.data.find((i) => i.productId) ?? null;
|
|
14
|
+
return {
|
|
15
|
+
productId: primary?.productId ?? null,
|
|
16
|
+
optionUnitId: primary?.optionUnitId ?? null,
|
|
17
|
+
isPending: query.isPending,
|
|
18
|
+
isLoading: query.isLoading,
|
|
19
|
+
};
|
|
20
|
+
}
|
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
import { type BookingRecord } from "../schemas.js";
|
|
2
|
+
type BookingStatus = BookingRecord["status"];
|
|
3
|
+
export interface UpdateBookingStatusInput {
|
|
4
|
+
/**
|
|
5
|
+
* Current status — required for client-side dispatch to the right verb
|
|
6
|
+
* endpoint. The dialog has this in its props; pass it through.
|
|
7
|
+
*/
|
|
8
|
+
currentStatus: BookingStatus;
|
|
9
|
+
status: BookingStatus;
|
|
10
|
+
note?: string | null;
|
|
11
|
+
/**
|
|
12
|
+
* When true and `status === "confirmed"`, downstream subscribers
|
|
13
|
+
* (auto-dispatch notifications, document bundle email) skip
|
|
14
|
+
* sending. Lets the operator confirm a booking silently.
|
|
15
|
+
*/
|
|
16
|
+
suppressNotifications?: boolean;
|
|
17
|
+
/**
|
|
18
|
+
* When true and the status change falls through to override-status, keep
|
|
19
|
+
* the audit event but skip verb-specific lifecycle events.
|
|
20
|
+
*/
|
|
21
|
+
suppressLifecycleEvents?: boolean;
|
|
22
|
+
}
|
|
23
|
+
export declare function useBookingStatusMutation(bookingId: string): import("@tanstack/react-query").UseMutationResult<{
|
|
24
|
+
id: string;
|
|
25
|
+
bookingNumber: string;
|
|
26
|
+
status: "draft" | "expired" | "cancelled" | "completed" | "confirmed" | "on_hold" | "awaiting_payment" | "in_progress";
|
|
27
|
+
personId: string | null;
|
|
28
|
+
organizationId: string | null;
|
|
29
|
+
sellCurrency: string;
|
|
30
|
+
sellAmountCents: number | null;
|
|
31
|
+
costAmountCents: number | null;
|
|
32
|
+
marginPercent: number | null;
|
|
33
|
+
startDate: string | null;
|
|
34
|
+
endDate: string | null;
|
|
35
|
+
pax: number | null;
|
|
36
|
+
internalNotes: string | null;
|
|
37
|
+
createdAt: string;
|
|
38
|
+
updatedAt: string;
|
|
39
|
+
startsAt?: string | null | undefined;
|
|
40
|
+
endsAt?: string | null | undefined;
|
|
41
|
+
items?: {
|
|
42
|
+
id: string;
|
|
43
|
+
title: string;
|
|
44
|
+
itemType: string;
|
|
45
|
+
productId: string | null;
|
|
46
|
+
productName?: string | null | undefined;
|
|
47
|
+
startsAt?: string | null | undefined;
|
|
48
|
+
endsAt?: string | null | undefined;
|
|
49
|
+
}[] | undefined;
|
|
50
|
+
communicationLanguage?: string | null | undefined;
|
|
51
|
+
contactFirstName?: string | null | undefined;
|
|
52
|
+
contactLastName?: string | null | undefined;
|
|
53
|
+
contactPartyType?: "individual" | "company" | null | undefined;
|
|
54
|
+
contactTaxId?: string | null | undefined;
|
|
55
|
+
contactEmail?: string | null | undefined;
|
|
56
|
+
contactPhone?: string | null | undefined;
|
|
57
|
+
contactPreferredLanguage?: string | null | undefined;
|
|
58
|
+
contactCountry?: string | null | undefined;
|
|
59
|
+
contactRegion?: string | null | undefined;
|
|
60
|
+
contactCity?: string | null | undefined;
|
|
61
|
+
contactAddressLine1?: string | null | undefined;
|
|
62
|
+
contactAddressLine2?: string | null | undefined;
|
|
63
|
+
contactPostalCode?: string | null | undefined;
|
|
64
|
+
customerPaymentPolicy?: {
|
|
65
|
+
deposit: {
|
|
66
|
+
kind: "none" | "percent" | "fixed_cents";
|
|
67
|
+
percent?: number | undefined;
|
|
68
|
+
amountCents?: number | undefined;
|
|
69
|
+
};
|
|
70
|
+
minDaysBeforeDepartureForDeposit: number;
|
|
71
|
+
balanceDueDaysBeforeDeparture: number;
|
|
72
|
+
balanceDueMinDaysFromNow: number;
|
|
73
|
+
} | null | undefined;
|
|
74
|
+
priceOverride?: {
|
|
75
|
+
isManual: true;
|
|
76
|
+
originalAmountCents: number | null;
|
|
77
|
+
overriddenAmountCents: number;
|
|
78
|
+
currency: string;
|
|
79
|
+
reason: string;
|
|
80
|
+
overriddenBy: string;
|
|
81
|
+
overriddenAt: string;
|
|
82
|
+
} | null | undefined;
|
|
83
|
+
}, Error, UpdateBookingStatusInput, unknown>;
|
|
84
|
+
export interface UpdateBookingStatusByIdInput extends UpdateBookingStatusInput {
|
|
85
|
+
bookingId: string;
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* Variant of `useBookingStatusMutation` that accepts the booking id at call
|
|
89
|
+
* time instead of at hook-setup time. Used by flows that create a booking
|
|
90
|
+
* and immediately transition its status in the same handler — the id only
|
|
91
|
+
* exists after the create returns, so the per-booking hook shape doesn't
|
|
92
|
+
* fit.
|
|
93
|
+
*/
|
|
94
|
+
export declare function useBookingStatusByIdMutation(): import("@tanstack/react-query").UseMutationResult<{
|
|
95
|
+
id: string;
|
|
96
|
+
bookingNumber: string;
|
|
97
|
+
status: "draft" | "expired" | "cancelled" | "completed" | "confirmed" | "on_hold" | "awaiting_payment" | "in_progress";
|
|
98
|
+
personId: string | null;
|
|
99
|
+
organizationId: string | null;
|
|
100
|
+
sellCurrency: string;
|
|
101
|
+
sellAmountCents: number | null;
|
|
102
|
+
costAmountCents: number | null;
|
|
103
|
+
marginPercent: number | null;
|
|
104
|
+
startDate: string | null;
|
|
105
|
+
endDate: string | null;
|
|
106
|
+
pax: number | null;
|
|
107
|
+
internalNotes: string | null;
|
|
108
|
+
createdAt: string;
|
|
109
|
+
updatedAt: string;
|
|
110
|
+
startsAt?: string | null | undefined;
|
|
111
|
+
endsAt?: string | null | undefined;
|
|
112
|
+
items?: {
|
|
113
|
+
id: string;
|
|
114
|
+
title: string;
|
|
115
|
+
itemType: string;
|
|
116
|
+
productId: string | null;
|
|
117
|
+
productName?: string | null | undefined;
|
|
118
|
+
startsAt?: string | null | undefined;
|
|
119
|
+
endsAt?: string | null | undefined;
|
|
120
|
+
}[] | undefined;
|
|
121
|
+
communicationLanguage?: string | null | undefined;
|
|
122
|
+
contactFirstName?: string | null | undefined;
|
|
123
|
+
contactLastName?: string | null | undefined;
|
|
124
|
+
contactPartyType?: "individual" | "company" | null | undefined;
|
|
125
|
+
contactTaxId?: string | null | undefined;
|
|
126
|
+
contactEmail?: string | null | undefined;
|
|
127
|
+
contactPhone?: string | null | undefined;
|
|
128
|
+
contactPreferredLanguage?: string | null | undefined;
|
|
129
|
+
contactCountry?: string | null | undefined;
|
|
130
|
+
contactRegion?: string | null | undefined;
|
|
131
|
+
contactCity?: string | null | undefined;
|
|
132
|
+
contactAddressLine1?: string | null | undefined;
|
|
133
|
+
contactAddressLine2?: string | null | undefined;
|
|
134
|
+
contactPostalCode?: string | null | undefined;
|
|
135
|
+
customerPaymentPolicy?: {
|
|
136
|
+
deposit: {
|
|
137
|
+
kind: "none" | "percent" | "fixed_cents";
|
|
138
|
+
percent?: number | undefined;
|
|
139
|
+
amountCents?: number | undefined;
|
|
140
|
+
};
|
|
141
|
+
minDaysBeforeDepartureForDeposit: number;
|
|
142
|
+
balanceDueDaysBeforeDeparture: number;
|
|
143
|
+
balanceDueMinDaysFromNow: number;
|
|
144
|
+
} | null | undefined;
|
|
145
|
+
priceOverride?: {
|
|
146
|
+
isManual: true;
|
|
147
|
+
originalAmountCents: number | null;
|
|
148
|
+
overriddenAmountCents: number;
|
|
149
|
+
currency: string;
|
|
150
|
+
reason: string;
|
|
151
|
+
overriddenBy: string;
|
|
152
|
+
overriddenAt: string;
|
|
153
|
+
} | null | undefined;
|
|
154
|
+
}, Error, UpdateBookingStatusByIdInput, unknown>;
|
|
155
|
+
export {};
|
|
156
|
+
//# sourceMappingURL=use-booking-status-mutation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-booking-status-mutation.d.ts","sourceRoot":"","sources":["../../src/hooks/use-booking-status-mutation.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,KAAK,aAAa,EAAyB,MAAM,eAAe,CAAA;AAEzE,KAAK,aAAa,GAAG,aAAa,CAAC,QAAQ,CAAC,CAAA;AAE5C,MAAM,WAAW,wBAAwB;IACvC;;;OAGG;IACH,aAAa,EAAE,aAAa,CAAA;IAC5B,MAAM,EAAE,aAAa,CAAA;IACrB,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IACpB;;;;OAIG;IACH,qBAAqB,CAAC,EAAE,OAAO,CAAA;IAC/B;;;OAGG;IACH,uBAAuB,CAAC,EAAE,OAAO,CAAA;CAClC;AAED,wBAAgB,wBAAwB,CAAC,SAAS,EAAE,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;6CA8BzD;AAED,MAAM,WAAW,4BAA6B,SAAQ,wBAAwB;IAC5E,SAAS,EAAE,MAAM,CAAA;CAClB;AAED;;;;;;GAMG;AACH,wBAAgB,4BAA4B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iDAiC3C"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { useMutation, useQueryClient } from "@tanstack/react-query";
|
|
3
|
+
import { dispatchBookingStatusChange } from "@voyant-travel/bookings/status-dispatch";
|
|
4
|
+
import { fetchWithValidation } from "../client.js";
|
|
5
|
+
import { useVoyantBookingsContext } from "../provider.js";
|
|
6
|
+
import { bookingsQueryKeys } from "../query-keys.js";
|
|
7
|
+
import { bookingSingleResponse } from "../schemas.js";
|
|
8
|
+
export function useBookingStatusMutation(bookingId) {
|
|
9
|
+
const { baseUrl, fetcher } = useVoyantBookingsContext();
|
|
10
|
+
const queryClient = useQueryClient();
|
|
11
|
+
return useMutation({
|
|
12
|
+
mutationFn: async (input) => {
|
|
13
|
+
const target = dispatchBookingStatusChange(bookingId, input.currentStatus, input.status, input.note, {
|
|
14
|
+
suppressNotifications: input.suppressNotifications,
|
|
15
|
+
suppressLifecycleEvents: input.suppressLifecycleEvents,
|
|
16
|
+
});
|
|
17
|
+
const { data } = await fetchWithValidation(target.path, bookingSingleResponse, { baseUrl, fetcher }, { method: "POST", body: JSON.stringify(target.body) });
|
|
18
|
+
return data;
|
|
19
|
+
},
|
|
20
|
+
onSuccess: (data) => {
|
|
21
|
+
void queryClient.invalidateQueries({ queryKey: bookingsQueryKeys.bookings() });
|
|
22
|
+
queryClient.setQueryData(bookingsQueryKeys.booking(bookingId), { data });
|
|
23
|
+
void queryClient.invalidateQueries({ queryKey: bookingsQueryKeys.activity(bookingId) });
|
|
24
|
+
},
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Variant of `useBookingStatusMutation` that accepts the booking id at call
|
|
29
|
+
* time instead of at hook-setup time. Used by flows that create a booking
|
|
30
|
+
* and immediately transition its status in the same handler — the id only
|
|
31
|
+
* exists after the create returns, so the per-booking hook shape doesn't
|
|
32
|
+
* fit.
|
|
33
|
+
*/
|
|
34
|
+
export function useBookingStatusByIdMutation() {
|
|
35
|
+
const { baseUrl, fetcher } = useVoyantBookingsContext();
|
|
36
|
+
const queryClient = useQueryClient();
|
|
37
|
+
return useMutation({
|
|
38
|
+
mutationFn: async ({ bookingId, currentStatus, status, note, suppressNotifications, suppressLifecycleEvents, }) => {
|
|
39
|
+
const target = dispatchBookingStatusChange(bookingId, currentStatus, status, note, {
|
|
40
|
+
suppressNotifications,
|
|
41
|
+
suppressLifecycleEvents,
|
|
42
|
+
});
|
|
43
|
+
const { data } = await fetchWithValidation(target.path, bookingSingleResponse, { baseUrl, fetcher }, { method: "POST", body: JSON.stringify(target.body) });
|
|
44
|
+
return data;
|
|
45
|
+
},
|
|
46
|
+
onSuccess: (data, variables) => {
|
|
47
|
+
void queryClient.invalidateQueries({ queryKey: bookingsQueryKeys.bookings() });
|
|
48
|
+
queryClient.setQueryData(bookingsQueryKeys.booking(variables.bookingId), { data });
|
|
49
|
+
void queryClient.invalidateQueries({
|
|
50
|
+
queryKey: bookingsQueryKeys.activity(variables.bookingId),
|
|
51
|
+
});
|
|
52
|
+
},
|
|
53
|
+
});
|
|
54
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { TaxPreviewFilters } from "../query-keys.js";
|
|
2
|
+
export interface UseBookingTaxPreviewOptions extends TaxPreviewFilters {
|
|
3
|
+
enabled?: boolean;
|
|
4
|
+
}
|
|
5
|
+
/**
|
|
6
|
+
* Real-time tax breakdown for the in-progress booking the operator is
|
|
7
|
+
* configuring. The hook fires whenever `subtotalCents` changes so the
|
|
8
|
+
* preview card reflects the customer-facing total as staff iterate on
|
|
9
|
+
* travelers / options / rooms.
|
|
10
|
+
*
|
|
11
|
+
* Wired to the mountable booking-tax `/v1/admin/bookings/tax-preview`
|
|
12
|
+
* route — resolved tax matches what will land on `booking_item_tax_lines`
|
|
13
|
+
* at booking finalize.
|
|
14
|
+
*/
|
|
15
|
+
export declare function useBookingTaxPreview({ enabled, ...filters }: UseBookingTaxPreviewOptions): import("@tanstack/react-query").UseQueryResult<{
|
|
16
|
+
data: {
|
|
17
|
+
subtotalCents: number;
|
|
18
|
+
taxCents: number;
|
|
19
|
+
totalCents: number;
|
|
20
|
+
currency: string;
|
|
21
|
+
taxRate: {
|
|
22
|
+
code: string;
|
|
23
|
+
label: string;
|
|
24
|
+
rateBasisPoints: number;
|
|
25
|
+
priceMode: "inclusive" | "exclusive";
|
|
26
|
+
} | null;
|
|
27
|
+
};
|
|
28
|
+
}, Error>;
|
|
29
|
+
//# sourceMappingURL=use-booking-tax-preview.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-booking-tax-preview.d.ts","sourceRoot":"","sources":["../../src/hooks/use-booking-tax-preview.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAA;AAGzD,MAAM,WAAW,2BAA4B,SAAQ,iBAAiB;IACpE,OAAO,CAAC,EAAE,OAAO,CAAA;CAClB;AAED;;;;;;;;;GASG;AACH,wBAAgB,oBAAoB,CAAC,EAAE,OAAc,EAAE,GAAG,OAAO,EAAE,EAAE,2BAA2B;;;;;;;;;;;;;UAM/F"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { useQuery } from "@tanstack/react-query";
|
|
3
|
+
import { useVoyantBookingsContext } from "../provider.js";
|
|
4
|
+
import { getTaxPreviewQueryOptions } from "../query-options.js";
|
|
5
|
+
/**
|
|
6
|
+
* Real-time tax breakdown for the in-progress booking the operator is
|
|
7
|
+
* configuring. The hook fires whenever `subtotalCents` changes so the
|
|
8
|
+
* preview card reflects the customer-facing total as staff iterate on
|
|
9
|
+
* travelers / options / rooms.
|
|
10
|
+
*
|
|
11
|
+
* Wired to the mountable booking-tax `/v1/admin/bookings/tax-preview`
|
|
12
|
+
* route — resolved tax matches what will land on `booking_item_tax_lines`
|
|
13
|
+
* at booking finalize.
|
|
14
|
+
*/
|
|
15
|
+
export function useBookingTaxPreview({ enabled = true, ...filters }) {
|
|
16
|
+
const client = useVoyantBookingsContext();
|
|
17
|
+
return useQuery({
|
|
18
|
+
...getTaxPreviewQueryOptions(client, filters),
|
|
19
|
+
enabled: enabled && Boolean(filters.productId) && filters.subtotalCents > 0,
|
|
20
|
+
});
|
|
21
|
+
}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
export interface UseBookingOptions {
|
|
2
|
+
enabled?: boolean;
|
|
3
|
+
}
|
|
4
|
+
export declare function useBooking(id: string | null | undefined, options?: UseBookingOptions): import("@tanstack/react-query").UseQueryResult<{
|
|
5
|
+
data: {
|
|
6
|
+
id: string;
|
|
7
|
+
bookingNumber: string;
|
|
8
|
+
status: "draft" | "expired" | "cancelled" | "completed" | "confirmed" | "on_hold" | "awaiting_payment" | "in_progress";
|
|
9
|
+
personId: string | null;
|
|
10
|
+
organizationId: string | null;
|
|
11
|
+
sellCurrency: string;
|
|
12
|
+
sellAmountCents: number | null;
|
|
13
|
+
costAmountCents: number | null;
|
|
14
|
+
marginPercent: number | null;
|
|
15
|
+
startDate: string | null;
|
|
16
|
+
endDate: string | null;
|
|
17
|
+
pax: number | null;
|
|
18
|
+
internalNotes: string | null;
|
|
19
|
+
createdAt: string;
|
|
20
|
+
updatedAt: string;
|
|
21
|
+
startsAt?: string | null | undefined;
|
|
22
|
+
endsAt?: string | null | undefined;
|
|
23
|
+
items?: {
|
|
24
|
+
id: string;
|
|
25
|
+
title: string;
|
|
26
|
+
itemType: string;
|
|
27
|
+
productId: string | null;
|
|
28
|
+
productName?: string | null | undefined;
|
|
29
|
+
startsAt?: string | null | undefined;
|
|
30
|
+
endsAt?: string | null | undefined;
|
|
31
|
+
}[] | undefined;
|
|
32
|
+
communicationLanguage?: string | null | undefined;
|
|
33
|
+
contactFirstName?: string | null | undefined;
|
|
34
|
+
contactLastName?: string | null | undefined;
|
|
35
|
+
contactPartyType?: "individual" | "company" | null | undefined;
|
|
36
|
+
contactTaxId?: string | null | undefined;
|
|
37
|
+
contactEmail?: string | null | undefined;
|
|
38
|
+
contactPhone?: string | null | undefined;
|
|
39
|
+
contactPreferredLanguage?: string | null | undefined;
|
|
40
|
+
contactCountry?: string | null | undefined;
|
|
41
|
+
contactRegion?: string | null | undefined;
|
|
42
|
+
contactCity?: string | null | undefined;
|
|
43
|
+
contactAddressLine1?: string | null | undefined;
|
|
44
|
+
contactAddressLine2?: string | null | undefined;
|
|
45
|
+
contactPostalCode?: string | null | undefined;
|
|
46
|
+
customerPaymentPolicy?: {
|
|
47
|
+
deposit: {
|
|
48
|
+
kind: "none" | "percent" | "fixed_cents";
|
|
49
|
+
percent?: number | undefined;
|
|
50
|
+
amountCents?: number | undefined;
|
|
51
|
+
};
|
|
52
|
+
minDaysBeforeDepartureForDeposit: number;
|
|
53
|
+
balanceDueDaysBeforeDeparture: number;
|
|
54
|
+
balanceDueMinDaysFromNow: number;
|
|
55
|
+
} | null | undefined;
|
|
56
|
+
priceOverride?: {
|
|
57
|
+
isManual: true;
|
|
58
|
+
originalAmountCents: number | null;
|
|
59
|
+
overriddenAmountCents: number;
|
|
60
|
+
currency: string;
|
|
61
|
+
reason: string;
|
|
62
|
+
overriddenBy: string;
|
|
63
|
+
overriddenAt: string;
|
|
64
|
+
} | null | undefined;
|
|
65
|
+
};
|
|
66
|
+
}, Error>;
|
|
67
|
+
//# sourceMappingURL=use-booking.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-booking.d.ts","sourceRoot":"","sources":["../../src/hooks/use-booking.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 { useVoyantBookingsContext } from "../provider.js";
|
|
4
|
+
import { getBookingQueryOptions } from "../query-options.js";
|
|
5
|
+
export function useBooking(id, options = {}) {
|
|
6
|
+
const { baseUrl, fetcher } = useVoyantBookingsContext();
|
|
7
|
+
const { enabled = true } = options;
|
|
8
|
+
return useQuery({
|
|
9
|
+
...getBookingQueryOptions({ baseUrl, fetcher }, id),
|
|
10
|
+
enabled: enabled && Boolean(id),
|
|
11
|
+
});
|
|
12
|
+
}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import type { BookingsListFilters } from "../query-keys.js";
|
|
2
|
+
export interface UseBookingsOptions extends BookingsListFilters {
|
|
3
|
+
enabled?: boolean;
|
|
4
|
+
}
|
|
5
|
+
export declare function useBookings(options?: UseBookingsOptions): import("@tanstack/react-query").UseQueryResult<{
|
|
6
|
+
data: {
|
|
7
|
+
id: string;
|
|
8
|
+
bookingNumber: string;
|
|
9
|
+
status: "draft" | "expired" | "cancelled" | "completed" | "confirmed" | "on_hold" | "awaiting_payment" | "in_progress";
|
|
10
|
+
personId: string | null;
|
|
11
|
+
organizationId: string | null;
|
|
12
|
+
sellCurrency: string;
|
|
13
|
+
sellAmountCents: number | null;
|
|
14
|
+
costAmountCents: number | null;
|
|
15
|
+
marginPercent: number | null;
|
|
16
|
+
startDate: string | null;
|
|
17
|
+
endDate: string | null;
|
|
18
|
+
pax: number | null;
|
|
19
|
+
internalNotes: string | null;
|
|
20
|
+
createdAt: string;
|
|
21
|
+
updatedAt: string;
|
|
22
|
+
startsAt?: string | null | undefined;
|
|
23
|
+
endsAt?: string | null | undefined;
|
|
24
|
+
items?: {
|
|
25
|
+
id: string;
|
|
26
|
+
title: string;
|
|
27
|
+
itemType: string;
|
|
28
|
+
productId: string | null;
|
|
29
|
+
productName?: string | null | undefined;
|
|
30
|
+
startsAt?: string | null | undefined;
|
|
31
|
+
endsAt?: string | null | undefined;
|
|
32
|
+
}[] | undefined;
|
|
33
|
+
communicationLanguage?: string | null | undefined;
|
|
34
|
+
contactFirstName?: string | null | undefined;
|
|
35
|
+
contactLastName?: string | null | undefined;
|
|
36
|
+
contactPartyType?: "individual" | "company" | null | undefined;
|
|
37
|
+
contactTaxId?: string | null | undefined;
|
|
38
|
+
contactEmail?: string | null | undefined;
|
|
39
|
+
contactPhone?: string | null | undefined;
|
|
40
|
+
contactPreferredLanguage?: string | null | undefined;
|
|
41
|
+
contactCountry?: string | null | undefined;
|
|
42
|
+
contactRegion?: string | null | undefined;
|
|
43
|
+
contactCity?: string | null | undefined;
|
|
44
|
+
contactAddressLine1?: string | null | undefined;
|
|
45
|
+
contactAddressLine2?: string | null | undefined;
|
|
46
|
+
contactPostalCode?: string | null | undefined;
|
|
47
|
+
customerPaymentPolicy?: {
|
|
48
|
+
deposit: {
|
|
49
|
+
kind: "none" | "percent" | "fixed_cents";
|
|
50
|
+
percent?: number | undefined;
|
|
51
|
+
amountCents?: number | undefined;
|
|
52
|
+
};
|
|
53
|
+
minDaysBeforeDepartureForDeposit: number;
|
|
54
|
+
balanceDueDaysBeforeDeparture: number;
|
|
55
|
+
balanceDueMinDaysFromNow: number;
|
|
56
|
+
} | null | undefined;
|
|
57
|
+
priceOverride?: {
|
|
58
|
+
isManual: true;
|
|
59
|
+
originalAmountCents: number | null;
|
|
60
|
+
overriddenAmountCents: number;
|
|
61
|
+
currency: string;
|
|
62
|
+
reason: string;
|
|
63
|
+
overriddenBy: string;
|
|
64
|
+
overriddenAt: string;
|
|
65
|
+
} | null | undefined;
|
|
66
|
+
}[];
|
|
67
|
+
total: number;
|
|
68
|
+
limit: number;
|
|
69
|
+
offset: number;
|
|
70
|
+
}, Error>;
|
|
71
|
+
//# sourceMappingURL=use-bookings.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-bookings.d.ts","sourceRoot":"","sources":["../../src/hooks/use-bookings.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAA;AAG3D,MAAM,WAAW,kBAAmB,SAAQ,mBAAmB;IAC7D,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 { useVoyantBookingsContext } from "../provider.js";
|
|
4
|
+
import { getBookingsQueryOptions } from "../query-options.js";
|
|
5
|
+
export function useBookings(options = {}) {
|
|
6
|
+
const { baseUrl, fetcher } = useVoyantBookingsContext();
|
|
7
|
+
const { enabled = true, ...filters } = options;
|
|
8
|
+
return useQuery({
|
|
9
|
+
...getBookingsQueryOptions({ baseUrl, fetcher }, filters),
|
|
10
|
+
enabled,
|
|
11
|
+
});
|
|
12
|
+
}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import type { PricingPreviewFilters } from "../query-keys.js";
|
|
2
|
+
export interface UsePricingPreviewOptions extends PricingPreviewFilters {
|
|
3
|
+
enabled?: boolean;
|
|
4
|
+
}
|
|
5
|
+
/**
|
|
6
|
+
* Catalog-resolved pricing snapshot for a product + option (+ optional
|
|
7
|
+
* catalog). Consumers match the returned `unitPrices` / `tiers` against their
|
|
8
|
+
* traveler/unit selection to render a breakdown. The snapshot is the same
|
|
9
|
+
* data the storefront session uses, so operator-side numbers stay in sync
|
|
10
|
+
* with customer-facing ones.
|
|
11
|
+
*/
|
|
12
|
+
export declare function usePricingPreview({ enabled, ...filters }: UsePricingPreviewOptions): import("@tanstack/react-query").UseQueryResult<{
|
|
13
|
+
data: {
|
|
14
|
+
catalog: {
|
|
15
|
+
id: string;
|
|
16
|
+
currencyCode: string;
|
|
17
|
+
};
|
|
18
|
+
options: {
|
|
19
|
+
id: string;
|
|
20
|
+
name: string;
|
|
21
|
+
isDefault: boolean;
|
|
22
|
+
}[];
|
|
23
|
+
rules: {
|
|
24
|
+
id: string;
|
|
25
|
+
optionId: string;
|
|
26
|
+
pricingMode: string;
|
|
27
|
+
baseSellAmountCents: number | null;
|
|
28
|
+
isDefault: boolean;
|
|
29
|
+
}[];
|
|
30
|
+
pricingCategories: {
|
|
31
|
+
id: string;
|
|
32
|
+
name: string;
|
|
33
|
+
code: string | null;
|
|
34
|
+
categoryType: string;
|
|
35
|
+
minAge: number | null;
|
|
36
|
+
maxAge: number | null;
|
|
37
|
+
sortOrder: number;
|
|
38
|
+
metadata?: Record<string, unknown> | null | undefined;
|
|
39
|
+
}[];
|
|
40
|
+
unitPrices: {
|
|
41
|
+
id: string;
|
|
42
|
+
optionPriceRuleId: string;
|
|
43
|
+
optionId: string | null;
|
|
44
|
+
unitId: string;
|
|
45
|
+
unitName: string | null;
|
|
46
|
+
unitType: string | null;
|
|
47
|
+
occupancyMax: number | null;
|
|
48
|
+
pricingCategoryId: string | null;
|
|
49
|
+
pricingMode: string;
|
|
50
|
+
sellAmountCents: number | null;
|
|
51
|
+
minQuantity: number | null;
|
|
52
|
+
maxQuantity: number | null;
|
|
53
|
+
tiers: {
|
|
54
|
+
minQuantity: number;
|
|
55
|
+
maxQuantity: number | null;
|
|
56
|
+
sellAmountCents: number | null;
|
|
57
|
+
}[];
|
|
58
|
+
}[];
|
|
59
|
+
};
|
|
60
|
+
}, Error>;
|
|
61
|
+
//# sourceMappingURL=use-pricing-preview.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-pricing-preview.d.ts","sourceRoot":"","sources":["../../src/hooks/use-pricing-preview.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,kBAAkB,CAAA;AAG7D,MAAM,WAAW,wBAAyB,SAAQ,qBAAqB;IACrE,OAAO,CAAC,EAAE,OAAO,CAAA;CAClB;AAED;;;;;;GAMG;AACH,wBAAgB,iBAAiB,CAAC,EAAE,OAAc,EAAE,GAAG,OAAO,EAAE,EAAE,wBAAwB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;UAMzF"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { useQuery } from "@tanstack/react-query";
|
|
3
|
+
import { useVoyantBookingsContext } from "../provider.js";
|
|
4
|
+
import { getPricingPreviewQueryOptions } from "../query-options.js";
|
|
5
|
+
/**
|
|
6
|
+
* Catalog-resolved pricing snapshot for a product + option (+ optional
|
|
7
|
+
* catalog). Consumers match the returned `unitPrices` / `tiers` against their
|
|
8
|
+
* traveler/unit selection to render a breakdown. The snapshot is the same
|
|
9
|
+
* data the storefront session uses, so operator-side numbers stay in sync
|
|
10
|
+
* with customer-facing ones.
|
|
11
|
+
*/
|
|
12
|
+
export function usePricingPreview({ enabled = true, ...filters }) {
|
|
13
|
+
const client = useVoyantBookingsContext();
|
|
14
|
+
return useQuery({
|
|
15
|
+
...getPricingPreviewQueryOptions(client, filters),
|
|
16
|
+
enabled: enabled && Boolean(filters.productId),
|
|
17
|
+
});
|
|
18
|
+
}
|