opentripmodel / otm5-change-requests

Tracking and reporting bugs and change requests of the OTM5 specification.
5 stars 1 forks source link

Document association #28

Closed gerardpeters closed 2 years ago

gerardpeters commented 3 years ago

Type of request

Is your feature request related to a problem? I'm not entirely sure of this is a change, a bug or that it's unclear how to use the specs. I'm implementing the documents endpoints but I'm not sure how to add a document to an existing consignment. For what I see now there are some options:

What is your take on this?

bmeesters commented 3 years ago

Add the document and then with a AssociationCreatedEvent associate the document with the consignment.

This is indeed the envisioned workflow for adding connections between entities after both have been created.

In this case I'm missing the Document as EntityType I think.

You are right, this has been an oversight. Since this is a bug I will fix this soon, I expect to be able to change it next week.

The other problem I have here, is that the system doesn't allow me to add a document without a reference to an existing Consignment/Trip;

I don't understand what you mean by this. I assume you want to add Documents to an existing Consignment right? So then you can have a reference to an existing Consignment right when you make the AssociationCreatedEvent?

Alternatively we could also look into adding more associations to Documents if something like that is common.

gerardpeters commented 3 years ago

The other problem I have here, is that the system doesn't allow me to add a document without a reference to an existing Consignment/Trip

When inserting a document into our system, I directly need the relation with another entity (consignment/trip). Because the processing of documents and events are happening asynchronous I do not have the guarantee that the document is already created in the system before the associationevent is received. And building somekind of queing or retry is to much of a hassle.

So, of you can add more associations that would be helpfull but in the meantime I'll use the ExternalAttributes to solve the problem.

bmeesters commented 3 years ago

I fixed the problem with document not being present as entity type. I think the remaining part of this change request is to add more associations to document right? Or do you not wish for that anymore? If so, I'll update the title of this change request to reflect the purpose.

gerardpeters commented 3 years ago

For my specific case it is not needed anymore, I'm using the external attributes for now. Don't know if other will benefit from extending the model but if so I'll change it to the appropriate association if this gets a place in the model.

bmeesters commented 2 years ago

Since you do not need it anymore and since there has been no further demand for this I will close this change request