@qite/tide-components 1.0.7 → 1.0.8

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.
@@ -0,0 +1,11 @@
1
+ import { PackagingEntry } from '@qite/tide-client';
2
+ /**
3
+ * The entry to send to the backend, as opposed to the one the page works with.
4
+ *
5
+ * They differ only for a traject: the page keeps the line guids the traject was rendered with,
6
+ * because that is what joins its nodes to its lines, while pricing and booking need the guids the
7
+ * searches cached their lines under. Anything else passes through untouched, so this can be used
8
+ * wherever the entry leaves the component without checking which flow is running.
9
+ */
10
+ declare const useBookableEntry: () => PackagingEntry | null;
11
+ export default useBookableEntry;
@@ -45,6 +45,8 @@ export interface SearchResultsState {
45
45
  trajectDaySuggestions: Record<number, TrajectDaySuggestions>;
46
46
  trajectEditLineGuid: string | null;
47
47
  trajectActivitiesDayOrder: number | null;
48
+ trajectResolving: boolean;
49
+ trajectItineraryView: boolean;
48
50
  }
49
51
  export type TrajectNodeStatus = 'idle' | 'loading' | 'resolved' | 'unavailable';
50
52
  export interface TrajectNodeAvailability {
@@ -86,7 +88,7 @@ export declare const setResults: import("@reduxjs/toolkit").ActionCreatorWithPay
86
88
  }, "searchResults/setTrajectNodeAvailability">, setTrajectNodeSelection: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
87
89
  lineGuid: string;
88
90
  code: string;
89
- }, "searchResults/setTrajectNodeSelection">, setTrajectFlightLoading: import("@reduxjs/toolkit").ActionCreatorWithPayload<string, "searchResults/setTrajectFlightLoading">, setTrajectFlightAvailability: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
91
+ }, "searchResults/setTrajectNodeSelection">, setTrajectResolving: import("@reduxjs/toolkit").ActionCreatorWithPayload<boolean, "searchResults/setTrajectResolving">, setTrajectItineraryView: import("@reduxjs/toolkit").ActionCreatorWithPayload<boolean, "searchResults/setTrajectItineraryView">, setTrajectFlightLoading: import("@reduxjs/toolkit").ActionCreatorWithPayload<string, "searchResults/setTrajectFlightLoading">, setTrajectFlightAvailability: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
90
92
  lineGuid: string;
91
93
  results: PackagingFlightResponse[];
92
94
  selectedGuid: string | null;
@@ -23,31 +23,49 @@ export interface TrajectSearchContext {
23
23
  }
24
24
  export declare const buildTrajectClientConfig: (context: SearchResultsConfiguration) => TideClientConfig;
25
25
  export declare const buildTrajectSearchContext: (context: SearchResultsConfiguration, trajectEntry: PackagingTrajectResponse) => TrajectSearchContext;
26
- export declare const buildTrajectNodeRequest: ({ node, line }: TrajectNodeWithLine, context: TrajectSearchContext, productCode: string) => PackagingAccommodationRequest;
26
+ export declare const buildTrajectNodeRequest: ({ node, line }: TrajectNodeWithLine, context: TrajectSearchContext, productCode: string, destination?: PackagingDestination) => PackagingAccommodationRequest;
27
27
  export declare const getDayDestinationItem: (items: TrajectNodeWithLine[], dayOrder: number) => TrajectNodeWithLine | null;
28
28
  export declare const getDayDestination: (items: TrajectNodeWithLine[], availability: Record<string, {
29
29
  results: PackagingAccommodationResponse[];
30
30
  selectedCode: string | null;
31
31
  }>, dayOrder: number) => PackagingDestination | null;
32
32
  export declare const buildTrajectDayExcursionRequest: (date: string, destination: PackagingDestination, context: TrajectSearchContext) => PackagingAccommodationRequest;
33
- /**
34
- * Entry lines for an excursion the traveller picked out of the suggestions.
35
- *
36
- * A traject node already has its lines and only needs stamping; a suggestion has none, so this
37
- * builds them — one per selected option, as the regular day-by-day excursion flow does, since an
38
- * excursion's options are ticket types (adult, child) rather than rooms. Where the search marks no
39
- * default, the first option of each room stands in.
40
- */
33
+ type ExcursionOption = PackagingAccommodationResponse['rooms'][number]['options'][number];
34
+ export declare const getExcursionOptionGroups: (result: PackagingAccommodationResponse) => ExcursionOption[][];
35
+ export declare const excursionNeedsChoice: (result: PackagingAccommodationResponse) => boolean;
41
36
  export declare const buildTrajectExcursionLines: (result: PackagingAccommodationResponse) => PackagingEntryLine[];
