@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,331 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
// agent-quality: file-size exception -- owner: bookings-react; existing UI surface stays co-located until a dedicated split preserves behavior and tests.
|
|
3
|
+
import { defineAdminExtension, } from "@voyant-travel/admin";
|
|
4
|
+
// Importing the slot id also binds the crm-ui `AdminDestinations`
|
|
5
|
+
// augmentation (`person.list`, `organization.list`, ...) into this program;
|
|
6
|
+
// this package already peer-depends on `@voyant-travel/relationships-react/ui`.
|
|
7
|
+
import { personDetailBookingsTabSlot } from "@voyant-travel/relationships-react/admin";
|
|
8
|
+
import * as React from "react";
|
|
9
|
+
import { z } from "zod";
|
|
10
|
+
// Lean statics only: the client module (fetcher), query-key types, and the
|
|
11
|
+
// skeletons. Query options and page data helpers resolve via dynamic import
|
|
12
|
+
// inside the loaders so the data layer (clients + response schemas) stays
|
|
13
|
+
// out of the workspace-chrome chunk that evaluates this factory.
|
|
14
|
+
import { defaultFetcher } from "../client.js";
|
|
15
|
+
import { BookingDetailSkeleton } from "./booking-detail-skeleton.js";
|
|
16
|
+
import { BookingsListSkeleton } from "./bookings-list-skeleton.js";
|
|
17
|
+
export { BookingDetailSkeleton } from "./booking-detail-skeleton.js";
|
|
18
|
+
export { BookingsListSkeleton } from "./bookings-list-skeleton.js";
|
|
19
|
+
export { bookingDetailFinanceEndSlot, bookingDetailFinanceStartSlot, bookingDetailInvoicesTabSlot, } from "./slots.js";
|
|
20
|
+
const bookingsListSortBySchema = z.enum([
|
|
21
|
+
"bookingNumber",
|
|
22
|
+
"status",
|
|
23
|
+
"sellAmount",
|
|
24
|
+
"pax",
|
|
25
|
+
"startDate",
|
|
26
|
+
"endDate",
|
|
27
|
+
"createdAt",
|
|
28
|
+
]);
|
|
29
|
+
const bookingsListSortDirSchema = z.enum(["asc", "desc"]);
|
|
30
|
+
/**
|
|
31
|
+
* Search contract for the bookings list page: the URL projection of
|
|
32
|
+
* `BookingListFiltersState` (filters, sort, paging). Package-owned so the
|
|
33
|
+
* route file, the host, and the extension contribution validate the same
|
|
34
|
+
* shape. Defaults are absent from the URL — see
|
|
35
|
+
* {@link bookingsFiltersToSearch}.
|
|
36
|
+
*/
|
|
37
|
+
export const bookingsIndexSearchSchema = z.object({
|
|
38
|
+
search: z.string().optional(),
|
|
39
|
+
status: z.string().optional(),
|
|
40
|
+
productId: z.string().optional(),
|
|
41
|
+
optionId: z.string().optional(),
|
|
42
|
+
supplierId: z.string().optional(),
|
|
43
|
+
productCategoryId: z.string().optional(),
|
|
44
|
+
personId: z.string().optional(),
|
|
45
|
+
organizationId: z.string().optional(),
|
|
46
|
+
availabilitySlotId: z.string().optional(),
|
|
47
|
+
dateFrom: z.string().optional(),
|
|
48
|
+
dateTo: z.string().optional(),
|
|
49
|
+
paxMin: z.string().optional(),
|
|
50
|
+
paxMax: z.string().optional(),
|
|
51
|
+
sortBy: bookingsListSortBySchema.optional(),
|
|
52
|
+
sortDir: bookingsListSortDirSchema.optional(),
|
|
53
|
+
offset: z.coerce.number().int().min(0).optional(),
|
|
54
|
+
});
|
|
55
|
+
/** URL search params → `BookingList` initial state. Empty / `"all"` /
|
|
56
|
+
* default values are absent in the URL; we let `BookingList`'s defaults
|
|
57
|
+
* fill them in. */
|
|
58
|
+
export function bookingsSearchToFilters(search) {
|
|
59
|
+
return {
|
|
60
|
+
search: search.search,
|
|
61
|
+
status: search.status,
|
|
62
|
+
productId: search.productId ?? null,
|
|
63
|
+
optionId: search.optionId ?? null,
|
|
64
|
+
supplierId: search.supplierId ?? null,
|
|
65
|
+
productCategoryId: search.productCategoryId ?? null,
|
|
66
|
+
personId: search.personId ?? null,
|
|
67
|
+
organizationId: search.organizationId ?? null,
|
|
68
|
+
availabilitySlotId: search.availabilitySlotId ?? null,
|
|
69
|
+
dateFrom: search.dateFrom ?? null,
|
|
70
|
+
dateTo: search.dateTo ?? null,
|
|
71
|
+
paxMin: search.paxMin,
|
|
72
|
+
paxMax: search.paxMax,
|
|
73
|
+
sortBy: search.sortBy,
|
|
74
|
+
sortDir: search.sortDir,
|
|
75
|
+
offset: search.offset,
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
/** Project the filter snapshot back into URL search params, dropping
|
|
79
|
+
* any value that matches the component's default so the URL stays
|
|
80
|
+
* clean when the operator is viewing the unfiltered list. */
|
|
81
|
+
export function bookingsFiltersToSearch(filters) {
|
|
82
|
+
return {
|
|
83
|
+
search: filters.search || undefined,
|
|
84
|
+
status: filters.status === "all" ? undefined : filters.status,
|
|
85
|
+
productId: filters.productId ?? undefined,
|
|
86
|
+
optionId: filters.optionId ?? undefined,
|
|
87
|
+
supplierId: filters.supplierId ?? undefined,
|
|
88
|
+
productCategoryId: filters.productCategoryId ?? undefined,
|
|
89
|
+
personId: filters.personId ?? undefined,
|
|
90
|
+
organizationId: filters.organizationId ?? undefined,
|
|
91
|
+
availabilitySlotId: filters.availabilitySlotId ?? undefined,
|
|
92
|
+
dateFrom: filters.dateFrom ?? undefined,
|
|
93
|
+
dateTo: filters.dateTo ?? undefined,
|
|
94
|
+
paxMin: filters.paxMin || undefined,
|
|
95
|
+
paxMax: filters.paxMax || undefined,
|
|
96
|
+
sortBy: filters.sortBy === "createdAt" ? undefined : filters.sortBy,
|
|
97
|
+
sortDir: filters.sortDir === "desc" ? undefined : filters.sortDir,
|
|
98
|
+
offset: filters.offset === 0 ? undefined : filters.offset,
|
|
99
|
+
};
|
|
100
|
+
}
|
|
101
|
+
/** Tab values of the canonical `BookingDetailPage`, as a search-param schema. */
|
|
102
|
+
export const bookingDetailTabSchema = z.enum([
|
|
103
|
+
"items",
|
|
104
|
+
"travelers",
|
|
105
|
+
"finance",
|
|
106
|
+
"invoices",
|
|
107
|
+
"documents",
|
|
108
|
+
"suppliers",
|
|
109
|
+
"activity",
|
|
110
|
+
"metadata",
|
|
111
|
+
]);
|
|
112
|
+
/**
|
|
113
|
+
* Search contract for the booking detail page. `productId`/`slotId` only
|
|
114
|
+
* matter for the `"new"` pseudo-id: a deep link with a product pre-chosen
|
|
115
|
+
* redirects into the unified booking journey (host route concern).
|
|
116
|
+
*/
|
|
117
|
+
export const bookingDetailSearchSchema = z.object({
|
|
118
|
+
productId: z.string().optional(),
|
|
119
|
+
slotId: z.string().optional(),
|
|
120
|
+
tab: bookingDetailTabSchema.optional(),
|
|
121
|
+
});
|
|
122
|
+
/**
|
|
123
|
+
* Search contract for the packaged "New booking" entry page. A deep link
|
|
124
|
+
* with `productId` pre-chosen (e.g. launched from a product page) forwards
|
|
125
|
+
* straight into the unified booking journey; `slotId` pins the departure.
|
|
126
|
+
*/
|
|
127
|
+
export const bookingNewSearchSchema = z.object({
|
|
128
|
+
productId: z.string().optional(),
|
|
129
|
+
slotId: z.string().optional(),
|
|
130
|
+
});
|
|
131
|
+
/**
|
|
132
|
+
* Search contract for the unified booking journey page — the URL projection
|
|
133
|
+
* of the journey's entry state (provenance, pre-pinned departure/option/
|
|
134
|
+
* rate, side-panel preview hints). Key PRESENCE is meaningful: callers pass
|
|
135
|
+
* only the fields their selection actually carries.
|
|
136
|
+
*/
|
|
137
|
+
export const bookingJourneySearchSchema = z.object({
|
|
138
|
+
sourceKind: z.string().min(1),
|
|
139
|
+
sourceConnectionId: z.string().optional(),
|
|
140
|
+
sourceRef: z.string().optional(),
|
|
141
|
+
departureId: z.string().optional(),
|
|
142
|
+
departureDate: z.string().optional(),
|
|
143
|
+
optionId: z.string().optional(),
|
|
144
|
+
roomTypeId: z.string().optional(),
|
|
145
|
+
ratePlanId: z.string().optional(),
|
|
146
|
+
board: z.string().optional(),
|
|
147
|
+
entityName: z.string().optional(),
|
|
148
|
+
entityImageUrl: z.string().optional(),
|
|
149
|
+
/** Stable draft id — refresh-safe. When absent, the journey page
|
|
150
|
+
* generates a fresh id on mount. */
|
|
151
|
+
draftId: z.string().optional(),
|
|
152
|
+
});
|
|
153
|
+
/** Map the host-supplied route runtime onto the bookings data client shape. */
|
|
154
|
+
function loaderClient(runtime) {
|
|
155
|
+
return { baseUrl: runtime.baseUrl, fetcher: runtime.fetcher ?? defaultFetcher };
|
|
156
|
+
}
|
|
157
|
+
const LazyPersonBookingsWidget = React.lazy(() => import("./person-bookings-widget.js").then((module) => ({
|
|
158
|
+
default: module.PersonBookingsWidget,
|
|
159
|
+
})));
|
|
160
|
+
/**
|
|
161
|
+
* Suspense-wrapped lazy mount of {@link LazyPersonBookingsWidget}. The widget
|
|
162
|
+
* registry takes a sync component, but the card (and the booking-list stack
|
|
163
|
+
* behind it) must not load with workspace chrome — the chunk fetches when the
|
|
164
|
+
* CRM person page actually renders the Bookings tab.
|
|
165
|
+
*/
|
|
166
|
+
function PersonBookingsWidgetLoader(props) {
|
|
167
|
+
return (_jsx(React.Suspense, { fallback: null, children: _jsx(LazyPersonBookingsWidget, { ...props }) }));
|
|
168
|
+
}
|
|
169
|
+
function adminWidgetComponent(Widget) {
|
|
170
|
+
return function AdminWidgetComponent(props) {
|
|
171
|
+
return _jsx(Widget, { ...props });
|
|
172
|
+
};
|
|
173
|
+
}
|
|
174
|
+
const PersonBookingsWidgetContribution = adminWidgetComponent(PersonBookingsWidgetLoader);
|
|
175
|
+
/**
|
|
176
|
+
* The bookings admin contribution (packaged-admin RFC Phase 3,
|
|
177
|
+
* `@voyant-travel/<domain>-ui/admin` convention).
|
|
178
|
+
*
|
|
179
|
+
* NAVIGATION: deliberately none. The Bookings nav item is part of the BASE
|
|
180
|
+
* operator navigation — see `createOperatorAdminNavigation` in
|
|
181
|
+
* `@voyant-travel/admin` — so contributing nav entries here would duplicate it.
|
|
182
|
+
* If the base nav ever drops the bookings item, this extension is where the
|
|
183
|
+
* entry moves.
|
|
184
|
+
*
|
|
185
|
+
* ROUTES: full implementations (packaged-admin RFC §4.8) — the package-owned
|
|
186
|
+
* search contracts ({@link bookingsIndexSearchSchema} for the list,
|
|
187
|
+
* {@link bookingDetailSearchSchema} for the detail page), loaders that
|
|
188
|
+
* prefetch through the host-supplied runtime, and lazy `page` modules. The
|
|
189
|
+
* PAGES are package-owned too: {@link BookingsHost} and
|
|
190
|
+
* {@link BookingDetailHost} bind the canonical bookings pages to their data
|
|
191
|
+
* wiring (bookings/finance provider context) and resolve every cross-route
|
|
192
|
+
* link through the semantic destinations declared above — no app RPC client,
|
|
193
|
+
* no host route tree.
|
|
194
|
+
*
|
|
195
|
+
* `component:` stays unattached; each contribution carries a lazy `page`
|
|
196
|
+
* loader instead. The host binder wraps it in the router's lazy-component
|
|
197
|
+
* machinery (so the page lands in its own chunk) and hands the resolved
|
|
198
|
+
* component its route state as `AdminRoutePageProps` — which is how the
|
|
199
|
+
* param/search-taking bookings pages mount without a host route file. The
|
|
200
|
+
* `page` thunks below dynamically import the SPECIFIC page modules, never
|
|
201
|
+
* this barrel, so the factory itself never pins page code into the
|
|
202
|
+
* workspace-chrome chunk.
|
|
203
|
+
*
|
|
204
|
+
* WIDGETS: the crm-ui ↔ bookings-ui cycle resolution (RFC §4.7). The CRM
|
|
205
|
+
* person detail page mounts a Bookings tab, but this package depends on
|
|
206
|
+
* `@voyant-travel/relationships-react/ui`, so crm-ui's host cannot import the bookings-owned
|
|
207
|
+
* card. Instead this extension contributes {@link PersonBookingsWidget} on
|
|
208
|
+
* the `person.details.bookings-tab` slot crm-ui's `PersonDetailHost`
|
|
209
|
+
* exposes; the host mounts its Bookings tab whenever a contribution targets
|
|
210
|
+
* that slot and hands the widget its typed slot context
|
|
211
|
+
* (`PersonDetailBookingsTabContext`) as props.
|
|
212
|
+
*/
|
|
213
|
+
export function createBookingsAdminExtension(options = {}) {
|
|
214
|
+
const { basePath = "/bookings", labels = {}, indexHeaderActions, detailPageComponent } = options;
|
|
215
|
+
const { bookings = "Bookings" } = labels;
|
|
216
|
+
return defineAdminExtension({
|
|
217
|
+
id: "bookings",
|
|
218
|
+
routes: [
|
|
219
|
+
{
|
|
220
|
+
id: "bookings-index",
|
|
221
|
+
path: basePath,
|
|
222
|
+
title: bookings,
|
|
223
|
+
// Route-backed destination (RFC §4.7 endgame): the key resolves by
|
|
224
|
+
// pure path interpolation of this route, so the host's resolver is
|
|
225
|
+
// generated (`voyant admin generate --destinations`). `booking.detail`
|
|
226
|
+
// is deliberately NOT bound: its resolver constructs the `tab` search
|
|
227
|
+
// param, which is beyond path interpolation — it stays hand-written.
|
|
228
|
+
destination: "booking.list",
|
|
229
|
+
ssr: "data-only",
|
|
230
|
+
validateSearch: (search) => bookingsIndexSearchSchema.parse(search),
|
|
231
|
+
pendingComponent: BookingsListSkeleton,
|
|
232
|
+
// Dynamic import on purpose: the query options pull the bookings
|
|
233
|
+
// data layer (client + response schemas), and a static import here
|
|
234
|
+
// would pin it into the workspace-chrome chunk that evaluates this
|
|
235
|
+
// factory. The loader and the page resolve shared modules once.
|
|
236
|
+
loader: async ({ queryClient, runtime }) => {
|
|
237
|
+
const { getBookingsQueryOptions } = await import("../query-options.js");
|
|
238
|
+
return queryClient.ensureQueryData(getBookingsQueryOptions(loaderClient(runtime)));
|
|
239
|
+
},
|
|
240
|
+
page: async () => {
|
|
241
|
+
const module = await import("./pages/bookings-index-page.js");
|
|
242
|
+
const Page = module.default;
|
|
243
|
+
// Tiny wrapper only — the heavy page stays in its own chunk; this
|
|
244
|
+
// closure just threads the app-owned header actions through.
|
|
245
|
+
return {
|
|
246
|
+
default: (props) => (_jsx(Page, { ...props, headerActions: indexHeaderActions })),
|
|
247
|
+
};
|
|
248
|
+
},
|
|
249
|
+
},
|
|
250
|
+
{
|
|
251
|
+
id: "bookings-detail",
|
|
252
|
+
path: `${basePath}/$id`,
|
|
253
|
+
title: bookings,
|
|
254
|
+
ssr: "data-only",
|
|
255
|
+
validateSearch: (search) => bookingDetailSearchSchema.parse(search),
|
|
256
|
+
pendingComponent: BookingDetailSkeleton,
|
|
257
|
+
// The static `/bookings/new` route (the "bookings-new" contribution
|
|
258
|
+
// below) outranks this param route for the `"new"` segment, but the
|
|
259
|
+
// loader stays defensive — nothing to prefetch for a pseudo-id.
|
|
260
|
+
loader: async ({ queryClient, runtime, params }) => {
|
|
261
|
+
const id = params.id;
|
|
262
|
+
if (!id || id === "new")
|
|
263
|
+
return;
|
|
264
|
+
// Dynamic import on purpose — see the index loader above.
|
|
265
|
+
const { getBookingActivityQueryOptions, getBookingNotesQueryOptions, getBookingQueryOptions, getSupplierStatusesQueryOptions, getTravelersQueryOptions, } = await import("../query-options.js");
|
|
266
|
+
const client = loaderClient(runtime);
|
|
267
|
+
// Critical: booking itself drives the header. Everything else
|
|
268
|
+
// (travelers, supplier statuses, activity, notes) is per-section
|
|
269
|
+
// and renders progressively.
|
|
270
|
+
await queryClient.ensureQueryData(getBookingQueryOptions(client, id));
|
|
271
|
+
void queryClient.prefetchQuery(getTravelersQueryOptions(client, id));
|
|
272
|
+
void queryClient.prefetchQuery(getSupplierStatusesQueryOptions(client, id));
|
|
273
|
+
void queryClient.prefetchQuery(getBookingActivityQueryOptions(client, id));
|
|
274
|
+
void queryClient.prefetchQuery(getBookingNotesQueryOptions(client, id));
|
|
275
|
+
},
|
|
276
|
+
page: async () => {
|
|
277
|
+
const module = await (detailPageComponent
|
|
278
|
+
? detailPageComponent()
|
|
279
|
+
: import("./pages/booking-detail-page.js"));
|
|
280
|
+
const Page = module.default;
|
|
281
|
+
return {
|
|
282
|
+
default: ({ params, search, updateSearch }) => (_jsx(Page, { id: params.id ?? "", activeTab: search.tab, onTabChange: (tab) => updateSearch((prev) => ({ ...prev, tab }), { replace: true }) })),
|
|
283
|
+
};
|
|
284
|
+
},
|
|
285
|
+
},
|
|
286
|
+
{
|
|
287
|
+
id: "bookings-new",
|
|
288
|
+
path: `${basePath}/new`,
|
|
289
|
+
title: bookings,
|
|
290
|
+
// Route-backed destination (RFC §4.7 endgame): the key resolves by
|
|
291
|
+
// pure path interpolation of this route (no params), so the host's
|
|
292
|
+
// resolver is generated.
|
|
293
|
+
destination: "booking.create",
|
|
294
|
+
validateSearch: (search) => bookingNewSearchSchema.parse(search),
|
|
295
|
+
page: () => import("./pages/booking-new-page.js"),
|
|
296
|
+
},
|
|
297
|
+
{
|
|
298
|
+
id: "bookings-compose",
|
|
299
|
+
path: `${basePath}/compose`,
|
|
300
|
+
title: bookings,
|
|
301
|
+
// Alias route: forwards to the host's trips via the
|
|
302
|
+
// `trip.create` destination (see the page module).
|
|
303
|
+
page: () => import("./pages/booking-compose-page.js"),
|
|
304
|
+
},
|
|
305
|
+
{
|
|
306
|
+
id: "bookings-journey",
|
|
307
|
+
// Deliberately OUTSIDE `basePath`: the journey mounts on the catalog
|
|
308
|
+
// plane (`bookingJourney.start` hrefs point here), flat under the
|
|
309
|
+
// workspace layout so it renders without catalog section nesting —
|
|
310
|
+
// the same semantics the old escaped `catalog_.journey` route file
|
|
311
|
+
// had. NOT destination-annotated: `bookingJourney.start` constructs
|
|
312
|
+
// search params, which is beyond path interpolation — its resolver
|
|
313
|
+
// stays hand-written in the host map.
|
|
314
|
+
path: "/catalog/journey/$entityModule/$entityId",
|
|
315
|
+
title: bookings,
|
|
316
|
+
validateSearch: (search) => bookingJourneySearchSchema.parse(search),
|
|
317
|
+
page: () => import("./pages/booking-journey-page.js"),
|
|
318
|
+
},
|
|
319
|
+
],
|
|
320
|
+
widgets: [
|
|
321
|
+
{
|
|
322
|
+
id: "bookings-person-bookings",
|
|
323
|
+
slot: personDetailBookingsTabSlot,
|
|
324
|
+
// The widget registry is untyped (`Record<string, unknown>` props);
|
|
325
|
+
// the typed contract is `PersonDetailBookingsTabContext`, which
|
|
326
|
+
// crm-ui's person detail host passes verbatim to this slot's widgets.
|
|
327
|
+
component: PersonBookingsWidgetContribution,
|
|
328
|
+
},
|
|
329
|
+
],
|
|
330
|
+
});
|
|
331
|
+
}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import type { BillingExtrasContext } from "../journey/index.js";
|
|
2
|
+
export declare function JourneyBillingDuplicateWarning({ buyerType, personId, organizationId, productId, departureSlotId, }: BillingExtrasContext): React.ReactElement | null;
|
|
3
|
+
//# sourceMappingURL=journey-billing-duplicate-warning.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"journey-billing-duplicate-warning.d.ts","sourceRoot":"","sources":["../../src/admin/journey-billing-duplicate-warning.tsx"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAA;AAE/D,wBAAgB,8BAA8B,CAAC,EAC7C,SAAS,EACT,QAAQ,EACR,cAAc,EACd,SAAS,EACT,eAAe,GAChB,EAAE,oBAAoB,GAAG,KAAK,CAAC,YAAY,GAAG,IAAI,CA0ClD"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
/**
|
|
4
|
+
* Heads-up shown under the billing block when the picked lead (person for B2C,
|
|
5
|
+
* organization for B2B) already has a booking on the selected departure — with
|
|
6
|
+
* a link to each. Helps operators avoid accidental duplicate bookings.
|
|
7
|
+
*/
|
|
8
|
+
import { useAdminNavigate, useOperatorAdminMessages } from "@voyant-travel/admin";
|
|
9
|
+
import { useBookings } from "../hooks/use-bookings.js";
|
|
10
|
+
export function JourneyBillingDuplicateWarning({ buyerType, personId, organizationId, productId, departureSlotId, }) {
|
|
11
|
+
const t = useOperatorAdminMessages().bookings.detail.bookingJourney;
|
|
12
|
+
const navigate = useAdminNavigate();
|
|
13
|
+
const leadId = buyerType === "B2B" ? organizationId : personId;
|
|
14
|
+
// Only a scheduled departure (slot) gives a precise duplicate match.
|
|
15
|
+
const enabled = Boolean(leadId && departureSlotId);
|
|
16
|
+
const query = useBookings({
|
|
17
|
+
...(buyerType === "B2B" ? { organizationId } : { personId }),
|
|
18
|
+
productId,
|
|
19
|
+
availabilitySlotId: departureSlotId,
|
|
20
|
+
enabled,
|
|
21
|
+
});
|
|
22
|
+
const existing = (query.data?.data ?? []).filter((booking) => booking.status !== "cancelled");
|
|
23
|
+
if (!enabled || existing.length === 0)
|
|
24
|
+
return null;
|
|
25
|
+
return (_jsxs("div", { className: "space-y-1 rounded-md border border-amber-300 bg-amber-50 p-3 text-amber-900 text-sm dark:border-amber-700 dark:bg-amber-950 dark:text-amber-100", children: [_jsxs("p", { children: ["\u26A0 ", t.duplicateDepartureWarning] }), _jsx("ul", { className: "space-y-0.5", children: existing.map((booking) => (_jsxs("li", { children: [_jsx("button", { type: "button", className: "font-medium underline underline-offset-2 hover:opacity-80", onClick: () => navigate("booking.detail", { bookingId: booking.id }), children: booking.bookingNumber }), booking.items?.[0]?.title ? (_jsxs("span", { className: "text-amber-900/80 dark:text-amber-100/80", children: [" ", "\u00B7 ", booking.items[0].title] })) : null] }, booking.id))) })] }));
|
|
26
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { DeparturePickerProps } from "../journey/index.js";
|
|
2
|
+
export declare function JourneyDeparturePicker({ productId, optionId, slotId, departureDate, onChange, lockDeparture, }: DeparturePickerProps & {
|
|
3
|
+
/** The departure is fixed (a sourced offer's date came in pre-selected) —
|
|
4
|
+
* show it read-only rather than a re-editable input. */
|
|
5
|
+
lockDeparture?: boolean;
|
|
6
|
+
}): React.ReactElement;
|
|
7
|
+
//# sourceMappingURL=journey-departure-picker.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"journey-departure-picker.d.ts","sourceRoot":"","sources":["../../src/admin/journey-departure-picker.tsx"],"names":[],"mappings":"AAkBA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAA;AA4B/D,wBAAgB,sBAAsB,CAAC,EACrC,SAAS,EACT,QAAQ,EACR,MAAM,EACN,aAAa,EACb,QAAQ,EACR,aAAqB,GACtB,EAAE,oBAAoB,GAAG;IACxB;6DACyD;IACzD,aAAa,CAAC,EAAE,OAAO,CAAA;CACxB,GAAG,KAAK,CAAC,YAAY,CAsIrB"}
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { useSlots } from "@voyant-travel/operations-react/availability";
|
|
4
|
+
import { Combobox, ComboboxCollection, ComboboxContent, ComboboxEmpty, ComboboxInput, ComboboxItem, ComboboxList, } from "@voyant-travel/ui/components/combobox";
|
|
5
|
+
import { Input } from "@voyant-travel/ui/components/input";
|
|
6
|
+
import { Label } from "@voyant-travel/ui/components/label";
|
|
7
|
+
import { useEffect, useMemo, useState } from "react";
|
|
8
|
+
import { getBookableDepartureSlots } from "../components/booking-create-utils.js";
|
|
9
|
+
import { useBookingsUiMessagesOrDefault } from "../i18n/provider.js";
|
|
10
|
+
/**
|
|
11
|
+
* Admin departure picker for the booking journey's `"departure"`
|
|
12
|
+
* sub-step. Loads the owned product's scheduled departures from
|
|
13
|
+
* availability and lets the operator pick a real one (filtered by the
|
|
14
|
+
* chosen product option). When the product has no scheduled
|
|
15
|
+
* departures, it falls back to a free date so non-scheduled
|
|
16
|
+
* products can still be booked.
|
|
17
|
+
*
|
|
18
|
+
* Wired into `<BookingJourneyHost />` via the journey's
|
|
19
|
+
* `renderDeparturePicker` slot.
|
|
20
|
+
*/
|
|
21
|
+
const dateFormatter = new Intl.DateTimeFormat(undefined, {
|
|
22
|
+
year: "numeric",
|
|
23
|
+
month: "short",
|
|
24
|
+
day: "numeric",
|
|
25
|
+
});
|
|
26
|
+
export function JourneyDeparturePicker({ productId, optionId, slotId, departureDate, onChange, lockDeparture = false, }) {
|
|
27
|
+
const messages = useBookingsUiMessagesOrDefault().bookingCreateDialog;
|
|
28
|
+
// Stable "now" so the slot query + future filter don't churn every render.
|
|
29
|
+
const [nowIso] = useState(() => new Date().toISOString());
|
|
30
|
+
const query = useSlots({
|
|
31
|
+
productId: productId || undefined,
|
|
32
|
+
status: "open",
|
|
33
|
+
startsAtFrom: nowIso,
|
|
34
|
+
limit: 100,
|
|
35
|
+
enabled: Boolean(productId) && !lockDeparture,
|
|
36
|
+
});
|
|
37
|
+
const slots = useMemo(() => getBookableDepartureSlots((query.data?.data ?? []), {
|
|
38
|
+
nowIso,
|
|
39
|
+
optionId,
|
|
40
|
+
}), [query.data?.data, nowIso, optionId]);
|
|
41
|
+
const slotMap = useMemo(() => new Map(slots.map((s) => [s.id, s])), [slots]);
|
|
42
|
+
const formatLabel = (slot) => {
|
|
43
|
+
const date = dateFormatter.format(new Date(slot.startsAt));
|
|
44
|
+
const remaining = !slot.unlimited && typeof slot.remainingPax === "number"
|
|
45
|
+
? ` · ${slot.remainingPax} ${messages.labels.remainingCapacity}`
|
|
46
|
+
: "";
|
|
47
|
+
return `${date}${remaining}`;
|
|
48
|
+
};
|
|
49
|
+
const [inputValue, setInputValue] = useState(() => {
|
|
50
|
+
const current = slotId ? slotMap.get(slotId) : undefined;
|
|
51
|
+
return current ? formatLabel(current) : "";
|
|
52
|
+
});
|
|
53
|
+
// The draft keeps the picked slotId across step navigation, but this
|
|
54
|
+
// component's input is local state and re-seeds to "" on remount (before
|
|
55
|
+
// slots load). Reflect the selected slot's label once it resolves so a
|
|
56
|
+
// revisited departure shows as selected rather than empty.
|
|
57
|
+
// biome-ignore lint/correctness/useExhaustiveDependencies: formatLabel is render-stable; slotId/slotMap are the real triggers -- owner: bookings-react; existing suppression is intentional pending typed cleanup.
|
|
58
|
+
useEffect(() => {
|
|
59
|
+
if (!slotId)
|
|
60
|
+
return;
|
|
61
|
+
const slot = slotMap.get(slotId);
|
|
62
|
+
if (slot)
|
|
63
|
+
setInputValue((prev) => (prev ? prev : formatLabel(slot)));
|
|
64
|
+
}, [slotId, slotMap]);
|
|
65
|
+
// Sourced offer with a fixed date (came in pre-selected) → show it read-only.
|
|
66
|
+
// A different date would be a different offer, so there's nothing to edit.
|
|
67
|
+
if (lockDeparture && departureDate) {
|
|
68
|
+
return (_jsxs("div", { className: "space-y-1", children: [_jsx(Label, { children: messages.fields.departure }), _jsx("p", { className: "font-medium text-sm", children: dateFormatter.format(new Date(`${departureDate.slice(0, 10)}T00:00:00`)) })] }));
|
|
69
|
+
}
|
|
70
|
+
// No scheduled departures for this product → a free date so the operator can
|
|
71
|
+
// still set a departure for non-scheduled products. (No time field — tour /
|
|
72
|
+
// package departures are by date.)
|
|
73
|
+
if (!query.isLoading && slots.length === 0) {
|
|
74
|
+
return (_jsxs("div", { className: "space-y-1", children: [_jsx(Label, { htmlFor: "bj-departure-date", children: messages.fields.departure }), _jsx(Input, { id: "bj-departure-date", type: "date", className: "sm:max-w-xs", value: departureDate ?? "", onChange: (e) => onChange({ departureDate: e.target.value || null }) })] }));
|
|
75
|
+
}
|
|
76
|
+
return (_jsxs("div", { className: "flex flex-col gap-1", children: [_jsxs(Label, { children: [messages.fields.departure, " ", _jsx("span", { className: "text-destructive", children: "*" })] }), _jsxs(Combobox, { items: slots.map((s) => s.id), value: slotId || null, inputValue: inputValue, autoHighlight: true, disabled: query.isLoading, filter: () => true, itemToStringLabel: (id) => {
|
|
77
|
+
const slot = slotMap.get(id);
|
|
78
|
+
return slot ? formatLabel(slot) : id;
|
|
79
|
+
}, itemToStringValue: (id) => id, onInputValueChange: (next) => setInputValue(next), onValueChange: (next) => {
|
|
80
|
+
const id = next ?? "";
|
|
81
|
+
const slot = id ? slotMap.get(id) : undefined;
|
|
82
|
+
if (!slot) {
|
|
83
|
+
onChange({ slotId: null, departureDate: null });
|
|
84
|
+
setInputValue("");
|
|
85
|
+
return;
|
|
86
|
+
}
|
|
87
|
+
onChange({
|
|
88
|
+
slotId: slot.id,
|
|
89
|
+
// Anchor the free-date field on the slot's date so downstream
|
|
90
|
+
// (payment schedules, hold) has a concrete departure date.
|
|
91
|
+
departureDate: slot.startsAt.slice(0, 10),
|
|
92
|
+
});
|
|
93
|
+
setInputValue(formatLabel(slot));
|
|
94
|
+
}, children: [_jsx(ComboboxInput, { placeholder: messages.placeholders.departure, showClear: Boolean(slotId) }), _jsxs(ComboboxContent, { children: [_jsx(ComboboxEmpty, { children: messages.placeholders.departureEmpty }), _jsx(ComboboxList, { children: _jsx(ComboboxCollection, { children: (id) => {
|
|
95
|
+
const slot = slotMap.get(id);
|
|
96
|
+
if (!slot)
|
|
97
|
+
return null;
|
|
98
|
+
return (_jsx(ComboboxItem, { value: slot.id, children: formatLabel(slot) }, slot.id));
|
|
99
|
+
} }) })] })] })] }));
|
|
100
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { UnitsPickerProps } from "../journey/index.js";
|
|
2
|
+
/**
|
|
3
|
+
* Admin rooms/units picker for the booking journey's `"option-units"`
|
|
4
|
+
* sub-step. Wraps the shared `OptionUnitsStepperSection` (which loads the
|
|
5
|
+
* product's option units + per-slot availability) and mirrors the picked
|
|
6
|
+
* quantities into the journey draft's `configure.optionSelections`.
|
|
7
|
+
*
|
|
8
|
+
* Wired into `<BookingJourneyHost />` via the `renderUnitsPicker` slot.
|
|
9
|
+
*/
|
|
10
|
+
export declare function JourneyUnitsPicker({ productId, optionId, slotId, selections, onChange, }: UnitsPickerProps): React.ReactElement;
|
|
11
|
+
//# sourceMappingURL=journey-units-picker.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"journey-units-picker.d.ts","sourceRoot":"","sources":["../../src/admin/journey-units-picker.tsx"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAA0B,gBAAgB,EAAE,MAAM,qBAAqB,CAAA;AAEnF;;;;;;;GAOG;AACH,wBAAgB,kBAAkB,CAAC,EACjC,SAAS,EACT,QAAQ,EACR,MAAM,EACN,UAAU,EACV,QAAQ,GACT,EAAE,gBAAgB,GAAG,KAAK,CAAC,YAAY,CAuDvC"}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import { useRef, useState } from "react";
|
|
4
|
+
import { emptyOptionUnitsStepperValue, OptionUnitsStepperSection, } from "../components/option-units-stepper-section.js";
|
|
5
|
+
/**
|
|
6
|
+
* Admin rooms/units picker for the booking journey's `"option-units"`
|
|
7
|
+
* sub-step. Wraps the shared `OptionUnitsStepperSection` (which loads the
|
|
8
|
+
* product's option units + per-slot availability) and mirrors the picked
|
|
9
|
+
* quantities into the journey draft's `configure.optionSelections`.
|
|
10
|
+
*
|
|
11
|
+
* Wired into `<BookingJourneyHost />` via the `renderUnitsPicker` slot.
|
|
12
|
+
*/
|
|
13
|
+
export function JourneyUnitsPicker({ productId, optionId, slotId, selections, onChange, }) {
|
|
14
|
+
// Seed the stepper from any selections already on the draft (refresh /
|
|
15
|
+
// step revisit). Local state mirrors the departure picker's approach.
|
|
16
|
+
const [value, setValue] = useState(() => {
|
|
17
|
+
const quantities = {};
|
|
18
|
+
for (const selection of selections) {
|
|
19
|
+
if (selection.optionUnitId)
|
|
20
|
+
quantities[selection.optionUnitId] = selection.quantity;
|
|
21
|
+
}
|
|
22
|
+
return Object.keys(quantities).length > 0 ? { quantities } : emptyOptionUnitsStepperValue;
|
|
23
|
+
});
|
|
24
|
+
// The loaded unit metadata (optionId + name per unit) needed to rebuild
|
|
25
|
+
// `optionSelections` from the quantity map.
|
|
26
|
+
// Loaded unit metadata is kept in a ref, NOT state: it's only read when
|
|
27
|
+
// the operator changes a quantity, never rendered. Using state here would
|
|
28
|
+
// make `onUnitsChange` (which fires as units load) re-render → the stepper
|
|
29
|
+
// re-emits → setDraft → re-quote → re-render … an infinite loop.
|
|
30
|
+
const unitsRef = useRef([]);
|
|
31
|
+
const emit = (quantities) => {
|
|
32
|
+
const next = [];
|
|
33
|
+
for (const unit of unitsRef.current) {
|
|
34
|
+
const quantity = quantities[unit.optionUnitId] ?? 0;
|
|
35
|
+
if (quantity <= 0)
|
|
36
|
+
continue;
|
|
37
|
+
const unitOptionId = unit.optionId ?? optionId;
|
|
38
|
+
if (!unitOptionId)
|
|
39
|
+
continue;
|
|
40
|
+
next.push({
|
|
41
|
+
optionId: unitOptionId,
|
|
42
|
+
optionUnitId: unit.optionUnitId,
|
|
43
|
+
optionUnitName: unit.unitName,
|
|
44
|
+
quantity,
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
onChange(next);
|
|
48
|
+
};
|
|
49
|
+
return (_jsx(OptionUnitsStepperSection, { value: value, onChange: (nextValue) => {
|
|
50
|
+
setValue(nextValue);
|
|
51
|
+
emit(nextValue.quantities);
|
|
52
|
+
}, productId: productId, slotId: slotId ?? undefined, optionId: optionId,
|
|
53
|
+
// The journey nests rooms under the chosen option — show only that
|
|
54
|
+
// option's units (New having no rooms correctly shows none).
|
|
55
|
+
restrictToOption: true, enabled: true,
|
|
56
|
+
// Record loaded units without triggering a render (see unitsRef note).
|
|
57
|
+
onUnitsChange: (loadedUnits) => {
|
|
58
|
+
unitsRef.current = loadedUnits;
|
|
59
|
+
} }));
|
|
60
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"journey-voucher-picker.d.ts","sourceRoot":"","sources":["../../src/admin/journey-voucher-picker.tsx"],"names":[],"mappings":"AAuBA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAA;AAc7D,wBAAgB,oBAAoB,CAAC,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE,kBAAkB,GAAG,KAAK,CAAC,YAAY,CAgF/F"}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
/**
|
|
4
|
+
* Admin voucher picker — an async combobox over the admin vouchers list.
|
|
5
|
+
* Staff search by code and pick a voucher (the full remaining balance is
|
|
6
|
+
* redeemed); they never need to know the exact code, unlike storefront
|
|
7
|
+
* customers. Wired into `<BookingJourneyHost />` via `renderVoucherPicker`.
|
|
8
|
+
*/
|
|
9
|
+
import { useOperatorAdminMessages } from "@voyant-travel/admin";
|
|
10
|
+
import { useVouchers } from "@voyant-travel/finance-react";
|
|
11
|
+
import { Combobox, ComboboxCollection, ComboboxContent, ComboboxEmpty, ComboboxInput, ComboboxItem, ComboboxList, } from "@voyant-travel/ui/components/combobox";
|
|
12
|
+
import { Label } from "@voyant-travel/ui/components/label";
|
|
13
|
+
import { useEffect, useState } from "react";
|
|
14
|
+
function formatMoney(cents, currency) {
|
|
15
|
+
try {
|
|
16
|
+
return new Intl.NumberFormat(undefined, { style: "currency", currency }).format(cents / 100);
|
|
17
|
+
}
|
|
18
|
+
catch {
|
|
19
|
+
return `${(cents / 100).toFixed(2)} ${currency}`;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
function voucherLabel(voucher) {
|
|
23
|
+
return `${voucher.code} · ${formatMoney(voucher.remainingAmountCents, voucher.currency)}`;
|
|
24
|
+
}
|
|
25
|
+
export function JourneyVoucherPicker({ value, onApply }) {
|
|
26
|
+
const t = useOperatorAdminMessages().bookings.detail.bookingJourney;
|
|
27
|
+
const [inputValue, setInputValue] = useState("");
|
|
28
|
+
const [search, setSearch] = useState("");
|
|
29
|
+
// Active vouchers with a remaining balance, filtered by the typed code.
|
|
30
|
+
const query = useVouchers({
|
|
31
|
+
status: "active",
|
|
32
|
+
hasBalance: true,
|
|
33
|
+
search: search || undefined,
|
|
34
|
+
limit: 20,
|
|
35
|
+
});
|
|
36
|
+
const vouchers = query.data?.data ?? [];
|
|
37
|
+
const byId = new Map(vouchers.map((v) => [v.id, v]));
|
|
38
|
+
const selectedId = value.voucherId ?? null;
|
|
39
|
+
// Reflect a pre-selected voucher's label once its record loads.
|
|
40
|
+
useEffect(() => {
|
|
41
|
+
if (selectedId && byId.has(selectedId)) {
|
|
42
|
+
setInputValue(voucherLabel(byId.get(selectedId)));
|
|
43
|
+
}
|
|
44
|
+
}, [selectedId, byId]);
|
|
45
|
+
return (_jsxs("div", { className: "space-y-1", children: [_jsx(Label, { children: t.voucherPickerLabel }), _jsxs(Combobox, { items: vouchers.map((v) => v.id), value: selectedId, inputValue: inputValue, autoHighlight: true, itemToStringLabel: (id) => {
|
|
46
|
+
const v = byId.get(id);
|
|
47
|
+
return v ? voucherLabel(v) : id;
|
|
48
|
+
}, itemToStringValue: (id) => id, onInputValueChange: (next) => {
|
|
49
|
+
setInputValue(next);
|
|
50
|
+
setSearch(next);
|
|
51
|
+
if (!next)
|
|
52
|
+
onApply(null);
|
|
53
|
+
}, onValueChange: (next) => {
|
|
54
|
+
const id = next ?? null;
|
|
55
|
+
if (!id) {
|
|
56
|
+
onApply(null);
|
|
57
|
+
setInputValue("");
|
|
58
|
+
return;
|
|
59
|
+
}
|
|
60
|
+
const v = byId.get(id);
|
|
61
|
+
if (v) {
|
|
62
|
+
onApply({ voucherId: v.id, amountCents: v.remainingAmountCents });
|
|
63
|
+
setInputValue(voucherLabel(v));
|
|
64
|
+
}
|
|
65
|
+
}, children: [_jsx(ComboboxInput, { placeholder: t.voucherSearchPlaceholder, showClear: !!selectedId }), _jsxs(ComboboxContent, { children: [_jsx(ComboboxEmpty, { children: t.voucherEmpty }), _jsx(ComboboxList, { children: _jsx(ComboboxCollection, { children: (id) => {
|
|
66
|
+
const v = byId.get(id);
|
|
67
|
+
if (!v)
|
|
68
|
+
return null;
|
|
69
|
+
return (_jsx(ComboboxItem, { value: v.id, children: _jsxs("div", { className: "flex min-w-0 flex-col", children: [_jsx("span", { className: "truncate font-medium", children: v.code }), _jsx("span", { className: "truncate text-muted-foreground text-xs", children: formatMoney(v.remainingAmountCents, v.currency) })] }) }, v.id));
|
|
70
|
+
} }) })] })] })] }));
|
|
71
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Legacy alias: `/bookings/compose` → the trips. The composer used
|
|
3
|
+
* to live here; it moved under the trips area, and this packaged page keeps
|
|
4
|
+
* the old URL working by forwarding to the `trip.create` destination (the
|
|
5
|
+
* host resolves it to its composer route). `replace` keeps route-redirect
|
|
6
|
+
* history semantics — the alias never lands in history.
|
|
7
|
+
*/
|
|
8
|
+
export default function BookingComposePage(): null;
|
|
9
|
+
//# sourceMappingURL=booking-compose-page.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"booking-compose-page.d.ts","sourceRoot":"","sources":["../../../src/admin/pages/booking-compose-page.tsx"],"names":[],"mappings":"AAKA;;;;;;GAMG;AACH,MAAM,CAAC,OAAO,UAAU,kBAAkB,SAQzC"}
|