ti2-tourplan 1.0.38 → 1.0.39
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 +13 -5
- package/package.json +1 -1
- package/resolvers/product.js +6 -5
package/index.js
CHANGED
|
@@ -214,10 +214,10 @@ class Plugin {
|
|
|
214
214
|
Child: 'C',
|
|
215
215
|
Infant: 'I',
|
|
216
216
|
}[p.passengerType] || 'A',
|
|
217
|
-
Title: p.salutation,
|
|
218
217
|
};
|
|
218
|
+
if (p.salutation) PaxDetails.Title = p.salutation;
|
|
219
219
|
if (p.dob) PaxDetails.DateOfBirth = p.dob;
|
|
220
|
-
if (!isNaN(p.age)) {
|
|
220
|
+
if (!R.isNil(p.age) && !isNaN(p.age)) {
|
|
221
221
|
if (!(p.passengerType === 'Adult' && p.age === 0)) {
|
|
222
222
|
PaxDetails.Age = p.age;
|
|
223
223
|
}
|
|
@@ -525,7 +525,11 @@ class Plugin {
|
|
|
525
525
|
Opt: optionId,
|
|
526
526
|
Info: 'S',
|
|
527
527
|
DateFrom: startDate,
|
|
528
|
-
|
|
528
|
+
SCUqty: (() => {
|
|
529
|
+
const num = parseInt(chargeUnitQuanity, 10);
|
|
530
|
+
if (isNaN(num) || num < 1) return 1;
|
|
531
|
+
return num;
|
|
532
|
+
})(),
|
|
529
533
|
RoomConfigs: this.getPaxConfigs(paxConfigs, true),
|
|
530
534
|
AgentID: hostConnectAgentID,
|
|
531
535
|
Password: hostConnectAgentPassword,
|
|
@@ -690,7 +694,11 @@ class Plugin {
|
|
|
690
694
|
Opt: optionId,
|
|
691
695
|
DateFrom: startDate,
|
|
692
696
|
RateId: 'Default',
|
|
693
|
-
SCUqty:
|
|
697
|
+
SCUqty: (() => {
|
|
698
|
+
const num = parseInt(chargeUnitQuanity, 10);
|
|
699
|
+
if (isNaN(num) || num < 1) return 1;
|
|
700
|
+
return num;
|
|
701
|
+
})(),
|
|
694
702
|
AgentRef: reference,
|
|
695
703
|
RoomConfigs: this.getPaxConfigs(paxConfigs),
|
|
696
704
|
},
|
|
@@ -703,7 +711,7 @@ class Plugin {
|
|
|
703
711
|
});
|
|
704
712
|
return {
|
|
705
713
|
message: R.path(['AddServiceReply', 'Status'], replyObj)
|
|
706
|
-
=== 'NO' ? 'Service cannot be added to quote' : '',
|
|
714
|
+
=== 'NO' ? 'Service cannot be added to quote (could be due to no rates)' : '',
|
|
707
715
|
quote: {
|
|
708
716
|
id: R.path(['AddServiceReply', 'BookingId'], replyObj),
|
|
709
717
|
reference: R.path(['AddServiceReply', 'Ref'], replyObj),
|
package/package.json
CHANGED
package/resolvers/product.js
CHANGED
|
@@ -123,15 +123,16 @@ const translateTPOption = ({ optionsGroupedBySupplierId, supplierData }) => {
|
|
|
123
123
|
} : null].filter(Boolean);
|
|
124
124
|
}
|
|
125
125
|
if (R.path(['OptGeneral', 'SType'], option) === 'Y' || R.path(['OptGeneral', 'SType'], option) === 'P') {
|
|
126
|
+
console.log('hit here')
|
|
126
127
|
return ['Single', 'Twin', 'Double', 'Quad']
|
|
127
|
-
.map((
|
|
128
|
+
.map((unitId) => ({
|
|
128
129
|
unitId,
|
|
129
|
-
unitName,
|
|
130
|
+
unitName: unitId,
|
|
130
131
|
pricing: [],
|
|
131
132
|
restrictions: {
|
|
132
|
-
allowed: R.path(['OptGeneral', `${
|
|
133
|
-
paxCount: R.path(['OptGeneral', `${
|
|
134
|
-
|| R.path(['OptGeneral', `${
|
|
133
|
+
allowed: R.path(['OptGeneral', `${unitId}_Avail`], option) === 'Y',
|
|
134
|
+
paxCount: R.path(['OptGeneral', `${unitId}_Max`], option)
|
|
135
|
+
|| R.path(['OptGeneral', `${unitId}_Ad_Max`], option),
|
|
135
136
|
},
|
|
136
137
|
}));
|
|
137
138
|
}
|