UnionInternationalCheminsdeFer / OSDM

Projects related to an open sales & distribution API for public transportation.
https://osdm.io
Apache License 2.0
53 stars 21 forks source link

New try to add a selectionFee to availability/place-map #557

Closed Linus-Turnit closed 1 month ago

Linus-Turnit commented 3 months ago

SelectionFee is a fee related to each specific places and applied when a place is actively selected by the user. If the passenger automatically is placed here, the selectionFee will not be applied.

This is very complicated to achieve with a fee at offer search since it is only applied when selected and each fee-level then probably need its own accommodationSubType. One place, probably need to be defined as two different accomodationSubTypes. For that reason we introduce the selectionFee direct in the placeMap-response

To have, the selectionFee direct in the availability response for the place-map, makes it easy for the Sales Application to show the customer the fee to select this individual place direct in the place map.

It is up to the provider system to calculate a selectionFee or not. The selectionFee will be applied by the IMS when placeSelections are provided in POST /bookings request.

With this approach the selectionFee will be added every time a place is selected (from placeMap or direct by user input) in POST /bookings/{bookingId}.

It will be more and more common in the commercial transportation landscape to have selection fees like this. Eg. In the air industry it is very common to add a selection fee on places with extra room for the legs.

The selectionFee is referenced from the reservation object and are removed if the reservation is removed/refunded.

{
  "vehicleAvailability": {
    "vehicle": {
      "coaches": [
        {
          "compartments": [
            {
              "places": [
                {
                  "number": "string",
                  "status": "NONE",
                  "isSelectable": true,
                  "placeProperties": [
                    "string"
                  ],
                  "selectionFee": {    <==== The selection fee on place-level
                    "currency": "string",
                    "amount": 0,
                    "scale": 0
                  }
                }
              ],
              "number": "string",
              "isSelectable": true,
              "status": "NONE",
              "travelClass": "string",
              "serviceClass": "string",
              "compartmentProperties": [
                "string",
                 "selectionFee": {    <==== The selection fee on compartment-level
                   "currency": "string",
                   "amount": 0,
                   "scale": 0
                  }
              ]
            }
          ],
          "number": "string",
          "status": "NONE",
          "layoutId": "string",
          "layoutIdUpperDeck": "string",
          "layoutIdLowerDeck": "string",
          "direction": "UNSPECIFIED",
          "owner": "string",
          "specialCoach": "string"
        }
      ]
    },
    "preSelections": [
      {
        "coach": "string",
        "place": "string",
        "reservationId": "string"
      }
    ]
  }
}
CGantert345 commented 3 months ago

We would need the selection fee also on compartment in case the compartment is selectable.

The ApplicabilityType in fee needs a new value "PLACE_SELECTION"

We need a new value in graphicalReservation in the reservation offer to indicate that there will be a fee "WITH_FEE".

Should the place selection request return the fee or feeId of the fee added to the booking nby selecting the place?

Do we need an additional mechanism to avoid getting the fee unintentionally?

KlausKovar commented 2 months ago

At the moment ÖBB does not have concrete requirements on fees for the use of the seat-map via OSDM. So unfortunately I can't contribute anything definitive for version 3.3 here. I hope I know more vor version 3.4 or 4.

CGantert345 commented 4 weeks ago

TODO add patch for selectionFee on compartment