【问题标题】:How to know which fareComponent is associated with a segment in BargainFinderMaxRS如何知道哪个 fareComponent 与 BargainFinderMaxRS 中的段相关联
【发布时间】: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"
            }
          ]

【问题讨论】:

    标签: rest sabre


    【解决方案1】:

    Bargain Finder 响应与价格不匹配。行程组段(段),每个行程都有自己的价格。

    编辑:我误解了这个问题。你没有错过什么,你是对的。首先,您需要使用行程的“legs”属性通过它的 ref 值对腿进行分组。您需要使用该信息对航段航段进行排序,之后您将看到航段数和票价组件 --> 航段属性计数是相同的。它们的索引也相同。我的意思是你在排序后有 3 条腿:

    腿1 腿2 腿3

    您有 3 个票价组成部分:

    票价组件1 票价组件2 fareComponent3

    结果如下:

    leg1 自己的 fareComponent1

    leg2 自己的 fareComponent2

    ... 等等。我希望这会有所帮助。

    【讨论】:

    • 谢谢,这正是我所需要的。我只是不确定是否可以安全地假设腿的索引与 fareComponents 的索引匹配。
    猜你喜欢
    • 1970-01-01
    • 2017-03-08
    • 1970-01-01
    • 2017-03-23
    • 2021-10-31
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-02-26
    相关资源
    最近更新 更多