@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,127 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { AdminWidgetSlotRenderer, resolveAdminWidgets, useAdminBreadcrumbs, useAdminExtensions, useAdminHref, useAdminNavigate, useLocale, useOperatorAdminMessages, } from "@voyant-travel/admin";
|
|
4
|
+
import { useInvoices, usePaymentMutation } from "@voyant-travel/finance-react";
|
|
5
|
+
import { Sheet, SheetContent } from "@voyant-travel/ui/components/sheet";
|
|
6
|
+
import { useState } from "react";
|
|
7
|
+
import { BookingDetailPage, } from "../components/booking-detail-page.js";
|
|
8
|
+
import { useBooking } from "../index.js";
|
|
9
|
+
import { BookingDocumentsTable } from "./booking-documents-table.js";
|
|
10
|
+
import { BookingInvoiceSheet } from "./booking-invoice-sheet.js";
|
|
11
|
+
import { bookingDetailFinanceEndSlot, bookingDetailFinanceStartSlot, bookingDetailInvoicesTabSlot, } from "./slots.js";
|
|
12
|
+
import { useBookingActionLedgerEvents } from "./use-booking-action-ledger-events.js";
|
|
13
|
+
// The slot ids live in `./slots.js` — a lean, component-free module — so
|
|
14
|
+
// other domains' admin extension factories (evaluated with workspace chrome)
|
|
15
|
+
// can import them without pulling this host into the entry chunk.
|
|
16
|
+
// Re-exported here for backwards compatibility.
|
|
17
|
+
export { bookingDetailFinanceEndSlot, bookingDetailFinanceStartSlot, bookingDetailInvoicesTabSlot };
|
|
18
|
+
/**
|
|
19
|
+
* Packaged admin host for the canonical `BookingDetailPage` (packaged-admin
|
|
20
|
+
* RFC Phase 3). Owns everything package-clean:
|
|
21
|
+
*
|
|
22
|
+
* - Cross-route links resolve through semantic destinations (RFC §4.7):
|
|
23
|
+
* `booking.list`, `person.detail`, `organization.detail`,
|
|
24
|
+
* `product.detail`, `availabilitySlot.detail`, `payment.detail`,
|
|
25
|
+
* `invoice.detail` — no host route tree import.
|
|
26
|
+
* - Admin chrome breadcrumbs (`useAdminBreadcrumbs`).
|
|
27
|
+
* - Admin widget extension points: the `booking.details.header` and
|
|
28
|
+
* `booking.details.after-summary` slots render through the shared
|
|
29
|
+
* `AdminWidgetSlotRenderer`, which reads the workspace shell's
|
|
30
|
+
* `AdminExtensionsProvider` context.
|
|
31
|
+
* - Paid-amount aggregation across the booking's invoices and the
|
|
32
|
+
* derived fully-paid disabled reasons.
|
|
33
|
+
* - Payment row delete (finance-react mutation) and the in-place
|
|
34
|
+
* invoice sheet ({@link BookingInvoiceSheet}).
|
|
35
|
+
*
|
|
36
|
+
* App-local cards without package-level data access stay injectable via
|
|
37
|
+
* {@link BookingDetailHostSlots}.
|
|
38
|
+
*/
|
|
39
|
+
export function BookingDetailHost({ id, activeTab, onTabChange, onRecordPayment, onEditPayment, onGenerateLink, slots, }) {
|
|
40
|
+
const detailMessages = useOperatorAdminMessages().bookings.detail;
|
|
41
|
+
const { resolvedLocale } = useLocale();
|
|
42
|
+
const resolveHref = useAdminHref();
|
|
43
|
+
const navigateTo = useAdminNavigate();
|
|
44
|
+
// Finance (or any extension that may not import this package) contributes
|
|
45
|
+
// the Invoices-tab content as widget contributions; the tab mounts whenever
|
|
46
|
+
// an app slot or at least one widget targets it.
|
|
47
|
+
const adminExtensions = useAdminExtensions();
|
|
48
|
+
const hasInvoicesTabWidgets = resolveAdminWidgets({ slot: bookingDetailInvoicesTabSlot, extensions: adminExtensions })
|
|
49
|
+
.length > 0;
|
|
50
|
+
const [viewingInvoiceId, setViewingInvoiceId] = useState(null);
|
|
51
|
+
const { remove: removePayment } = usePaymentMutation();
|
|
52
|
+
// Mirror the booking fetch so the admin chrome can render breadcrumbs
|
|
53
|
+
// without prop-drilling through the canonical page. TanStack Query
|
|
54
|
+
// dedupes by key, so this doesn't issue a second network request.
|
|
55
|
+
const { data: bookingData } = useBooking(id);
|
|
56
|
+
const booking = bookingData?.data;
|
|
57
|
+
// Sum customer payments across this booking's non-credit-note,
|
|
58
|
+
// non-draft invoices.
|
|
59
|
+
const { data: invoicesData } = useInvoices({ bookingId: id, limit: 20 });
|
|
60
|
+
const paidAmountCents = invoicesData?.data
|
|
61
|
+
? invoicesData.data
|
|
62
|
+
.filter((inv) => {
|
|
63
|
+
const type = inv.invoiceType ?? "invoice";
|
|
64
|
+
return type !== "credit_note" && inv.status !== "draft";
|
|
65
|
+
})
|
|
66
|
+
.reduce((sum, inv) => sum + (inv.paidCents ?? 0), 0)
|
|
67
|
+
: null;
|
|
68
|
+
const fullyPaidReason = booking &&
|
|
69
|
+
booking.sellAmountCents != null &&
|
|
70
|
+
paidAmountCents != null &&
|
|
71
|
+
paidAmountCents >= booking.sellAmountCents
|
|
72
|
+
? detailMessages.generateLinkFullyPaid
|
|
73
|
+
: null;
|
|
74
|
+
const bookingsHref = resolveHref("booking.list", {});
|
|
75
|
+
useAdminBreadcrumbs(booking
|
|
76
|
+
? [
|
|
77
|
+
{ label: detailMessages.breadcrumbBookings, href: bookingsHref },
|
|
78
|
+
{ label: booking.bookingNumber },
|
|
79
|
+
]
|
|
80
|
+
: [{ label: detailMessages.breadcrumbBookings, href: bookingsHref }]);
|
|
81
|
+
const slotContext = (b) => ({
|
|
82
|
+
booking: b,
|
|
83
|
+
paidAmountCents,
|
|
84
|
+
fullyPaidReason,
|
|
85
|
+
openInvoiceSheet: setViewingInvoiceId,
|
|
86
|
+
onGenerateLink,
|
|
87
|
+
});
|
|
88
|
+
// Central action-ledger entries merged into the Activity timeline —
|
|
89
|
+
// package-owned since the feed ships from `@voyant-travel/bookings-react`.
|
|
90
|
+
const { events: actionLedgerEvents, footer: actionLedgerFooter } = useBookingActionLedgerEvents(id);
|
|
91
|
+
const activityExtraEvents = slots?.activityExtraEvents
|
|
92
|
+
? [...actionLedgerEvents, ...slots.activityExtraEvents]
|
|
93
|
+
: actionLedgerEvents;
|
|
94
|
+
return (_jsxs(_Fragment, { children: [_jsx(BookingDetailPage, { id: id, locale: resolvedLocale, hideBreadcrumb: true, activeTab: activeTab, onTabChange: onTabChange, onBack: () => navigateTo("booking.list", {}), onPersonOpen: (personId) => navigateTo("person.detail", { personId }), onOrganizationOpen: (organizationId) => navigateTo("organization.detail", { organizationId }), onRecordPayment: onRecordPayment ? () => onRecordPayment() : undefined, recordPaymentDisabledReason: fullyPaidReason, addScheduleDisabledReason: fullyPaidReason, paidAmountCents: paidAmountCents, onItemResourceOpen: (kind, resourceId) => {
|
|
95
|
+
if (kind === "product") {
|
|
96
|
+
navigateTo("product.detail", { productId: resourceId });
|
|
97
|
+
return;
|
|
98
|
+
}
|
|
99
|
+
if (kind === "availabilitySlot") {
|
|
100
|
+
navigateTo("availabilitySlot.detail", { slotId: resourceId });
|
|
101
|
+
}
|
|
102
|
+
}, onInvoiceOpen: (invoiceId) => setViewingInvoiceId(invoiceId), onViewPayment: (row) => navigateTo("payment.detail", { paymentId: row.id }), onEditPayment: onEditPayment, onDeletePayment: async (row) => {
|
|
103
|
+
await removePayment.mutateAsync(row.id);
|
|
104
|
+
}, slots: {
|
|
105
|
+
header: (b) => (_jsx(AdminWidgetSlotRenderer, { slot: "booking.details.header", props: { booking: b } })),
|
|
106
|
+
afterSummary: (b) => (_jsx(AdminWidgetSlotRenderer, { slot: "booking.details.after-summary", props: { booking: b } })),
|
|
107
|
+
financeStart: (b) => (_jsxs(_Fragment, { children: [slots?.financeStart?.(slotContext(b)), _jsx(AdminWidgetSlotRenderer, { slot: bookingDetailFinanceStartSlot, props: { ...slotContext(b) } })] })),
|
|
108
|
+
financeEnd: (b) => (_jsxs(_Fragment, { children: [slots?.financeEnd?.(slotContext(b)), _jsx(AdminWidgetSlotRenderer, { slot: bookingDetailFinanceEndSlot, props: { ...slotContext(b) } })] })),
|
|
109
|
+
invoicesTab: slots?.invoicesTab || hasInvoicesTabWidgets
|
|
110
|
+
? {
|
|
111
|
+
label: slots?.invoicesTab?.label,
|
|
112
|
+
content: (b) => (_jsxs(_Fragment, { children: [slots?.invoicesTab?.content(slotContext(b)), _jsx(AdminWidgetSlotRenderer, { slot: bookingDetailInvoicesTabSlot, props: { ...slotContext(b) } })] })),
|
|
113
|
+
}
|
|
114
|
+
: undefined,
|
|
115
|
+
documents: slots?.documents
|
|
116
|
+
? (b) => slots.documents?.(slotContext(b))
|
|
117
|
+
: () => _jsx(BookingDocumentsTable, { bookingId: id }),
|
|
118
|
+
activityExtraEvents,
|
|
119
|
+
activityTimelineFooter: actionLedgerFooter || slots?.activityTimelineFooter ? (_jsxs(_Fragment, { children: [actionLedgerFooter, slots?.activityTimelineFooter] })) : undefined,
|
|
120
|
+
} }), _jsx(Sheet, { open: Boolean(viewingInvoiceId), onOpenChange: (open) => {
|
|
121
|
+
if (!open)
|
|
122
|
+
setViewingInvoiceId(null);
|
|
123
|
+
}, children: _jsx(SheetContent, { side: "right", className: "w-full! max-w-5xl!", children: viewingInvoiceId ? (_jsx(BookingInvoiceSheet, { invoiceId: viewingInvoiceId, onOpenInvoice: (invoiceId) => {
|
|
124
|
+
setViewingInvoiceId(null);
|
|
125
|
+
navigateTo("invoice.detail", { invoiceId });
|
|
126
|
+
} })) : null }) })] }));
|
|
127
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Route-level placeholder for the booking detail page. Mirrors the
|
|
3
|
+
* canonical `BookingDetailPage` layout (header row, summary card, tab
|
|
4
|
+
* bar, two list cards) so the pending state doesn't shift the page.
|
|
5
|
+
*/
|
|
6
|
+
export declare function BookingDetailSkeleton(): import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
//# sourceMappingURL=booking-detail-skeleton.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"booking-detail-skeleton.d.ts","sourceRoot":"","sources":["../../src/admin/booking-detail-skeleton.tsx"],"names":[],"mappings":"AAGA;;;;GAIG;AACH,wBAAgB,qBAAqB,4CAUpC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Card, CardContent, CardHeader } from "@voyant-travel/ui/components/card";
|
|
3
|
+
import { Skeleton } from "@voyant-travel/ui/components/skeleton";
|
|
4
|
+
/**
|
|
5
|
+
* Route-level placeholder for the booking detail page. Mirrors the
|
|
6
|
+
* canonical `BookingDetailPage` layout (header row, summary card, tab
|
|
7
|
+
* bar, two list cards) so the pending state doesn't shift the page.
|
|
8
|
+
*/
|
|
9
|
+
export function BookingDetailSkeleton() {
|
|
10
|
+
return (_jsxs("div", { className: "flex flex-col gap-6 p-6", children: [_jsx(Header, {}), _jsx(SummaryCard, {}), _jsx(TabsBar, {}), _jsx(ListCard, { titleWidth: "w-32", rows: 3 }), _jsx(ListCard, { titleWidth: "w-28", rows: 2 })] }));
|
|
11
|
+
}
|
|
12
|
+
function Header() {
|
|
13
|
+
return (_jsxs("div", { className: "flex items-center justify-between", children: [_jsxs("div", { className: "flex items-center gap-3", children: [_jsx(Skeleton, { className: "h-7 w-44" }), _jsx(Skeleton, { className: "h-5 w-20 rounded-full" })] }), _jsx(Skeleton, { className: "h-8 w-8 rounded-md" })] }));
|
|
14
|
+
}
|
|
15
|
+
function SummaryCard() {
|
|
16
|
+
return (_jsx(Card, { children: _jsx(CardContent, { className: "grid grid-cols-2 gap-6 py-6 sm:grid-cols-4", children: Array.from({ length: 8 }).map((_, i) => (_jsxs("div", { className: "flex flex-col gap-1.5", children: [_jsx(Skeleton, { className: "h-3 w-20" }), _jsx(Skeleton, { className: "h-5 w-28" }), _jsx(Skeleton, { className: "h-3 w-12" })] }, i))) }) }));
|
|
17
|
+
}
|
|
18
|
+
function TabsBar() {
|
|
19
|
+
const widths = ["w-20", "w-20", "w-16", "w-20", "w-24", "w-16"];
|
|
20
|
+
return (_jsx("div", { className: "flex h-9 w-fit items-center gap-1 rounded-lg bg-muted p-[3px]", children: widths.map((w, i) => (_jsx(Skeleton, { className: `h-7 rounded-md ${w}` }, i))) }));
|
|
21
|
+
}
|
|
22
|
+
function ListCard({ titleWidth, rows }) {
|
|
23
|
+
return (_jsxs(Card, { children: [_jsxs(CardHeader, { className: "flex flex-row items-center justify-between", children: [_jsx(Skeleton, { className: `h-5 ${titleWidth}` }), _jsx(Skeleton, { className: "h-8 w-24" })] }), _jsx(CardContent, { className: "space-y-2", children: Array.from({ length: rows }).map((_, i) => (_jsxs("div", { className: "flex items-center justify-between rounded-md border px-3 py-3", children: [_jsxs("div", { className: "space-y-1.5", children: [_jsx(Skeleton, { className: "h-4 w-48" }), _jsx(Skeleton, { className: "h-3 w-32" })] }), _jsxs("div", { className: "flex items-center gap-2", children: [_jsx(Skeleton, { className: "h-4 w-16" }), _jsx(Skeleton, { className: "h-5 w-16 rounded-full" })] })] }, i))) })] }));
|
|
24
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export interface BookingDocumentsTableProps {
|
|
2
|
+
bookingId: string;
|
|
3
|
+
}
|
|
4
|
+
/**
|
|
5
|
+
* Unified Documents tab for a booking — flattens auto-generated legal
|
|
6
|
+
* contracts and per-traveler documents (passport, visa, insurance…) into
|
|
7
|
+
* a single DataTable that matches the rest of the booking detail tabs.
|
|
8
|
+
* Contracts render first (canonical booking docs), traveler-uploaded
|
|
9
|
+
* documents below; each contract row owns its own attachments fetch so
|
|
10
|
+
* we don't need a join endpoint server-side.
|
|
11
|
+
*/
|
|
12
|
+
export declare function BookingDocumentsTable({ bookingId, }: BookingDocumentsTableProps): React.ReactElement;
|
|
13
|
+
//# sourceMappingURL=booking-documents-table.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"booking-documents-table.d.ts","sourceRoot":"","sources":["../../src/admin/booking-documents-table.tsx"],"names":[],"mappings":"AA8CA,MAAM,WAAW,0BAA0B;IACzC,SAAS,EAAE,MAAM,CAAA;CAClB;AAmDD;;;;;;;GAOG;AACH,wBAAgB,qBAAqB,CAAC,EACpC,SAAS,GACV,EAAE,0BAA0B,GAAG,KAAK,CAAC,YAAY,CA6MjD"}
|
|
@@ -0,0 +1,259 @@
|
|
|
1
|
+
// agent-quality: file-size exception -- owner: bookings-react; existing UI surface stays co-located until a dedicated split preserves behavior and tests.
|
|
2
|
+
"use client";
|
|
3
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
4
|
+
import { useQueryClient } from "@tanstack/react-query";
|
|
5
|
+
import { useAdminNavigate, useOperatorAdminMessages } from "@voyant-travel/admin";
|
|
6
|
+
import { legalQueryKeys, useLegalContractAttachments, useLegalContracts, useVoyantLegalContext, } from "@voyant-travel/legal-react";
|
|
7
|
+
import { AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogTitle, Badge, Button, } from "@voyant-travel/ui/components";
|
|
8
|
+
import { DataTable } from "@voyant-travel/ui/components/data-table";
|
|
9
|
+
import { ArrowUpRight, Download, FileText, Loader2, Plus, RotateCw, Trash2 } from "lucide-react";
|
|
10
|
+
import { useMemo, useState } from "react";
|
|
11
|
+
import { BookingDocumentDialog } from "../components/booking-document-dialog.js";
|
|
12
|
+
import { IconActionButton } from "../components/icon-action-button.js";
|
|
13
|
+
import { StatusBadge } from "../components/status-badge.js";
|
|
14
|
+
import { useBooking, useBookingContractGenerationMutation, useBookingTravelerDocumentMutation, useBookingTravelerDocuments, useTravelers, } from "../index.js";
|
|
15
|
+
import { BookingContractDialog } from "./booking-contract-dialog.js";
|
|
16
|
+
const CONTRACT_GENERATION_FAILURE_LABELS = {
|
|
17
|
+
render_unavailable: "contractGenerationTemplateError",
|
|
18
|
+
generator_failed: "contractGenerationGeneratorFailed",
|
|
19
|
+
};
|
|
20
|
+
function resolveContractGenerationFailure(contract) {
|
|
21
|
+
const metadata = contract.metadata;
|
|
22
|
+
if (!metadata || typeof metadata !== "object" || Array.isArray(metadata)) {
|
|
23
|
+
return null;
|
|
24
|
+
}
|
|
25
|
+
const status = metadata.lastGenerationStatus;
|
|
26
|
+
if (typeof status !== "string" || status === "generated") {
|
|
27
|
+
return null;
|
|
28
|
+
}
|
|
29
|
+
return {
|
|
30
|
+
status,
|
|
31
|
+
error: typeof metadata.lastGenerationError === "string" && metadata.lastGenerationError.trim()
|
|
32
|
+
? metadata.lastGenerationError
|
|
33
|
+
: null,
|
|
34
|
+
attemptedAt: typeof metadata.lastGenerationAttemptedAt === "string"
|
|
35
|
+
? metadata.lastGenerationAttemptedAt
|
|
36
|
+
: null,
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Unified Documents tab for a booking — flattens auto-generated legal
|
|
41
|
+
* contracts and per-traveler documents (passport, visa, insurance…) into
|
|
42
|
+
* a single DataTable that matches the rest of the booking detail tabs.
|
|
43
|
+
* Contracts render first (canonical booking docs), traveler-uploaded
|
|
44
|
+
* documents below; each contract row owns its own attachments fetch so
|
|
45
|
+
* we don't need a join endpoint server-side.
|
|
46
|
+
*/
|
|
47
|
+
export function BookingDocumentsTable({ bookingId, }) {
|
|
48
|
+
const t = useOperatorAdminMessages().bookings.detail.documentsTable;
|
|
49
|
+
const [uploadOpen, setUploadOpen] = useState(false);
|
|
50
|
+
const [contractDialogOpen, setContractDialogOpen] = useState(false);
|
|
51
|
+
const [deleteTarget, setDeleteTarget] = useState(null);
|
|
52
|
+
const [deletePending, setDeletePending] = useState(false);
|
|
53
|
+
const bookingQuery = useBooking(bookingId);
|
|
54
|
+
const booking = bookingQuery.data?.data ?? null;
|
|
55
|
+
const contractsQuery = useLegalContracts({ bookingId, limit: 25 });
|
|
56
|
+
const contracts = contractsQuery.data?.data ?? [];
|
|
57
|
+
const travelerDocsQuery = useBookingTravelerDocuments(bookingId);
|
|
58
|
+
const travelerDocs = travelerDocsQuery.data?.data ?? [];
|
|
59
|
+
const travelersQuery = useTravelers(bookingId);
|
|
60
|
+
const travelersById = useMemo(() => new Map((travelersQuery.data?.data ?? []).map((tr) => [tr.id, tr])), [travelersQuery.data]);
|
|
61
|
+
const removeTravelerDoc = useBookingTravelerDocumentMutation(bookingId).remove;
|
|
62
|
+
const isLoading = bookingQuery.isLoading || contractsQuery.isLoading || travelerDocsQuery.isLoading;
|
|
63
|
+
const rows = useMemo(() => [
|
|
64
|
+
...contracts.map((contract) => ({
|
|
65
|
+
kind: "contract",
|
|
66
|
+
id: contract.id,
|
|
67
|
+
contract,
|
|
68
|
+
})),
|
|
69
|
+
...travelerDocs.map((doc) => ({
|
|
70
|
+
kind: "traveler",
|
|
71
|
+
id: doc.id,
|
|
72
|
+
doc,
|
|
73
|
+
traveler: doc.travelerId ? (travelersById.get(doc.travelerId) ?? null) : null,
|
|
74
|
+
})),
|
|
75
|
+
], [contracts, travelerDocs, travelersById]);
|
|
76
|
+
const columns = useMemo(() => [
|
|
77
|
+
{
|
|
78
|
+
id: "category",
|
|
79
|
+
header: t.headerCategory,
|
|
80
|
+
cell: ({ row }) => row.original.kind === "contract" ? (_jsx(Badge, { variant: "outline", className: "text-[10px]", children: t.contractBadge })) : (_jsx(Badge, { variant: "outline", className: "text-[10px]", children: humanizeDocType(row.original.doc.type) })),
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
id: "document",
|
|
84
|
+
header: t.headerDocument,
|
|
85
|
+
cell: ({ row }) => row.original.kind === "contract" ? (_jsx(ContractDocumentCell, { contract: row.original.contract })) : (_jsx(TravelerDocumentCell, { doc: row.original.doc })),
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
id: "for",
|
|
89
|
+
header: t.headerFor,
|
|
90
|
+
cell: ({ row }) => {
|
|
91
|
+
if (row.original.kind === "contract") {
|
|
92
|
+
return _jsx("span", { className: "text-muted-foreground text-xs", children: t.forBooking });
|
|
93
|
+
}
|
|
94
|
+
const traveler = row.original.traveler;
|
|
95
|
+
const name = traveler
|
|
96
|
+
? `${traveler.firstName ?? ""} ${traveler.lastName ?? ""}`.trim() || t.travelerFallback
|
|
97
|
+
: t.forBooking;
|
|
98
|
+
return _jsx("span", { className: "text-muted-foreground text-xs", children: name });
|
|
99
|
+
},
|
|
100
|
+
},
|
|
101
|
+
{
|
|
102
|
+
id: "status",
|
|
103
|
+
header: t.headerStatus,
|
|
104
|
+
cell: ({ row }) => row.original.kind === "contract" ? (_jsx(ContractStatusCell, { contract: row.original.contract, messages: t })) : (_jsx(TravelerStatusCell, { doc: row.original.doc, messages: t })),
|
|
105
|
+
},
|
|
106
|
+
{
|
|
107
|
+
id: "date",
|
|
108
|
+
header: t.headerDate,
|
|
109
|
+
cell: ({ row }) => row.original.kind === "contract" ? (_jsx(ContractDateCell, { contract: row.original.contract, messages: t })) : (_jsx(TravelerDateCell, { doc: row.original.doc, messages: t })),
|
|
110
|
+
},
|
|
111
|
+
{
|
|
112
|
+
id: "actions",
|
|
113
|
+
header: () => _jsx("span", { className: "sr-only", children: t.headerCategory }),
|
|
114
|
+
cell: ({ row }) => {
|
|
115
|
+
if (row.original.kind === "contract") {
|
|
116
|
+
return _jsx(ContractActionsCell, { contract: row.original.contract, messages: t });
|
|
117
|
+
}
|
|
118
|
+
const docPayload = row.original.doc;
|
|
119
|
+
return (_jsx(TravelerActionsCell, { doc: docPayload, messages: t, onDelete: () => setDeleteTarget(docPayload) }));
|
|
120
|
+
},
|
|
121
|
+
},
|
|
122
|
+
], [t]);
|
|
123
|
+
const handleDeleteConfirm = async () => {
|
|
124
|
+
if (!deleteTarget)
|
|
125
|
+
return;
|
|
126
|
+
setDeletePending(true);
|
|
127
|
+
try {
|
|
128
|
+
await removeTravelerDoc.mutateAsync(deleteTarget.id);
|
|
129
|
+
setDeleteTarget(null);
|
|
130
|
+
}
|
|
131
|
+
finally {
|
|
132
|
+
setDeletePending(false);
|
|
133
|
+
}
|
|
134
|
+
};
|
|
135
|
+
return (_jsxs("div", { "data-slot": "booking-documents-list", className: "flex flex-col gap-3", children: [_jsxs("div", { className: "flex items-center justify-between gap-3", children: [_jsxs("h2", { className: "flex items-center gap-2 text-base font-semibold", children: [_jsx(FileText, { className: "h-4 w-4 text-muted-foreground" }), t.title] }), _jsxs("div", { className: "flex items-center gap-2", children: [_jsxs(Button, { size: "sm", variant: "outline", onClick: () => setContractDialogOpen(true), disabled: !booking, children: [_jsx(FileText, { className: "mr-1.5 h-3.5 w-3.5" }), t.addContract] }), _jsxs(Button, { size: "sm", variant: "outline", onClick: () => setUploadOpen(true), children: [_jsx(Plus, { className: "mr-1 h-3.5 w-3.5" }), t.uploadDocument] })] })] }), isLoading ? (_jsxs("div", { className: "flex items-center justify-center gap-2 py-6 text-muted-foreground text-sm", children: [_jsx(Loader2, { className: "h-3.5 w-3.5 animate-spin" }), t.loading] })) : (_jsx(DataTable, { columns: columns, data: rows, emptyMessage: t.empty, showPagination: false })), _jsx(BookingDocumentDialog, { open: uploadOpen, onOpenChange: setUploadOpen, bookingId: bookingId }), _jsx(BookingContractDialog, { open: contractDialogOpen, onOpenChange: setContractDialogOpen, bookingId: bookingId, bookingNumber: booking?.bookingNumber ?? null }), _jsx(AlertDialog, { open: Boolean(deleteTarget), onOpenChange: (next) => {
|
|
136
|
+
if (!next && !deletePending)
|
|
137
|
+
setDeleteTarget(null);
|
|
138
|
+
}, children: _jsxs(AlertDialogContent, { size: "sm", children: [_jsxs(AlertDialogHeader, { children: [_jsx(AlertDialogTitle, { children: t.deleteConfirm }), deleteTarget ? (_jsx(AlertDialogDescription, { children: deleteTarget.fileName })) : null] }), _jsxs(AlertDialogFooter, { children: [_jsx(AlertDialogCancel, { disabled: deletePending, children: t.deleteCancel }), _jsx(AlertDialogAction, { variant: "destructive", disabled: deletePending, onClick: () => void handleDeleteConfirm(), children: t.deleteConfirmAction })] })] }) })] }));
|
|
139
|
+
}
|
|
140
|
+
/**
|
|
141
|
+
* Admin download URL of a contract attachment, resolved against the
|
|
142
|
+
* legal provider context so the table works in any host app without an
|
|
143
|
+
* `apiBaseUrl` prop.
|
|
144
|
+
*/
|
|
145
|
+
function useContractAttachmentDownloadHref(attachment) {
|
|
146
|
+
const { baseUrl } = useVoyantLegalContext();
|
|
147
|
+
if (!attachment)
|
|
148
|
+
return null;
|
|
149
|
+
return `${baseUrl}/v1/admin/legal/contracts/attachments/${attachment.id}/download`;
|
|
150
|
+
}
|
|
151
|
+
function ContractDocumentCell({ contract }) {
|
|
152
|
+
const attachmentsQuery = useLegalContractAttachments({ contractId: contract.id });
|
|
153
|
+
const attachments = (attachmentsQuery.data ?? []).filter((a) => a.kind === "document");
|
|
154
|
+
const latest = attachments[0] ?? null;
|
|
155
|
+
const downloadHref = useContractAttachmentDownloadHref(latest);
|
|
156
|
+
const titleText = latest?.name ?? contract.contractNumber ?? `Contract ${contract.id.slice(-8)}`;
|
|
157
|
+
return downloadHref ? (_jsxs("a", { href: downloadHref, target: "_blank", rel: "noopener noreferrer", className: "inline-flex items-center gap-1.5 text-primary hover:underline", children: [_jsx(FileText, { className: "h-3.5 w-3.5 shrink-0 opacity-60" }), _jsx("span", { className: "truncate", children: titleText }), _jsx(ArrowUpRight, { className: "h-3 w-3" }), latest?.fileSize != null ? (_jsx("span", { className: "ml-1 text-muted-foreground text-xs", children: formatBytes(latest.fileSize) })) : null] })) : (_jsxs("span", { className: "inline-flex items-center gap-1.5 text-muted-foreground", children: [_jsx(FileText, { className: "h-3.5 w-3.5 shrink-0 opacity-60" }), titleText] }));
|
|
158
|
+
}
|
|
159
|
+
function TravelerDocumentCell({ doc }) {
|
|
160
|
+
return (_jsxs("a", { href: doc.fileUrl, target: "_blank", rel: "noopener noreferrer", className: "inline-flex items-center gap-1.5 text-primary hover:underline", children: [_jsx(FileText, { className: "h-3.5 w-3.5 shrink-0 opacity-60" }), _jsx("span", { className: "truncate", children: doc.fileName }), _jsx(ArrowUpRight, { className: "h-3 w-3" })] }));
|
|
161
|
+
}
|
|
162
|
+
function ContractStatusCell({ contract, messages, }) {
|
|
163
|
+
const generationFailure = resolveContractGenerationFailure(contract);
|
|
164
|
+
if (generationFailure) {
|
|
165
|
+
const failureLabelKey = CONTRACT_GENERATION_FAILURE_LABELS[generationFailure.status];
|
|
166
|
+
const failureLabel = failureLabelKey
|
|
167
|
+
? messages[failureLabelKey]
|
|
168
|
+
: messages.contractGenerationFailed;
|
|
169
|
+
return (_jsxs("div", { className: "max-w-80 space-y-1", children: [_jsx(StatusBadge, { status: "failed", children: failureLabel }), _jsx("p", { className: "text-muted-foreground text-xs", children: generationFailure.error ?? messages.contractGenerationErrorFallback })] }));
|
|
170
|
+
}
|
|
171
|
+
return _jsx(StatusBadge, { status: contract.status, children: contract.status.replace(/_/g, " ") });
|
|
172
|
+
}
|
|
173
|
+
function TravelerStatusCell({ doc, messages, }) {
|
|
174
|
+
const isExpired = doc.expiresAt && Number.isFinite(new Date(doc.expiresAt).getTime())
|
|
175
|
+
? new Date(doc.expiresAt).getTime() < Date.now()
|
|
176
|
+
: false;
|
|
177
|
+
return (_jsx(StatusBadge, { status: isExpired ? "expired" : "active", children: isExpired ? messages.travelerStatusExpired : messages.travelerStatusOnFile }));
|
|
178
|
+
}
|
|
179
|
+
function ContractDateCell({ contract, messages, }) {
|
|
180
|
+
const generationFailure = resolveContractGenerationFailure(contract);
|
|
181
|
+
const attachmentsQuery = useLegalContractAttachments({ contractId: contract.id });
|
|
182
|
+
const attachments = (attachmentsQuery.data ?? []).filter((a) => a.kind === "document");
|
|
183
|
+
const hasDocument = attachments.length > 0;
|
|
184
|
+
const dateIso = generationFailure?.attemptedAt ?? contract.issuedAt ?? contract.createdAt ?? null;
|
|
185
|
+
const dateLabel = generationFailure
|
|
186
|
+
? messages.contractGenerationAttemptedLabel
|
|
187
|
+
: hasDocument
|
|
188
|
+
? messages.contractIssuedLabel
|
|
189
|
+
: messages.contractPendingSinceLabel;
|
|
190
|
+
if (!dateIso)
|
|
191
|
+
return _jsx("span", { className: "text-muted-foreground text-xs", children: "\u2014" });
|
|
192
|
+
return (_jsxs("span", { className: "text-muted-foreground text-xs", children: [_jsxs("span", { className: "opacity-60", children: [dateLabel, " "] }), formatDate(dateIso)] }));
|
|
193
|
+
}
|
|
194
|
+
function TravelerDateCell({ doc, messages, }) {
|
|
195
|
+
const dateIso = doc.expiresAt ?? doc.createdAt ?? null;
|
|
196
|
+
const dateLabel = doc.expiresAt ? messages.travelerExpiresLabel : messages.travelerUploadedLabel;
|
|
197
|
+
if (!dateIso)
|
|
198
|
+
return _jsx("span", { className: "text-muted-foreground text-xs", children: "\u2014" });
|
|
199
|
+
return (_jsxs("span", { className: "text-muted-foreground text-xs", children: [_jsxs("span", { className: "opacity-60", children: [dateLabel, " "] }), formatDate(dateIso)] }));
|
|
200
|
+
}
|
|
201
|
+
function ContractActionsCell({ contract, messages, }) {
|
|
202
|
+
const queryClient = useQueryClient();
|
|
203
|
+
const navigateTo = useAdminNavigate();
|
|
204
|
+
const attachmentsQuery = useLegalContractAttachments({ contractId: contract.id });
|
|
205
|
+
const attachments = (attachmentsQuery.data ?? []).filter((a) => a.kind === "document");
|
|
206
|
+
const latest = attachments[0] ?? null;
|
|
207
|
+
const hasDocument = latest !== null;
|
|
208
|
+
const downloadHref = useContractAttachmentDownloadHref(latest);
|
|
209
|
+
const { generate } = useBookingContractGenerationMutation(contract.bookingId ?? "");
|
|
210
|
+
return (_jsxs("div", { className: "flex items-center justify-end gap-1", children: [_jsx(IconActionButton, { label: messages.contractOpenTooltip, icon: _jsx(ArrowUpRight, { className: "h-3.5 w-3.5" }), onClick: (e) => {
|
|
211
|
+
e.stopPropagation();
|
|
212
|
+
navigateTo("contract.detail", { contractId: contract.id });
|
|
213
|
+
} }), downloadHref ? (_jsx(IconActionButton, { label: messages.downloadDocumentAria, icon: _jsx(Download, { className: "h-3.5 w-3.5" }), onClick: (e) => {
|
|
214
|
+
e.stopPropagation();
|
|
215
|
+
window.open(downloadHref, "_blank", "noopener,noreferrer");
|
|
216
|
+
} })) : null, _jsx(IconActionButton, { label: hasDocument ? messages.contractRegenerateTooltip : messages.contractGenerateTooltip, icon: generate.isPending ? (_jsx(Loader2, { className: "h-3.5 w-3.5 animate-spin" })) : (_jsx(RotateCw, { className: "h-3.5 w-3.5" })), disabled: generate.isPending || !contract.bookingId, onClick: (e) => {
|
|
217
|
+
e.stopPropagation();
|
|
218
|
+
if (!contract.bookingId)
|
|
219
|
+
return;
|
|
220
|
+
generate.mutate({ force: hasDocument }, {
|
|
221
|
+
onSuccess: () => {
|
|
222
|
+
void queryClient.invalidateQueries({ queryKey: legalQueryKeys.contracts() });
|
|
223
|
+
},
|
|
224
|
+
});
|
|
225
|
+
} })] }));
|
|
226
|
+
}
|
|
227
|
+
function TravelerActionsCell({ doc, messages, onDelete, }) {
|
|
228
|
+
return (_jsxs("div", { className: "flex items-center justify-end gap-1", children: [_jsx(IconActionButton, { label: messages.downloadDocumentAria, icon: _jsx(Download, { className: "h-3.5 w-3.5" }), onClick: (e) => {
|
|
229
|
+
e.stopPropagation();
|
|
230
|
+
window.open(doc.fileUrl, "_blank", "noopener,noreferrer");
|
|
231
|
+
} }), _jsx(IconActionButton, { label: messages.deleteDocumentAria, icon: _jsx(Trash2, { className: "h-3.5 w-3.5" }), className: "text-muted-foreground hover:bg-destructive/10 hover:text-destructive", onClick: (e) => {
|
|
232
|
+
e.stopPropagation();
|
|
233
|
+
onDelete();
|
|
234
|
+
} })] }));
|
|
235
|
+
}
|
|
236
|
+
function humanizeDocType(type) {
|
|
237
|
+
return type
|
|
238
|
+
.split("_")
|
|
239
|
+
.map((part) => part.charAt(0).toUpperCase() + part.slice(1))
|
|
240
|
+
.join(" ");
|
|
241
|
+
}
|
|
242
|
+
function formatBytes(bytes) {
|
|
243
|
+
if (bytes < 1024)
|
|
244
|
+
return `${bytes} B`;
|
|
245
|
+
if (bytes < 1024 * 1024)
|
|
246
|
+
return `${Math.round(bytes / 1024)} KB`;
|
|
247
|
+
return `${(bytes / (1024 * 1024)).toFixed(1)} MB`;
|
|
248
|
+
}
|
|
249
|
+
function formatDate(iso) {
|
|
250
|
+
try {
|
|
251
|
+
const d = new Date(iso);
|
|
252
|
+
if (!Number.isFinite(d.getTime()))
|
|
253
|
+
return iso;
|
|
254
|
+
return d.toLocaleDateString(undefined, { day: "numeric", month: "short", year: "numeric" });
|
|
255
|
+
}
|
|
256
|
+
catch {
|
|
257
|
+
return iso;
|
|
258
|
+
}
|
|
259
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export interface BookingInvoiceSheetProps {
|
|
2
|
+
invoiceId: string;
|
|
3
|
+
/** Navigate to the full invoice detail page. */
|
|
4
|
+
onOpenInvoice?: (invoiceId: string) => void;
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* Compact invoice view designed to live inside a `Sheet` next to the
|
|
8
|
+
* booking detail page. Unlike `InvoiceDetailPage` (a standalone page
|
|
9
|
+
* with breadcrumb + action bar + collapsible cards), this component
|
|
10
|
+
* trims the chrome and focuses on the operator's reconciliation needs:
|
|
11
|
+
* summary numbers, line items, payments. Big actions (edit, void)
|
|
12
|
+
* stay on the dedicated invoice page.
|
|
13
|
+
*
|
|
14
|
+
* Packaged host piece (packaged-admin RFC Phase 3): API base URL comes
|
|
15
|
+
* from the shell's finance provider context — no app env import.
|
|
16
|
+
*/
|
|
17
|
+
export declare function BookingInvoiceSheet({ invoiceId, onOpenInvoice }: BookingInvoiceSheetProps): import("react/jsx-runtime").JSX.Element;
|
|
18
|
+
//# sourceMappingURL=booking-invoice-sheet.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"booking-invoice-sheet.d.ts","sourceRoot":"","sources":["../../src/admin/booking-invoice-sheet.tsx"],"names":[],"mappings":"AA8BA,MAAM,WAAW,wBAAwB;IACvC,SAAS,EAAE,MAAM,CAAA;IACjB,gDAAgD;IAChD,aAAa,CAAC,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,IAAI,CAAA;CAC5C;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,mBAAmB,CAAC,EAAE,SAAS,EAAE,aAAa,EAAE,EAAE,wBAAwB,2CAwTzF"}
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { useLocale, useOperatorAdminMessages } from "@voyant-travel/admin";
|
|
4
|
+
import { useInvoice, useInvoiceAttachments, useInvoiceLineItems, useInvoiceMutation, useInvoicePayments, useVoyantFinanceContext, } from "@voyant-travel/finance-react";
|
|
5
|
+
import { AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogTitle, Button, SheetHeader, SheetTitle, } from "@voyant-travel/ui/components";
|
|
6
|
+
import { ArrowRightLeft, ArrowUpRight, Download, FileText, Loader2 } from "lucide-react";
|
|
7
|
+
import { useState } from "react";
|
|
8
|
+
import { StatusBadge } from "../components/status-badge.js";
|
|
9
|
+
/**
|
|
10
|
+
* Compact invoice view designed to live inside a `Sheet` next to the
|
|
11
|
+
* booking detail page. Unlike `InvoiceDetailPage` (a standalone page
|
|
12
|
+
* with breadcrumb + action bar + collapsible cards), this component
|
|
13
|
+
* trims the chrome and focuses on the operator's reconciliation needs:
|
|
14
|
+
* summary numbers, line items, payments. Big actions (edit, void)
|
|
15
|
+
* stay on the dedicated invoice page.
|
|
16
|
+
*
|
|
17
|
+
* Packaged host piece (packaged-admin RFC Phase 3): API base URL comes
|
|
18
|
+
* from the shell's finance provider context — no app env import.
|
|
19
|
+
*/
|
|
20
|
+
export function BookingInvoiceSheet({ invoiceId, onOpenInvoice }) {
|
|
21
|
+
const { resolvedLocale } = useLocale();
|
|
22
|
+
const adminMessages = useOperatorAdminMessages();
|
|
23
|
+
const messages = adminMessages.bookings.detail.invoiceSheet;
|
|
24
|
+
const financeMessages = adminMessages.finance;
|
|
25
|
+
const { data: invoiceData, isPending: invoicePending } = useInvoice(invoiceId);
|
|
26
|
+
const { data: lineItemsData, isPending: lineItemsPending } = useInvoiceLineItems(invoiceId);
|
|
27
|
+
const { data: paymentsData, isPending: paymentsPending } = useInvoicePayments(invoiceId);
|
|
28
|
+
const { data: attachmentsData, isPending: attachmentsPending } = useInvoiceAttachments(invoiceId);
|
|
29
|
+
const { convertToInvoice } = useInvoiceMutation();
|
|
30
|
+
const [confirmConvert, setConfirmConvert] = useState(false);
|
|
31
|
+
if (invoicePending) {
|
|
32
|
+
return (_jsxs(_Fragment, { children: [_jsx(SheetHeader, { children: _jsx(SheetTitle, { children: messages.invoiceTypes.invoice }) }), _jsx("div", { className: "flex flex-1 items-center justify-center py-12", children: _jsx(Loader2, { className: "h-5 w-5 animate-spin text-muted-foreground" }) })] }));
|
|
33
|
+
}
|
|
34
|
+
const invoice = invoiceData?.data;
|
|
35
|
+
if (!invoice) {
|
|
36
|
+
return (_jsxs(_Fragment, { children: [_jsx(SheetHeader, { children: _jsx(SheetTitle, { children: messages.invoiceTypes.invoice }) }), _jsx("div", { className: "p-6 text-sm text-muted-foreground", children: messages.notFound })] }));
|
|
37
|
+
}
|
|
38
|
+
const invoiceType = invoice.invoiceType ?? "invoice";
|
|
39
|
+
const sheetTitle = messages.invoiceTypes[invoiceType] ?? messages.invoiceTypes.invoice;
|
|
40
|
+
const canConvert = invoiceType === "proforma" && invoice.status !== "void";
|
|
41
|
+
// A void proforma with a `convertedToInvoiceId` is "Invoiced" in the
|
|
42
|
+
// operator's mental model — the void is purely how our DB models the
|
|
43
|
+
// hand-off. Display the friendlier label and link to the final
|
|
44
|
+
// invoice on the same sheet (no extra navigation).
|
|
45
|
+
const convertedToInvoiceId = invoice.convertedToInvoiceId ?? null;
|
|
46
|
+
const convertedToInvoiceNumber = invoice.convertedToInvoiceNumber ?? null;
|
|
47
|
+
const showAsInvoiced = invoiceType === "proforma" && invoice.status === "void" && Boolean(convertedToInvoiceId);
|
|
48
|
+
const displayStatusKey = showAsInvoiced ? "invoiced" : invoice.status;
|
|
49
|
+
const displayStatusLabel = showAsInvoiced
|
|
50
|
+
? (messages.invoiceStatusLabels.invoiced ??
|
|
51
|
+
financeMessages.invoiceStatusInvoiced ??
|
|
52
|
+
"Invoiced")
|
|
53
|
+
: (messages.invoiceStatusLabels[invoice.status] ??
|
|
54
|
+
invoice.status);
|
|
55
|
+
const lineItems = lineItemsData?.data ?? [];
|
|
56
|
+
const payments = paymentsData?.data ?? [];
|
|
57
|
+
const formatMoney = makeFormatMoney(resolvedLocale, invoice.currency);
|
|
58
|
+
const formatDate = (iso) => iso ? new Date(iso).toLocaleDateString(resolvedLocale, { dateStyle: "medium" }) : "—";
|
|
59
|
+
const formatDateTime = (iso) => iso
|
|
60
|
+
? new Date(iso).toLocaleString(resolvedLocale, {
|
|
61
|
+
dateStyle: "medium",
|
|
62
|
+
timeStyle: "short",
|
|
63
|
+
})
|
|
64
|
+
: "—";
|
|
65
|
+
return (_jsxs(_Fragment, { children: [_jsx(SheetHeader, { children: _jsx(SheetTitle, { children: sheetTitle }) }), _jsxs("div", { className: "flex-1 overflow-y-auto px-6 pb-6", children: [_jsxs("header", { className: "mb-6 flex flex-col gap-3 border-b pb-4", children: [_jsxs("div", { className: "flex flex-wrap items-center justify-between gap-3", children: [_jsxs("div", { className: "flex flex-wrap items-center gap-2", children: [_jsx("span", { className: "font-mono text-base font-semibold", children: invoice.invoiceNumber }), _jsx(StatusBadge, { status: showAsInvoiced ? "paid" : invoice.status, children: displayStatusLabel }), showAsInvoiced && convertedToInvoiceId ? (_jsxs("button", { type: "button", onClick: () => onOpenInvoice?.(convertedToInvoiceId), className: "inline-flex items-center gap-1 font-mono text-xs text-primary hover:underline", title: messages.convertedToInvoiceTitle, children: ["\u2192 ", convertedToInvoiceNumber ?? displayStatusKey, _jsx(ArrowUpRight, { className: "h-3 w-3" })] })) : null] }), _jsxs("div", { className: "flex items-center gap-2", children: [canConvert ? (_jsxs(Button, { variant: "outline", size: "sm", disabled: convertToInvoice.isPending, onClick: () => setConfirmConvert(true), children: [_jsx(ArrowRightLeft, { className: "mr-1 h-3.5 w-3.5" }), financeMessages.convertToInvoice] })) : null, onOpenInvoice ? (_jsxs(Button, { size: "sm", onClick: () => onOpenInvoice(invoiceId), children: [messages.openInvoice, _jsx(ArrowUpRight, { className: "ml-1 h-3.5 w-3.5" })] })) : null] })] }), invoice.notes ? (_jsx("p", { className: "whitespace-pre-wrap text-sm text-muted-foreground", children: invoice.notes })) : null] }), _jsxs("section", { className: "mb-6", children: [_jsx("h3", { className: "mb-3 text-xs font-medium uppercase tracking-wide text-muted-foreground", children: messages.summarySection }), _jsxs("dl", { className: "rounded-md border divide-y", children: [_jsx(SummaryRow, { label: messages.subtotal, value: formatMoney(invoice.subtotalCents) }), _jsx(SummaryRow, { label: messages.tax, value: formatMoney(invoice.taxCents) }), _jsx(SummaryRow, { label: messages.total, value: formatMoney(invoice.totalCents), emphasis: true }), _jsx(SummaryRow, { label: messages.paid, value: formatMoney(invoice.paidCents) }), _jsx(SummaryRow, { label: messages.balanceDue, value: formatMoney(invoice.balanceDueCents), emphasis: invoice.balanceDueCents > 0 })] })] }), _jsxs("section", { className: "mb-6 grid grid-cols-1 gap-3 sm:grid-cols-2", children: [_jsx(DatesCard, { label: messages.issueDate, value: formatDate(invoice.issueDate) }), _jsx(DatesCard, { label: messages.dueDate, value: formatDate(invoice.dueDate) }), _jsx(DatesCard, { label: messages.createdAt, value: formatDateTime(invoice.createdAt) }), _jsx(DatesCard, { label: messages.updatedAt, value: formatDateTime(invoice.updatedAt) })] }), _jsxs("section", { className: "mb-6", children: [_jsx("h3", { className: "mb-3 text-xs font-medium uppercase tracking-wide text-muted-foreground", children: messages.lineItemsSection }), lineItemsPending ? (_jsxs("div", { className: "flex items-center gap-2 rounded-md border p-3 text-sm text-muted-foreground", children: [_jsx(Loader2, { className: "h-3.5 w-3.5 animate-spin" }), messages.loading] })) : lineItems.length === 0 ? (_jsx("p", { className: "rounded-md border py-4 text-center text-sm text-muted-foreground", children: messages.lineItemsEmpty })) : (_jsx("div", { className: "overflow-hidden rounded-md border", children: _jsxs("table", { className: "w-full text-sm", children: [_jsx("thead", { className: "bg-muted/50", children: _jsxs("tr", { className: "border-b text-muted-foreground", children: [_jsx("th", { className: "px-3 py-2 text-left font-medium", children: messages.colDescription }), _jsx("th", { className: "px-3 py-2 text-right font-medium", children: messages.colQty }), _jsx("th", { className: "px-3 py-2 text-right font-medium", children: messages.colUnitPrice }), _jsx("th", { className: "px-3 py-2 text-right font-medium", children: messages.colTax }), _jsx("th", { className: "px-3 py-2 text-right font-medium", children: messages.colLineTotal })] }) }), _jsx("tbody", { children: lineItems.map((line) => {
|
|
66
|
+
const taxAmountCents = line.taxRate != null
|
|
67
|
+
? Math.round((line.totalCents * line.taxRate) / 100)
|
|
68
|
+
: null;
|
|
69
|
+
return (_jsxs("tr", { className: "border-b last:border-b-0", children: [_jsx("td", { className: "px-3 py-2", children: line.description }), _jsx("td", { className: "px-3 py-2 text-right font-mono", children: line.quantity }), _jsx("td", { className: "px-3 py-2 text-right font-mono", children: formatMoney(line.unitPriceCents) }), _jsx("td", { className: "px-3 py-2 text-right font-mono", children: taxAmountCents != null && line.taxRate != null ? (_jsxs(_Fragment, { children: [formatMoney(taxAmountCents), " ", _jsxs("span", { className: "text-muted-foreground", children: ["(", line.taxRate, "%)"] })] })) : ("—") }), _jsx("td", { className: "px-3 py-2 text-right font-mono", children: formatMoney(line.totalCents) })] }, line.id));
|
|
70
|
+
}) })] }) }))] }), _jsxs("section", { children: [_jsx("h3", { className: "mb-3 text-xs font-medium uppercase tracking-wide text-muted-foreground", children: messages.paymentsSection }), paymentsPending ? (_jsxs("div", { className: "flex items-center gap-2 rounded-md border p-3 text-sm text-muted-foreground", children: [_jsx(Loader2, { className: "h-3.5 w-3.5 animate-spin" }), messages.loading] })) : payments.length === 0 ? (_jsx("p", { className: "rounded-md border py-4 text-center text-sm text-muted-foreground", children: messages.paymentsEmpty })) : (_jsx("div", { className: "overflow-hidden rounded-md border", children: _jsxs("table", { className: "w-full text-sm", children: [_jsx("thead", { className: "bg-muted/50", children: _jsxs("tr", { className: "border-b text-muted-foreground", children: [_jsx("th", { className: "px-3 py-2 text-left font-medium", children: messages.colDate }), _jsx("th", { className: "px-3 py-2 text-left font-medium", children: messages.colMethod }), _jsx("th", { className: "px-3 py-2 text-left font-medium", children: messages.colStatus }), _jsx("th", { className: "px-3 py-2 text-left font-medium", children: messages.colReference }), _jsx("th", { className: "px-3 py-2 text-right font-medium", children: messages.colAmount })] }) }), _jsx("tbody", { children: payments.map((payment) => (_jsxs("tr", { className: "border-b last:border-b-0", children: [_jsx("td", { className: "px-3 py-2", children: formatDateTime(payment.paymentDate) }), _jsx("td", { className: "px-3 py-2 capitalize", children: payment.paymentMethod.replaceAll("_", " ") }), _jsx("td", { className: "px-3 py-2", children: _jsx(StatusBadge, { status: payment.status, children: payment.status }) }), _jsx("td", { className: "px-3 py-2 font-mono text-xs text-muted-foreground", children: payment.referenceNumber ?? "—" }), _jsx("td", { className: "px-3 py-2 text-right font-mono font-medium", children: formatMoney(payment.amountCents) })] }, payment.id))) })] }) }))] }), _jsxs("section", { className: "mt-6", children: [_jsx("h3", { className: "mb-3 text-xs font-medium uppercase tracking-wide text-muted-foreground", children: messages.attachmentsSection }), attachmentsPending ? (_jsxs("div", { className: "flex items-center gap-2 rounded-md border p-3 text-sm text-muted-foreground", children: [_jsx(Loader2, { className: "h-3.5 w-3.5 animate-spin" }), messages.loading] })) : (attachmentsData?.data ?? []).length === 0 ? (_jsx("p", { className: "rounded-md border py-4 text-center text-sm text-muted-foreground", children: messages.attachmentsEmpty })) : (_jsx("ul", { className: "flex flex-col divide-y rounded-md border", children: (attachmentsData?.data ?? []).map((attachment) => (_jsx(AttachmentRow, { attachment: attachment, downloadLabel: messages.attachmentDownload }, attachment.id))) }))] })] }), _jsx(AlertDialog, { open: confirmConvert, onOpenChange: (next) => {
|
|
71
|
+
if (!next && !convertToInvoice.isPending)
|
|
72
|
+
setConfirmConvert(false);
|
|
73
|
+
}, children: _jsxs(AlertDialogContent, { size: "sm", children: [_jsxs(AlertDialogHeader, { children: [_jsx(AlertDialogTitle, { children: financeMessages.convertToInvoice }), _jsx(AlertDialogDescription, { children: financeMessages.convertConfirm })] }), _jsxs(AlertDialogFooter, { children: [_jsx(AlertDialogCancel, { disabled: convertToInvoice.isPending, children: financeMessages.detailPage.cancel }), _jsx(AlertDialogAction, { disabled: convertToInvoice.isPending, onClick: () => {
|
|
74
|
+
convertToInvoice.mutate({ id: invoiceId }, { onSuccess: () => setConfirmConvert(false) });
|
|
75
|
+
}, children: financeMessages.convertToInvoice })] })] }) })] }));
|
|
76
|
+
}
|
|
77
|
+
function AttachmentRow({ attachment, downloadLabel, }) {
|
|
78
|
+
// Same admin endpoint the finance invoice page links to; the base URL
|
|
79
|
+
// comes from the finance provider context instead of an app env helper.
|
|
80
|
+
const { baseUrl } = useVoyantFinanceContext();
|
|
81
|
+
const trimmedBase = baseUrl.endsWith("/") ? baseUrl.slice(0, -1) : baseUrl;
|
|
82
|
+
const href = `${trimmedBase}/v1/admin/finance/invoice-attachments/${attachment.id}/download`;
|
|
83
|
+
const sizeKb = typeof attachment.fileSize === "number" ? `${Math.round(attachment.fileSize / 1024)} KB` : null;
|
|
84
|
+
return (_jsxs("li", { className: "flex items-center justify-between gap-3 px-3 py-2 text-sm", children: [_jsxs("div", { className: "flex min-w-0 items-center gap-2", children: [_jsx(FileText, { className: "h-4 w-4 shrink-0 text-muted-foreground", "aria-hidden": "true" }), _jsxs("div", { className: "flex min-w-0 flex-col", children: [_jsx("span", { className: "truncate", children: attachment.name }), _jsxs("span", { className: "text-muted-foreground text-xs uppercase", children: [attachment.kind, sizeKb ? ` · ${sizeKb}` : null] })] })] }), _jsxs("a", { href: href, target: "_blank", rel: "noopener noreferrer", className: "inline-flex items-center gap-1 rounded-md px-2 py-1 text-xs text-muted-foreground hover:bg-muted hover:text-foreground", children: [_jsx(Download, { className: "h-3.5 w-3.5" }), downloadLabel] })] }));
|
|
85
|
+
}
|
|
86
|
+
function SummaryRow({ label, value, emphasis, }) {
|
|
87
|
+
return (_jsxs("div", { className: "flex items-baseline justify-between gap-4 px-4 py-2.5 text-sm", children: [_jsx("dt", { className: emphasis ? "font-semibold" : "text-muted-foreground", children: label }), _jsx("dd", { className: emphasis ? "font-mono text-base font-semibold" : "font-mono", children: value })] }));
|
|
88
|
+
}
|
|
89
|
+
function DatesCard({ label, value }) {
|
|
90
|
+
return (_jsxs("div", { className: "rounded-md border p-3", children: [_jsx("div", { className: "mb-0.5 text-xs uppercase tracking-wide text-muted-foreground", children: label }), _jsx("div", { className: "text-sm", children: value })] }));
|
|
91
|
+
}
|
|
92
|
+
function makeFormatMoney(locale, currency) {
|
|
93
|
+
return (cents) => {
|
|
94
|
+
try {
|
|
95
|
+
return new Intl.NumberFormat(locale, { style: "currency", currency }).format(cents / 100);
|
|
96
|
+
}
|
|
97
|
+
catch {
|
|
98
|
+
return `${(cents / 100).toFixed(2)} ${currency}`;
|
|
99
|
+
}
|
|
100
|
+
};
|
|
101
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
export interface BookingJourneyHostProps {
|
|
2
|
+
entityModule: string;
|
|
3
|
+
entityId: string;
|
|
4
|
+
/** Usually omitted — the server resolves provenance from `(module, id)`. */
|
|
5
|
+
sourceKind?: string;
|
|
6
|
+
sourceConnectionId?: string;
|
|
7
|
+
sourceRef?: string;
|
|
8
|
+
departureId?: string;
|
|
9
|
+
/** Free-form departure date (ISO) for sourced products with no slot id. */
|
|
10
|
+
departureDate?: string;
|
|
11
|
+
optionId?: string;
|
|
12
|
+
/** Sourced stays/package rate pin — the exact room + rate plan to re-resolve. */
|
|
13
|
+
roomTypeId?: string;
|
|
14
|
+
ratePlanId?: string;
|
|
15
|
+
board?: string;
|
|
16
|
+
/** Preview hints (name + hero image) for sourced entities, which aren't in
|
|
17
|
+
* the owned products table. */
|
|
18
|
+
entityName?: string;
|
|
19
|
+
entityImageUrl?: string;
|
|
20
|
+
draftId: string;
|
|
21
|
+
className?: string;
|
|
22
|
+
}
|
|
23
|
+
export declare function BookingJourneyHost({ entityModule, entityId, sourceKind, sourceConnectionId, sourceRef, departureId, departureDate, optionId, roomTypeId, ratePlanId, board, entityName, entityImageUrl, draftId, className, }: BookingJourneyHostProps): React.ReactElement;
|
|
24
|
+
//# sourceMappingURL=booking-journey-host.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"booking-journey-host.d.ts","sourceRoot":"","sources":["../../src/admin/booking-journey-host.tsx"],"names":[],"mappings":"AAuDA,MAAM,WAAW,uBAAuB;IACtC,YAAY,EAAE,MAAM,CAAA;IACpB,QAAQ,EAAE,MAAM,CAAA;IAChB,4EAA4E;IAC5E,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,kBAAkB,CAAC,EAAE,MAAM,CAAA;IAC3B,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,2EAA2E;IAC3E,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,iFAAiF;IACjF,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd;oCACgC;IAChC,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB,OAAO,EAAE,MAAM,CAAA;IACf,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB;AAED,wBAAgB,kBAAkB,CAAC,EACjC,YAAY,EACZ,QAAQ,EACR,UAAU,EACV,kBAAkB,EAClB,SAAS,EACT,WAAW,EACX,aAAa,EACb,QAAQ,EACR,UAAU,EACV,UAAU,EACV,KAAK,EACL,UAAU,EACV,cAAc,EACd,OAAO,EACP,SAAS,GACV,EAAE,uBAAuB,GAAG,KAAK,CAAC,YAAY,CAqG9C"}
|