Impact migration of the route POST /v0/proposals/{proposal_id}/alternative_transports

  • Outdated
  • September 16, 2023
  • 1 related route

Context

Upgrade from POST - /v0/proposals/{proposal_id}/alternative_transports to POST - /v2/proposals/{proposal_id}/alternative_transports

⚠️ Check Discussion: https://github.com/orgs/ClubMediterranee/discussions/7377 to migrate from v0 to v2 straight away

Key benefits : Having the same name for the field transport_class for all API endpoints ⭐ Key benefits : Having the same values for transport_class enum in all API endpoints ℹ️ In the Body -> flight_class becomes transport_class and its enum values become: PLANE_ECONOMY, PLANE_ECONOMY_PLUS, PLANE_BUSINESS, PLANE_PREMIUM, PLANE_FIRST, TRAIN_FIRST, TRAIN_SECOND instead of ECO, BUS, FIR, 1CL, 2CL, EC+, DIB, DIV, PCR, PRE ℹ️ In the Response -> Values of journeys.travel_sections.transport.class field become: PLANE_ECONOMY, PLANE_ECONOMY_PLUS, PLANE_BUSINESS, PLANE_PREMIUM, PLANE_FIRST, TRAIN_FIRST, TRAIN_SECOND instead of ECO, BUS, FIR, 1CL, 2CL, EC+, DIB, DIV, PCR, PRE

Key benefits :

  • GOs can exclude one or more flight companies
  • GOs can exclude one or more connection cities
  • GOs can allow or not cabin mixability
  • GOs can chose a min/max connection duration
  • GOs can allow airport change between 2 travel sections

As a BE B2B Dev I want to be able to use the same mapping for all transport_class fields In order to avoid multiple mappings for the same fields in several endpoints


Impacts

Route to call :

  • POST - /v2/proposals/{proposal_id}/alternative_transports

Body

flight_class got a new name : transport_classtransport_class is an ENUM containing the following values: PLANE_ECONOMY, PLANE_ECONOMY_PLUS, PLANE_BUSINESS, PLANE_PREMIUM, PLANE_FIRST, TRAIN_FIRST, TRAIN_SECOND

Model

Champ APIDéfinitionExampleType
transport_classTransport information indicating its classPLANE_ECONOMYENUM

ENUM Spotlight PLANE_ECONOMY, PLANE_ECONOMY_PLUS, PLANE_BUSINESS, PLANE_PREMIUM, PLANE_FIRST, TRAIN_FIRST, TRAIN_SECOND

POST /v2/proposals/{proposal_id}/alternative_transports

Body Example value

{
  "journeys": [
    {
      "way": "INBOUND",
      "travel_sections": [
        {
          "departure": {
            "city": {
              "id": "PAR",
              "label": "PARIS"
            },
            "date": "20160812",
            "time": "17:00:00",
            "location": {
              "id": "CDG",
              "label": "PARIS-ROISSY CDG",
              "terminal_code": "2A"
            }
          },
          "arrival": {
            "city": {
              "id": "PAR",
              "label": "PARIS"
            },
            "date": "20160812",
            "time": "17:00:00",
            "location": {
              "id": "CDG",
              "label": "PARIS-ROISSY CDG",
              "terminal_code": "2A"
            }
          }
        }
      ],
      "transport_class": "PLANE_ECONOMY"
    }
  ],
  "is_direct_flight_only": true,
  "max_connections": 2,
  "transport_connection_duration": {
    "min": 60,
    "max": 120
  },
  "is_transport_stations_changes_allowed": {
    "on_connection": true,
    "along_roundtrip": false
  },
  "is_cabin_mixing_allowed": false,
  "is_companies_mixing_allowed": true,
  "imposed_companies": [
    "AF"
  ],
  "imposed_connection_cities": [
    "PAR"
  ],
  "excluded_companies": [
    "RA"
  ],
  "excluded_connection_cities": [
    "HAM"
  ]
}

Response

