ti2-tourplan 1.0.31 → 1.0.32
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 +21 -9
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -205,20 +205,27 @@ class Plugin {
|
|
|
205
205
|
})[roomType];
|
|
206
206
|
if (RoomType) RoomConfig.RoomType = RoomType;
|
|
207
207
|
if (passengers && passengers.length && !noPaxList) {
|
|
208
|
-
RoomConfig.PaxList = passengers.map(p =>
|
|
209
|
-
PaxDetails
|
|
208
|
+
RoomConfig.PaxList = passengers.map(p => {
|
|
209
|
+
const PaxDetails = {
|
|
210
210
|
Forename: p.firstName,
|
|
211
211
|
Surname: p.lastName,
|
|
212
212
|
PaxType: {
|
|
213
213
|
Adult: 'A',
|
|
214
214
|
Child: 'C',
|
|
215
215
|
Infant: 'I',
|
|
216
|
-
}[p.passengerType],
|
|
217
|
-
Age: p.age,
|
|
218
|
-
...(p.dob ? { DateOfBirth: p.dob } : {}),
|
|
216
|
+
}[p.passengerType] || 'A',
|
|
219
217
|
Title: p.salutation,
|
|
220
|
-
}
|
|
221
|
-
|
|
218
|
+
};
|
|
219
|
+
if (p.dob) PaxDetails.DateOfBirth = p.dob;
|
|
220
|
+
if (!isNaN(p.age)) {
|
|
221
|
+
if (!(p.passengerType === 'Adult' && p.age === 0)) {
|
|
222
|
+
PaxDetails.Age = p.age;
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
return {
|
|
226
|
+
PaxDetails,
|
|
227
|
+
};
|
|
228
|
+
});
|
|
222
229
|
}
|
|
223
230
|
return { RoomConfig };
|
|
224
231
|
});
|
|
@@ -585,14 +592,19 @@ class Plugin {
|
|
|
585
592
|
RateId: rateId,
|
|
586
593
|
} : {}),
|
|
587
594
|
...(puInfo ? {
|
|
588
|
-
|
|
595
|
+
...(puInfo.time && puInfo.time.replace(/\D/g, '') ? {
|
|
596
|
+
puTime: puInfo.time.replace(/\D/g, ''),
|
|
597
|
+
} : {}),
|
|
589
598
|
puRemark: `Time: ${puInfo.time || 'NA'},
|
|
590
599
|
Location: ${puInfo.location || 'NA'},
|
|
591
600
|
Flight: ${puInfo.flightDetails || 'NA'},
|
|
592
601
|
`,
|
|
593
602
|
} : {}),
|
|
594
603
|
...(doInfo ? {
|
|
595
|
-
|
|
604
|
+
// only get numbers from doInfo.time
|
|
605
|
+
...(doInfo.time && doInfo.time.replace(/\D/g, '') ? {
|
|
606
|
+
doTime: doInfo.time.replace(/\D/g, ''),
|
|
607
|
+
} : {}),
|
|
596
608
|
doRemark: `Time: ${doInfo.time || 'NA'},
|
|
597
609
|
Location: ${doInfo.location || 'NA'},
|
|
598
610
|
Flight: ${doInfo.flightDetails || 'NA'},
|