@qite/tide-booking-component
Version:
React Booking wizard & Booking product component for Tide
271 lines (244 loc) • 6.04 kB
text/typescript
import { BookingPackageFlight } from "@qite/tide-client/build/types";
export interface Settings {
officeId: number;
bookingOptions: BookingOptions;
productPath: string;
basePath: string;
roomOptions: {
isHidden?: boolean | null;
pathSuffix?: string | null;
},
flightOptions: {
isHidden?: boolean | null;
pathSuffix?: string | null;
},
options: {
pathSuffix: string;
};
travellers: {
pathSuffix: string;
};
summary: {
pathSuffix: string;
checkboxes?: SummaryCheckbox[] | null;
};
confirmation: {
pathSuffix: string;
};
error: {
pathSuffix: string;
};
language: string;
currency: string;
includeFlights?: boolean;
generatePaymentUrl?: boolean;
skipPaymentWithAgent?: boolean;
companyContactEmail: string;
companyContactPhone: string;
showProductCardRating: boolean;
showSidebarDeposit: boolean;
sidebarHeaderComponent?: JSX.Element | null;
sidebarFooterComponent?: JSX.Element | null;
loaderComponent?: JSX.Element | null;
icons?: string | null;
tagIds?: number[];
agentRequired?: boolean;
hideAgentSelection?: boolean;
agentAdressId?: number;
affiliateSlug?: string;
enableVoucher?: boolean;
skipRouter?: boolean;
apiUrl?: string;
apiKey?: string;
hideTags?: boolean;
translationFiles?: {
language: string,
path: string;
}[];
accommodations?: AccommodationContent[];
regimes?: RegimeContent[];
accommodationViewId?: number;
isOffer?: boolean;
}
export interface BookingOptions {
b2b: BookingOptionsDetail;
b2b2c: BookingOptionsDetail;
b2c: BookingOptionsDetail;
}
export interface BookingOptionsDetail {
entryStatus: number;
customEntryStatusId?: number;
tagIds?: number[];
}
export interface SummaryCheckbox {
id: string;
text: string;
isSelected: boolean;
}
export interface Traveler {
id: number;
gender: string;
firstName: string;
lastName: string;
birthDate: string;
}
export interface Room {
adults: number;
children: number;
childAges: number[];
accommodationCode?: string;
regimeCode?: string;
}
export interface FlightInfo {
outwardCode: string;
outwardNumbers: string[];
outwardClass: string;
returnCode: string;
returnNumbers: string[];
returnClass: string;
}
export interface TravelersFormValues {
rooms: TravelersFormRoomValues[];
startDate?: string;
mainBookerId: number;
street: string;
houseNumber: string;
box: string;
zipCode: string;
place: string;
country: string;
phone: string;
email: string;
emailConfirmation: string;
travelAgentId: number;
travelAgentName: string;
}
export interface TravelersFormRoomValues {
adults: Traveler[];
children: Traveler[];
}
export interface ProductAttributes {
productCode: string;
productName: string;
}
export interface BookingAttributes {
startDate: string;
endDate: string;
catalog: number;
rooms: Room[];
flight: FlightInfo | null;
tourCode: string | null;
allotmentName: string | null;
allotmentIds: number[];
includeFlights?: boolean;
}
export interface FlightLine {
departureAirportIata?: string;
departureAirportDescription?: string;
departureDate?: string;
departureTime?: string;
arrivalAirportIata?: string;
arrivalAirportDescription?: string;
arrivalDate?: string;
arrivalTime?: string;
airlineIata?: string;
airlineDescription?: string;
airlineNumber?: string;
travelClass?: string;
}
export interface AccommodationContent {
code: string;
title: string;
imageUrl: string;
usps: string[];
description: string | undefined;
}
export interface RegimeContent {
code: string;
title: string;
}
export interface SelectableRoom {
index: number;
selected: SelectableRoomAccommodation,
alternatives: SelectableRoomAccommodation[];
}
export interface SelectableRoomAccommodation {
code: string;
regimeCode: string;
from: string;
to: string;
price: number;
regimes: SelectableRoomRegime[];
title: string;
image: string | undefined;
usps: string[];
description: string | undefined;
viewHtml: string | undefined
}
export interface SelectableRoomRegime {
code: string;
title: string;
price: number;
}
export interface GroupedFlights {
isSelected: boolean;
price: number;
outward: GroupedFlightDetails;
return: GroupedFlightDetails;
selectedOutward: BookingPackageFlight;
selectedReturn: BookingPackageFlight;
}
export interface GroupedFlightDetails {
airlineCode: string;
airline: string;
departureDate: string;
departureTime: string;
departureAirportCode: string;
departureAirport: string;
arrivalDate: string;
arrivalTime: string;
arrivalAirport: string;
changeDurationMinutes: number;
travelDurationMinutes: number;
travelDuration: string;
numberOfStops: number;
isNextDay: boolean;
travelClass: string;
flightLines: GroupedFlightLine[];
}
export interface GroupedFlightLine {
airline: string;
number: string;
departureDate: string;
departureTime: string;
departureAirport: string;
arrivalDate: string;
arrivalTime: string;
arrivalAirport: string;
travelDuration: string;
waitDuration: string | undefined;
}
export interface FlightFilterOptions {
airports: FlightFilterOption[];
airlines: FlightFilterOption[];
numberOfStops: FlightFilterOption[];
outward: FlightDirectionFilter;
return: FlightDirectionFilter;
}
export interface FlightFilterOption {
value: string;
label: string;
count: number;
isSelected: boolean;
}
export interface FlightDirectionFilter {
departurePeriod: FlightFilterOption[];
travelDuration: TimeRangeFilter;
changeDuration: TimeRangeFilter;
}
export interface TimeRangeFilter {
min: number;
max: number;
selectedMin: number;
selectedMax: number;
}