@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,148 @@
|
|
|
1
|
+
export declare function usePublicBookingSessionFlowMutation(sessionId: string): {
|
|
2
|
+
updateState: import("@tanstack/react-query").UseMutationResult<{
|
|
3
|
+
sessionId: string;
|
|
4
|
+
stateKey: "wizard";
|
|
5
|
+
currentStep: string | null;
|
|
6
|
+
completedSteps: string[];
|
|
7
|
+
payload: Record<string, unknown>;
|
|
8
|
+
version: number;
|
|
9
|
+
createdAt: string;
|
|
10
|
+
updatedAt: string;
|
|
11
|
+
}, Error, {
|
|
12
|
+
payload: Record<string, unknown>;
|
|
13
|
+
replacePayload: boolean;
|
|
14
|
+
currentStep?: string | null | undefined;
|
|
15
|
+
completedSteps?: string[] | undefined;
|
|
16
|
+
}, unknown>;
|
|
17
|
+
reprice: import("@tanstack/react-query").UseMutationResult<{
|
|
18
|
+
pricing: {
|
|
19
|
+
sessionId: string;
|
|
20
|
+
catalogId: string | null;
|
|
21
|
+
currencyCode: string;
|
|
22
|
+
totalSellAmountCents: number;
|
|
23
|
+
items: {
|
|
24
|
+
itemId: string;
|
|
25
|
+
title: string;
|
|
26
|
+
productId: string | null;
|
|
27
|
+
optionId: string | null;
|
|
28
|
+
optionUnitId: string | null;
|
|
29
|
+
optionUnitName: string | null;
|
|
30
|
+
optionUnitType: string | null;
|
|
31
|
+
pricingCategoryId: string | null;
|
|
32
|
+
quantity: number;
|
|
33
|
+
pricingMode: string;
|
|
34
|
+
unitSellAmountCents: number | null;
|
|
35
|
+
totalSellAmountCents: number | null;
|
|
36
|
+
warnings: string[];
|
|
37
|
+
}[];
|
|
38
|
+
warnings: string[];
|
|
39
|
+
appliedToSession: boolean;
|
|
40
|
+
};
|
|
41
|
+
session: {
|
|
42
|
+
sessionId: string;
|
|
43
|
+
bookingNumber: string;
|
|
44
|
+
status: "draft" | "expired" | "cancelled" | "completed" | "confirmed" | "on_hold" | "awaiting_payment" | "in_progress";
|
|
45
|
+
externalBookingRef: string | null;
|
|
46
|
+
communicationLanguage: string | null;
|
|
47
|
+
sellCurrency: string;
|
|
48
|
+
sellAmountCents: number | null;
|
|
49
|
+
startDate: string | null;
|
|
50
|
+
endDate: string | null;
|
|
51
|
+
pax: number | null;
|
|
52
|
+
holdExpiresAt: string | null;
|
|
53
|
+
confirmedAt: string | null;
|
|
54
|
+
expiredAt: string | null;
|
|
55
|
+
cancelledAt: string | null;
|
|
56
|
+
completedAt: string | null;
|
|
57
|
+
travelers: {
|
|
58
|
+
id: string;
|
|
59
|
+
participantType: "other" | "traveler" | "occupant";
|
|
60
|
+
travelerCategory: "other" | "adult" | "child" | "infant" | "senior" | null;
|
|
61
|
+
firstName: string;
|
|
62
|
+
lastName: string;
|
|
63
|
+
email: string | null;
|
|
64
|
+
phone: string | null;
|
|
65
|
+
preferredLanguage: string | null;
|
|
66
|
+
specialRequests: string | null;
|
|
67
|
+
isPrimary: boolean;
|
|
68
|
+
notes: string | null;
|
|
69
|
+
}[];
|
|
70
|
+
items: {
|
|
71
|
+
id: string;
|
|
72
|
+
title: string;
|
|
73
|
+
description: string | null;
|
|
74
|
+
itemType: "other" | "unit" | "service" | "accommodation" | "transport" | "tax" | "extra" | "fee" | "discount" | "adjustment";
|
|
75
|
+
status: "draft" | "expired" | "cancelled" | "fulfilled" | "confirmed" | "on_hold";
|
|
76
|
+
serviceDate: string | null;
|
|
77
|
+
startsAt: string | null;
|
|
78
|
+
endsAt: string | null;
|
|
79
|
+
quantity: number;
|
|
80
|
+
sellCurrency: string;
|
|
81
|
+
unitSellAmountCents: number | null;
|
|
82
|
+
totalSellAmountCents: number | null;
|
|
83
|
+
costCurrency: string | null;
|
|
84
|
+
unitCostAmountCents: number | null;
|
|
85
|
+
totalCostAmountCents: number | null;
|
|
86
|
+
notes: string | null;
|
|
87
|
+
productId: string | null;
|
|
88
|
+
optionId: string | null;
|
|
89
|
+
optionUnitId: string | null;
|
|
90
|
+
pricingCategoryId: string | null;
|
|
91
|
+
travelerLinks: {
|
|
92
|
+
id: string;
|
|
93
|
+
travelerId: string;
|
|
94
|
+
role: "other" | "traveler" | "occupant" | "beneficiary";
|
|
95
|
+
isPrimary: boolean;
|
|
96
|
+
}[];
|
|
97
|
+
}[];
|
|
98
|
+
allocations: {
|
|
99
|
+
id: string;
|
|
100
|
+
bookingItemId: string | null;
|
|
101
|
+
productId: string | null;
|
|
102
|
+
optionId: string | null;
|
|
103
|
+
optionUnitId: string | null;
|
|
104
|
+
pricingCategoryId: string | null;
|
|
105
|
+
availabilitySlotId: string | null;
|
|
106
|
+
quantity: number;
|
|
107
|
+
allocationType: "resource" | "unit" | "pickup";
|
|
108
|
+
status: "expired" | "cancelled" | "released" | "fulfilled" | "confirmed" | "held";
|
|
109
|
+
holdExpiresAt: string | null;
|
|
110
|
+
confirmedAt: string | null;
|
|
111
|
+
releasedAt: string | null;
|
|
112
|
+
}[];
|
|
113
|
+
checklist: {
|
|
114
|
+
hasTravelers: boolean;
|
|
115
|
+
hasPrimaryTraveler: boolean;
|
|
116
|
+
hasItems: boolean;
|
|
117
|
+
hasAllocations: boolean;
|
|
118
|
+
readyForConfirmation: boolean;
|
|
119
|
+
};
|
|
120
|
+
state: {
|
|
121
|
+
sessionId: string;
|
|
122
|
+
stateKey: "wizard";
|
|
123
|
+
currentStep: string | null;
|
|
124
|
+
completedSteps: string[];
|
|
125
|
+
payload: Record<string, unknown>;
|
|
126
|
+
version: number;
|
|
127
|
+
createdAt: string;
|
|
128
|
+
updatedAt: string;
|
|
129
|
+
} | null;
|
|
130
|
+
checkoutCapability?: {
|
|
131
|
+
token: string;
|
|
132
|
+
expiresAt: string;
|
|
133
|
+
actions: ("session:read" | "session:update" | "session:reprice" | "session:finalize" | "payment:read" | "payment:start")[];
|
|
134
|
+
} | undefined;
|
|
135
|
+
} | null;
|
|
136
|
+
}, Error, {
|
|
137
|
+
applyToSession: boolean;
|
|
138
|
+
selections: {
|
|
139
|
+
itemId: string;
|
|
140
|
+
optionId?: string | null | undefined;
|
|
141
|
+
optionUnitId?: string | null | undefined;
|
|
142
|
+
pricingCategoryId?: string | null | undefined;
|
|
143
|
+
quantity?: number | undefined;
|
|
144
|
+
}[];
|
|
145
|
+
catalogId?: string | undefined;
|
|
146
|
+
}, unknown>;
|
|
147
|
+
};
|
|
148
|
+
//# sourceMappingURL=use-public-booking-session-flow-mutation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-public-booking-session-flow-mutation.d.ts","sourceRoot":"","sources":["../../src/hooks/use-public-booking-session-flow-mutation.ts"],"names":[],"mappings":"AAgBA,wBAAgB,mCAAmC,CAAC,SAAS,EAAE,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAyCpE"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { useMutation, useQueryClient } from "@tanstack/react-query";
|
|
3
|
+
import { fetchWithValidation } from "../client.js";
|
|
4
|
+
import { useVoyantBookingsContext } from "../provider.js";
|
|
5
|
+
import { bookingsQueryKeys } from "../query-keys.js";
|
|
6
|
+
import { publicBookingSessionRepriceResponse, publicBookingSessionStateResponse, } from "../schemas.js";
|
|
7
|
+
export function usePublicBookingSessionFlowMutation(sessionId) {
|
|
8
|
+
const { baseUrl, fetcher } = useVoyantBookingsContext();
|
|
9
|
+
const queryClient = useQueryClient();
|
|
10
|
+
const updateState = useMutation({
|
|
11
|
+
mutationFn: async (input) => {
|
|
12
|
+
const { data } = await fetchWithValidation(`/v1/public/bookings/sessions/${sessionId}/state`, publicBookingSessionStateResponse, { baseUrl, fetcher }, { method: "PUT", body: JSON.stringify(input) });
|
|
13
|
+
return data;
|
|
14
|
+
},
|
|
15
|
+
onSuccess: (data) => {
|
|
16
|
+
queryClient.setQueryData(bookingsQueryKeys.publicSessionState(sessionId), { data });
|
|
17
|
+
void queryClient.invalidateQueries({ queryKey: bookingsQueryKeys.publicSession(sessionId) });
|
|
18
|
+
},
|
|
19
|
+
});
|
|
20
|
+
const reprice = useMutation({
|
|
21
|
+
mutationFn: async (input) => {
|
|
22
|
+
const { data } = await fetchWithValidation(`/v1/public/bookings/sessions/${sessionId}/reprice`, publicBookingSessionRepriceResponse, { baseUrl, fetcher }, { method: "POST", body: JSON.stringify(input) });
|
|
23
|
+
return data;
|
|
24
|
+
},
|
|
25
|
+
onSuccess: (data) => {
|
|
26
|
+
if (data.session) {
|
|
27
|
+
queryClient.setQueryData(bookingsQueryKeys.publicSession(sessionId), { data: data.session });
|
|
28
|
+
void queryClient.invalidateQueries({
|
|
29
|
+
queryKey: bookingsQueryKeys.publicSessionState(sessionId),
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
},
|
|
33
|
+
});
|
|
34
|
+
return { updateState, reprice };
|
|
35
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export interface UsePublicBookingSessionStateOptions {
|
|
2
|
+
enabled?: boolean;
|
|
3
|
+
}
|
|
4
|
+
export declare function usePublicBookingSessionState(sessionId: string | null | undefined, options?: UsePublicBookingSessionStateOptions): import("@tanstack/react-query").UseQueryResult<{
|
|
5
|
+
data: {
|
|
6
|
+
sessionId: string;
|
|
7
|
+
stateKey: "wizard";
|
|
8
|
+
currentStep: string | null;
|
|
9
|
+
completedSteps: string[];
|
|
10
|
+
payload: Record<string, unknown>;
|
|
11
|
+
version: number;
|
|
12
|
+
createdAt: string;
|
|
13
|
+
updatedAt: string;
|
|
14
|
+
};
|
|
15
|
+
}, Error>;
|
|
16
|
+
//# sourceMappingURL=use-public-booking-session-state.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-public-booking-session-state.d.ts","sourceRoot":"","sources":["../../src/hooks/use-public-booking-session-state.ts"],"names":[],"mappings":"AAOA,MAAM,WAAW,mCAAmC;IAClD,OAAO,CAAC,EAAE,OAAO,CAAA;CAClB;AAED,wBAAgB,4BAA4B,CAC1C,SAAS,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,EACpC,OAAO,GAAE,mCAAwC;;;;;;;;;;;UASlD"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { useQuery } from "@tanstack/react-query";
|
|
3
|
+
import { useVoyantBookingsContext } from "../provider.js";
|
|
4
|
+
import { getPublicBookingSessionStateQueryOptions } from "../query-options.js";
|
|
5
|
+
export function usePublicBookingSessionState(sessionId, options = {}) {
|
|
6
|
+
const { baseUrl, fetcher } = useVoyantBookingsContext();
|
|
7
|
+
const { enabled = true } = options;
|
|
8
|
+
return useQuery({
|
|
9
|
+
...getPublicBookingSessionStateQueryOptions({ baseUrl, fetcher }, sessionId),
|
|
10
|
+
enabled: enabled && Boolean(sessionId),
|
|
11
|
+
});
|
|
12
|
+
}
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
export interface UsePublicBookingSessionOptions {
|
|
2
|
+
enabled?: boolean;
|
|
3
|
+
}
|
|
4
|
+
export declare function usePublicBookingSession(sessionId: string | null | undefined, options?: UsePublicBookingSessionOptions): import("@tanstack/react-query").UseQueryResult<{
|
|
5
|
+
data: {
|
|
6
|
+
sessionId: string;
|
|
7
|
+
bookingNumber: string;
|
|
8
|
+
status: "draft" | "expired" | "cancelled" | "completed" | "confirmed" | "on_hold" | "awaiting_payment" | "in_progress";
|
|
9
|
+
externalBookingRef: string | null;
|
|
10
|
+
communicationLanguage: string | null;
|
|
11
|
+
sellCurrency: string;
|
|
12
|
+
sellAmountCents: number | null;
|
|
13
|
+
startDate: string | null;
|
|
14
|
+
endDate: string | null;
|
|
15
|
+
pax: number | null;
|
|
16
|
+
holdExpiresAt: string | null;
|
|
17
|
+
confirmedAt: string | null;
|
|
18
|
+
expiredAt: string | null;
|
|
19
|
+
cancelledAt: string | null;
|
|
20
|
+
completedAt: string | null;
|
|
21
|
+
travelers: {
|
|
22
|
+
id: string;
|
|
23
|
+
participantType: "other" | "traveler" | "occupant";
|
|
24
|
+
travelerCategory: "other" | "adult" | "child" | "infant" | "senior" | null;
|
|
25
|
+
firstName: string;
|
|
26
|
+
lastName: string;
|
|
27
|
+
email: string | null;
|
|
28
|
+
phone: string | null;
|
|
29
|
+
preferredLanguage: string | null;
|
|
30
|
+
specialRequests: string | null;
|
|
31
|
+
isPrimary: boolean;
|
|
32
|
+
notes: string | null;
|
|
33
|
+
}[];
|
|
34
|
+
items: {
|
|
35
|
+
id: string;
|
|
36
|
+
title: string;
|
|
37
|
+
description: string | null;
|
|
38
|
+
itemType: "other" | "unit" | "service" | "accommodation" | "transport" | "tax" | "extra" | "fee" | "discount" | "adjustment";
|
|
39
|
+
status: "draft" | "expired" | "cancelled" | "fulfilled" | "confirmed" | "on_hold";
|
|
40
|
+
serviceDate: string | null;
|
|
41
|
+
startsAt: string | null;
|
|
42
|
+
endsAt: string | null;
|
|
43
|
+
quantity: number;
|
|
44
|
+
sellCurrency: string;
|
|
45
|
+
unitSellAmountCents: number | null;
|
|
46
|
+
totalSellAmountCents: number | null;
|
|
47
|
+
costCurrency: string | null;
|
|
48
|
+
unitCostAmountCents: number | null;
|
|
49
|
+
totalCostAmountCents: number | null;
|
|
50
|
+
notes: string | null;
|
|
51
|
+
productId: string | null;
|
|
52
|
+
optionId: string | null;
|
|
53
|
+
optionUnitId: string | null;
|
|
54
|
+
pricingCategoryId: string | null;
|
|
55
|
+
travelerLinks: {
|
|
56
|
+
id: string;
|
|
57
|
+
travelerId: string;
|
|
58
|
+
role: "other" | "traveler" | "occupant" | "beneficiary";
|
|
59
|
+
isPrimary: boolean;
|
|
60
|
+
}[];
|
|
61
|
+
}[];
|
|
62
|
+
allocations: {
|
|
63
|
+
id: string;
|
|
64
|
+
bookingItemId: string | null;
|
|
65
|
+
productId: string | null;
|
|
66
|
+
optionId: string | null;
|
|
67
|
+
optionUnitId: string | null;
|
|
68
|
+
pricingCategoryId: string | null;
|
|
69
|
+
availabilitySlotId: string | null;
|
|
70
|
+
quantity: number;
|
|
71
|
+
allocationType: "resource" | "unit" | "pickup";
|
|
72
|
+
status: "expired" | "cancelled" | "released" | "fulfilled" | "confirmed" | "held";
|
|
73
|
+
holdExpiresAt: string | null;
|
|
74
|
+
confirmedAt: string | null;
|
|
75
|
+
releasedAt: string | null;
|
|
76
|
+
}[];
|
|
77
|
+
checklist: {
|
|
78
|
+
hasTravelers: boolean;
|
|
79
|
+
hasPrimaryTraveler: boolean;
|
|
80
|
+
hasItems: boolean;
|
|
81
|
+
hasAllocations: boolean;
|
|
82
|
+
readyForConfirmation: boolean;
|
|
83
|
+
};
|
|
84
|
+
state: {
|
|
85
|
+
sessionId: string;
|
|
86
|
+
stateKey: "wizard";
|
|
87
|
+
currentStep: string | null;
|
|
88
|
+
completedSteps: string[];
|
|
89
|
+
payload: Record<string, unknown>;
|
|
90
|
+
version: number;
|
|
91
|
+
createdAt: string;
|
|
92
|
+
updatedAt: string;
|
|
93
|
+
} | null;
|
|
94
|
+
checkoutCapability?: {
|
|
95
|
+
token: string;
|
|
96
|
+
expiresAt: string;
|
|
97
|
+
actions: ("session:read" | "session:update" | "session:reprice" | "session:finalize" | "payment:read" | "payment:start")[];
|
|
98
|
+
} | undefined;
|
|
99
|
+
};
|
|
100
|
+
}, Error>;
|
|
101
|
+
//# sourceMappingURL=use-public-booking-session.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-public-booking-session.d.ts","sourceRoot":"","sources":["../../src/hooks/use-public-booking-session.ts"],"names":[],"mappings":"AAOA,MAAM,WAAW,8BAA8B;IAC7C,OAAO,CAAC,EAAE,OAAO,CAAA;CAClB;AAED,wBAAgB,uBAAuB,CACrC,SAAS,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,EACpC,OAAO,GAAE,8BAAmC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;UAS7C"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { useQuery } from "@tanstack/react-query";
|
|
3
|
+
import { useVoyantBookingsContext } from "../provider.js";
|
|
4
|
+
import { getPublicBookingSessionQueryOptions } from "../query-options.js";
|
|
5
|
+
export function usePublicBookingSession(sessionId, options = {}) {
|
|
6
|
+
const { baseUrl, fetcher } = useVoyantBookingsContext();
|
|
7
|
+
const { enabled = true } = options;
|
|
8
|
+
return useQuery({
|
|
9
|
+
...getPublicBookingSessionQueryOptions({ baseUrl, fetcher }, sessionId),
|
|
10
|
+
enabled: enabled && Boolean(sessionId),
|
|
11
|
+
});
|
|
12
|
+
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
export interface UseRevealTravelerOptions {
|
|
2
|
+
/**
|
|
3
|
+
* When false, the reveal request is skipped — keeps the eye-button
|
|
4
|
+
* default-off behaviour. Toggle to true when the user clicks reveal.
|
|
5
|
+
*/
|
|
6
|
+
enabled: boolean;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Lazily fetch an unmasked traveler row. Authorization is server-side;
|
|
10
|
+
* the response is the full traveler with email/phone/firstName/lastName
|
|
11
|
+
* in the clear. Every reveal hits the audit log on the backend, so the
|
|
12
|
+
* `staleTime: 0` in the query options is intentional — re-mounting the
|
|
13
|
+
* row should re-log.
|
|
14
|
+
*/
|
|
15
|
+
export declare function useRevealTraveler(bookingId: string | null | undefined, travelerId: string | null | undefined, options: UseRevealTravelerOptions): import("@tanstack/react-query").UseQueryResult<{
|
|
16
|
+
data: {
|
|
17
|
+
id: string;
|
|
18
|
+
bookingId: string;
|
|
19
|
+
participantType: string;
|
|
20
|
+
firstName: string;
|
|
21
|
+
lastName: string;
|
|
22
|
+
email: string | null;
|
|
23
|
+
phone: string | null;
|
|
24
|
+
specialRequests: string | null;
|
|
25
|
+
isPrimary: boolean;
|
|
26
|
+
createdAt: string;
|
|
27
|
+
travelDetails: {
|
|
28
|
+
travelerId: string;
|
|
29
|
+
nationality: string | null;
|
|
30
|
+
documentType: "other" | "passport" | "visa" | "id_card" | "driver_license" | null;
|
|
31
|
+
documentNumber: string | null;
|
|
32
|
+
documentExpiry: string | null;
|
|
33
|
+
documentIssuingCountry: string | null;
|
|
34
|
+
documentIssuingAuthority: string | null;
|
|
35
|
+
documentPersonDocumentId: string | null;
|
|
36
|
+
dateOfBirth: string | null;
|
|
37
|
+
dietaryRequirements: string | null;
|
|
38
|
+
accessibilityNeeds: string | null;
|
|
39
|
+
isLeadTraveler: boolean;
|
|
40
|
+
sharingGroupId: string | null;
|
|
41
|
+
roomTypeId: string | null;
|
|
42
|
+
bedPreference: "double" | "single" | "twin" | "no-preference" | null;
|
|
43
|
+
allocations: Record<string, string>;
|
|
44
|
+
createdAt: string;
|
|
45
|
+
updatedAt: string;
|
|
46
|
+
} | null;
|
|
47
|
+
travelerCategory?: string | null | undefined;
|
|
48
|
+
personId?: string | null | undefined;
|
|
49
|
+
preferredLanguage?: string | null | undefined;
|
|
50
|
+
notes?: string | null | undefined;
|
|
51
|
+
updatedAt?: string | undefined;
|
|
52
|
+
};
|
|
53
|
+
}, Error>;
|
|
54
|
+
//# sourceMappingURL=use-reveal-traveler.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-reveal-traveler.d.ts","sourceRoot":"","sources":["../../src/hooks/use-reveal-traveler.ts"],"names":[],"mappings":"AAOA,MAAM,WAAW,wBAAwB;IACvC;;;OAGG;IACH,OAAO,EAAE,OAAO,CAAA;CACjB;AAED;;;;;;GAMG;AACH,wBAAgB,iBAAiB,CAC/B,SAAS,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,EACpC,UAAU,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,EACrC,OAAO,EAAE,wBAAwB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;UAOlC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { useQuery } from "@tanstack/react-query";
|
|
3
|
+
import { useVoyantBookingsContext } from "../provider.js";
|
|
4
|
+
import { getTravelerRevealQueryOptions } from "../query-options.js";
|
|
5
|
+
/**
|
|
6
|
+
* Lazily fetch an unmasked traveler row. Authorization is server-side;
|
|
7
|
+
* the response is the full traveler with email/phone/firstName/lastName
|
|
8
|
+
* in the clear. Every reveal hits the audit log on the backend, so the
|
|
9
|
+
* `staleTime: 0` in the query options is intentional — re-mounting the
|
|
10
|
+
* row should re-log.
|
|
11
|
+
*/
|
|
12
|
+
export function useRevealTraveler(bookingId, travelerId, options) {
|
|
13
|
+
const { baseUrl, fetcher } = useVoyantBookingsContext();
|
|
14
|
+
return useQuery({
|
|
15
|
+
...getTravelerRevealQueryOptions({ baseUrl, fetcher }, bookingId, travelerId),
|
|
16
|
+
enabled: options.enabled && Boolean(bookingId) && Boolean(travelerId),
|
|
17
|
+
});
|
|
18
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
export interface UseSharingGroupsForSlotOptions {
|
|
2
|
+
enabled?: boolean;
|
|
3
|
+
}
|
|
4
|
+
export declare function useSharingGroupsForSlot(slotId: string | null | undefined, options?: UseSharingGroupsForSlotOptions): import("@tanstack/react-query").UseQueryResult<{
|
|
5
|
+
data: {
|
|
6
|
+
id: string;
|
|
7
|
+
label: string;
|
|
8
|
+
occupancy: number;
|
|
9
|
+
roomTypeId: string | null;
|
|
10
|
+
bookingIds: string[];
|
|
11
|
+
}[];
|
|
12
|
+
}, Error>;
|
|
13
|
+
export interface UseBookingsBySharingGroupOptions {
|
|
14
|
+
enabled?: boolean;
|
|
15
|
+
}
|
|
16
|
+
export declare function useBookingsBySharingGroup(slotId: string | null | undefined, groupId: string | null | undefined, options?: UseBookingsBySharingGroupOptions): import("@tanstack/react-query").UseQueryResult<{
|
|
17
|
+
data: {
|
|
18
|
+
id: string;
|
|
19
|
+
bookingId: string;
|
|
20
|
+
participantType: string;
|
|
21
|
+
firstName: string;
|
|
22
|
+
lastName: string;
|
|
23
|
+
email: string | null;
|
|
24
|
+
phone: string | null;
|
|
25
|
+
specialRequests: string | null;
|
|
26
|
+
isPrimary: boolean;
|
|
27
|
+
createdAt: string;
|
|
28
|
+
bookingNumber: string;
|
|
29
|
+
personId: string | null;
|
|
30
|
+
isLeadTraveler: boolean;
|
|
31
|
+
sharingGroupId: string;
|
|
32
|
+
roomTypeId: string | null;
|
|
33
|
+
bedPreference: string | null;
|
|
34
|
+
allocations: Record<string, string>;
|
|
35
|
+
travelerCategory?: string | null | undefined;
|
|
36
|
+
preferredLanguage?: string | null | undefined;
|
|
37
|
+
notes?: string | null | undefined;
|
|
38
|
+
updatedAt?: string | undefined;
|
|
39
|
+
}[];
|
|
40
|
+
}, Error>;
|
|
41
|
+
//# sourceMappingURL=use-sharing-groups.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-sharing-groups.d.ts","sourceRoot":"","sources":["../../src/hooks/use-sharing-groups.ts"],"names":[],"mappings":"AAUA,MAAM,WAAW,8BAA8B;IAC7C,OAAO,CAAC,EAAE,OAAO,CAAA;CAClB;AAED,wBAAgB,uBAAuB,CACrC,MAAM,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,EACjC,OAAO,GAAE,8BAAmC;;;;;;;;UAS7C;AAED,MAAM,WAAW,gCAAgC;IAC/C,OAAO,CAAC,EAAE,OAAO,CAAA;CAClB;AAED,wBAAgB,yBAAyB,CACvC,MAAM,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,EACjC,OAAO,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,EAClC,OAAO,GAAE,gCAAqC;;;;;;;;;;;;;;;;;;;;;;;;UAS/C"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { useQuery } from "@tanstack/react-query";
|
|
3
|
+
import { useVoyantBookingsContext } from "../provider.js";
|
|
4
|
+
import { getBookingsBySharingGroupQueryOptions, getSharingGroupsForSlotQueryOptions, } from "../query-options.js";
|
|
5
|
+
export function useSharingGroupsForSlot(slotId, options = {}) {
|
|
6
|
+
const { baseUrl, fetcher } = useVoyantBookingsContext();
|
|
7
|
+
const { enabled = true } = options;
|
|
8
|
+
return useQuery({
|
|
9
|
+
...getSharingGroupsForSlotQueryOptions({ baseUrl, fetcher }, slotId),
|
|
10
|
+
enabled: enabled && Boolean(slotId),
|
|
11
|
+
});
|
|
12
|
+
}
|
|
13
|
+
export function useBookingsBySharingGroup(slotId, groupId, options = {}) {
|
|
14
|
+
const { baseUrl, fetcher } = useVoyantBookingsContext();
|
|
15
|
+
const { enabled = true } = options;
|
|
16
|
+
return useQuery({
|
|
17
|
+
...getBookingsBySharingGroupQueryOptions({ baseUrl, fetcher }, slotId, groupId),
|
|
18
|
+
enabled: enabled && Boolean(slotId) && Boolean(groupId),
|
|
19
|
+
});
|
|
20
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
export interface CreateSupplierStatusInput {
|
|
2
|
+
supplierServiceId?: string | null;
|
|
3
|
+
serviceName: string;
|
|
4
|
+
status?: "pending" | "confirmed" | "rejected" | "cancelled";
|
|
5
|
+
supplierReference?: string | null;
|
|
6
|
+
costCurrency: string;
|
|
7
|
+
costAmountCents: number;
|
|
8
|
+
notes?: string | null;
|
|
9
|
+
}
|
|
10
|
+
export type UpdateSupplierStatusInput = Partial<CreateSupplierStatusInput> & {
|
|
11
|
+
confirmedAt?: string | null;
|
|
12
|
+
};
|
|
13
|
+
export declare function useSupplierStatusMutation(bookingId: string): {
|
|
14
|
+
create: import("@tanstack/react-query").UseMutationResult<{
|
|
15
|
+
id: string;
|
|
16
|
+
bookingId: string;
|
|
17
|
+
supplierServiceId: string | null;
|
|
18
|
+
serviceName: string;
|
|
19
|
+
status: "pending" | "cancelled" | "confirmed" | "rejected";
|
|
20
|
+
supplierReference: string | null;
|
|
21
|
+
costCurrency: string;
|
|
22
|
+
costAmountCents: number;
|
|
23
|
+
notes: string | null;
|
|
24
|
+
confirmedAt: string | null;
|
|
25
|
+
createdAt: string;
|
|
26
|
+
updatedAt: string;
|
|
27
|
+
}, Error, CreateSupplierStatusInput, unknown>;
|
|
28
|
+
update: import("@tanstack/react-query").UseMutationResult<{
|
|
29
|
+
id: string;
|
|
30
|
+
bookingId: string;
|
|
31
|
+
supplierServiceId: string | null;
|
|
32
|
+
serviceName: string;
|
|
33
|
+
status: "pending" | "cancelled" | "confirmed" | "rejected";
|
|
34
|
+
supplierReference: string | null;
|
|
35
|
+
costCurrency: string;
|
|
36
|
+
costAmountCents: number;
|
|
37
|
+
notes: string | null;
|
|
38
|
+
confirmedAt: string | null;
|
|
39
|
+
createdAt: string;
|
|
40
|
+
updatedAt: string;
|
|
41
|
+
}, Error, {
|
|
42
|
+
id: string;
|
|
43
|
+
input: UpdateSupplierStatusInput;
|
|
44
|
+
}, unknown>;
|
|
45
|
+
};
|
|
46
|
+
//# sourceMappingURL=use-supplier-status-mutation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-supplier-status-mutation.d.ts","sourceRoot":"","sources":["../../src/hooks/use-supplier-status-mutation.ts"],"names":[],"mappings":"AAUA,MAAM,WAAW,yBAAyB;IACxC,iBAAiB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IACjC,WAAW,EAAE,MAAM,CAAA;IACnB,MAAM,CAAC,EAAE,SAAS,GAAG,WAAW,GAAG,UAAU,GAAG,WAAW,CAAA;IAC3D,iBAAiB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IACjC,YAAY,EAAE,MAAM,CAAA;IACpB,eAAe,EAAE,MAAM,CAAA;IACvB,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;CACtB;AAED,MAAM,MAAM,yBAAyB,GAAG,OAAO,CAAC,yBAAyB,CAAC,GAAG;IAC3E,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;CAC5B,CAAA;AAMD,wBAAgB,yBAAyB,CAAC,SAAS,EAAE,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;YAuBf,MAAM;eAAS,yBAAyB;;EAkBnF"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { useMutation, useQueryClient } from "@tanstack/react-query";
|
|
3
|
+
import { z } from "zod";
|
|
4
|
+
import { fetchWithValidation } from "../client.js";
|
|
5
|
+
import { useVoyantBookingsContext } from "../provider.js";
|
|
6
|
+
import { bookingsQueryKeys } from "../query-keys.js";
|
|
7
|
+
import { bookingSupplierStatusRecordSchema } from "../schemas.js";
|
|
8
|
+
const bookingSupplierStatusSingleResponse = z.object({
|
|
9
|
+
data: bookingSupplierStatusRecordSchema,
|
|
10
|
+
});
|
|
11
|
+
export function useSupplierStatusMutation(bookingId) {
|
|
12
|
+
const { baseUrl, fetcher } = useVoyantBookingsContext();
|
|
13
|
+
const queryClient = useQueryClient();
|
|
14
|
+
const create = useMutation({
|
|
15
|
+
mutationFn: async (input) => {
|
|
16
|
+
const { data } = await fetchWithValidation(`/v1/bookings/${bookingId}/supplier-statuses`, bookingSupplierStatusSingleResponse, { baseUrl, fetcher }, { method: "POST", body: JSON.stringify(input) });
|
|
17
|
+
return data;
|
|
18
|
+
},
|
|
19
|
+
onSuccess: () => {
|
|
20
|
+
void queryClient.invalidateQueries({
|
|
21
|
+
queryKey: bookingsQueryKeys.supplierStatuses(bookingId),
|
|
22
|
+
});
|
|
23
|
+
void queryClient.invalidateQueries({ queryKey: bookingsQueryKeys.activity(bookingId) });
|
|
24
|
+
},
|
|
25
|
+
});
|
|
26
|
+
const update = useMutation({
|
|
27
|
+
mutationFn: async ({ id, input }) => {
|
|
28
|
+
const { data } = await fetchWithValidation(`/v1/bookings/${bookingId}/supplier-statuses/${id}`, bookingSupplierStatusSingleResponse, { baseUrl, fetcher }, { method: "PATCH", body: JSON.stringify(input) });
|
|
29
|
+
return data;
|
|
30
|
+
},
|
|
31
|
+
onSuccess: () => {
|
|
32
|
+
void queryClient.invalidateQueries({
|
|
33
|
+
queryKey: bookingsQueryKeys.supplierStatuses(bookingId),
|
|
34
|
+
});
|
|
35
|
+
void queryClient.invalidateQueries({ queryKey: bookingsQueryKeys.activity(bookingId) });
|
|
36
|
+
},
|
|
37
|
+
});
|
|
38
|
+
return { create, update };
|
|
39
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export interface UseSupplierStatusesOptions {
|
|
2
|
+
enabled?: boolean;
|
|
3
|
+
}
|
|
4
|
+
export declare function useSupplierStatuses(bookingId: string | null | undefined, options?: UseSupplierStatusesOptions): import("@tanstack/react-query").UseQueryResult<{
|
|
5
|
+
data: {
|
|
6
|
+
id: string;
|
|
7
|
+
bookingId: string;
|
|
8
|
+
supplierServiceId: string | null;
|
|
9
|
+
serviceName: string;
|
|
10
|
+
status: "pending" | "cancelled" | "confirmed" | "rejected";
|
|
11
|
+
supplierReference: string | null;
|
|
12
|
+
costCurrency: string;
|
|
13
|
+
costAmountCents: number;
|
|
14
|
+
notes: string | null;
|
|
15
|
+
confirmedAt: string | null;
|
|
16
|
+
createdAt: string;
|
|
17
|
+
updatedAt: string;
|
|
18
|
+
}[];
|
|
19
|
+
}, Error>;
|
|
20
|
+
//# sourceMappingURL=use-supplier-statuses.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-supplier-statuses.d.ts","sourceRoot":"","sources":["../../src/hooks/use-supplier-statuses.ts"],"names":[],"mappings":"AAOA,MAAM,WAAW,0BAA0B;IACzC,OAAO,CAAC,EAAE,OAAO,CAAA;CAClB;AAED,wBAAgB,mBAAmB,CACjC,SAAS,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,EACpC,OAAO,GAAE,0BAA+B;;;;;;;;;;;;;;;UASzC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { useQuery } from "@tanstack/react-query";
|
|
3
|
+
import { useVoyantBookingsContext } from "../provider.js";
|
|
4
|
+
import { getSupplierStatusesQueryOptions } from "../query-options.js";
|
|
5
|
+
export function useSupplierStatuses(bookingId, options = {}) {
|
|
6
|
+
const { baseUrl, fetcher } = useVoyantBookingsContext();
|
|
7
|
+
const { enabled = true } = options;
|
|
8
|
+
return useQuery({
|
|
9
|
+
...getSupplierStatusesQueryOptions({ baseUrl, fetcher }, bookingId),
|
|
10
|
+
enabled: enabled && Boolean(bookingId),
|
|
11
|
+
});
|
|
12
|
+
}
|