Populate fare shop search form
populateFareShopSearchForm populates the FareShopSearch form.
It accepts two params: the first one needs to be an object formParams with the structure specified below, and the second one is a boolean value to disable the fields when populating, its value is false by default.
In order to make this method work properly, formParams has to be a String. The shape of formParams is a simplified version of fareShopSearch Application State and looks like follows:
const formParams = {
OnDs: {
0: {
fields: {
from: 'BCN',
to: 'MAD',
date: '01 Jan',
time: '00:00',
},
},
1: {
fields: {
from: 'MAD',
to: 'LON',
date: '01 Jan',
time: '01:00',
},
},
},
modifiers: { carrier: 'carrier', cabinClass: 'Cabin Class' },
};
dispatch('populateFareShopSearchForm', formParams, true);
-
formParams Object [REQUIRED]
Parameters needed to populate search form.
putFareShopSearchPax
Puts a new group of passengers (Pax).
Example
dispatch('putFareShopSearchPax');
removeFareShopSearchOnD
Remove an existing group of OnD.
Example
dispatch('removeFareShopSearchOnD');
removeFareShopSearchPax
Remove an existing group of passengers (Pax).
Example
dispatch('removeFareShopSearchPax');
resetFareShopSearchForm
Reset the search form to the initial state.
Example
dispatch('resetFareShopSearchForm');
setFareShopSearchCabinClass
Set any of the fields of the cabin class.
Example
const cabinClass = { description: 'Cabin Class', code: 'CCLASS' };
dispatch('setFareShopSearchCabinClass', 'value', cabinClass);
-
cabinClass Object [REQUIRED]
Object that contains the information about cabin class and class of service.
setFareShopSearchCarrierModifier
Set the Carrier Modifier of the search form. (Itinerary Modifier).
Example
const carrier = { name: 'preferred', value: 'Preferred' };
dispatch('setFareShopSearchCarrierModifier', 'value', carrier);
-
carrier Object [REQUIRED]
Object that contains the information about carrier of service.
setFareShopSearchFareType
Set the Fare Type Modifier value of the search form. (Itinerary Modifier).
Example
const fareType = { fare_type: 'preferred', value: 'Fare Type' };
dispatch('setFareShopSearchFareType', fareType);
-
fareType Object [REQUIRED]
Object that contains the information about the fare type of service.
setFareShopSearchOnDsIsAddible
Set if more OnDs can be added.
Example
const isAddible = true;
dispatch('setFareShopSearchOnDsIsAddible', isAddible);
-
isAddible Boolean [REQUIRED]
Boolean that sets the add button to disabled if false.
setFareShopSearchOnDsIsRemovable
Set if OnDs can be deleted.
Example
const isRemovable = false;
dispatch('setFareShopSearchOnDsIsRemovable', isRemovable);
-
isRemovable Boolean [REQUIRED]
Boolean that sets the remove button to disabled if false.
The formParams include:
-
searchSources: Search source value. Possible values: 'GDS', 'NDC', 'GDS,NDC'
-
OnDs: Array of search legs with origin, destination, time and date. Example: [{"fields": {"from": "BCN","to": "MAD","time": "10:00","date": "18AUG"}}]
-
modifiers: Set of itinerary modifiers:
-
cabinClass: The cabin class value.
-
cabinClassPrefenceType: The cabin class preference type. Possible values: 'Preferred', 'Only'
-
carrier: The carrier code.
-
carrierPreferenceType: The carrier preference type. Possible values: 'Preferred', 'Only'
-
pax: Array passenger type codes and number. Example: [{"ptcType": "ADT","number": "2"}]
-
popularPreferences: Array of popular preferences. Example: [{"popularPreference": "carryOnBag","value": true}]. Possible values: 'carryOnBag', 'checkedBag', 'earlySeatSelection', 'changeable', 'mealsBeverages', 'wifiAccess'
-
refundabilityType: Refundability type. Possible values: 'All', 'NonRefundable', 'PartialRefund', 'Refundable'
-
stopPreference: Number of stop preference. Possible values: 'Any number of stops', 'Nonstop only', 'Up to 1 stop', 'Up to 2 stop'
-
Example for populateFareShopSearchForm request:
{
"id": "8e5129e3-d78e-4138-9ea3-28a1e6c69b8b",
"type": "action",
"operation": "populateFareShopSearchForm",
"windowNumber": "1",
"parameters": {
"searchSources": "GDS,NDC",
"OnDs": [
{
"fields": {
"from": "BCN",
"to": "MAD",
"time": "10:00",
"date": "18AUG"
}
},
{
"fields": {
"from": "MAD",
"to": "BCN",
"time": "17:00",
"date": "23AUG"
}
}
],
"modifiers": {
"carrier": "QF",
"cabinClass": "Economy",
"pax": [
{
"ptcType": "ADT",
"number": 2
},
{
"ptcType": "CHD",
"number": 1
},
{
"ptcType": "INF",
"number": 1
}
],
"cabinClassPrefenceType": "Preferred",
"carrierPreferenceType": "Preferred",
"stopPreference": "Up to 1 stop",
"refundabilityType": "All",
"popularPreferences": [
{
"popularPreference": "carryOnBag",
"value": true
},
{
"popularPreference": "checkedBag",
"value": true
},
{
"popularPreference": "earlySeatSelection",
"value": true
},
{
"popularPreference": "changeable",
"value": true
},
{
"popularPreference": "mealsBeverages",
"value": true
},
{
"popularPreference": "wifiAccess",
"value": true
}
]
}
}
}
Example
var message = new MessageRequest
{
id = Guid.NewGuid().ToString(),
type = "action",
operation = "clearTerminal",
windowNumber = "1",
};
webView.CoreWebView2.PostWebMessageAsJson(JsonConvert.SerializeObject(message));