ti2-tourplan 1.0.13 → 1.0.14
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 +16 -12
- package/package.json +1 -1
- package/resolvers/product.js +3 -1
package/index.js
CHANGED
|
@@ -328,7 +328,7 @@ class Plugin {
|
|
|
328
328
|
}, {
|
|
329
329
|
id: 'chargeUnitQuanity', // secondary charge unit (SCU) quantity
|
|
330
330
|
description: 'number of nights or days or hours depending on charge unit',
|
|
331
|
-
title: '
|
|
331
|
+
title: 'Nights/Days',
|
|
332
332
|
type: 'count',
|
|
333
333
|
}];
|
|
334
334
|
const products = R.call(R.compose(
|
|
@@ -634,6 +634,7 @@ class Plugin {
|
|
|
634
634
|
paxConfigs: [{ roomType: 'DB', adults: 2 }, { roomType: 'TW', children: 2 }]
|
|
635
635
|
*/
|
|
636
636
|
paxConfigs,
|
|
637
|
+
passengers,
|
|
637
638
|
/*
|
|
638
639
|
The number of second charge units required (second charge units are discussed
|
|
639
640
|
in the OptionInfo section). Should only be specified for options that have SCUs.
|
|
@@ -656,20 +657,22 @@ class Plugin {
|
|
|
656
657
|
RateId: 'Default',
|
|
657
658
|
SCUqty: chargeUnitQuanity || 1,
|
|
658
659
|
AgentRef: reference,
|
|
659
|
-
RoomConfigs: paxConfigs.map(obj =>
|
|
660
|
-
RoomConfig
|
|
660
|
+
RoomConfigs: paxConfigs.map(obj => {
|
|
661
|
+
const RoomConfig = {
|
|
661
662
|
Adults: obj.adults || 0,
|
|
662
663
|
Children: obj.children || 0,
|
|
663
664
|
Infants: obj.infants || 0,
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
}
|
|
672
|
-
|
|
665
|
+
};
|
|
666
|
+
const RoomType = ({
|
|
667
|
+
Single: 'SG',
|
|
668
|
+
Double: 'DB',
|
|
669
|
+
Twin: 'TW',
|
|
670
|
+
Triple: 'TR',
|
|
671
|
+
Quad: 'QU',
|
|
672
|
+
})[obj.roomType];
|
|
673
|
+
if (RoomType) RoomConfig.RoomType = RoomType;
|
|
674
|
+
return { RoomConfig };
|
|
675
|
+
}),
|
|
673
676
|
},
|
|
674
677
|
};
|
|
675
678
|
const replyObj = await this.callTourplan({
|
|
@@ -685,6 +688,7 @@ class Plugin {
|
|
|
685
688
|
quote: {
|
|
686
689
|
id: R.path(['AddServiceReply', 0, 'BookingId', 0], replyObj),
|
|
687
690
|
reference: R.path(['AddServiceReply', 0, 'Ref', 0], replyObj),
|
|
691
|
+
linePrice: R.path(['AddServiceReply', 0, 'Services', 0, 'Service', 0, 'LinePrice', 0], replyObj),
|
|
688
692
|
},
|
|
689
693
|
};
|
|
690
694
|
}
|
package/package.json
CHANGED
package/resolvers/product.js
CHANGED
|
@@ -34,10 +34,12 @@ const translateTCMLCollection = async ({ rootValue, typeDefs, query }) => {
|
|
|
34
34
|
return retVal.data;
|
|
35
35
|
};
|
|
36
36
|
|
|
37
|
-
const translateTPOption = ({ optionsGroupedBySupplierId, supplierData
|
|
37
|
+
const translateTPOption = ({ optionsGroupedBySupplierId, supplierData }) => {
|
|
38
38
|
return {
|
|
39
39
|
productId: supplierData.supplierId,
|
|
40
40
|
productName: supplierData.supplierName,
|
|
41
|
+
// Guides, Accommodation, Transfers, Entrance Fees, Meals, Other
|
|
42
|
+
// category: R.path([0, 'OptGeneral', 0, 'ButtonName', 0], optionsGroupedBySupplierId),
|
|
41
43
|
options: optionsGroupedBySupplierId.map(option => {
|
|
42
44
|
const keyData = {
|
|
43
45
|
optionId: R.path(['Opt', 0], option),
|