Skip to content

Commit

Permalink
process QB and custom field values
Browse files Browse the repository at this point in the history
  • Loading branch information
mogii committed Sep 29, 2024
1 parent 216e663 commit 4864c75
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -715,10 +715,21 @@ class Plugin {
puInfo,
doInfo,
notes,
QB,
directHeaderPayload,
directLinePayload,
customFieldValues = [],
},
}) {
const cfvPerService = customFieldValues.filter(f => f.isPerService && f.value)
.reduce((acc, f) => {
if (f.type === 'extended-option') {
acc[f.id] = f.value.value || f.value;
} else {
acc[f.id] = f.value;
}
return acc;
}, {});
const model = {
AddServiceRequest: {
AgentID: hostConnectAgentID,
Expand All @@ -728,7 +739,7 @@ class Plugin {
} : {
NewBookingInfo: {
Name: this.escapeInvalidXmlChars(quoteName),
QB: 'Q',
QB: QB || 'Q',
...(directHeaderPayload || {}),
},
}),
Expand Down Expand Up @@ -769,6 +780,7 @@ class Plugin {
AgentRef: reference,
RoomConfigs: this.getRoomConfigs(paxConfigs),
...(directLinePayload || {}),
...(cfvPerService || {}),
},
};
const replyObj = await this.callTourplan({
Expand Down

0 comments on commit 4864c75

Please sign in to comment.