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

On which code (productCode or productId or even another) can an OSDM consumer build product specific functionality? #596

Open ralfbayer-db opened 2 months ago

ralfbayer-db commented 2 months ago

We assumed initally that productId is a stable code which can be used to base any product specific logic/functionality/configuration upon in a OSDM consumer system.

However this doesn't seem to hold for all OSDM providers.

How does this agree with the fact that there is a product masterdata endpoint - how useful is that with unstable productIDs?

schlpbch commented 1 month ago

The product.code is stable, but also the product.id must be stable during a booking flow. Needs a discussion with @nixxus1030.

Discuss whether we need GET /products/{product-code}.

nixxus1030 commented 1 month ago

Hi all, the product.code is stable. The product.id should be stable within one booking process indeed, but not from one booking to another or when reopening the booking some time later

GET /products/{product.code} is not bulletproof (at least from where we look at it) because the product is always from a specific context:

CGantert345 commented 1 month ago

Proposal:

stable products: id = /products/12345

new endpoint for stable product: get /products/productCode+issuing-date

nixxus1030 commented 4 days ago

The proposal for me is

we could add a standalone stable endpoint, which would then be GET /products/?productCode=<productCode>&idType=<code>&issueingDate=\<date\>&travelDate=\<date\>

This call then would lack any context-related information. dates could be optional, in which case today would be assumed for both dates.

If this is ok, we can proceed and add the GETter. It should be documented too.

schlpbch commented 1 day ago

@nixxus1030 provides a PR.