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

Relation between fulfilment and leg within a through fare #489

Open rolandkla opened 5 months ago

rolandkla commented 5 months ago

A fulfilment has a relation to one or more bookingParts and a bookingPart is for a trip with one or more legs. There is however no relation between a fulfilment and leg

In cases where a bookingPart covers multiple legs, for instance a through fare, and each leg has its own fulfilment it is not possible to link that directly to a leg.

Example:

- trips[]
  - id: 1
  - legs[]
    - timedLeg: A > B
    - timedLeg: B > C

- bookedOffer
  - admission
    - id: abc  
    - tripCoverage
       - coveredTripId: 1

- fulfillments[]
  - fulfilment
    - id: 1
    - bookingParts[abc]
   - fulfilment
    - id: 2
    - bookingParts[abc]

How can we link that fulfilment 1 is for leg A > B and fulfilment 2 is for B > C?

Especially with through fares of different operators this can be confusion or even cause settlement issues.

ralfbayer-db commented 5 months ago

Problem: the same through fare links to multiple fulfillments (e.g. one per leg) as multiple operators are giving out their own fulfillments. They each have individual control numbers and operator codes.

This means that multiple fulfillments point to the same BookedOfferPart, but the model doesn't have a way to distinguish them.

stinacarlstedt commented 4 months ago

Suggest one of these to model this link. Most simply, add a string-array to the fulfillment element detailing which leg ids, as provided in the trip element of the booking, are affected by the fulfillment. image

Alternately, to more closely mirror the way the booking parts are handled, same principle but using a LegReference element to detail the affected leg. This would allow for extending the amount of information provided without breaking the schema later: image

Finally, to create a more robust link between the trip and the fulfillment, a TripCoverage element as previously defined could be added to the fulfillment outright. image

CGantert345 commented 4 months ago

add trip coverage optional. If it is not stated nothing can be deducted.

TODO patch for next meeting --> Roland

rolandkla commented 3 months ago

https://github.com/UnionInternationalCheminsdeFer/OSDM/tree/feature/489

jspetrak commented 3 months ago

@rolandkla Could you also create the merge request? If I create one, I can't approve it being creator of the MR.

ralfbayer-db commented 2 months ago

Unfortunately DB cannot support multiple fulfillments per Admission.

CGantert345 commented 1 month ago

Examples for the cases with multiple fulfillment per accomodation are needed by DB

stinacarlstedt commented 1 month ago
  1. Through-fare with the same operator on both (all) legs will give one admission but one fulfillment per leg. (SJ)