ti2-tourplan 1.0.44 → 1.0.46
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/index.js +11 -9
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -215,8 +215,12 @@ class Plugin {
|
|
|
215
215
|
})[roomType];
|
|
216
216
|
if (RoomType) RoomConfig.RoomType = RoomType;
|
|
217
217
|
if (passengers && passengers.length && !noPaxList) {
|
|
218
|
-
|
|
219
|
-
|
|
218
|
+
// There should be only 1 PaxList inside each RoomConfig
|
|
219
|
+
RoomConfig.PaxList = {};
|
|
220
|
+
// Inside PaxList, there should be 1 PaxDetails for each passenger (Pax)
|
|
221
|
+
RoomConfig.PaxList.PaxDetails = [];
|
|
222
|
+
passengers.forEach((p, index) => {
|
|
223
|
+
const EachPaxDetails = {
|
|
220
224
|
Forename: this.escapeInvalidXmlChars(p.firstName),
|
|
221
225
|
Surname: this.escapeInvalidXmlChars(p.lastName),
|
|
222
226
|
PaxType: {
|
|
@@ -225,16 +229,14 @@ class Plugin {
|
|
|
225
229
|
Infant: 'I',
|
|
226
230
|
}[p.passengerType] || 'A',
|
|
227
231
|
};
|
|
228
|
-
if (p.salutation)
|
|
229
|
-
if (p.dob)
|
|
232
|
+
if (p.salutation) EachPaxDetails.Title = this.escapeInvalidXmlChars(p.salutation);
|
|
233
|
+
if (p.dob) EachPaxDetails.DateOfBirth = p.dob;
|
|
230
234
|
if (!R.isNil(p.age) && !isNaN(p.age)) {
|
|
231
235
|
if (!(p.passengerType === 'Adult' && p.age === 0)) {
|
|
232
|
-
|
|
236
|
+
EachPaxDetails.Age = p.age;
|
|
233
237
|
}
|
|
234
238
|
}
|
|
235
|
-
|
|
236
|
-
PaxDetails,
|
|
237
|
-
};
|
|
239
|
+
RoomConfig.PaxList.PaxDetails[index] = EachPaxDetails;
|
|
238
240
|
});
|
|
239
241
|
}
|
|
240
242
|
return { RoomConfig };
|
|
@@ -723,7 +725,7 @@ class Plugin {
|
|
|
723
725
|
});
|
|
724
726
|
return {
|
|
725
727
|
message: R.path(['AddServiceReply', 'Status'], replyObj)
|
|
726
|
-
=== 'NO' ? 'Service cannot be added to quote
|
|
728
|
+
=== 'NO' ? 'Service cannot be added to quote for the requested date/stay. (e.g. no rates, block out period, on request, minimum stay etc.)' : '',
|
|
727
729
|
quote: {
|
|
728
730
|
id: R.path(['AddServiceReply', 'BookingId'], replyObj),
|
|
729
731
|
reference: R.path(['AddServiceReply', 'Ref'], replyObj),
|