Zengate Traceability Metadata Standard
V1 standard of traceability data stored offchain via decentralized storage such as IPFS
v1.0.0
name
- type: string
- Name of commodity
version
- type: number
- version of traceability standard
- data is parsed according to version, therefore it is critical for this field to be filled accurately
creationDate
- type: string
- ISO 8601 timestamp string
errorDeclaration
- type
{
"isCorrection": false, // boolean
"declarationTime":"", // ISO 8601 timestamp string
"reason":"", // any string
"errorEventBoxId": "" // box id of incorrect event
} - this is used only if this event is amending the previous incorrect event
eventType
- type: string
- type of event
- object
- aggregation
- transformation
- association
- transaction
eventId
- type: string
- token id of this event
- if this is the first event, then this is an empty string
""
inputItems
- type
[
{
"itemIdentifier": "", // string
"itemEventId": "" // token id of the input event
"itemQuantity": 100 // number
"unit": "kilogram" // null if quantity does not apply
} // object
] // array of objects - contains item(s) which are inputs of this event
outputItems
- type
[
{
"itemIdentifier": "", // string
"itemQuantity": 100 // number
"unit": "kilogram" // null if quantity does not apply
} // object
] // array of objects - contains item(s) which are outputs of this event
- this is an empty array if this event is either aggregation or association
metadata
type
[
{
"key": "string", // string
"unit": "kilogram" // null if doesn't apply
"value": "string" // string or
"value": [
{
"key": "string", // string
"unit": "kilogram" // null if doesn't apply
"value": "string" // string or
"value": [
{
"key": "string", // string
"unit": "kilogram" // null if doesn't apply
"value": "string" // string
// and so on, as many nested levels as you need
}
]
}
]
}
]typescript type
type MetadataValue = string | Metadata;
interface MetadataItem {
key: string;
value: MetadataValue;
unit?: string;
}
type Metadata = MetadataItem[];recursive data structure to allow value to be stored.
- recursion ends when value is a string rather than another object of
Metadata
type
- recursion ends when value is a string rather than another object of