UnionInternationalCheminsdeFer / OSDM

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

Which error code for "Confirmation Time Limit Exceeded" #708

Closed ralfbayer-db closed 1 month ago

ralfbayer-db commented 1 month ago

Booking contains the attribute confirmationTimeLimit. When this time is exceeded, and a consumer attempts to do a POST /bookings/{booking-id}/fulfillments, this will/may fail.

Which error code will be returned in this case? The https://osdm.io/spec/errors-problems/ does not contain an explicit code for this fact, can we either (a) agree on one of the existing codes to be used in this case or (b) add an explicit code for this case.

jspetrak commented 1 month ago

@ralfbayer-db If I understand the Booking state model correctly, when TTL is reached (indicated by the confirmationTimeLimit), all parts are marked as CANCELLED.

In that case, I would return urn:osdm:problem:BOOKING_BOOKING_ALREADY_CANCELLED unless this is reserved for situation when we want to cancel the booking, and it is already cancelled.