Skip to content

Commit

Permalink
Merge pull request #652 from Travelport-Ukraine/master
Browse files Browse the repository at this point in the history
1.16.5: Operating airline added
  • Loading branch information
dchertousov authored Mar 27, 2024
2 parents 28810d3 + d016723 commit 63d8d5c
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 9 deletions.
10 changes: 5 additions & 5 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "uapi-json",
"version": "1.16.4",
"version": "1.16.5",
"description": "Travelport Universal API",
"main": "src/",
"files": [
Expand Down
5 changes: 5 additions & 0 deletions src/Services/Air/AirFormat.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,13 +79,18 @@ function getBaggageInfo(info) {
}

function formatSegment(segment) {
const operatingAirline = segment['air:CodeshareInfo']
? segment['air:CodeshareInfo'].OperatingCarrier
: null;

const seg = {
from: segment.Origin,
to: segment.Destination,
group: Number(segment.Group),
departure: segment.DepartureTime,
arrival: segment.ArrivalTime,
airline: segment.Carrier,
operatingAirline,
flightNumber: segment.FlightNumber,
uapi_segment_ref: segment.Key,
uapiSegmentReference: segment.Key,
Expand Down
7 changes: 4 additions & 3 deletions test/Air/AirParser.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@ const checkLowSearchFareXml = (filename) => {
(segment) => {
expect(segment).to.be.an('object');
expect(segment).to.have.all.keys([
'from', 'to', 'departure', 'arrival', 'airline', 'flightNumber', 'serviceClass',
'plane', 'details', 'duration', 'techStops', 'bookingClass', 'baggage',
'from', 'to', 'departure', 'arrival', 'airline', 'operatingAirline', 'flightNumber',
'serviceClass', 'plane', 'details', 'duration', 'techStops', 'bookingClass', 'baggage',
'fareBasisCode', 'group', 'uapi_segment_ref', 'uapiSegmentReference',
]);
expect(segment.from).to.match(/^[A-Z]{3}$/);
Expand Down Expand Up @@ -2195,6 +2195,7 @@ describe('#AirParser', () => {
expect(segment).to.be.an('object');
expect(segment).to.have.all.keys([
'airline',
'operatingAirline',
'arrival',
'bookingClass',
'departure',
Expand Down Expand Up @@ -2340,7 +2341,7 @@ describe('#AirParser', () => {
leg.forEach((segment) => {
expect(segment).to.be.an('object');
expect(segment).to.have.all.keys([
'from', 'to', 'departure', 'arrival', 'airline',
'from', 'to', 'departure', 'arrival', 'airline', 'operatingAirline',
'flightNumber', 'plane', 'duration',
'uapi_segment_ref', 'group', 'availability', 'uapiSegmentReference',
]);
Expand Down

0 comments on commit 63d8d5c

Please sign in to comment.