journeys.travel_sections.transport.class is a string having a new mapping (new values names): PLANE_ECONOMY, PLANE_ECONOMY_PLUS, PLANE_BUSINESS, PLANE_PREMIUM, PLANE_FIRST, TRAIN_FIRST, TRAIN_SECOND

Model

Champ APIDéfinitionExampleType
journeys.travel_sections.transport.classTransport information indicating its classPLANE_ECONOMYString

OUTPUT BECAME:

[
  {
    "id": "2:ac27a:64845",
    "price": {
      "amount": 1734,
+      "currency": "EUR"
    },
    "total_differential_price": {
      "amount": 154,
      "currency": "EUR",
      "is_best_differential_price": true
    },
    "journeys": [
      {
        "way": "INBOUND",
        "total_duration_in_min": 520,
        "travel_sections": [
          {
            "technical_stops": 0,
            "connection_duration_in_min": null,
            "stopover_duration_in_min": null,
            "duration_in_min": null,
            "clubmed_transport": false,
 +           "cancellation_policy_type": "THEO",
            "departure": {
              "date": "20240615",
              "time": "11:30:00",
              "city": {
                "id": "PAR",
                "label": "PARIS"
              },
              "location": {
                "id": "ORY",
                "label": "PARIS-ORLY",
                "terminal_code": "3"
              }
            },
            "arrival": {
              "date": "20240615",
              "time": "14:10:00",
              "city": {
                "id": "FDF",
                "label": "FORT DE FRANCE"
              },
              "location": {
                "id": "FDF",
                "label": "FORT DE FRANCE",
                "terminal_code": ""
              }
            },
            "transport": {
              "type": "PLANE",
              "class": "PLANE_ECONOMY",
              "travel_number": "842",
              "vehicle_type": "BOEING 777-200/300",
              "company": {
                "operator": {
                  "id": "AF",
                  "label": "AIR FRANCE",
                  "logo": "https://ns.clubmed.com/it/2013/img/be/airline_logos/AF.png"
                },
                "exploiter": {
                  "id": "AF",
                  "label": "AIR FRANCE",
                  "logo": "https://ns.clubmed.com/it/2013/img/be/airline_logos/AF.png"
                }
              },
              "baggage": {
                "weight": "",
                "quantity": "1"
              },
              "fare_class": "U"
            },
            "flight_code": "THEO2E"
          }
        ]
      },
      {
        "way": "OUTBOUND",
        "total_duration_in_min": 495,
        "travel_sections": [
          {
            "technical_stops": 0,
            "connection_duration_in_min": null,
            "stopover_duration_in_min": null,
            "duration_in_min": null,
            "clubmed_transport": false,
            "cancellation_policy_type": "THEO",
            "departure": {
              "date": "20240629",
              "time": "16:40:00",
              "city": {
                "id": "FDF",
                "label": "FORT DE FRANCE"
              },
              "location": {
                "id": "FDF",
                "label": "FORT DE FRANCE",
                "terminal_code": ""
              }
            },
            "arrival": {
              "date": "20240630",
              "time": "06:55:00",
              "city": {
                "id": "PAR",
                "label": "PARIS"
              },
              "location": {
                "id": "ORY",
                "label": "PARIS-ORLY",
                "terminal_code": "3"
              }
            },
            "transport": {
              "type": "PLANE",
              "class": "PLANE_ECONOMY",
              "travel_number": "841",
              "vehicle_type": "BOEING 777-200/300",
              "company": {
                "operator": {
                  "id": "AF",
                  "label": "AIR FRANCE",
                  "logo": "https://ns.clubmed.com/it/2013/img/be/airline_logos/AF.png"
                },
                "exploiter": {
                  "id": "AF",
                  "label": "AIR FRANCE",
                  "logo": "https://ns.clubmed.com/it/2013/img/be/airline_logos/AF.png"
                }
              },
              "baggage": {
                "weight": "",
                "quantity": "1"
              },
              "fare_class": "U"
            },
            "flight_code": "THEO2E"
          }
        ]
      }
    ]
  }
]