Entity
An Entity is the base building block for structuring trips.
All objects, actions, an events are modeled as entities. An entity may for example represent a trip, a load/unload action (stop), a consignment, or a goods line. Entities themselves may be the parent of one or multiple entities in a one-to-many relationship.
Each entity must always consist of at least a foreignId, and flag field may be complemented with additional fields as described in the table below.
Property | Required | Type | Description |
|---|---|---|---|
foreignId | true | string | Unique identifier used to identify an entity. This value must always stay the same when referencing the same entity. Most often, an internal database ID is used. |
flag | true | string | Used to specify the type of entity. There is no predefined list of possible flags. You can determine the flags yourself to match your trip structure. Some commonly used flags are:
|
rank | false | long | Used to determine the order in which entities are displayed in the app. Entities are sorted in ascending order meaning entities with a lower rank will appear first. When no rank is provided entities are displayed in the order in which they are received. |
title | false | string | A human-readable name for the entity. When left empty the |
meta | false | JsonObject | Field used to provide additional (meta) data for an entity. For example, an address, contact details, references, action descriptions (load/unload), etc. There are no predetermined fields for the values within the metadata. You may add as many fields as you want as long as the |
entities | false | Entity array | To model a hierarchy, an entity may contain one or multiple entities as children. A possible commonly used hierarchy is trip -> stop -> goods line |
Examples
Each of the examples below contains a JSON snippet together with a brief explanation.
The example below contains a possible JSON structure for an entity representing a trip. The entities field contains an array of entities to create a logical hierarchy. In this example the trip entity contains 2 entities representing a stop.
The example below contains a possible JSON structure for an entity representing a stop.
The example below contains the possible JSON structure for an entity representing a goods line