37
+ export declare const buildExcursionSearchParams: (result: PackagingAccommodationResponse) => {
38
+ date: string;
39
+ fromDate: string;
40
+ toDate: string;
41
+ countryId: number | null | undefined;
42
+ regionId: number | null | undefined;
43
+ oordId: number | null | undefined;
44
+ locationId: number | null | undefined;
45
+ locationName: string;
46
+ accommodationCode: null;
47
+ accommodationName: null;
48
+ hotelCode: string;
49
+ hotelName: string;
50
+ rooms: import("@qite/tide-client").PackageMainRoom[];
51
+ };
42
52
  export interface DayActivityCard {
43
53
  result: PackagingAccommodationResponse;
44
- /** The traject node this result answers, where it is one of the trip's own excursions. */
45
54
  item?: TrajectNodeWithLine;
46
55
  }
47
56
  export declare const buildDayActivityCards: (items: TrajectNodeWithLine[], availability: Record<string, {
48
57
  results: PackagingAccommodationResponse[];
49
58
  selectedCode: string | null;
50
59
  }>, suggestions: PackagingAccommodationResponse[]) => DayActivityCard[];
60
+ /**
61
+ * Where to search for a node.
62
+ *
63
+ * Normally the node says so itself, through the product it was configured with. An excursion slot
64
+ * left empty on the traject says nothing at all — no code, no alternatives, and a line with no
65
+ * place on it — so it falls back to wherever the party is staying that day, the same anchor the
66
+ * day's own activity search uses.
67
+ */
68
+ export declare const getNodeSearchDestination: (items: TrajectNodeWithLine[], item: TrajectNodeWithLine) => PackagingDestination;
51
69
  export declare const getConfiguredExcursionCodes: (items: TrajectNodeWithLine[], dayOrder: number) => Set<string>;
52
70
  export declare const getNodeCandidates: (node: PackagingTrajectNode) => PackagingTrajectAlternative[];
53
71
  export declare const findCandidateForResult: (node: PackagingTrajectNode, result: PackagingAccommodationResponse) => PackagingTrajectAlternative | null;
@@ -57,6 +75,25 @@ export declare const pickCheapest: (results: PackagingAccommodationResponse[]) =
57
75
  export declare const applyResultToLines: (lines: PackagingEntryLine[], result: PackagingAccommodationResponse) => PackagingEntryLine[];
58
76
  export declare const applyResultToLine: (line: PackagingEntryLine, result: PackagingAccommodationResponse, roomIndex?: number) => PackagingEntryLine;
59
77
  export declare const buildTrajectFlightRequest: ({ node, line }: TrajectNodeWithLine, context: TrajectSearchContext, pax: FlightSearchRequest["pax"]) => FlightSearchRequest;
78
+ /**
79
+ * The entry as the backend can price it.
80
+ *
81
+ * A search caches an EntryLine per option and hands back that line's guid on the option. The
82
+ * backend then rebuilds the entry by looking each line up in that cache on its guid, so a line
83
+ * it cannot find is dropped — PackagingEntryBuilder.SyncEntryLines skips it, and an entry whose
84
+ * lines all came off a traject prices as nothing at all.
85
+ *
86
+ * A traject entry is rendered before any search runs, so its lines carry the guids the traject
87
+ * mapper gave them. This swaps in the guid of whatever each line resolved onto, leaving the
88
+ * lines the traveller added themselves alone — those were built from a search result and already
89
+ * carry the right one.
90
+ */
91
+ export declare const withCachedEntryLineGuids: (entry: PackagingEntry, trajectEntry: PackagingTrajectResponse, nodeAvailability: Record<string, {
92
+ results: PackagingAccommodationResponse[];
93
+ selectedCode: string | null;
94
+ }>, flightAvailability: Record<string, {
95
+ selectedGuid: string | null;
96
+ }>) => PackagingEntry;
60
97
  export declare const pickCheapestFlight: (flights: PackagingFlightResponse[]) => PackagingFlightResponse | null;
61
98
  export declare const applyFlightToLine: (line: PackagingEntryLine, flight: PackagingFlightResponse) => PackagingEntryLine;
62
99
  /**
@@ -66,3 +103,4 @@ export declare const applyFlightToLine: (line: PackagingEntryLine, flight: Packa
66
103
  */
67
104
  export declare const isExternalResult: (result: PackagingAccommodationResponse) => boolean;
68
105
  export declare const isExternalCandidate: (candidate: PackagingTrajectAlternative) => boolean;
106
+ export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@qite/tide-components",
3
- "version": "1.0.7",
3
+ "version": "1.0.8",
4
4
  "description": "React components for Tide (booking, product availability, form, ...)",
5
5
  "main": "build/build-cjs/index.js",
6
6
  "types": "build/build-cjs/src/index.d.ts",