import { type AdminExtension, type SelectedAdminExtensionFactoryContext } from "@voyant-travel/admin"; import { z } from "zod"; import type { BookingDetailTabValue } from "../components/booking-detail-page.js"; import type { BookingListFiltersState } from "../components/booking-list.js"; /** * Semantic destinations the bookings admin surfaces navigate to * (packaged-admin RFC §4.7). The booking pages link into routes they do not * own — the CRM person/organization pages, the product editor, the finance * payment/invoice pages — so instead of importing a host route tree they * resolve these keys through `useAdminHref`/`useAdminNavigate` from * `@voyant-travel/admin`. Hosts register one resolver per key * (`satisfies AdminDestinationResolvers`). * * `booking.detail`/`booking.list` are declared here even * though bookings pages are their first consumers: other domains' packaged * pages navigate TO bookings through the same keys. */ declare module "@voyant-travel/admin" { interface AdminDestinations { /** The bookings list page. */ "booking.list": Record; /** The focused manual booking creation page. */ "booking.create": { productId?: string; slotId?: string; }; /** A booking's detail page; `tab` deep-links a specific tab. */ "booking.detail": { bookingId: string; tab?: BookingDetailTabValue; }; /** A CRM person's detail page. */ "person.detail": { personId: string; }; /** A CRM organization's detail page. */ "organization.detail": { organizationId: string; }; /** * The owned-product editor/detail page. Also declared by * `@voyant-travel/catalog-react/admin` — interface merging requires the member * shape to stay identical across packages. */ "product.detail": { productId: string; }; /** An availability slot's detail page. */ "availabilitySlot.detail": { slotId: string; }; /** * The trips's "new trip" entry. Declared here because the * packaged `/bookings/compose` alias route forwards to it — the composer * pages themselves live in the trips area, whose admin entry * may also declare this key (interface merging requires the member shape * to stay identical across packages). */ "trip.create": Record; /** A payment's detail page in the finance area. */ "payment.detail": { paymentId: string; }; /** An invoice's full detail page in the finance area. */ "invoice.detail": { invoiceId: string; }; /** * A legal contract's detail page. Also declared by * `@voyant-travel/legal-react/admin` — interface merging requires the member * shape to stay identical across packages. Declared here because the * booking Documents tab links contract rows to their detail page. */ "contract.detail": { contractId: string; }; } } export type { BookingDetailHostProps, BookingDetailHostSlot, BookingDetailHostSlotContext, BookingDetailHostSlots, BookingDetailPaymentActions, BookingDetailPaymentControllerSlotContext, } from "./booking-detail-host.js"; export { BookingDetailSkeleton } from "./booking-detail-skeleton.js"; export type { BookingDocumentsTableProps } from "./booking-documents-table.js"; export type { BookingInvoiceSheetProps } from "./booking-invoice-sheet.js"; export type { BookingsHostProps } from "./bookings-host.js"; export { BookingsListSkeleton } from "./bookings-list-skeleton.js"; export type { PersonBookingsWidgetProps } from "./person-bookings-widget.js"; export { bookingDetailFinanceEndSlot, bookingDetailFinanceStartSlot, bookingDetailInvoicesTabSlot, bookingDetailPaymentControllerSlot, bookingsListHeaderActionsSlot, } from "./slots.js"; /** * Search contract for the bookings list page: the URL projection of * `BookingListFiltersState` (filters, sort, paging). Package-owned so the * route file, the host, and the extension contribution validate the same * shape. Defaults are absent from the URL — see * {@link bookingsFiltersToSearch}. */ export declare const bookingsIndexSearchSchema: z.ZodObject<{ search: z.ZodOptional; status: z.ZodOptional; productId: z.ZodOptional; optionId: z.ZodOptional; supplierId: z.ZodOptional; productCategoryId: z.ZodOptional; personId: z.ZodOptional; organizationId: z.ZodOptional; availabilitySlotId: z.ZodOptional; dateFrom: z.ZodOptional; dateTo: z.ZodOptional; paxMin: z.ZodOptional; paxMax: z.ZodOptional; sortBy: z.ZodOptional>; sortDir: z.ZodOptional>; offset: z.ZodOptional>; }, z.core.$strip>; export type BookingsIndexSearchParams = z.infer; /** Search contract for the focused manual booking create page. */ export declare const bookingNewSearchSchema: z.ZodObject<{ productId: z.ZodOptional; slotId: z.ZodOptional; }, z.core.$strip>; export type BookingNewSearchParams = z.infer; /** URL search params → `BookingList` initial state. Empty / `"all"` / * default values are absent in the URL; we let `BookingList`'s defaults * fill them in. */ export declare function bookingsSearchToFilters(search: BookingsIndexSearchParams): Partial; /** Project the filter snapshot back into URL search params, dropping * any value that matches the component's default so the URL stays * clean when the operator is viewing the unfiltered list. */ export declare function bookingsFiltersToSearch(filters: BookingListFiltersState): BookingsIndexSearchParams; /** Tab values of the canonical `BookingDetailPage`, as a search-param schema. */ export declare const bookingDetailTabSchema: z.ZodEnum<{ metadata: "metadata"; items: "items"; travelers: "travelers"; activity: "activity"; documents: "documents"; suppliers: "suppliers"; invoices: "invoices"; finance: "finance"; }>; /** * Search contract for the booking detail page. */ export declare const bookingDetailSearchSchema: z.ZodObject<{ tab: z.ZodOptional>; }, z.core.$strip>; export type BookingDetailSearchParams = z.infer; /** * Props contract of the booking detail PAGE component the "bookings-detail" * contribution mounts — the route-state subset of `BookingDetailHostProps`. * The packaged default wraps {@link BookingDetailHost} with exactly these; * selected packages attach cross-domain behavior through stable widget slots. */ export interface BookingDetailPageComponentProps { id: string; activeTab?: BookingDetailTabValue; onTabChange?: (tab: BookingDetailTabValue) => void; } export interface CreateBookingsAdminExtensionOptions { /** Mount path of the bookings pages inside the admin workspace. Default `/bookings`. */ basePath?: string; /** Localized page titles. Defaults are the English operator nav labels. */ labels?: { bookings?: string; }; } /** * The bookings admin contribution (packaged-admin RFC Phase 3, * `@voyant-travel/-ui/admin` convention). * * NAVIGATION: the general-purpose factory remains neutral. The graph-selected * factory below adds the standard operator Bookings item. * * ROUTES: full implementations (packaged-admin RFC §4.8) — the package-owned * search contracts ({@link bookingsIndexSearchSchema} for the list, * {@link bookingDetailSearchSchema} for the detail page), loaders that * prefetch through the host-supplied runtime, and lazy `page` modules. The * PAGES are package-owned too: {@link BookingsHost} and * {@link BookingDetailHost} bind the canonical bookings pages to their data * wiring (bookings/finance provider context) and resolve every cross-route * link through the semantic destinations declared above — no app RPC client, * no host route tree. * * `component:` stays unattached; each contribution carries a lazy `page` * loader instead. The host binder wraps it in the router's lazy-component * machinery (so the page lands in its own chunk) and hands the resolved * component its route state as `AdminRoutePageProps` — which is how the * param/search-taking bookings pages mount without a host route file. The * `page` thunks below dynamically import the SPECIFIC page modules, never * this barrel, so the factory itself never pins page code into the * workspace-chrome chunk. * * WIDGETS: the crm-ui ↔ bookings-ui cycle resolution (RFC §4.7). The CRM * person detail page mounts a Bookings tab, but this package depends on * `@voyant-travel/relationships-react/ui`, so crm-ui's host cannot import the bookings-owned * card. Instead this extension contributes {@link PersonBookingsWidget} on * the `person.details.bookings-tab` slot crm-ui's `PersonDetailHost` * exposes; the host mounts its Bookings tab whenever a contribution targets * that slot and hands the widget its typed slot context * (`PersonDetailBookingsTabContext`) as props. */ export declare function createBookingsAdminExtension(options?: CreateBookingsAdminExtensionOptions): AdminExtension; export declare function createSelectedBookingsAdminExtension({ navMessages, }: SelectedAdminExtensionFactoryContext): AdminExtension;