【发布时间】:2019-08-01 22:54:21
【问题描述】:
其余的 api BargainFinderMaxRS groupedItineraryResponse 对象为我提供了行程及其时间表(段)。它还为我提供了乘客信息中的 fareComponents。但我不知道哪个 fareComponent 属于哪个航段。我没有看到将特定航段链接到其 fareComponent 的任何标识符,例如“id”或“ref”。我错过了什么吗?
谢谢,
legs: [
0: {
id: 1,
schedules: [
0: {...},
1: {...}
]
},
1: {
id: 2,
schedules: [
0: {...}
]
}
]
...
passengerInfo: {
fareComponents: [
0: {...},
1: {...},
2: {...}
]
}
编辑好的,我以为我了解如何将 Legs 与 FareComponents 匹配,但我仍然遇到问题。有时,legs 和 fareComponents 的数组索引似乎匹配,但有时它们不匹配。
在下面的行程中,第一站有 2 个航段,第二站是不间断的。但是第一个 fareComponent 有 1 个段,第二个有 2 个段。显然 fareComponent2 属于 Leg1
这是来自 BFM 响应对象的 Legs 数组:
"legs": [
{
"ref": 3,
"id": 3,
"schedules": [
{
"ref": 13,
"id": 13,
"dotRating": "9",
"frequency": "SMTWT**",
"stopCount": 0,
"eTicketable": true,
"totalMilesFlown": 2556,
"departure": {
"airport": "HNL",
"city": "HNL",
"state": "HI",
"country": "US",
"time": "20:55:00-10:00",
"terminal": "2"
},
"arrival": {
"airport": "LAX",
"city": "LAX",
"state": "CA",
"country": "US",
"time": "05:18:00-07:00",
"terminal": "2",
"dateAdjustment": 1
},
"carrier": {
"marketing": "DL",
"marketingFlightNumber": 1212,
"operating": "DL",
"operatingFlightNumber": 1212,
"equipment": {
"code": "739",
"typeForFirstLeg": "N",
"typeForLastLeg": "N"
}
}
},
{
"ref": 12,
"departureDateAdjustment": 1,
"id": 12,
"dotRating": "8",
"frequency": "SMTWT**",
"stopCount": 0,
"eTicketable": true,
"totalMilesFlown": 953,
"departure": {
"airport": "LAX",
"city": "LAX",
"state": "CA",
"country": "US",
"time": "09:38:00-07:00",
"terminal": "3"
},
"arrival": {
"airport": "SEA",
"city": "SEA",
"state": "WA",
"country": "US",
"time": "12:27:00-07:00"
},
"carrier": {
"marketing": "DL",
"marketingFlightNumber": 2540,
"operating": "DL",
"operatingFlightNumber": 2540,
"equipment": {
"code": "739",
"typeForFirstLeg": "N",
"typeForLastLeg": "N"
}
}
}
]
},
{
"ref": 6,
"id": 6,
"schedules": [
{
"ref": 10,
"id": 10,
"dotRating": "9",
"frequency": "****TF*",
"stopCount": 0,
"eTicketable": true,
"totalMilesFlown": 2676,
"departure": {
"airport": "SEA",
"city": "SEA",
"state": "WA",
"country": "US",
"time": "08:20:00-07:00"
},
"arrival": {
"airport": "HNL",
"city": "HNL",
"state": "HI",
"country": "US",
"time": "11:29:00-10:00",
"terminal": "2"
},
"carrier": {
"marketing": "DL",
"marketingFlightNumber": 1887,
"operating": "DL",
"operatingFlightNumber": 1887,
"equipment": {
"code": "753",
"typeForFirstLeg": "N",
"typeForLastLeg": "N"
}
}
}
]
}
]
这是 fareComponents 数组:
"fareComponents": [
{
"ref": 1,
"segments": [
{
"segment": {
"bookingCode": "V",
"cabinCode": "Y",
"mealCode": "D",
"seatsAvailable": 4,
"availabilityBreak": true
}
}
],
"id": 1,
"governingCarrier": "DL",
"fareAmount": 137.31,
"fareCurrency": "USD",
"fareBasisCode": "VA0SLOME/LN75",
"farePassengerType": "JCB",
"ticketDesignator": "LN75",
"publishedFareAmount": 274.62,
"negotiatedFare": true,
"privateFare": true,
"directionality": "FROM",
"direction": "WH",
"notValidAfter": "2019-08-31",
"applicablePricingCategories": "5 10 15 16 18 25 35",
"vendorCode": "ATP",
"fareTypeBitmap": "0E",
"fareType": "SIP",
"fareTariff": "191",
"fareRule": "8694"
},
{
"ref": 5,
"segments": [
{
"segment": {
"bookingCode": "V",
"cabinCode": "Y",
"mealCode": "B",
"seatsAvailable": 4,
"availabilityBreak": true
}
},
{
"segment": {
"bookingCode": "V",
"cabinCode": "Y",
"mealCode": "B",
"seatsAvailable": 9,
"availabilityBreak": true
}
}
],
"id": 5,
"governingCarrier": "DL",
"fareAmount": 137.31,
"fareCurrency": "USD",
"fareBasisCode": "VA0SLOME/LN75",
"farePassengerType": "JCB",
"ticketDesignator": "LN75",
"publishedFareAmount": 274.62,
"negotiatedFare": true,
"privateFare": true,
"directionality": "TO",
"direction": "WH",
"notValidAfter": "2019-08-31",
"applicablePricingCategories": "5 10 15 16 18 25 35",
"vendorCode": "ATP",
"fareTypeBitmap": "0E",
"fareType": "SIP",
"fareTariff": "191",
"fareRule": "8694"
}
]
【问题讨论】: