Repository navigation
Description
Type of request
- I'd like to add something to the OTM 5 spec
- I'd like to change something in the OTM 5 spec
Is your feature request related to a problem?
Currently OTM does have no way of communicating data about documents, whereas documents are an important source of information in logistics. Examples include providing an eCMR (an eCMR might be added natively later) scanned CMRs, an official transport order, a proof of delivery in the shape of a photo, etc. Since this type of data is quite rich we cannot use (or abuse) external attributes for this purpose.
Describe the solution you'd like
After discussion between TANS, Centric and Simacan we came up with the following proposal:
- Create a new entity
Document. The reason to make this an entity instead of a data type is that we believe it is important that documents can be queried, inserted, updated, and associated from other entities. - Like all other entities, it should at least include the uuid, the name, and external attributes.
- On top of that we want to add (all optional fields):
- The filename, so the original name of the document can be shared and won't be lost among multiple exchanges of data.
- The type of document (photo, text file, etc.)
- The mimeType that indicates what kind of type the document is.
- The encoding of the document.
- The description of the document.
- The status (proposal to use the same status as Consignments and Trips for consistency, though we need to check whether we are grouping unrelated things). There is already another proposal to extend the possible statuses.
- The owner (associated actor) and creator (associated actor) of the document.
- And the only mandatory field, the content. Where the content can either be a reference to some file (URI), or the actual content encoded (as base64). The reference also contains some data about what kind of reference it is.
Documents can be associated to loads, unloads, handOvers, consignments, transportOrders, goods and trips
An example document then looks like this:
{
"uuid": "cf32da57-5edc-4c46-9a97-58c97ae27cf8",
"name": "Photo of PoD",
"externalAttributes": {
"externalID": "photo1234"
},
"documentType": "photo",
"filename": "my_photo.JPG",
"mimeType": "image/jpeg",
"encoding": "JPEG",
"description": "Proof that the goods are delivered by providing the photo that captures the moment",
"owner": {
"assocaitionType": ":reference",
"uuid": "655a2a4e-79b1-4637-9f13-b904730022ef"
},
"content": {
"contentType": "data",
"data": "<some base64 string>"
}
}
The alternative content would look like this:
...
"content": {
"contentType": "reference",
"uri": "https://link-to-photo.com/photo1234"
}
Something that still needs some discussion:
- Where do we want to use open text fields and where to we want to provide a list of possible options (enums)? Enums provide consistency and clarity in usage but can be too restrictive.
- Are the associations to Documents good? Do we also want to include other entities such as actors or actions such as stops?
Describe alternatives you've considered
Additional context
Activity
rvanweegberg commentedon Mar 25, 2021
Good description of necessary solution.
rverberne commentedon Mar 25, 2021
Overall a good proposal. A few points:
encodingandmimeType? If so, could we remove one of them? If not, how do they differ?origin. Values could bePlanningandDriver. I would choose to use this instead of thecreatorActor because a Actor is heavier in terms of implementation complexity. It can be hard to establish a translation between your system and a Actor. Using aoriginattribite you could distinguish between different document streams independent of a Actor. You can answer the question: "Is this a Document from the planner to the driver?" and "Is this a Document originating from the driver"?bmeesters commentedon Mar 25, 2021
@rvanweegberg
thomaskolmans commentedon Apr 8, 2021
How does this support eCMR exactly? Are we supposed to save the eCMR data as base64 then or how is this meant? I get that scanned CMRs as a PDF or image can be saved in this format.
The addition is very much welcome for the handling of documents of course!
bmeesters commentedon Apr 8, 2021
Yes, you are right, it does not natively handle eCMRs. Which could also be a good addition to OTM. However it can support any kind of raw document, which includes just CMRs as PDFs or links to digital document containing the eCMR. Currently Simcan works with Transfollow for the eCMRs and these Document entities could be used for that, so I was a little quick to jump to the conclusion that eCMRs are supported. It does not truly incorporate eCMRs. I'll update the title to make this distinction better.
[-]Add Documents Entity to deal with documents such as photos, eCMRs, PDFs, etc.[/-][+]Add Documents Entity to deal with documents such as photos, scanned CMRs, PDFs, etc.[/+]bmeesters commentedon Jun 1, 2021
Closing this as it is now official part of OTM5.1