diff --git a/e2e/constant.ts b/e2e/constant.ts new file mode 100644 index 00000000..20112479 --- /dev/null +++ b/e2e/constant.ts @@ -0,0 +1,14 @@ +export const ORCHARD_FACILITY = 'Orchard Facility'; +export const APP_CONFIG_FEATURE_APP = 'apps'; + +export const DIGITAL_TRACEABILITY_EVENT = 'DigitalTraceabilityEvent'; +export const DIGITAL_PRODUCT_PASSPORT = 'DigitalProductPassport'; + +export const ISSUE_DPP = 'Issue DPP'; +export const ISSUE_TRACEABILITY_TRANSFORMATION_EVENT = 'Issue Traceability Transformation Event'; +export const ISSUE_TRACEABILITY_OBJECT_EVENT = 'Issue Traceability Object Event'; +export const ISSUE_TRACEABILITY_ASSOCIATION_EVENT = 'Issue Traceability Association Event'; +export const ISSUE_TRACEABILITY_AGGREGATION_EVENT = 'Issue Traceability Aggregation Event'; +export const MOVE_TO_NEXT_FACILITY = 'Move to Next Facility'; + +export const TRACEABILITY_LINK_TYPE = 'http://localhost:3000/gs1/01/09359502000034/21/123456'; \ No newline at end of file diff --git a/e2e/cypress/e2e/issue_workflow_test/Traceability/issueAggregationEvent.cy.ts b/e2e/cypress/e2e/issue_workflow_test/Traceability/issueAggregationEvent.cy.ts new file mode 100644 index 00000000..8e679aec --- /dev/null +++ b/e2e/cypress/e2e/issue_workflow_test/Traceability/issueAggregationEvent.cy.ts @@ -0,0 +1,37 @@ +import { + APP_CONFIG_FEATURE_APP, + DIGITAL_TRACEABILITY_EVENT, + ISSUE_TRACEABILITY_AGGREGATION_EVENT, + ORCHARD_FACILITY, + TRACEABILITY_LINK_TYPE, +} from 'constant'; +import IssuePage from 'cypress/page/issuePage'; + +const aggregationEvent = new IssuePage(); + +describe('Issue Digital Traceability Aggregation Event end-to-end testing flow', () => { + beforeEach(() => { + aggregationEvent.beforeAll(); + }); + + it('should access the right the app config data', () => { + aggregationEvent.testAppConfig(); + }); + + it('should visit the homepage, navigate to "Orchard Facility", handle API calls, and show success message', () => { + aggregationEvent.generateWorkflow( + ORCHARD_FACILITY, + ISSUE_TRACEABILITY_AGGREGATION_EVENT, + DIGITAL_TRACEABILITY_EVENT, + APP_CONFIG_FEATURE_APP, + ); + }); + + it('Verify linkType', () => { + aggregationEvent.verifyLinkType(TRACEABILITY_LINK_TYPE); + }); + + it('Runs testing UNTP test suite for Digital Traceability Aggregation Event', () => { + aggregationEvent.runUntpTest('digitalTraceabilityEvent', 'v0.5.0'); + }); +}); diff --git a/e2e/cypress/e2e/issue_workflow_test/Traceability/issueAssociationEvent.cy.ts b/e2e/cypress/e2e/issue_workflow_test/Traceability/issueAssociationEvent.cy.ts new file mode 100644 index 00000000..58f28897 --- /dev/null +++ b/e2e/cypress/e2e/issue_workflow_test/Traceability/issueAssociationEvent.cy.ts @@ -0,0 +1,32 @@ +import { APP_CONFIG_FEATURE_APP, DIGITAL_TRACEABILITY_EVENT, ISSUE_TRACEABILITY_ASSOCIATION_EVENT, ORCHARD_FACILITY, TRACEABILITY_LINK_TYPE } from 'constant'; +import IssuePage from 'cypress/page/issuePage'; + +const associationEvent = new IssuePage(); + +describe('Issue Digital Traceability Association Event end-to-end testing flow', () => { + beforeEach(() => { + associationEvent.beforeAll(); + }); + + it('should access the right the app config data', () => { + associationEvent.testAppConfig(); + }); + + it('should visit the homepage, navigate to "Orchard Facility", handle API calls, and show success message', () => { + associationEvent.generateWorkflow( + ORCHARD_FACILITY, + ISSUE_TRACEABILITY_ASSOCIATION_EVENT, + DIGITAL_TRACEABILITY_EVENT, + APP_CONFIG_FEATURE_APP, + ); + + }); + + it('Verify linkType', () => { + associationEvent.verifyLinkType(TRACEABILITY_LINK_TYPE); + }); + + it('Runs testing UNTP test suite for Digital Traceability Association Event', () => { + associationEvent.runUntpTest('digitalTraceabilityEvent', 'v0.5.0'); + }); +}); diff --git a/e2e/cypress/e2e/issue_workflow_test/Traceability/issueObjectEvent.cy.ts b/e2e/cypress/e2e/issue_workflow_test/Traceability/issueObjectEvent.cy.ts new file mode 100644 index 00000000..643c7fd7 --- /dev/null +++ b/e2e/cypress/e2e/issue_workflow_test/Traceability/issueObjectEvent.cy.ts @@ -0,0 +1,37 @@ +import { + APP_CONFIG_FEATURE_APP, + DIGITAL_TRACEABILITY_EVENT, + ISSUE_TRACEABILITY_OBJECT_EVENT, + ORCHARD_FACILITY, + TRACEABILITY_LINK_TYPE, +} from 'constant'; +import IssuePage from 'cypress/page/issuePage'; + +const objectEvent = new IssuePage(); + +describe('Issue Digital Traceability Object Event end-to-end testing flow', () => { + beforeEach(() => { + objectEvent.beforeAll(); + }); + + it('should access the right the app config data', () => { + objectEvent.testAppConfig(); + }); + + it('should visit the homepage, navigate to "Orchard Facility", handle API calls, and show success message', () => { + objectEvent.generateWorkflow( + ORCHARD_FACILITY, + ISSUE_TRACEABILITY_OBJECT_EVENT, + DIGITAL_TRACEABILITY_EVENT, + APP_CONFIG_FEATURE_APP, + ); + }); + + it('Verify linkType', () => { + objectEvent.verifyLinkType(TRACEABILITY_LINK_TYPE); + }); + + it('Runs testing UNTP test suite for Digital Traceability Object Event', () => { + objectEvent.runUntpTest('digitalTraceabilityEvent', 'v0.5.0'); + }); +}); diff --git a/e2e/cypress/e2e/issue_workflow_test/Traceability/issueTransactionEvent.cy.ts b/e2e/cypress/e2e/issue_workflow_test/Traceability/issueTransactionEvent.cy.ts new file mode 100644 index 00000000..123af89a --- /dev/null +++ b/e2e/cypress/e2e/issue_workflow_test/Traceability/issueTransactionEvent.cy.ts @@ -0,0 +1,45 @@ +import { + APP_CONFIG_FEATURE_APP, + DIGITAL_PRODUCT_PASSPORT, + DIGITAL_TRACEABILITY_EVENT, + ISSUE_DPP, + MOVE_TO_NEXT_FACILITY, + ORCHARD_FACILITY, + TRACEABILITY_LINK_TYPE, +} from 'constant'; +import IssuePage from 'cypress/page/issuePage'; + +const transactionEvent = new IssuePage(); +const dppIssue = new IssuePage(); + +describe('Issue Digital Traceability Transaction Event end-to-end testing flow', () => { + beforeEach(() => { + transactionEvent.beforeAll(); + cy.clearLocalStorage(); + }); + + it('should access the right the app config data', () => { + transactionEvent.testAppConfig(); + }); + + it('should issue DPP first and then issue Digital Traceability Transaction Event', () => { + dppIssue.generateWorkflow(ORCHARD_FACILITY, ISSUE_DPP, DIGITAL_PRODUCT_PASSPORT, APP_CONFIG_FEATURE_APP); + + cy.visit('/'); + + transactionEvent.generateWorkflow( + ORCHARD_FACILITY, + MOVE_TO_NEXT_FACILITY, + DIGITAL_TRACEABILITY_EVENT, + APP_CONFIG_FEATURE_APP, + ); + }); + + it('Verify linkType', () => { + transactionEvent.verifyLinkType(TRACEABILITY_LINK_TYPE); + }); + + it('Runs testing UNTP test suite for Digital Traceability Transaction Event', () => { + transactionEvent.runUntpTest('digitalTraceabilityEvent', 'v0.5.0'); + }); +}); diff --git a/e2e/cypress/e2e/issue_workflow_test/Traceability/issueTransformationEvent.cy.ts b/e2e/cypress/e2e/issue_workflow_test/Traceability/issueTransformationEvent.cy.ts new file mode 100644 index 00000000..8055edd3 --- /dev/null +++ b/e2e/cypress/e2e/issue_workflow_test/Traceability/issueTransformationEvent.cy.ts @@ -0,0 +1,37 @@ +import { + APP_CONFIG_FEATURE_APP, + DIGITAL_TRACEABILITY_EVENT, + ISSUE_TRACEABILITY_TRANSFORMATION_EVENT, + ORCHARD_FACILITY, + TRACEABILITY_LINK_TYPE, +} from 'constant'; +import IssuePage from 'cypress/page/issuePage'; + +const transformationEvent = new IssuePage(); + +describe('Issue Digital Traceability Transformation Event end-to-end testing flow', () => { + beforeEach(() => { + transformationEvent.beforeAll(); + }); + + it('should access the right the app config data', () => { + transformationEvent.testAppConfig(); + }); + + it('should visit the homepage, navigate to "Orchard Facility", handle API calls, and show success message', () => { + transformationEvent.generateWorkflow( + ORCHARD_FACILITY, + ISSUE_TRACEABILITY_TRANSFORMATION_EVENT, + DIGITAL_TRACEABILITY_EVENT, + APP_CONFIG_FEATURE_APP, + ); + }); + + it('Verify linkType', () => { + transformationEvent.verifyLinkType(TRACEABILITY_LINK_TYPE); + }); + + it('Runs testing UNTP test suite for Digital Traceability Transformation Event', () => { + transformationEvent.runUntpTest('digitalTraceabilityEvent', 'v0.5.0'); + }); +}); diff --git a/e2e/cypress/fixtures/app-config.json b/e2e/cypress/fixtures/app-config.json index 6ac8fc69..02881e42 100644 --- a/e2e/cypress/fixtures/app-config.json +++ b/e2e/cypress/fixtures/app-config.json @@ -613,27 +613,18 @@ "name": "JsonForm", "type": "EntryData", "props": { - "schema":{ + "schema": { "type": "object", "additionalProperties": true, "properties": { "type": { "type": "array", "readOnly": true, - "const": [ - "DigitalFacilityRecord", - "VerifiableCredential" - ], - "default": [ - "DigitalFacilityRecord", - "VerifiableCredential" - ], + "const": ["DigitalFacilityRecord", "VerifiableCredential"], + "default": ["DigitalFacilityRecord", "VerifiableCredential"], "items": { "type": "string", - "enum": [ - "DigitalFacilityRecord", - "VerifiableCredential" - ] + "enum": ["DigitalFacilityRecord", "VerifiableCredential"] } }, "@context": { @@ -685,11 +676,7 @@ } }, "description": "A digital verifiable credential holding facility performance information.", - "required": [ - "@context", - "id", - "issuer" - ], + "required": ["@context", "id", "issuer"], "$schema": "https://json-schema.org/draft/2020-12/schema", "$defs": { "CredentialIssuer": { @@ -699,17 +686,11 @@ "type": { "type": "array", "readOnly": true, - "const": [ - "CredentialIssuer" - ], - "default": [ - "CredentialIssuer" - ], + "const": ["CredentialIssuer"], + "default": ["CredentialIssuer"], "items": { "type": "string", - "enum": [ - "CredentialIssuer" - ] + "enum": ["CredentialIssuer"] } }, "id": { @@ -732,10 +713,7 @@ } }, "description": "The issuer party (person or organisation) of a verifiable credential.", - "required": [ - "id", - "name" - ] + "required": ["id", "name"] }, "Identifier": { "type": "object", @@ -744,17 +722,11 @@ "type": { "type": "array", "readOnly": true, - "const": [ - "Identifier" - ], - "default": [ - "Identifier" - ], + "const": ["Identifier"], + "default": ["Identifier"], "items": { "type": "string", - "enum": [ - "Identifier" - ] + "enum": ["Identifier"] } }, "id": { @@ -779,10 +751,7 @@ } }, "description": "The ID and Name of an identified entity such as a product, facility, party, standard, etc. If the identifier is a W3C DID then the corresponding DID document SHOULD include a serviceEndpoint of type \"IdentityResolver\". If the identifier is not a W3C DID then the id property SHOULD be an identity resolver URL.", - "required": [ - "id", - "name" - ] + "required": ["id", "name"] }, "IdentifierScheme": { "type": "object", @@ -791,17 +760,11 @@ "type": { "type": "array", "readOnly": true, - "const": [ - "IdentifierScheme" - ], - "default": [ - "IdentifierScheme" - ], + "const": ["IdentifierScheme"], + "default": ["IdentifierScheme"], "items": { "type": "string", - "enum": [ - "IdentifierScheme" - ] + "enum": ["IdentifierScheme"] } }, "id": { @@ -825,17 +788,11 @@ "type": { "type": "array", "readOnly": true, - "const": [ - "Facility" - ], - "default": [ - "Facility" - ], + "const": ["Facility"], + "default": ["Facility"], "items": { "type": "string", - "enum": [ - "Facility" - ] + "enum": ["Facility"] } }, "id": { @@ -903,10 +860,7 @@ } }, "description": "The physical site (eg farm or factory) where the product or materials was produced. Including the facility sustainability performance record.", - "required": [ - "id", - "name" - ] + "required": ["id", "name"] }, "Classification": { "type": "object", @@ -915,17 +869,11 @@ "type": { "type": "array", "readOnly": true, - "const": [ - "Classification" - ], - "default": [ - "Classification" - ], + "const": ["Classification"], + "default": ["Classification"], "items": { "type": "string", - "enum": [ - "Classification" - ] + "enum": ["Classification"] } }, "id": { @@ -957,10 +905,7 @@ } }, "description": "A classification scheme and code / name representing a category value for a product, entity, or facility.", - "required": [ - "id", - "name" - ] + "required": ["id", "name"] }, "Address": { "type": "object", @@ -969,17 +914,11 @@ "type": { "type": "array", "readOnly": true, - "const": [ - "Address" - ], - "default": [ - "Address" - ], + "const": ["Address"], + "default": ["Address"], "items": { "type": "string", - "enum": [ - "Address" - ] + "enum": ["Address"] } }, "streetAddress": { @@ -1017,17 +956,11 @@ "type": { "type": "array", "readOnly": true, - "const": [ - "Location" - ], - "default": [ - "Location" - ], + "const": ["Location"], + "default": ["Location"], "items": { "type": "string", - "enum": [ - "Location" - ] + "enum": ["Location"] } }, "plusCode": { @@ -1053,9 +986,7 @@ "properties": { "type": { "type": "string", - "enum": [ - "Point" - ], + "enum": ["Point"], "example": "Point", "description": "" }, @@ -1065,9 +996,7 @@ } }, "description": "Represents a Point geometry", - "required": [ - "type" - ] + "required": ["type"] }, "Point3D": { "description": "Point in 3d space", @@ -1075,17 +1004,11 @@ { "type": "array", "readOnly": true, - "const": [ - "Point3D" - ], - "default": [ - "Point3D" - ], + "const": ["Point3D"], + "default": ["Point3D"], "items": { "type": "string", - "enum": [ - "Point3D" - ] + "enum": ["Point3D"] } }, { @@ -1104,9 +1027,7 @@ "properties": { "type": { "type": "string", - "enum": [ - "Polygon" - ], + "enum": ["Polygon"], "example": "Polygon", "description": "" }, @@ -1119,9 +1040,7 @@ } }, "description": "Represents a Polygon geometry", - "required": [ - "type" - ] + "required": ["type"] }, "Point3DWrapper": { "description": "", @@ -1129,17 +1048,11 @@ { "type": "array", "readOnly": true, - "const": [ - "Point3DWrapper" - ], - "default": [ - "Point3DWrapper" - ], + "const": ["Point3DWrapper"], + "default": ["Point3DWrapper"], "items": { "type": "string", - "enum": [ - "Point3DWrapper" - ] + "enum": ["Point3DWrapper"] } }, { @@ -1158,20 +1071,11 @@ "type": { "type": "array", "readOnly": true, - "const": [ - "Claim", - "Declaration" - ], - "default": [ - "Claim", - "Declaration" - ], + "const": ["Claim", "Declaration"], + "default": ["Claim", "Declaration"], "items": { "type": "string", - "enum": [ - "Claim", - "Declaration" - ] + "enum": ["Claim", "Declaration"] } }, "assessmentDate": { @@ -1241,11 +1145,7 @@ } }, "description": "A conformity claim about the facility against a specific standard or regulation.", - "required": [ - "id", - "conformance", - "conformityTopic" - ] + "required": ["id", "conformance", "conformityTopic"] }, "Standard": { "type": "object", @@ -1254,17 +1154,11 @@ "type": { "type": "array", "readOnly": true, - "const": [ - "Standard" - ], - "default": [ - "Standard" - ], + "const": ["Standard"], + "default": ["Standard"], "items": { "type": "string", - "enum": [ - "Standard" - ] + "enum": ["Standard"] } }, "id": { @@ -1290,9 +1184,7 @@ } }, "description": "A standard (eg ISO 14000) that specifies the criteria for conformance.", - "required": [ - "issuingParty" - ] + "required": ["issuingParty"] }, "Regulation": { "type": "object", @@ -1301,17 +1193,11 @@ "type": { "type": "array", "readOnly": true, - "const": [ - "Regulation" - ], - "default": [ - "Regulation" - ], + "const": ["Regulation"], + "default": ["Regulation"], "items": { "type": "string", - "enum": [ - "Regulation" - ] + "enum": ["Regulation"] } }, "id": { @@ -1342,9 +1228,7 @@ } }, "description": "A regulation (eg EU deforestation regulation) that defines the criteria for assessment.", - "required": [ - "administeredBy" - ] + "required": ["administeredBy"] }, "Criterion": { "type": "object", @@ -1353,17 +1237,11 @@ "type": { "type": "array", "readOnly": true, - "const": [ - "Criterion" - ], - "default": [ - "Criterion" - ], + "const": ["Criterion"], + "default": ["Criterion"], "items": { "type": "string", - "enum": [ - "Criterion" - ] + "enum": ["Criterion"] } }, "id": { @@ -1386,10 +1264,7 @@ } }, "description": "A specific rule or criterion within a standard or regulation. eg a carbon intensity calculation rule within an emissions standard.", - "required": [ - "id", - "name" - ] + "required": ["id", "name"] }, "Metric": { "type": "object", @@ -1398,17 +1273,11 @@ "type": { "type": "array", "readOnly": true, - "const": [ - "Metric" - ], - "default": [ - "Metric" - ], + "const": ["Metric"], + "default": ["Metric"], "items": { "type": "string", - "enum": [ - "Metric" - ] + "enum": ["Metric"] } }, "metricName": { @@ -1432,10 +1301,7 @@ } }, "description": "A specific measure of performance against the criteria that governs the claim. Expressed as an array of metric (ie unit of measure) / value (ie the actual numeric value) pairs. ", - "required": [ - "metricName", - "metricValue" - ] + "required": ["metricName", "metricValue"] }, "Measure": { "type": "object", @@ -1444,17 +1310,11 @@ "type": { "type": "array", "readOnly": true, - "const": [ - "Measure" - ], - "default": [ - "Measure" - ], + "const": ["Measure"], + "default": ["Measure"], "items": { "type": "string", - "enum": [ - "Measure" - ] + "enum": ["Measure"] } }, "value": { @@ -1469,10 +1329,7 @@ } }, "description": "The measure class defines a numeric measured value (eg 10) and a coded unit of measure (eg KG).", - "required": [ - "value", - "unit" - ] + "required": ["value", "unit"] }, "SecureLink": { "type": "object", @@ -1481,20 +1338,11 @@ "type": { "type": "array", "readOnly": true, - "const": [ - "SecureLink", - "Link" - ], - "default": [ - "SecureLink", - "Link" - ], + "const": ["SecureLink", "Link"], + "default": ["SecureLink", "Link"], "items": { "type": "string", - "enum": [ - "SecureLink", - "Link" - ] + "enum": ["SecureLink", "Link"] } }, "linkURL": { @@ -1520,19 +1368,13 @@ }, "hashMethod": { "type": "string", - "enum": [ - "SHA-256", - "SHA-1" - ], + "enum": ["SHA-256", "SHA-1"], "example": "SHA-256", "description": "The hashing algorithm used to create the target hash. SHA-265 is the recommended standard" }, "encryptionMethod": { "type": "string", - "enum": [ - "none", - "AES" - ], + "enum": ["none", "AES"], "example": "none", "description": "The symmetric encryption algorithm used to encrypt the link target. AES is the recommended standard. Decryption keys are expected to be passed out of bounds." } @@ -3583,8 +3425,8 @@ ] }, { - "name": "Issue traceability Event", - "id": "issue_traceability_event", + "name": "Issue Traceability Transformation Event", + "id": "issue_traceability_transformation_event", "components": [ { "name": "JsonForm", @@ -4512,665 +4354,1741 @@ ] }, { - "name": "Issue Object Event", - "id": "issue_object_event", + "name": "Issue Traceability Object Event", + "id": "issue_traceability_object_event", "components": [ { "name": "JsonForm", "type": "EntryData", "props": { "schema": { - "url": "https://jargon.sh/user/unece/traceabilityEvents/v/working/artefacts/jsonSchemas/ObjectEvent.json?class=ObjectEvent" - }, - "data": { - "type": ["ObjectEvent", "Event"], - "id": "https://events.sample.com/01/09359502000034/21/123456", - "processType": "Weaving", - "eventTime": "2024-09-01T12:00:00", - "action": "add", - "disposition": "https://ref.gs1.org/cbv/Disp-active", - "bizStep": "https://ref.gs1.org/cbv/BizStep-commissioning", - "bizLocation": "https://id.gs1.org/414/9520123456788", - "sensorElementList": [ - { - "sensorMetadata": { - "device": { - "type": ["Item"], - "id": "https://id.gs1.org/01/09520123456788/21/12345", - "name": "EV battery 300Ah." + "type": "array", + "items": { + "$ref": "#/$defs/Event" + }, + "$defs": { + "CredentialIssuer": { + "type": "object", + "additionalProperties": false, + "properties": { + "type": { + "type": "array", + "readOnly": true, + "const": ["CredentialIssuer"], + "default": ["CredentialIssuer"], + "items": { + "type": "string", + "enum": ["CredentialIssuer"] + } }, - "dataProcessingMethod": "https://standards.org/sensorMethod#1234" - }, - "sensorReport": [ - { - "time": "2024-07-24T12:00:00", - "sensorType": "https://samplesensors.com/model1234", - "value": 25, - "uom": "KGM" + "id": { + "example": "did:web:identifiers.example-company.com:12345", + "type": "string", + "format": "uri", + "description": "The W3C DID of the issuer - should be a did:web or did:tdw" }, - { - "time": "2024-07-24T12:00:00", - "sensorType": "https://samplesensors.com/model1234", - "value": 25, - "uom": "KGM" + "name": { + "example": "Example Company Pty Ltd", + "type": "string", + "description": "The name of the issuer person or organisation" + }, + "otherIdentifier": { + "type": "array", + "items": { + "$ref": "#/$defs/Identifier" + }, + "description": "An optional list of other registered identifiers for this credential issuer " } - ], - "sensorIntegrityProof": "https://jargon.sh" + }, + "description": "The issuer party (person or organisation) of a verifiable credential.", + "required": ["id", "name"] }, - { - "sensorMetadata": { - "device": { - "type": ["Item"], - "id": "https://id.gs1.org/01/09520123456788/21/12345", - "name": "EV battery 300Ah." + "Identifier": { + "type": "object", + "additionalProperties": false, + "properties": { + "type": { + "type": "array", + "readOnly": true, + "const": ["Identifier"], + "default": ["Identifier"], + "items": { + "type": "string", + "enum": ["Identifier"] + } }, - "dataProcessingMethod": "https://standards.org/sensorMethod#1234" - }, - "sensorReport": [ - { - "time": "2024-07-24T12:00:00", - "sensorType": "https://samplesensors.com/model1234", - "value": 25, - "uom": "KGM" + "id": { + "example": "https://id.gs1.org/01/09520123456788/21/12345", + "type": "string", + "format": "uri", + "description": "The globally unique ID of the entity as a resolvable URL according to ISO 18975. ExamplesProduct - id.gs1.org/01/09520123456788/21/12345 Party - abr.business.gov.au/ABN/View?abn=90664869327. Facility - did:web:facilities.example-company.com:123. " }, - { - "time": "2024-07-24T12:00:00", - "sensorType": "https://samplesensors.com/model1234", - "value": 25, - "uom": "KGM" + "name": { + "example": "EV battery 300Ah.", + "type": "string", + "description": "The registered name of the entity within the identifier scheme. Examples: product - EV battery 300Ah, Party - Sample Company Pty Ltd, Facility - Green Acres battery factory" + }, + "registeredId": { + "example": "90664869327", + "type": "string", + "description": "The registration number (alphanumeric) of the entity within the register. Unique within the register." + }, + "idScheme": { + "$ref": "#/$defs/IdentifierScheme", + "description": "The identifier scheme. Examples : Product - id.gs1.org/01, Party - business.gov.au/abn, Facility - did:web:facilities.acme.com. " } - ], - "sensorIntegrityProof": "https://jargon.sh" - } - ], - "epcList": [ - { - "type": ["Item"], - "id": "https://id.gs1.org/01/09520123456788/21/12345", - "name": "EV battery 300Ah." - }, - { - "type": ["Item"], - "id": "https://id.gs1.org/01/09520123456788/21/12345", - "name": "EV battery 300Ah." - } - ], - "quantityList": [ - { - "productId": "https://id.gs1.org/01/09520123456788/21/12345", - "productName": "EV battery 300Ah.", - "quantity": 20, - "uom": "KGM" + }, + "description": "The ID and Name of an identified entity such as a product, facility, party, standard, etc. If the identifier is a W3C DID then the corresponding DID document SHOULD include a serviceEndpoint of type \"IdentityResolver\". If the identifier is not a W3C DID then the id property SHOULD be an identity resolver URL.", + "required": ["id", "name"] }, - { - "productId": "https://id.gs1.org/01/09520123456788/21/12345", - "productName": "EV battery 300Ah.", - "quantity": 20, - "uom": "KGM" - } - ] - }, - "constructData": { - "mappingFields": [], - "dummyFields": [], - "generationFields": [ - { - "path": "/eventTime", - "handler": "generateCurrentDatetime" - } - ] - }, - "className": "json-form", - "style": { - "margin": "40px auto", - "paddingTop": "40px", - "width": "80%" - } - } - }, - { - "name": "CustomButton", - "type": "Submit", - "props": {} - } - ], - "services": [ - { "name": "convertObjectToArray1Item", "parameters": [{ "path": "/data" }] }, - { - "name": "processObjectEvent", - "parameters": [ - { - "vckit": { - "vckitAPIUrl": "http://localhost:3332/v2", - "issuer": { - "id": "did:web:uncefact.github.io:project-vckit:test-and-development", - "name": "Orchard Facility" + "IdentifierScheme": { + "type": "object", + "additionalProperties": false, + "properties": { + "type": { + "type": "array", + "readOnly": true, + "const": ["IdentifierScheme"], + "default": ["IdentifierScheme"], + "items": { + "type": "string", + "enum": ["IdentifierScheme"] + } + }, + "id": { + "example": "https://id.gs1.org/01/", + "type": "string", + "format": "uri", + "description": "The globally unique identifier of the registration scheme. The scheme should be registered and discoverable from vocabulary.uncefact.org/identifierSchemes" + }, + "name": { + "example": "Global Trade Identification Number (GTIN)", + "type": "string", + "description": "The name of the identifier scheme. " + } + }, + "description": "An identifier registration scheme for products, facilities, or organisations. Typically operated by a state, national or global authority." }, - "headers": { - "Authorization": "Bearer test123" - } - }, - "traceabilityEvent": { - "context": ["https://test.uncefact.org/vocabulary/untp/dte/0.5.0/"], - "renderTemplate": [ - { - "template": "
DIGITAL TRACEABILITY EVENT
{{#each credentialSubject}}
{{processType}}
{{bizStep}} {{eventTime}}
Transformation
Output
{{#each outputEPCList}}
{{name}}
View
{{/each}} {{#each outputQuantityList}}
{{quantity}}{{uom}} {{productName}}
View
{{/each}}

Transformed

Input
{{#each inputEPCList}}
{{name}}
View
{{/each}} {{#each inputQuantityList}}
{{quantity}}{{uom}} {{productName}}
View
{{/each}}
Event sensor information
{{#each sensorElementList}}
{{sensorMetadata.device.name}}
{{#each sensorReport}}
Captured at
{{time}}
Sensor type
Reading
{{value}}{{uom}}
{{/each}}
Integrity proof
{{/each}}
{{!-- TODO: to be confirmed, since the SensorElementList.sensorIntegrityProof duplicate --}} {{!-- being assumed --}} Event location information
{{processType}}
{{bizStep}} {{eventTime}}
Transaction
Source
{{!-- TODO: to be confirmed, since the navigation link wasn't provided --}} {{!-- being assumed --}}
View
Destination
{{!-- TODO: to be confirmed, since the navigation link wasn't provided --}} {{!-- being assumed --}}
View
Object list
{{#each epcList}}
{{name}}
View
{{/each}} {{#each quantityList}}
{{quantity}}{{uom}} {{productName}}
View
{{/each}}
Event sensor information
{{#each sensorElementList}}
{{sensorMetadata.device.name}}
{{#each sensorReport}}
Captured at
{{time}}
Sensor type
Reading
{{value}}{{uom}}
{{/each}}
Integrity proof
{{/each}}
{{!-- TODO: to be confirmed, since the SensorElementList.sensorIntegrityProof duplicate --}} {{!-- being assumed --}} Event location information
{{processType}}
{{bizStep}} {{eventTime}}
Object event
Object list
{{#each epcList}}
{{name}}
View
{{/each}} {{#each quantityList}}
{{quantity}}{{uom}} {{productName}}
View
{{/each}}
Event sensor information
{{#each sensorElementList}}
{{sensorMetadata.device.name}}
{{#each sensorReport}}
Captured at
{{time}}
Sensor type
Reading
{{value}}{{uom}}
{{/each}}
Integrity proof
{{/each}}
{{!-- TODO: to be confirmed, since the SensorElementList.sensorIntegrityProof duplicate --}} {{!-- being assumed --}} Event location information
{{processType}}
{{bizStep}} {{eventTime}}
Aggregation
{{parentEPC.name}}
View

Aggregated

Child list
{{#each childEPCList}}
{{name}}
View
{{/each}} {{#each childQuantityList}}
{{quantity}}{{uom}} {{productName}}
View
{{/each}}
Event sensor information
{{#each sensorElementList}}
{{sensorMetadata.device.name}}
{{#each sensorReport}}
Captured at
{{time}}
Sensor type
Reading
{{value}}{{uom}}
{{/each}}
Integrity proof
{{/each}}
{{!-- TODO: to be confirmed, since the SensorElementList.sensorIntegrityProof duplicate --}} {{!-- being assumed --}} Event location information
{{processType}}
{{bizStep}} {{eventTime}}
Association
{{parentEPC.name}}
View

Assembled

Child list
{{#each childEPCList}}
{{name}}
View
{{/each}} {{#each childQuantityList}}
{{quantity}}{{uom}} {{productName}}
View
{{/each}}
Event sensor information
{{#each sensorElementList}}
{{sensorMetadata.device.name}}
{{#each sensorReport}}
Captured at
{{time}}
Sensor type
Reading
{{value}}{{uom}}
{{/each}}
Integrity proof
{{/each}}
{{!-- TODO: to be confirmed, since the SensorElementList.sensorIntegrityProof duplicate --}} {{!-- being assumed --}} Event location information
{{/each}}
Issuing details
Issued by
Valid from
{{validFrom}}
", - "@type": "WebRenderingTemplate2022" - } - ], - "type": ["DigitalTraceabilityEvent"], - "dlrLinkTitle": "Object Event", - "dlrVerificationPage": "http://localhost:3003/verify" - }, - "dlr": { - "dlrAPIUrl": "http://localhost:3000", - "dlrAPIKey": "test123", - "namespace": "gs1", - "linkRegisterPath": "/api/resolver" - }, - "storage": { - "url": "http://localhost:3334/v1/documents", - "params": { - "bucket": "verifiable-credentials" - }, - "options": { - "method": "POST", - "headers": { - "Content-Type": "application/json" - } - } - }, - "identifierKeyPath": "/0/id" - } - ] - } - ] - }, - { - "name": "Issue Association Event", - "id": "issue_association_event", - "components": [ - { - "name": "JsonForm", - "type": "EntryData", - "props": { - "schema": { - "url": "https://jargon.sh/user/unece/traceabilityEvents/v/working/artefacts/jsonSchemas/AssociationEvent.json?class=AssociationEvent" - }, - "data": { - "type": ["AssociationEvent", "Event"], - "id": "https://events.sample.com/01/09359502000034/21/123456", - "processType": "Weaving", - "eventTime": "2024-09-01T12:00:00", - "action": "add", - "disposition": "https://ref.gs1.org/cbv/Disp-active", - "bizStep": "https://ref.gs1.org/cbv/BizStep-commissioning", - "bizLocation": "https://id.gs1.org/414/9520123456788", - "sensorElementList": [ - { - "sensorMetadata": { - "device": { - "type": ["Item"], - "id": "https://id.gs1.org/01/09520123456788/21/12345", - "name": "EV battery 300Ah." + "TransformationEvent": { + "type": "object", + "additionalProperties": true, + "properties": { + "type": { + "type": "array", + "readOnly": true, + "const": ["TransformationEvent", "Event"], + "default": ["TransformationEvent", "Event"], + "items": { + "type": "string", + "enum": ["TransformationEvent", "Event"] + } + }, + "id": { + "readOnly": true, + "example": "https://events.sample.com/01/09359502000034/21/123456", + "type": "string", + "format": "uri", + "description": "The unique identifier of this event - SHOULD be a UUID" + }, + "processType": { + "example": "Weaving", + "type": "string", + "description": "A human readable name for industry specific process represented by this event." + }, + "eventTime": { + "example": "2024-09-01T12:00:00", + "type": "string", + "format": "date-time", + "description": "The ISO-8601 date time when the event occurred." + }, + "action": { + "type": "string", + "enum": ["observe", "add", "delete"], + "example": "observe", + "description": "Code describing how an event relates to the life-cycle of the entity impacted by the event." + }, + "disposition": { + "type": "string", + "x-external-enumeration": "https://ref.gs1.org/cbv/Disp", + "description": "Disposition code describing the state of the item after the event. \n\n This is an enumerated value, but the list of valid values are too big, or change too often to include here. You can access the list of allowable values at this URL: https://ref.gs1.org/cbv/Disp\n " + }, + "bizStep": { + "type": "string", + "x-external-enumeration": "https://ref.gs1.org/cbv/BizStep", + "description": "A business step code drawn from a controlled vocabulary.\n\n This is an enumerated value, but the list of valid values are too big, or change too often to include here. You can access the list of allowable values at this URL: https://ref.gs1.org/cbv/BizStep\n " + }, + "bizLocation": { + "example": "https://id.gs1.org/414/9520123456788", + "type": "string", + "format": "uri", + "description": "A Business Location is a uniquely identified and discretely recorded geospatial location that is meant to designate the specific place where an object is assumed to be following an event until it is reported to be at a different Business Location by a subsequent event. The bizLocation must be a resolvable URI that links to facility information and geo-location data." + }, + "sensorElementList": { + "type": "array", + "items": { + "$ref": "#/$defs/SensorElement" + }, + "description": "An array (one for each sensor) of sensor device data sets associated with the event. " + }, + "outputEPCList": { + "type": "array", + "items": { + "$ref": "#/$defs/Item" + }, + "description": "The list of uniquely identified items that are the output of this transformation event - for example a list of individually identified bolts of cloth that are the output of a weaving process." + }, + "inputEPCList": { + "type": "array", + "items": { + "$ref": "#/$defs/Item" + }, + "description": "The list of uniquely identified items that are the input of this transformation event - for example a list of individually identified bobbins of yarn that are the input of a weaving process." + }, + "inputQuantityList": { + "type": "array", + "items": { + "$ref": "#/$defs/QuantityElement" + }, + "description": "The quantified list of product classes that are the input of this transformation event - used when each item does not have a unique identity. for example the weight of raw cotton that is the input to a ginning process." }, - "dataProcessingMethod": "https://standards.org/sensorMethod#1234" + "outputQuantityList": { + "type": "array", + "items": { + "$ref": "#/$defs/QuantityElement" + }, + "description": "The quantified list of product classes that are the output of this transformation event - used when each item does not have a unique identity. for example a count of the bales of cleaned cotton that are the output of a ginning process." + } }, - "sensorReport": [ - { - "time": "2024-07-24T12:00:00", - "sensorType": "https://samplesensors.com/model1234", - "value": 25, - "uom": "KGM" + "description": "Transformation represents an event in which input objects are fully or partially consumed and output objects are produced, such that any of the input objects may have contributed to all of the output objects - for example consuming bales of cotton to produce yarn." + }, + "SensorElement": { + "type": "object", + "additionalProperties": false, + "properties": { + "type": { + "type": "array", + "readOnly": true, + "const": ["SensorElement"], + "default": ["SensorElement"], + "items": { + "type": "string", + "enum": ["SensorElement"] + } }, - { - "time": "2024-07-24T12:00:00", - "sensorType": "https://samplesensors.com/model1234", - "value": 25, - "uom": "KGM" + "sensorMetadata": { + "$ref": "#/$defs/Sensor", + "description": "Data that describes the physical sensor that recorded the sensor data set." + }, + "sensorReport": { + "type": "array", + "items": { + "$ref": "#/$defs/SensorData" + }, + "description": "A list of sensor readings from the given sensor relevant to the traceability event context." + }, + "sensorIntegrityProof": { + "type": "string", + "format": "uri", + "description": "An optional reference to a verifiable credential signed by the sensor device or device manufacturer that contains the digitally signed raw data associated with this sensor report." } - ], - "sensorIntegrityProof": "https://jargon.sh" + }, + "description": "A SensorElement is used to carry data related to an event that is captured one sensor such as an IoT device. Include one sensor property and an array of sensor data values." }, - { - "sensorMetadata": { + "Sensor": { + "type": "object", + "additionalProperties": false, + "properties": { + "type": { + "type": "array", + "readOnly": true, + "const": ["Sensor"], + "default": ["Sensor"], + "items": { + "type": "string", + "enum": ["Sensor"] + } + }, "device": { - "type": ["Item"], - "id": "https://id.gs1.org/01/09520123456788/21/12345", - "name": "EV battery 300Ah." + "$ref": "#/$defs/Item", + "description": "The device Identifier for the sensor as a URI (typically an EPC)" }, - "dataProcessingMethod": "https://standards.org/sensorMethod#1234" + "dataProcessingMethod": { + "example": "https://standards.org/sensorMethod#1234", + "type": "string", + "format": "uri", + "description": "The data processing method used by the sensor - should reference a documented standard criteria as a URI" + } }, - "sensorReport": [ - { - "time": "2024-07-24T12:00:00", - "sensorType": "https://samplesensors.com/model1234", - "value": 25, - "uom": "KGM" + "description": "A physical sensor that records a sensor data set." + }, + "Item": { + "type": "object", + "additionalProperties": false, + "properties": { + "type": { + "type": "array", + "readOnly": true, + "const": ["Item"], + "default": ["Item"], + "items": { + "type": "string", + "enum": ["Item"] + } }, - { - "time": "2024-07-24T12:00:00", - "sensorType": "https://samplesensors.com/model1234", - "value": 25, - "uom": "KGM" + "id": { + "example": "https://id.gs1.org/01/09520123456788/21/12345", + "type": "string", + "format": "uri", + "description": "The globally unique ID of the product as a URI. Ideally as a resolvable URL according to ISO 18975. " + }, + "name": { + "example": "EV battery 300Ah.", + "type": "string", + "description": "The name of the product class to which the product item belongs. " } - ], - "sensorIntegrityProof": "https://jargon.sh" - } - ], - "parentEPC": { - "type": ["Item"], - "id": "https://id.gs1.org/01/09520123456788/21/12345", - "name": "EV battery 300Ah." - }, - "childEPCList": [ - { - "type": ["Item"], - "id": "https://id.gs1.org/01/09520123456788/21/12345", - "name": "EV battery 300Ah." - }, - { - "type": ["Item"], - "id": "https://id.gs1.org/01/09520123456788/21/12345", - "name": "EV battery 300Ah." - } - ], - "childQuantityList": [ - { - "productId": "https://id.gs1.org/01/09520123456788/21/12345", - "productName": "EV battery 300Ah.", - "quantity": 20, - "uom": "KGM" + }, + "description": "A specific serialised trade item which is an instance of a more generic product. ", + "required": ["id", "name"] }, - { - "productId": "https://id.gs1.org/01/09520123456788/21/12345", - "productName": "EV battery 300Ah.", - "quantity": 20, - "uom": "KGM" - } - ] - }, - "constructData": { - "mappingFields": [], - "dummyFields": [], - "generationFields": [ - { - "path": "/eventID", - "handler": "generateIdWithSerialNumber" - } - ] - }, - "className": "json-form", - "style": { - "margin": "40px auto", - "paddingTop": "40px", - "width": "80%" - } - } - }, - { - "name": "CustomButton", - "type": "Submit", - "props": {} - } - ], - "services": [ - { "name": "convertObjectToArray1Item", "parameters": [{ "path": "/data" }] }, - { - "name": "processAssociationEvent", - "parameters": [ - { - "vckit": { - "vckitAPIUrl": "http://localhost:3332/v2", - "issuer": { - "id": "did:web:uncefact.github.io:project-vckit:test-and-development", - "name": "Orchard Facility" - }, - "headers": { - "Authorization": "Bearer test123" - } - }, - "traceabilityEvent": { - "context": ["https://test.uncefact.org/vocabulary/untp/dte/0.5.0/"], - "renderTemplate": [ - { - "template": "
DIGITAL TRACEABILITY EVENT
{{#each credentialSubject}}
{{processType}}
{{bizStep}} {{eventTime}}
Transformation
Output
{{#each outputEPCList}}
{{name}}
View
{{/each}} {{#each outputQuantityList}}
{{quantity}}{{uom}} {{productName}}
View
{{/each}}

Transformed

Input
{{#each inputEPCList}}
{{name}}
View
{{/each}} {{#each inputQuantityList}}
{{quantity}}{{uom}} {{productName}}
View
{{/each}}
Event sensor information
{{#each sensorElementList}}
{{sensorMetadata.device.name}}
{{#each sensorReport}}
Captured at
{{time}}
Sensor type
Reading
{{value}}{{uom}}
{{/each}}
Integrity proof
{{/each}}
{{!-- TODO: to be confirmed, since the SensorElementList.sensorIntegrityProof duplicate --}} {{!-- being assumed --}} Event location information
{{processType}}
{{bizStep}} {{eventTime}}
Transaction
Source
{{!-- TODO: to be confirmed, since the navigation link wasn't provided --}} {{!-- being assumed --}}
View
Destination
{{!-- TODO: to be confirmed, since the navigation link wasn't provided --}} {{!-- being assumed --}}
View
Object list
{{#each epcList}}
{{name}}
View
{{/each}} {{#each quantityList}}
{{quantity}}{{uom}} {{productName}}
View
{{/each}}
Event sensor information
{{#each sensorElementList}}
{{sensorMetadata.device.name}}
{{#each sensorReport}}
Captured at
{{time}}
Sensor type
Reading
{{value}}{{uom}}
{{/each}}
Integrity proof
{{/each}}
{{!-- TODO: to be confirmed, since the SensorElementList.sensorIntegrityProof duplicate --}} {{!-- being assumed --}} Event location information
{{processType}}
{{bizStep}} {{eventTime}}
Object event
Object list
{{#each epcList}}
{{name}}
View
{{/each}} {{#each quantityList}}
{{quantity}}{{uom}} {{productName}}
View
{{/each}}
Event sensor information
{{#each sensorElementList}}
{{sensorMetadata.device.name}}
{{#each sensorReport}}
Captured at
{{time}}
Sensor type
Reading
{{value}}{{uom}}
{{/each}}
Integrity proof
{{/each}}
{{!-- TODO: to be confirmed, since the SensorElementList.sensorIntegrityProof duplicate --}} {{!-- being assumed --}} Event location information
{{processType}}
{{bizStep}} {{eventTime}}
Aggregation
{{parentEPC.name}}
View

Aggregated

Child list
{{#each childEPCList}}
{{name}}
View
{{/each}} {{#each childQuantityList}}
{{quantity}}{{uom}} {{productName}}
View
{{/each}}
Event sensor information
{{#each sensorElementList}}
{{sensorMetadata.device.name}}
{{#each sensorReport}}
Captured at
{{time}}
Sensor type
Reading
{{value}}{{uom}}
{{/each}}
Integrity proof
{{/each}}
{{!-- TODO: to be confirmed, since the SensorElementList.sensorIntegrityProof duplicate --}} {{!-- being assumed --}} Event location information
{{processType}}
{{bizStep}} {{eventTime}}
Association
{{parentEPC.name}}
View

Assembled

Child list
{{#each childEPCList}}
{{name}}
View
{{/each}} {{#each childQuantityList}}
{{quantity}}{{uom}} {{productName}}
View
{{/each}}
Event sensor information
{{#each sensorElementList}}
{{sensorMetadata.device.name}}
{{#each sensorReport}}
Captured at
{{time}}
Sensor type
Reading
{{value}}{{uom}}
{{/each}}
Integrity proof
{{/each}}
{{!-- TODO: to be confirmed, since the SensorElementList.sensorIntegrityProof duplicate --}} {{!-- being assumed --}} Event location information
{{/each}}
Issuing details
Issued by
Valid from
{{validFrom}}
", - "@type": "WebRenderingTemplate2022" - } - ], - "type": ["DigitalTraceabilityEvent"], - "dlrLinkTitle": "Association Event", - "dlrVerificationPage": "http://localhost:3003/verify" - }, - "dlr": { - "dlrAPIUrl": "http://localhost:3000", - "dlrAPIKey": "test123", - "namespace": "gs1", - "linkRegisterPath": "/api/resolver" - }, - "storage": { - "url": "http://localhost:3334/v1/documents", - "params": { - "bucket": "verifiable-credentials" - }, - "options": { - "method": "POST", - "headers": { - "Content-Type": "application/json" - } - } - }, - "identifierKeyPath": "/0/id" - } - ] - } - ] - }, - { - "name": "Issue Aggregation Event", - "id": "issue_aggregation_event", - "components": [ - { - "name": "JsonForm", - "type": "EntryData", - "props": { - "schema": { - "url": "https://jargon.sh/user/unece/traceabilityEvents/v/working/artefacts/jsonSchemas/AggregationEvent.json?class=AggregationEvent" - }, - "data": { - "type": ["AggregationEvent", "Event"], - "id": "https://events.sample.com/01/09359502000034/21/123456", - "processType": "Weaving", - "eventTime": "2024-09-01T12:00:00", - "action": "add", - "disposition": "https://ref.gs1.org/cbv/Disp-active", - "bizStep": "https://ref.gs1.org/cbv/BizStep-commissioning", - "bizLocation": "https://id.gs1.org/414/9520123456788", - "sensorElementList": [ - { - "sensorMetadata": { - "device": { - "type": ["Item"], - "id": "https://id.gs1.org/01/09520123456788/21/12345", - "name": "EV battery 300Ah." + "SensorData": { + "type": "object", + "additionalProperties": false, + "properties": { + "type": { + "type": "array", + "readOnly": true, + "const": ["SensorData"], + "default": ["SensorData"], + "items": { + "type": "string", + "enum": ["SensorData"] + } }, - "dataProcessingMethod": "https://standards.org/sensorMethod#1234" - }, - "sensorReport": [ - { - "time": "2024-07-24T12:00:00", - "sensorType": "https://samplesensors.com/model1234", - "value": 25, - "uom": "KGM" + "time": { + "example": "2024-07-24T12:00:00", + "type": "string", + "format": "date-time", + "description": "the timestamp at which the sensor reading was made." }, - { - "time": "2024-07-24T12:00:00", - "sensorType": "https://samplesensors.com/model1234", - "value": 25, - "uom": "KGM" - } - ], - "sensorIntegrityProof": "https://jargon.sh" - }, - { - "sensorMetadata": { - "device": { - "type": ["Item"], - "id": "https://id.gs1.org/01/09520123456788/21/12345", - "name": "EV battery 300Ah." + "sensorType": { + "example": "https://samplesensors.com/model1234", + "type": "string", + "format": "uri", + "description": "the measurement type of the sensor reading, as a URI reference to a measurement method specification." }, - "dataProcessingMethod": "https://standards.org/sensorMethod#1234" - }, - "sensorReport": [ - { - "time": "2024-07-24T12:00:00", - "sensorType": "https://samplesensors.com/model1234", - "value": 25, - "uom": "KGM" + "value": { + "example": 25, + "type": "number", + "description": "the sensor reading" }, - { - "time": "2024-07-24T12:00:00", - "sensorType": "https://samplesensors.com/model1234", - "value": 25, - "uom": "KGM" + "uom": { + "type": "string", + "x-external-enumeration": "https://vocabulary.uncefact.org/UnitMeasureCode", + "description": "the unit of measure for the sensor reading, drawn from UNECE rec20 code list.\n\n This is an enumerated value, but the list of valid values are too big, or change too often to include here. You can access the list of allowable values at this URL: https://vocabulary.uncefact.org/UnitMeasureCode\n " } - ], - "sensorIntegrityProof": "https://jargon.sh" - } - ], - "parentEPC": { - "type": ["Item"], - "id": "https://id.gs1.org/01/09520123456788/21/12345", - "name": "EV battery 300Ah." - }, - "childEPCList": [ - { - "type": ["Item"], - "id": "https://id.gs1.org/01/09520123456788/21/12345", - "name": "EV battery 300Ah." - }, - { - "type": ["Item"], - "id": "https://id.gs1.org/01/09520123456788/21/12345", - "name": "EV battery 300Ah." - } - ], - "childQuantityList": [ - { - "productId": "https://id.gs1.org/01/09520123456788/21/12345", - "productName": "EV battery 300Ah.", - "quantity": 20, - "uom": "KGM" - }, - { - "productId": "https://id.gs1.org/01/09520123456788/21/12345", - "productName": "EV battery 300Ah.", - "quantity": 20, - "uom": "KGM" - } - ] - }, - "constructData": { - "mappingFields": [], - "dummyFields": [], - "generationFields": [ - { - "path": "/eventID", - "handler": "generateIdWithSerialNumber" - } - ] - }, - "className": "json-form", - "style": { - "margin": "40px auto", - "paddingTop": "40px", - "width": "80%" - } - } - }, - { - "name": "CustomButton", - "type": "Submit", - "props": {} - } - ], - "services": [ - { "name": "convertObjectToArray1Item", "parameters": [{ "path": "/data" }] }, - { - "name": "processAggregationEvent", - "parameters": [ - { - "vckit": { - "vckitAPIUrl": "http://localhost:3332/v2", - "issuer": { - "id": "did:web:uncefact.github.io:project-vckit:test-and-development", - "name": "Orchard Facility" - }, - "headers": { - "Authorization": "Bearer test123" - } - }, - "traceabilityEvent": { - "context": ["https://test.uncefact.org/vocabulary/untp/dte/0.5.0/"], - "renderTemplate": [ - { - "template": "
DIGITAL TRACEABILITY EVENT
{{#each credentialSubject}}
{{processType}}
{{bizStep}} {{eventTime}}
Transformation
Output
{{#each outputEPCList}}
{{name}}
View
{{/each}} {{#each outputQuantityList}}
{{quantity}}{{uom}} {{productName}}
View
{{/each}}

Transformed

Input
{{#each inputEPCList}}
{{name}}
View
{{/each}} {{#each inputQuantityList}}
{{quantity}}{{uom}} {{productName}}
View
{{/each}}
Event sensor information
{{#each sensorElementList}}
{{sensorMetadata.device.name}}
{{#each sensorReport}}
Captured at
{{time}}
Sensor type
Reading
{{value}}{{uom}}
{{/each}}
Integrity proof
{{/each}}
{{!-- TODO: to be confirmed, since the SensorElementList.sensorIntegrityProof duplicate --}} {{!-- being assumed --}} Event location information
{{processType}}
{{bizStep}} {{eventTime}}
Transaction
Source
{{!-- TODO: to be confirmed, since the navigation link wasn't provided --}} {{!-- being assumed --}}
View
Destination
{{!-- TODO: to be confirmed, since the navigation link wasn't provided --}} {{!-- being assumed --}}
View
Object list
{{#each epcList}}
{{name}}
View
{{/each}} {{#each quantityList}}
{{quantity}}{{uom}} {{productName}}
View
{{/each}}
Event sensor information
{{#each sensorElementList}}
{{sensorMetadata.device.name}}
{{#each sensorReport}}
Captured at
{{time}}
Sensor type
Reading
{{value}}{{uom}}
{{/each}}
Integrity proof
{{/each}}
{{!-- TODO: to be confirmed, since the SensorElementList.sensorIntegrityProof duplicate --}} {{!-- being assumed --}} Event location information
{{processType}}
{{bizStep}} {{eventTime}}
Object event
Object list
{{#each epcList}}
{{name}}
View
{{/each}} {{#each quantityList}}
{{quantity}}{{uom}} {{productName}}
View
{{/each}}
Event sensor information
{{#each sensorElementList}}
{{sensorMetadata.device.name}}
{{#each sensorReport}}
Captured at
{{time}}
Sensor type
Reading
{{value}}{{uom}}
{{/each}}
Integrity proof
{{/each}}
{{!-- TODO: to be confirmed, since the SensorElementList.sensorIntegrityProof duplicate --}} {{!-- being assumed --}} Event location information
{{processType}}
{{bizStep}} {{eventTime}}
Aggregation
{{parentEPC.name}}
View

Aggregated

Child list
{{#each childEPCList}}
{{name}}
View
{{/each}} {{#each childQuantityList}}
{{quantity}}{{uom}} {{productName}}
View
{{/each}}
Event sensor information
{{#each sensorElementList}}
{{sensorMetadata.device.name}}
{{#each sensorReport}}
Captured at
{{time}}
Sensor type
Reading
{{value}}{{uom}}
{{/each}}
Integrity proof
{{/each}}
{{!-- TODO: to be confirmed, since the SensorElementList.sensorIntegrityProof duplicate --}} {{!-- being assumed --}} Event location information
{{processType}}
{{bizStep}} {{eventTime}}
Association
{{parentEPC.name}}
View

Assembled

Child list
{{#each childEPCList}}
{{name}}
View
{{/each}} {{#each childQuantityList}}
{{quantity}}{{uom}} {{productName}}
View
{{/each}}
Event sensor information
{{#each sensorElementList}}
{{sensorMetadata.device.name}}
{{#each sensorReport}}
Captured at
{{time}}
Sensor type
Reading
{{value}}{{uom}}
{{/each}}
Integrity proof
{{/each}}
{{!-- TODO: to be confirmed, since the SensorElementList.sensorIntegrityProof duplicate --}} {{!-- being assumed --}} Event location information
{{/each}}
Issuing details
Issued by
Valid from
{{validFrom}}
", - "@type": "WebRenderingTemplate2022" - } - ], - "type": ["DigitalTraceabilityEvent"], - "dlrLinkTitle": "Aggregation Event", - "dlrVerificationPage": "http://localhost:3003/verify" - }, - "dlr": { - "dlrAPIUrl": "http://localhost:3000", - "dlrAPIKey": "test123", - "namespace": "gs1", - "linkRegisterPath": "/api/resolver" - }, - "storage": { - "url": "http://localhost:3334/v1/documents", - "params": { - "bucket": "verifiable-credentials" + }, + "description": "A data point read by a sensor." }, - "options": { - "method": "POST", - "headers": { - "Content-Type": "application/json" - } - } - }, - "identifierKeyPath": "/0/id" - } - ] - } - ] - }, - { - "name": "Issue Transformation Event", - "id": "issue_transformation_event", - "components": [ - { - "name": "JsonForm", - "type": "EntryData", - "props": { - "schema": { - "url": "https://jargon.sh/user/unece/traceabilityEvents/v/working/artefacts/jsonSchemas/TransformationEvent.json?class=TransformationEvent" - }, - "data": { - "type": ["TransformationEvent", "Event"], - "id": "https://events.sample.com/01/09359502000034/21/123456", - "processType": "Weaving", - "eventTime": "2024-09-01T12:00:00", - "action": "observe", - "disposition": "https://ref.gs1.org/cbv/Disp-active", - "bizStep": "https://ref.gs1.org/cbv/BizStep-commissioning", - "bizLocation": "https://id.gs1.org/414/9520123456788", - "sensorElementList": [ - { - "sensorMetadata": { - "device": { - "type": ["Item"], - "id": "https://id.gs1.org/01/09520123456788/21/12345", - "name": "EV battery 300Ah." + "QuantityElement": { + "type": "object", + "additionalProperties": false, + "properties": { + "type": { + "type": "array", + "readOnly": true, + "const": ["QuantityElement"], + "default": ["QuantityElement"], + "items": { + "type": "string", + "enum": ["QuantityElement"] + } }, - "dataProcessingMethod": "https://standards.org/sensorMethod#1234" - }, - "sensorReport": [ - { - "time": "2024-07-24T12:00:00", - "sensorType": "https://samplesensors.com/model1234", - "value": 25, - "uom": "KGM" + "productId": { + "example": "https://id.gs1.org/01/09520123456788/21/12345", + "type": "string", + "format": "uri", + "description": "THe identifier of a product class (as opposed to a product instance) such as a GTIN code for a manufactured product." }, - { - "time": "2024-07-24T12:00:00", - "sensorType": "https://samplesensors.com/model1234", - "value": 25, - "uom": "KGM" - } - ], - "sensorIntegrityProof": "https://jargon.sh" - }, - { - "sensorMetadata": { - "device": { - "type": ["Item"], - "id": "https://id.gs1.org/01/09520123456788/21/12345", - "name": "EV battery 300Ah." + "productName": { + "example": "EV battery 300Ah.", + "type": "string", + "description": "The registered name of the product within the identifier scheme. " }, - "dataProcessingMethod": "https://standards.org/sensorMethod#1234" - }, - "sensorReport": [ - { - "time": "2024-07-24T12:00:00", - "sensorType": "https://samplesensors.com/model1234", - "value": 25, - "uom": "KGM" + "quantity": { + "example": 20, + "type": "number", + "description": "The numeric quantity of the product class (eg 100 kg of cotton)" }, - { - "time": "2024-07-24T12:00:00", - "sensorType": "https://samplesensors.com/model1234", - "value": 25, - "uom": "KGM" + "uom": { + "type": "string", + "x-external-enumeration": "https://vocabulary.uncefact.org/UnitMeasureCode", + "description": "The unit of measure for the quantity value (eg Kg or meters etc) using the UNECE Rec 20 unit of measure codelist.\n\n This is an enumerated value, but the list of valid values are too big, or change too often to include here. You can access the list of allowable values at this URL: https://vocabulary.uncefact.org/UnitMeasureCode\n " } - ], - "sensorIntegrityProof": "https://jargon.sh" - } - ], - "outputEPCList": [ - { - "type": ["Item"], - "id": "https://id.gs1.org/01/09520123456788/21/12345", - "name": "EV battery 300Ah." + }, + "description": "The quantity element is used to define the quantity (eg 100 kg of a product class. Used when serialised items are not applicable.", + "required": ["productId", "productName", "quantity"] + }, + "ObjectEvent": { + "type": "object", + "additionalProperties": true, + "properties": { + "type": { + "type": "array", + "readOnly": true, + "const": ["ObjectEvent", "Event"], + "default": ["ObjectEvent", "Event"], + "items": { + "type": "string", + "enum": ["ObjectEvent", "Event"] + } + }, + "id": { + "readOnly": true, + "example": "https://events.sample.com/01/09359502000034/21/123456", + "type": "string", + "format": "uri", + "description": "The unique identifier of this event - SHOULD be a UUID" + }, + "processType": { + "example": "Weaving", + "type": "string", + "description": "A human readable name for industry specific process represented by this event." + }, + "eventTime": { + "example": "2024-09-01T12:00:00", + "type": "string", + "format": "date-time", + "description": "The ISO-8601 date time when the event occurred." + }, + "action": { + "type": "string", + "enum": ["observe", "add", "delete"], + "example": "observe", + "description": "Code describing how an event relates to the life-cycle of the entity impacted by the event." + }, + "disposition": { + "type": "string", + "x-external-enumeration": "https://ref.gs1.org/cbv/Disp", + "description": "Disposition code describing the state of the item after the event. \n\n This is an enumerated value, but the list of valid values are too big, or change too often to include here. You can access the list of allowable values at this URL: https://ref.gs1.org/cbv/Disp\n " + }, + "bizStep": { + "type": "string", + "x-external-enumeration": "https://ref.gs1.org/cbv/BizStep", + "description": "A business step code drawn from a controlled vocabulary.\n\n This is an enumerated value, but the list of valid values are too big, or change too often to include here. You can access the list of allowable values at this URL: https://ref.gs1.org/cbv/BizStep\n " + }, + "bizLocation": { + "example": "https://id.gs1.org/414/9520123456788", + "type": "string", + "format": "uri", + "description": "A Business Location is a uniquely identified and discretely recorded geospatial location that is meant to designate the specific place where an object is assumed to be following an event until it is reported to be at a different Business Location by a subsequent event. The bizLocation must be a resolvable URI that links to facility information and geo-location data." + }, + "sensorElementList": { + "type": "array", + "items": { + "$ref": "#/$defs/SensorElement" + }, + "description": "An array (one for each sensor) of sensor device data sets associated with the event. " + }, + "epcList": { + "type": "array", + "items": { + "$ref": "#/$defs/Item" + }, + "description": "A list of uniquely identified items (eg specific items serial numbers or tagged shipments / packages) that are the focus of this object event. " + }, + "quantityList": { + "type": "array", + "items": { + "$ref": "#/$defs/QuantityElement" + }, + "description": "A quantified list of product classes (eg GS1 GTINs) that are the focus of this object event" + } + }, + "description": "Object represents an event that happened to one or more physical or digital objects - such as an inspection or certification of a product or shipment. The physical objects may be identified either as specific items (eg a unique consignment number) or as a quantified amount of a product class (eg 100Kg of cotton yarn)" + }, + "AggregationEvent": { + "type": "object", + "additionalProperties": true, + "properties": { + "type": { + "type": "array", + "readOnly": true, + "const": ["AggregationEvent", "Event"], + "default": ["AggregationEvent", "Event"], + "items": { + "type": "string", + "enum": ["AggregationEvent", "Event"] + } + }, + "id": { + "readOnly": true, + "example": "https://events.sample.com/01/09359502000034/21/123456", + "type": "string", + "format": "uri", + "description": "The unique identifier of this event - SHOULD be a UUID" + }, + "processType": { + "example": "Weaving", + "type": "string", + "description": "A human readable name for industry specific process represented by this event." + }, + "eventTime": { + "example": "2024-09-01T12:00:00", + "type": "string", + "format": "date-time", + "description": "The ISO-8601 date time when the event occurred." + }, + "action": { + "type": "string", + "enum": ["observe", "add", "delete"], + "example": "observe", + "description": "Code describing how an event relates to the life-cycle of the entity impacted by the event." + }, + "disposition": { + "type": "string", + "x-external-enumeration": "https://ref.gs1.org/cbv/Disp", + "description": "Disposition code describing the state of the item after the event. \n\n This is an enumerated value, but the list of valid values are too big, or change too often to include here. You can access the list of allowable values at this URL: https://ref.gs1.org/cbv/Disp\n " + }, + "bizStep": { + "type": "string", + "x-external-enumeration": "https://ref.gs1.org/cbv/BizStep", + "description": "A business step code drawn from a controlled vocabulary.\n\n This is an enumerated value, but the list of valid values are too big, or change too often to include here. You can access the list of allowable values at this URL: https://ref.gs1.org/cbv/BizStep\n " + }, + "bizLocation": { + "example": "https://id.gs1.org/414/9520123456788", + "type": "string", + "format": "uri", + "description": "A Business Location is a uniquely identified and discretely recorded geospatial location that is meant to designate the specific place where an object is assumed to be following an event until it is reported to be at a different Business Location by a subsequent event. The bizLocation must be a resolvable URI that links to facility information and geo-location data." + }, + "sensorElementList": { + "type": "array", + "items": { + "$ref": "#/$defs/SensorElement" + }, + "description": "An array (one for each sensor) of sensor device data sets associated with the event. " + }, + "parentEPC": { + "$ref": "#/$defs/Item", + "description": "The unique item identifier that is the result of this aggregation. Typically a packaging ID used in shipments that represents a box/ pallet / container of contained items." + }, + "childEPCList": { + "type": "array", + "items": { + "$ref": "#/$defs/Item" + }, + "description": "The list of child items that have been aggregated into the parent (or dis-aggregated from the parent). Maybe a list of package references (eg boxes on a pallet) or may be individual items (eg products in a box)." + }, + "childQuantityList": { + "type": "array", + "items": { + "$ref": "#/$defs/QuantityElement" + }, + "description": "List of quantified product classes that have been aggregated into the parent. Used when the child items do not have unique identifiers (eg 100 Kg of cotton bales)" + } + }, + "description": "Aggregation represents an event that happened to one or more objects that are physically aggregated together (physically constrained to be in the same place at the same time, as when cases are aggregated to a pallet). This event is also used to represent de-aggregation (eg unpacking) when businessStepCode is unpacking." + }, + "TransactionEvent": { + "type": "object", + "additionalProperties": true, + "properties": { + "type": { + "type": "array", + "readOnly": true, + "const": ["TransactionEvent", "Event"], + "default": ["TransactionEvent", "Event"], + "items": { + "type": "string", + "enum": ["TransactionEvent", "Event"] + } + }, + "id": { + "readOnly": true, + "example": "https://events.sample.com/01/09359502000034/21/123456", + "type": "string", + "format": "uri", + "description": "The unique identifier of this event - SHOULD be a UUID" + }, + "processType": { + "example": "Weaving", + "type": "string", + "description": "A human readable name for industry specific process represented by this event." + }, + "eventTime": { + "example": "2024-09-01T12:00:00", + "type": "string", + "format": "date-time", + "description": "The ISO-8601 date time when the event occurred." + }, + "action": { + "type": "string", + "enum": ["observe", "add", "delete"], + "example": "observe", + "description": "Code describing how an event relates to the life-cycle of the entity impacted by the event." + }, + "disposition": { + "type": "string", + "x-external-enumeration": "https://ref.gs1.org/cbv/Disp", + "description": "Disposition code describing the state of the item after the event. \n\n This is an enumerated value, but the list of valid values are too big, or change too often to include here. You can access the list of allowable values at this URL: https://ref.gs1.org/cbv/Disp\n " + }, + "bizStep": { + "type": "string", + "x-external-enumeration": "https://ref.gs1.org/cbv/BizStep", + "description": "A business step code drawn from a controlled vocabulary.\n\n This is an enumerated value, but the list of valid values are too big, or change too often to include here. You can access the list of allowable values at this URL: https://ref.gs1.org/cbv/BizStep\n " + }, + "bizLocation": { + "example": "https://id.gs1.org/414/9520123456788", + "type": "string", + "format": "uri", + "description": "A Business Location is a uniquely identified and discretely recorded geospatial location that is meant to designate the specific place where an object is assumed to be following an event until it is reported to be at a different Business Location by a subsequent event. The bizLocation must be a resolvable URI that links to facility information and geo-location data." + }, + "sensorElementList": { + "type": "array", + "items": { + "$ref": "#/$defs/SensorElement" + }, + "description": "An array (one for each sensor) of sensor device data sets associated with the event. " + }, + "sourcePartyId": { + "example": "https://abr.business.gov.au/ABN/View?abn=90664869327", + "type": "string", + "format": "uri", + "description": "The source party for this supply chain transaction - typically the seller party" + }, + "destinationPartyId": { + "example": "https://abr.business.gov.au/ABN/View?abn=90664869327", + "type": "string", + "format": "uri", + "description": "The destination party for this supply chain transaction - typically the buyer party." + }, + "bizTransaction": { + "type": "string", + "x-external-enumeration": "https://ref.gs1.org/cbv/BTT", + "description": "The document type representing the trade transaction drawn from the business transaction type vocabulary.\n\n This is an enumerated value, but the list of valid values are too big, or change too often to include here. You can access the list of allowable values at this URL: https://ref.gs1.org/cbv/BTT\n " + }, + "epcList": { + "type": "array", + "items": { + "$ref": "#/$defs/Item" + }, + "description": "The list of uniquely identified trade items included in this supply chain transaction." + }, + "quantityList": { + "type": "array", + "items": { + "$ref": "#/$defs/QuantityElement" + }, + "description": "List of quantified product classes that are included in this transaction. Used when the trade items do not have unique identifiers (eg 100 reels of yarn)" + } + }, + "description": "Transaction represents an event in which one or more objects become associated or disassociated with one or more identified business transactions - such as the purchase / shipment of goods between buyer and seller.", + "required": ["sourcePartyId", "destinationPartyId"] + }, + "AssociationEvent": { + "type": "object", + "additionalProperties": true, + "properties": { + "type": { + "type": "array", + "readOnly": true, + "const": ["AssociationEvent", "Event"], + "default": ["AssociationEvent", "Event"], + "items": { + "type": "string", + "enum": ["AssociationEvent", "Event"] + } + }, + "id": { + "readOnly": true, + "example": "https://events.sample.com/01/09359502000034/21/123456", + "type": "string", + "format": "uri", + "description": "The unique identifier of this event - SHOULD be a UUID" + }, + "processType": { + "example": "Weaving", + "type": "string", + "description": "A human readable name for industry specific process represented by this event." + }, + "eventTime": { + "example": "2024-09-01T12:00:00", + "type": "string", + "format": "date-time", + "description": "The ISO-8601 date time when the event occurred." + }, + "action": { + "type": "string", + "enum": ["observe", "add", "delete"], + "example": "observe", + "description": "Code describing how an event relates to the life-cycle of the entity impacted by the event." + }, + "disposition": { + "type": "string", + "x-external-enumeration": "https://ref.gs1.org/cbv/Disp", + "description": "Disposition code describing the state of the item after the event. \n\n This is an enumerated value, but the list of valid values are too big, or change too often to include here. You can access the list of allowable values at this URL: https://ref.gs1.org/cbv/Disp\n " + }, + "bizStep": { + "type": "string", + "x-external-enumeration": "https://ref.gs1.org/cbv/BizStep", + "description": "A business step code drawn from a controlled vocabulary.\n\n This is an enumerated value, but the list of valid values are too big, or change too often to include here. You can access the list of allowable values at this URL: https://ref.gs1.org/cbv/BizStep\n " + }, + "bizLocation": { + "example": "https://id.gs1.org/414/9520123456788", + "type": "string", + "format": "uri", + "description": "A Business Location is a uniquely identified and discretely recorded geospatial location that is meant to designate the specific place where an object is assumed to be following an event until it is reported to be at a different Business Location by a subsequent event. The bizLocation must be a resolvable URI that links to facility information and geo-location data." + }, + "sensorElementList": { + "type": "array", + "items": { + "$ref": "#/$defs/SensorElement" + }, + "description": "An array (one for each sensor) of sensor device data sets associated with the event. " + }, + "parentEPC": { + "$ref": "#/$defs/Item", + "description": "The unique item identifier that is the parent of this association. Typically an assembled product ID such as a desktop computer that is built from the associated child components." + }, + "childEPCList": { + "type": "array", + "items": { + "$ref": "#/$defs/Item" + }, + "description": "The list of child items that have been assembled to create the parent - for example the power supply or hard drive components of a desktop computer." + }, + "childQuantityList": { + "type": "array", + "items": { + "$ref": "#/$defs/QuantityElement" + }, + "description": "List of quantified product classes that have been assembled into the parent. Used when the child items do not have unique identifiers (eg brackets and screws used in the assembly of a desktop computer)" + } + }, + "description": "The association event represents the assembly of child sub-components to create a parent assembled item. For example a desktop computer assembled from power supply, hard drive, and motherboard. The association event is very similar in structure to the aggregation event but is used for physical assembly. An association event may represent a bill of materials used to assemble a product whilst an aggregation event may represent a packing list or items for transport. " + }, + "Event": { + "type": "object", + "oneOf": [ + { + "$ref": "#/$defs/ObjectEvent" + }, + { + "$ref": "#/$defs/TransformationEvent" + }, + + { + "$ref": "#/$defs/AggregationEvent" + }, + { + "$ref": "#/$defs/TransactionEvent" + }, + { + "$ref": "#/$defs/AssociationEvent" + } + ], + "description": "This abstract event structure provides a common language to describe supply chain events such as shipments, inspections, manufacturing processes, etc. There are four types of EPCIS event but this is an abstract class representing all common properties of an EPCIS event.", + "additionalProperties": true + } + } + }, + "data": [ + { + "type": ["ObjectEvent", "Event"], + "id": "https://events.sample.com/01/09359502000034/21/123456", + "processType": "Weaving", + "eventTime": "2024-09-01T12:00:00", + "action": "add", + "disposition": "https://ref.gs1.org/cbv/Disp-active", + "bizStep": "https://ref.gs1.org/cbv/BizStep-commissioning", + "bizLocation": "https://id.gs1.org/414/9520123456788", + "sensorElementList": [ + { + "sensorMetadata": { + "device": { + "type": ["Item"], + "id": "https://id.gs1.org/01/09520123456788/21/12345", + "name": "EV battery 300Ah." + }, + "dataProcessingMethod": "https://standards.org/sensorMethod#1234" + }, + "sensorReport": [ + { + "time": "2024-07-24T12:00:00", + "sensorType": "https://samplesensors.com/model1234", + "value": 25, + "uom": "KGM" + }, + { + "time": "2024-07-24T12:00:00", + "sensorType": "https://samplesensors.com/model1234", + "value": 25, + "uom": "KGM" + } + ], + "sensorIntegrityProof": "https://jargon.sh" + }, + { + "sensorMetadata": { + "device": { + "type": ["Item"], + "id": "https://id.gs1.org/01/09520123456788/21/12345", + "name": "EV battery 300Ah." + }, + "dataProcessingMethod": "https://standards.org/sensorMethod#1234" + }, + "sensorReport": [ + { + "time": "2024-07-24T12:00:00", + "sensorType": "https://samplesensors.com/model1234", + "value": 25, + "uom": "KGM" + }, + { + "time": "2024-07-24T12:00:00", + "sensorType": "https://samplesensors.com/model1234", + "value": 25, + "uom": "KGM" + } + ], + "sensorIntegrityProof": "https://jargon.sh" + } + ], + "epcList": [ + { + "type": ["Item"], + "id": "https://id.gs1.org/01/09520123456788/21/12345", + "name": "EV battery 300Ah." + }, + { + "type": ["Item"], + "id": "https://id.gs1.org/01/09520123456788/21/12345", + "name": "EV battery 300Ah." + } + ], + "quantityList": [ + { + "productId": "https://id.gs1.org/01/09520123456788/21/12345", + "productName": "EV battery 300Ah.", + "quantity": 20, + "uom": "KGM" + }, + { + "productId": "https://id.gs1.org/01/09520123456788/21/12345", + "productName": "EV battery 300Ah.", + "quantity": 20, + "uom": "KGM" + } + ] + } + ], + "constructData": { + "mappingFields": [], + "dummyFields": [], + "generationFields": [ + { + "path": "/eventID", + "handler": "generateIdWithSerialNumber" + } + ] + }, + "className": "json-form", + "style": { + "margin": "40px auto", + "paddingTop": "40px", + "width": "80%" + } + } + }, + { + "name": "CustomButton", + "type": "Submit", + "props": {} + } + ], + "services": [ + { + "name": "processTraceabilityEvent", + "parameters": [ + { + "vckit": { + "vckitAPIUrl": "http://localhost:3332/v2", + "issuer": { + "id": "did:web:uncefact.github.io:project-vckit:test-and-development", + "name": "Orchard Facility" + }, + "headers": { + "Authorization": "Bearer test123" + } + }, + "traceabilityEvent": { + "context": ["https://test.uncefact.org/vocabulary/untp/dte/0.5.0/"], + "renderTemplate": [ + { + "template": "
DIGITAL TRACEABILITY EVENT
{{#each credentialSubject}}
{{processType}}
{{bizStep}} {{eventTime}}
Transformation
Output
{{#each outputEPCList}}
{{name}}
View
{{/each}} {{#each outputQuantityList}}
{{quantity}}{{uom}} {{productName}}
View
{{/each}}

Transformed

Input
{{#each inputEPCList}}
{{name}}
View
{{/each}} {{#each inputQuantityList}}
{{quantity}}{{uom}} {{productName}}
View
{{/each}}
Event sensor information
{{#each sensorElementList}}
{{sensorMetadata.device.name}}
{{#each sensorReport}}
Captured at
{{time}}
Sensor type
Reading
{{value}}{{uom}}
{{/each}}
Integrity proof
{{/each}}
{{!-- TODO: to be confirmed, since the SensorElementList.sensorIntegrityProof duplicate --}} {{!-- being assumed --}} Event location information
{{processType}}
{{bizStep}} {{eventTime}}
Transaction
Source
{{!-- TODO: to be confirmed, since the navigation link wasn't provided --}} {{!-- being assumed --}}
View
Destination
{{!-- TODO: to be confirmed, since the navigation link wasn't provided --}} {{!-- being assumed --}}
View
Object list
{{#each epcList}}
{{name}}
View
{{/each}} {{#each quantityList}}
{{quantity}}{{uom}} {{productName}}
View
{{/each}}
Event sensor information
{{#each sensorElementList}}
{{sensorMetadata.device.name}}
{{#each sensorReport}}
Captured at
{{time}}
Sensor type
Reading
{{value}}{{uom}}
{{/each}}
Integrity proof
{{/each}}
{{!-- TODO: to be confirmed, since the SensorElementList.sensorIntegrityProof duplicate --}} {{!-- being assumed --}} Event location information
{{processType}}
{{bizStep}} {{eventTime}}
Object event
Object list
{{#each epcList}}
{{name}}
View
{{/each}} {{#each quantityList}}
{{quantity}}{{uom}} {{productName}}
View
{{/each}}
Event sensor information
{{#each sensorElementList}}
{{sensorMetadata.device.name}}
{{#each sensorReport}}
Captured at
{{time}}
Sensor type
Reading
{{value}}{{uom}}
{{/each}}
Integrity proof
{{/each}}
{{!-- TODO: to be confirmed, since the SensorElementList.sensorIntegrityProof duplicate --}} {{!-- being assumed --}} Event location information
{{processType}}
{{bizStep}} {{eventTime}}
Aggregation
{{parentEPC.name}}
View

Aggregated

Child list
{{#each childEPCList}}
{{name}}
View
{{/each}} {{#each childQuantityList}}
{{quantity}}{{uom}} {{productName}}
View
{{/each}}
Event sensor information
{{#each sensorElementList}}
{{sensorMetadata.device.name}}
{{#each sensorReport}}
Captured at
{{time}}
Sensor type
Reading
{{value}}{{uom}}
{{/each}}
Integrity proof
{{/each}}
{{!-- TODO: to be confirmed, since the SensorElementList.sensorIntegrityProof duplicate --}} {{!-- being assumed --}} Event location information
{{processType}}
{{bizStep}} {{eventTime}}
Association
{{parentEPC.name}}
View

Assembled

Child list
{{#each childEPCList}}
{{name}}
View
{{/each}} {{#each childQuantityList}}
{{quantity}}{{uom}} {{productName}}
View
{{/each}}
Event sensor information
{{#each sensorElementList}}
{{sensorMetadata.device.name}}
{{#each sensorReport}}
Captured at
{{time}}
Sensor type
Reading
{{value}}{{uom}}
{{/each}}
Integrity proof
{{/each}}
{{!-- TODO: to be confirmed, since the SensorElementList.sensorIntegrityProof duplicate --}} {{!-- being assumed --}} Event location information
{{/each}}
Issuing details
Issued by
Valid from
{{validFrom}}
", + "@type": "WebRenderingTemplate2022" + } + ], + "type": ["DigitalTraceabilityEvent"], + "dlrLinkTitle": "Traceability Event", + "dlrVerificationPage": "http://localhost:3003/verify" + }, + "dlr": { + "dlrAPIUrl": "http://localhost:3000", + "dlrAPIKey": "test123", + "namespace": "gs1", + "linkRegisterPath": "/api/resolver" + }, + "storage": { + "url": "http://localhost:3334/v1/documents", + "params": { + "bucket": "verifiable-credentials" + }, + "options": { + "method": "POST", + "headers": { + "Content-Type": "application/json" + } + } + }, + "identifierKeyPath": "/0/id", + "eventTypePath": "/0/type/0" + } + ] + } + ] + }, + { + "name": "Issue Traceability Association Event", + "id": "issue_traceability_association_event", + "components": [ + { + "name": "JsonForm", + "type": "EntryData", + "props": { + "schema": { + "type": "array", + "items": { + "$ref": "#/$defs/Event" + }, + "$defs": { + "CredentialIssuer": { + "type": "object", + "additionalProperties": false, + "properties": { + "type": { + "type": "array", + "readOnly": true, + "const": ["CredentialIssuer"], + "default": ["CredentialIssuer"], + "items": { + "type": "string", + "enum": ["CredentialIssuer"] + } + }, + "id": { + "example": "did:web:identifiers.example-company.com:12345", + "type": "string", + "format": "uri", + "description": "The W3C DID of the issuer - should be a did:web or did:tdw" + }, + "name": { + "example": "Example Company Pty Ltd", + "type": "string", + "description": "The name of the issuer person or organisation" + }, + "otherIdentifier": { + "type": "array", + "items": { + "$ref": "#/$defs/Identifier" + }, + "description": "An optional list of other registered identifiers for this credential issuer " + } + }, + "description": "The issuer party (person or organisation) of a verifiable credential.", + "required": ["id", "name"] + }, + "Identifier": { + "type": "object", + "additionalProperties": false, + "properties": { + "type": { + "type": "array", + "readOnly": true, + "const": ["Identifier"], + "default": ["Identifier"], + "items": { + "type": "string", + "enum": ["Identifier"] + } + }, + "id": { + "example": "https://id.gs1.org/01/09520123456788/21/12345", + "type": "string", + "format": "uri", + "description": "The globally unique ID of the entity as a resolvable URL according to ISO 18975. ExamplesProduct - id.gs1.org/01/09520123456788/21/12345 Party - abr.business.gov.au/ABN/View?abn=90664869327. Facility - did:web:facilities.example-company.com:123. " + }, + "name": { + "example": "EV battery 300Ah.", + "type": "string", + "description": "The registered name of the entity within the identifier scheme. Examples: product - EV battery 300Ah, Party - Sample Company Pty Ltd, Facility - Green Acres battery factory" + }, + "registeredId": { + "example": "90664869327", + "type": "string", + "description": "The registration number (alphanumeric) of the entity within the register. Unique within the register." + }, + "idScheme": { + "$ref": "#/$defs/IdentifierScheme", + "description": "The identifier scheme. Examples : Product - id.gs1.org/01, Party - business.gov.au/abn, Facility - did:web:facilities.acme.com. " + } + }, + "description": "The ID and Name of an identified entity such as a product, facility, party, standard, etc. If the identifier is a W3C DID then the corresponding DID document SHOULD include a serviceEndpoint of type \"IdentityResolver\". If the identifier is not a W3C DID then the id property SHOULD be an identity resolver URL.", + "required": ["id", "name"] + }, + "IdentifierScheme": { + "type": "object", + "additionalProperties": false, + "properties": { + "type": { + "type": "array", + "readOnly": true, + "const": ["IdentifierScheme"], + "default": ["IdentifierScheme"], + "items": { + "type": "string", + "enum": ["IdentifierScheme"] + } + }, + "id": { + "example": "https://id.gs1.org/01/", + "type": "string", + "format": "uri", + "description": "The globally unique identifier of the registration scheme. The scheme should be registered and discoverable from vocabulary.uncefact.org/identifierSchemes" + }, + "name": { + "example": "Global Trade Identification Number (GTIN)", + "type": "string", + "description": "The name of the identifier scheme. " + } + }, + "description": "An identifier registration scheme for products, facilities, or organisations. Typically operated by a state, national or global authority." + }, + "TransformationEvent": { + "type": "object", + "additionalProperties": true, + "properties": { + "type": { + "type": "array", + "readOnly": true, + "const": ["TransformationEvent", "Event"], + "default": ["TransformationEvent", "Event"], + "items": { + "type": "string", + "enum": ["TransformationEvent", "Event"] + } + }, + "id": { + "readOnly": true, + "example": "https://events.sample.com/01/09359502000034/21/123456", + "type": "string", + "format": "uri", + "description": "The unique identifier of this event - SHOULD be a UUID" + }, + "processType": { + "example": "Weaving", + "type": "string", + "description": "A human readable name for industry specific process represented by this event." + }, + "eventTime": { + "example": "2024-09-01T12:00:00", + "type": "string", + "format": "date-time", + "description": "The ISO-8601 date time when the event occurred." + }, + "action": { + "type": "string", + "enum": ["observe", "add", "delete"], + "example": "observe", + "description": "Code describing how an event relates to the life-cycle of the entity impacted by the event." + }, + "disposition": { + "type": "string", + "x-external-enumeration": "https://ref.gs1.org/cbv/Disp", + "description": "Disposition code describing the state of the item after the event. \n\n This is an enumerated value, but the list of valid values are too big, or change too often to include here. You can access the list of allowable values at this URL: https://ref.gs1.org/cbv/Disp\n " + }, + "bizStep": { + "type": "string", + "x-external-enumeration": "https://ref.gs1.org/cbv/BizStep", + "description": "A business step code drawn from a controlled vocabulary.\n\n This is an enumerated value, but the list of valid values are too big, or change too often to include here. You can access the list of allowable values at this URL: https://ref.gs1.org/cbv/BizStep\n " + }, + "bizLocation": { + "example": "https://id.gs1.org/414/9520123456788", + "type": "string", + "format": "uri", + "description": "A Business Location is a uniquely identified and discretely recorded geospatial location that is meant to designate the specific place where an object is assumed to be following an event until it is reported to be at a different Business Location by a subsequent event. The bizLocation must be a resolvable URI that links to facility information and geo-location data." + }, + "sensorElementList": { + "type": "array", + "items": { + "$ref": "#/$defs/SensorElement" + }, + "description": "An array (one for each sensor) of sensor device data sets associated with the event. " + }, + "outputEPCList": { + "type": "array", + "items": { + "$ref": "#/$defs/Item" + }, + "description": "The list of uniquely identified items that are the output of this transformation event - for example a list of individually identified bolts of cloth that are the output of a weaving process." + }, + "inputEPCList": { + "type": "array", + "items": { + "$ref": "#/$defs/Item" + }, + "description": "The list of uniquely identified items that are the input of this transformation event - for example a list of individually identified bobbins of yarn that are the input of a weaving process." + }, + "inputQuantityList": { + "type": "array", + "items": { + "$ref": "#/$defs/QuantityElement" + }, + "description": "The quantified list of product classes that are the input of this transformation event - used when each item does not have a unique identity. for example the weight of raw cotton that is the input to a ginning process." + }, + "outputQuantityList": { + "type": "array", + "items": { + "$ref": "#/$defs/QuantityElement" + }, + "description": "The quantified list of product classes that are the output of this transformation event - used when each item does not have a unique identity. for example a count of the bales of cleaned cotton that are the output of a ginning process." + } + }, + "description": "Transformation represents an event in which input objects are fully or partially consumed and output objects are produced, such that any of the input objects may have contributed to all of the output objects - for example consuming bales of cotton to produce yarn." + }, + "SensorElement": { + "type": "object", + "additionalProperties": false, + "properties": { + "type": { + "type": "array", + "readOnly": true, + "const": ["SensorElement"], + "default": ["SensorElement"], + "items": { + "type": "string", + "enum": ["SensorElement"] + } + }, + "sensorMetadata": { + "$ref": "#/$defs/Sensor", + "description": "Data that describes the physical sensor that recorded the sensor data set." + }, + "sensorReport": { + "type": "array", + "items": { + "$ref": "#/$defs/SensorData" + }, + "description": "A list of sensor readings from the given sensor relevant to the traceability event context." + }, + "sensorIntegrityProof": { + "type": "string", + "format": "uri", + "description": "An optional reference to a verifiable credential signed by the sensor device or device manufacturer that contains the digitally signed raw data associated with this sensor report." + } + }, + "description": "A SensorElement is used to carry data related to an event that is captured one sensor such as an IoT device. Include one sensor property and an array of sensor data values." + }, + "Sensor": { + "type": "object", + "additionalProperties": false, + "properties": { + "type": { + "type": "array", + "readOnly": true, + "const": ["Sensor"], + "default": ["Sensor"], + "items": { + "type": "string", + "enum": ["Sensor"] + } + }, + "device": { + "$ref": "#/$defs/Item", + "description": "The device Identifier for the sensor as a URI (typically an EPC)" + }, + "dataProcessingMethod": { + "example": "https://standards.org/sensorMethod#1234", + "type": "string", + "format": "uri", + "description": "The data processing method used by the sensor - should reference a documented standard criteria as a URI" + } + }, + "description": "A physical sensor that records a sensor data set." + }, + "Item": { + "type": "object", + "additionalProperties": false, + "properties": { + "type": { + "type": "array", + "readOnly": true, + "const": ["Item"], + "default": ["Item"], + "items": { + "type": "string", + "enum": ["Item"] + } + }, + "id": { + "example": "https://id.gs1.org/01/09520123456788/21/12345", + "type": "string", + "format": "uri", + "description": "The globally unique ID of the product as a URI. Ideally as a resolvable URL according to ISO 18975. " + }, + "name": { + "example": "EV battery 300Ah.", + "type": "string", + "description": "The name of the product class to which the product item belongs. " + } + }, + "description": "A specific serialised trade item which is an instance of a more generic product. ", + "required": ["id", "name"] + }, + "SensorData": { + "type": "object", + "additionalProperties": false, + "properties": { + "type": { + "type": "array", + "readOnly": true, + "const": ["SensorData"], + "default": ["SensorData"], + "items": { + "type": "string", + "enum": ["SensorData"] + } + }, + "time": { + "example": "2024-07-24T12:00:00", + "type": "string", + "format": "date-time", + "description": "the timestamp at which the sensor reading was made." + }, + "sensorType": { + "example": "https://samplesensors.com/model1234", + "type": "string", + "format": "uri", + "description": "the measurement type of the sensor reading, as a URI reference to a measurement method specification." + }, + "value": { + "example": 25, + "type": "number", + "description": "the sensor reading" + }, + "uom": { + "type": "string", + "x-external-enumeration": "https://vocabulary.uncefact.org/UnitMeasureCode", + "description": "the unit of measure for the sensor reading, drawn from UNECE rec20 code list.\n\n This is an enumerated value, but the list of valid values are too big, or change too often to include here. You can access the list of allowable values at this URL: https://vocabulary.uncefact.org/UnitMeasureCode\n " + } + }, + "description": "A data point read by a sensor." + }, + "QuantityElement": { + "type": "object", + "additionalProperties": false, + "properties": { + "type": { + "type": "array", + "readOnly": true, + "const": ["QuantityElement"], + "default": ["QuantityElement"], + "items": { + "type": "string", + "enum": ["QuantityElement"] + } + }, + "productId": { + "example": "https://id.gs1.org/01/09520123456788/21/12345", + "type": "string", + "format": "uri", + "description": "THe identifier of a product class (as opposed to a product instance) such as a GTIN code for a manufactured product." + }, + "productName": { + "example": "EV battery 300Ah.", + "type": "string", + "description": "The registered name of the product within the identifier scheme. " + }, + "quantity": { + "example": 20, + "type": "number", + "description": "The numeric quantity of the product class (eg 100 kg of cotton)" + }, + "uom": { + "type": "string", + "x-external-enumeration": "https://vocabulary.uncefact.org/UnitMeasureCode", + "description": "The unit of measure for the quantity value (eg Kg or meters etc) using the UNECE Rec 20 unit of measure codelist.\n\n This is an enumerated value, but the list of valid values are too big, or change too often to include here. You can access the list of allowable values at this URL: https://vocabulary.uncefact.org/UnitMeasureCode\n " + } + }, + "description": "The quantity element is used to define the quantity (eg 100 kg of a product class. Used when serialised items are not applicable.", + "required": ["productId", "productName", "quantity"] + }, + "ObjectEvent": { + "type": "object", + "additionalProperties": true, + "properties": { + "type": { + "type": "array", + "readOnly": true, + "const": ["ObjectEvent", "Event"], + "default": ["ObjectEvent", "Event"], + "items": { + "type": "string", + "enum": ["ObjectEvent", "Event"] + } + }, + "id": { + "readOnly": true, + "example": "https://events.sample.com/01/09359502000034/21/123456", + "type": "string", + "format": "uri", + "description": "The unique identifier of this event - SHOULD be a UUID" + }, + "processType": { + "example": "Weaving", + "type": "string", + "description": "A human readable name for industry specific process represented by this event." + }, + "eventTime": { + "example": "2024-09-01T12:00:00", + "type": "string", + "format": "date-time", + "description": "The ISO-8601 date time when the event occurred." + }, + "action": { + "type": "string", + "enum": ["observe", "add", "delete"], + "example": "observe", + "description": "Code describing how an event relates to the life-cycle of the entity impacted by the event." + }, + "disposition": { + "type": "string", + "x-external-enumeration": "https://ref.gs1.org/cbv/Disp", + "description": "Disposition code describing the state of the item after the event. \n\n This is an enumerated value, but the list of valid values are too big, or change too often to include here. You can access the list of allowable values at this URL: https://ref.gs1.org/cbv/Disp\n " + }, + "bizStep": { + "type": "string", + "x-external-enumeration": "https://ref.gs1.org/cbv/BizStep", + "description": "A business step code drawn from a controlled vocabulary.\n\n This is an enumerated value, but the list of valid values are too big, or change too often to include here. You can access the list of allowable values at this URL: https://ref.gs1.org/cbv/BizStep\n " + }, + "bizLocation": { + "example": "https://id.gs1.org/414/9520123456788", + "type": "string", + "format": "uri", + "description": "A Business Location is a uniquely identified and discretely recorded geospatial location that is meant to designate the specific place where an object is assumed to be following an event until it is reported to be at a different Business Location by a subsequent event. The bizLocation must be a resolvable URI that links to facility information and geo-location data." + }, + "sensorElementList": { + "type": "array", + "items": { + "$ref": "#/$defs/SensorElement" + }, + "description": "An array (one for each sensor) of sensor device data sets associated with the event. " + }, + "epcList": { + "type": "array", + "items": { + "$ref": "#/$defs/Item" + }, + "description": "A list of uniquely identified items (eg specific items serial numbers or tagged shipments / packages) that are the focus of this object event. " + }, + "quantityList": { + "type": "array", + "items": { + "$ref": "#/$defs/QuantityElement" + }, + "description": "A quantified list of product classes (eg GS1 GTINs) that are the focus of this object event" + } + }, + "description": "Object represents an event that happened to one or more physical or digital objects - such as an inspection or certification of a product or shipment. The physical objects may be identified either as specific items (eg a unique consignment number) or as a quantified amount of a product class (eg 100Kg of cotton yarn)" + }, + "AggregationEvent": { + "type": "object", + "additionalProperties": true, + "properties": { + "type": { + "type": "array", + "readOnly": true, + "const": ["AggregationEvent", "Event"], + "default": ["AggregationEvent", "Event"], + "items": { + "type": "string", + "enum": ["AggregationEvent", "Event"] + } + }, + "id": { + "readOnly": true, + "example": "https://events.sample.com/01/09359502000034/21/123456", + "type": "string", + "format": "uri", + "description": "The unique identifier of this event - SHOULD be a UUID" + }, + "processType": { + "example": "Weaving", + "type": "string", + "description": "A human readable name for industry specific process represented by this event." + }, + "eventTime": { + "example": "2024-09-01T12:00:00", + "type": "string", + "format": "date-time", + "description": "The ISO-8601 date time when the event occurred." + }, + "action": { + "type": "string", + "enum": ["observe", "add", "delete"], + "example": "observe", + "description": "Code describing how an event relates to the life-cycle of the entity impacted by the event." + }, + "disposition": { + "type": "string", + "x-external-enumeration": "https://ref.gs1.org/cbv/Disp", + "description": "Disposition code describing the state of the item after the event. \n\n This is an enumerated value, but the list of valid values are too big, or change too often to include here. You can access the list of allowable values at this URL: https://ref.gs1.org/cbv/Disp\n " + }, + "bizStep": { + "type": "string", + "x-external-enumeration": "https://ref.gs1.org/cbv/BizStep", + "description": "A business step code drawn from a controlled vocabulary.\n\n This is an enumerated value, but the list of valid values are too big, or change too often to include here. You can access the list of allowable values at this URL: https://ref.gs1.org/cbv/BizStep\n " + }, + "bizLocation": { + "example": "https://id.gs1.org/414/9520123456788", + "type": "string", + "format": "uri", + "description": "A Business Location is a uniquely identified and discretely recorded geospatial location that is meant to designate the specific place where an object is assumed to be following an event until it is reported to be at a different Business Location by a subsequent event. The bizLocation must be a resolvable URI that links to facility information and geo-location data." + }, + "sensorElementList": { + "type": "array", + "items": { + "$ref": "#/$defs/SensorElement" + }, + "description": "An array (one for each sensor) of sensor device data sets associated with the event. " + }, + "parentEPC": { + "$ref": "#/$defs/Item", + "description": "The unique item identifier that is the result of this aggregation. Typically a packaging ID used in shipments that represents a box/ pallet / container of contained items." + }, + "childEPCList": { + "type": "array", + "items": { + "$ref": "#/$defs/Item" + }, + "description": "The list of child items that have been aggregated into the parent (or dis-aggregated from the parent). Maybe a list of package references (eg boxes on a pallet) or may be individual items (eg products in a box)." + }, + "childQuantityList": { + "type": "array", + "items": { + "$ref": "#/$defs/QuantityElement" + }, + "description": "List of quantified product classes that have been aggregated into the parent. Used when the child items do not have unique identifiers (eg 100 Kg of cotton bales)" + } + }, + "description": "Aggregation represents an event that happened to one or more objects that are physically aggregated together (physically constrained to be in the same place at the same time, as when cases are aggregated to a pallet). This event is also used to represent de-aggregation (eg unpacking) when businessStepCode is unpacking." + }, + "TransactionEvent": { + "type": "object", + "additionalProperties": true, + "properties": { + "type": { + "type": "array", + "readOnly": true, + "const": ["TransactionEvent", "Event"], + "default": ["TransactionEvent", "Event"], + "items": { + "type": "string", + "enum": ["TransactionEvent", "Event"] + } + }, + "id": { + "readOnly": true, + "example": "https://events.sample.com/01/09359502000034/21/123456", + "type": "string", + "format": "uri", + "description": "The unique identifier of this event - SHOULD be a UUID" + }, + "processType": { + "example": "Weaving", + "type": "string", + "description": "A human readable name for industry specific process represented by this event." + }, + "eventTime": { + "example": "2024-09-01T12:00:00", + "type": "string", + "format": "date-time", + "description": "The ISO-8601 date time when the event occurred." + }, + "action": { + "type": "string", + "enum": ["observe", "add", "delete"], + "example": "observe", + "description": "Code describing how an event relates to the life-cycle of the entity impacted by the event." + }, + "disposition": { + "type": "string", + "x-external-enumeration": "https://ref.gs1.org/cbv/Disp", + "description": "Disposition code describing the state of the item after the event. \n\n This is an enumerated value, but the list of valid values are too big, or change too often to include here. You can access the list of allowable values at this URL: https://ref.gs1.org/cbv/Disp\n " + }, + "bizStep": { + "type": "string", + "x-external-enumeration": "https://ref.gs1.org/cbv/BizStep", + "description": "A business step code drawn from a controlled vocabulary.\n\n This is an enumerated value, but the list of valid values are too big, or change too often to include here. You can access the list of allowable values at this URL: https://ref.gs1.org/cbv/BizStep\n " + }, + "bizLocation": { + "example": "https://id.gs1.org/414/9520123456788", + "type": "string", + "format": "uri", + "description": "A Business Location is a uniquely identified and discretely recorded geospatial location that is meant to designate the specific place where an object is assumed to be following an event until it is reported to be at a different Business Location by a subsequent event. The bizLocation must be a resolvable URI that links to facility information and geo-location data." + }, + "sensorElementList": { + "type": "array", + "items": { + "$ref": "#/$defs/SensorElement" + }, + "description": "An array (one for each sensor) of sensor device data sets associated with the event. " + }, + "sourcePartyId": { + "example": "https://abr.business.gov.au/ABN/View?abn=90664869327", + "type": "string", + "format": "uri", + "description": "The source party for this supply chain transaction - typically the seller party" + }, + "destinationPartyId": { + "example": "https://abr.business.gov.au/ABN/View?abn=90664869327", + "type": "string", + "format": "uri", + "description": "The destination party for this supply chain transaction - typically the buyer party." + }, + "bizTransaction": { + "type": "string", + "x-external-enumeration": "https://ref.gs1.org/cbv/BTT", + "description": "The document type representing the trade transaction drawn from the business transaction type vocabulary.\n\n This is an enumerated value, but the list of valid values are too big, or change too often to include here. You can access the list of allowable values at this URL: https://ref.gs1.org/cbv/BTT\n " + }, + "epcList": { + "type": "array", + "items": { + "$ref": "#/$defs/Item" + }, + "description": "The list of uniquely identified trade items included in this supply chain transaction." + }, + "quantityList": { + "type": "array", + "items": { + "$ref": "#/$defs/QuantityElement" + }, + "description": "List of quantified product classes that are included in this transaction. Used when the trade items do not have unique identifiers (eg 100 reels of yarn)" + } + }, + "description": "Transaction represents an event in which one or more objects become associated or disassociated with one or more identified business transactions - such as the purchase / shipment of goods between buyer and seller.", + "required": ["sourcePartyId", "destinationPartyId"] + }, + "AssociationEvent": { + "type": "object", + "additionalProperties": true, + "properties": { + "type": { + "type": "array", + "readOnly": true, + "const": ["AssociationEvent", "Event"], + "default": ["AssociationEvent", "Event"], + "items": { + "type": "string", + "enum": ["AssociationEvent", "Event"] + } + }, + "id": { + "readOnly": true, + "example": "https://events.sample.com/01/09359502000034/21/123456", + "type": "string", + "format": "uri", + "description": "The unique identifier of this event - SHOULD be a UUID" + }, + "processType": { + "example": "Weaving", + "type": "string", + "description": "A human readable name for industry specific process represented by this event." + }, + "eventTime": { + "example": "2024-09-01T12:00:00", + "type": "string", + "format": "date-time", + "description": "The ISO-8601 date time when the event occurred." + }, + "action": { + "type": "string", + "enum": ["observe", "add", "delete"], + "example": "observe", + "description": "Code describing how an event relates to the life-cycle of the entity impacted by the event." + }, + "disposition": { + "type": "string", + "x-external-enumeration": "https://ref.gs1.org/cbv/Disp", + "description": "Disposition code describing the state of the item after the event. \n\n This is an enumerated value, but the list of valid values are too big, or change too often to include here. You can access the list of allowable values at this URL: https://ref.gs1.org/cbv/Disp\n " + }, + "bizStep": { + "type": "string", + "x-external-enumeration": "https://ref.gs1.org/cbv/BizStep", + "description": "A business step code drawn from a controlled vocabulary.\n\n This is an enumerated value, but the list of valid values are too big, or change too often to include here. You can access the list of allowable values at this URL: https://ref.gs1.org/cbv/BizStep\n " + }, + "bizLocation": { + "example": "https://id.gs1.org/414/9520123456788", + "type": "string", + "format": "uri", + "description": "A Business Location is a uniquely identified and discretely recorded geospatial location that is meant to designate the specific place where an object is assumed to be following an event until it is reported to be at a different Business Location by a subsequent event. The bizLocation must be a resolvable URI that links to facility information and geo-location data." + }, + "sensorElementList": { + "type": "array", + "items": { + "$ref": "#/$defs/SensorElement" + }, + "description": "An array (one for each sensor) of sensor device data sets associated with the event. " + }, + "parentEPC": { + "$ref": "#/$defs/Item", + "description": "The unique item identifier that is the parent of this association. Typically an assembled product ID such as a desktop computer that is built from the associated child components." + }, + "childEPCList": { + "type": "array", + "items": { + "$ref": "#/$defs/Item" + }, + "description": "The list of child items that have been assembled to create the parent - for example the power supply or hard drive components of a desktop computer." + }, + "childQuantityList": { + "type": "array", + "items": { + "$ref": "#/$defs/QuantityElement" + }, + "description": "List of quantified product classes that have been assembled into the parent. Used when the child items do not have unique identifiers (eg brackets and screws used in the assembly of a desktop computer)" + } + }, + "description": "The association event represents the assembly of child sub-components to create a parent assembled item. For example a desktop computer assembled from power supply, hard drive, and motherboard. The association event is very similar in structure to the aggregation event but is used for physical assembly. An association event may represent a bill of materials used to assemble a product whilst an aggregation event may represent a packing list or items for transport. " }, - { - "type": ["Item"], - "id": "https://id.gs1.org/01/09520123456788/21/12345", - "name": "EV battery 300Ah." + "Event": { + "type": "object", + "oneOf": [ + { + "$ref": "#/$defs/AssociationEvent" + }, + { + "$ref": "#/$defs/TransformationEvent" + }, + { + "$ref": "#/$defs/ObjectEvent" + }, + { + "$ref": "#/$defs/AggregationEvent" + }, + { + "$ref": "#/$defs/TransactionEvent" + } + ], + "description": "This abstract event structure provides a common language to describe supply chain events such as shipments, inspections, manufacturing processes, etc. There are four types of EPCIS event but this is an abstract class representing all common properties of an EPCIS event.", + "additionalProperties": true } - ], - "inputEPCList": [ - { - "type": ["Item"], - "id": "https://id.gs1.org/01/09520123456788/21/12345", - "name": "EV battery 300Ah." - }, - { + } + }, + "data": [ + { + "type": ["AssociationEvent", "Event"], + "id": "https://events.sample.com/01/09359502000034/21/123456", + "processType": "Weaving", + "eventTime": "2024-09-01T12:00:00", + "action": "add", + "disposition": "https://ref.gs1.org/cbv/Disp-active", + "bizStep": "https://ref.gs1.org/cbv/BizStep-commissioning", + "bizLocation": "https://id.gs1.org/414/9520123456788", + "sensorElementList": [ + { + "sensorMetadata": { + "device": { + "type": ["Item"], + "id": "https://id.gs1.org/01/09520123456788/21/12345", + "name": "EV battery 300Ah." + }, + "dataProcessingMethod": "https://standards.org/sensorMethod#1234" + }, + "sensorReport": [ + { + "time": "2024-07-24T12:00:00", + "sensorType": "https://samplesensors.com/model1234", + "value": 25, + "uom": "KGM" + }, + { + "time": "2024-07-24T12:00:00", + "sensorType": "https://samplesensors.com/model1234", + "value": 25, + "uom": "KGM" + } + ], + "sensorIntegrityProof": "https://jargon.sh" + }, + { + "sensorMetadata": { + "device": { + "type": ["Item"], + "id": "https://id.gs1.org/01/09520123456788/21/12345", + "name": "EV battery 300Ah." + }, + "dataProcessingMethod": "https://standards.org/sensorMethod#1234" + }, + "sensorReport": [ + { + "time": "2024-07-24T12:00:00", + "sensorType": "https://samplesensors.com/model1234", + "value": 25, + "uom": "KGM" + }, + { + "time": "2024-07-24T12:00:00", + "sensorType": "https://samplesensors.com/model1234", + "value": 25, + "uom": "KGM" + } + ], + "sensorIntegrityProof": "https://jargon.sh" + } + ], + "parentEPC": { "type": ["Item"], "id": "https://id.gs1.org/01/09520123456788/21/12345", "name": "EV battery 300Ah." - } - ], - "inputQuantityList": [ - { - "productId": "https://id.gs1.org/01/09520123456788/21/12345", - "productName": "EV battery 300Ah.", - "quantity": 20, - "uom": "KGM" - }, - { - "productId": "https://id.gs1.org/01/09520123456788/21/12345", - "productName": "EV battery 300Ah.", - "quantity": 20, - "uom": "KGM" - } - ], - "outputQuantityList": [ - { - "productId": "https://id.gs1.org/01/09520123456788/21/12345", - "productName": "EV battery 300Ah.", - "quantity": 20, - "uom": "KGM" }, - { - "productId": "https://id.gs1.org/01/09520123456788/21/12345", - "productName": "EV battery 300Ah.", - "quantity": 20, - "uom": "KGM" - } - ] - }, + "childEPCList": [ + { + "type": ["Item"], + "id": "https://id.gs1.org/01/09520123456788/21/12345", + "name": "EV battery 300Ah." + }, + { + "type": ["Item"], + "id": "https://id.gs1.org/01/09520123456788/21/12345", + "name": "EV battery 300Ah." + } + ], + "childQuantityList": [ + { + "productId": "https://id.gs1.org/01/09520123456788/21/12345", + "productName": "EV battery 300Ah.", + "quantity": 20, + "uom": "KGM" + }, + { + "productId": "https://id.gs1.org/01/09520123456788/21/12345", + "productName": "EV battery 300Ah.", + "quantity": 20, + "uom": "KGM" + } + ] + } + ], "constructData": { "mappingFields": [], "dummyFields": [], @@ -5179,415 +6097,907 @@ "path": "/eventID", "handler": "generateIdWithSerialNumber" } - ] - }, - "className": "json-form", - "style": { - "margin": "40px auto", - "paddingTop": "40px", - "width": "80%" + ] + }, + "className": "json-form", + "style": { + "margin": "40px auto", + "paddingTop": "40px", + "width": "80%" + } + } + }, + { + "name": "CustomButton", + "type": "Submit", + "props": {} + } + ], + "services": [ + { + "name": "processTraceabilityEvent", + "parameters": [ + { + "vckit": { + "vckitAPIUrl": "http://localhost:3332/v2", + "issuer": { + "id": "did:web:uncefact.github.io:project-vckit:test-and-development", + "name": "Orchard Facility" + }, + "headers": { + "Authorization": "Bearer test123" + } + }, + "traceabilityEvent": { + "context": ["https://test.uncefact.org/vocabulary/untp/dte/0.5.0/"], + "renderTemplate": [ + { + "template": "
DIGITAL TRACEABILITY EVENT
{{#each credentialSubject}}
{{processType}}
{{bizStep}} {{eventTime}}
Transformation
Output
{{#each outputEPCList}}
{{name}}
View
{{/each}} {{#each outputQuantityList}}
{{quantity}}{{uom}} {{productName}}
View
{{/each}}

Transformed

Input
{{#each inputEPCList}}
{{name}}
View
{{/each}} {{#each inputQuantityList}}
{{quantity}}{{uom}} {{productName}}
View
{{/each}}
Event sensor information
{{#each sensorElementList}}
{{sensorMetadata.device.name}}
{{#each sensorReport}}
Captured at
{{time}}
Sensor type
Reading
{{value}}{{uom}}
{{/each}}
Integrity proof
{{/each}}
{{!-- TODO: to be confirmed, since the SensorElementList.sensorIntegrityProof duplicate --}} {{!-- being assumed --}} Event location information
{{processType}}
{{bizStep}} {{eventTime}}
Transaction
Source
{{!-- TODO: to be confirmed, since the navigation link wasn't provided --}} {{!-- being assumed --}}
View
Destination
{{!-- TODO: to be confirmed, since the navigation link wasn't provided --}} {{!-- being assumed --}}
View
Object list
{{#each epcList}}
{{name}}
View
{{/each}} {{#each quantityList}}
{{quantity}}{{uom}} {{productName}}
View
{{/each}}
Event sensor information
{{#each sensorElementList}}
{{sensorMetadata.device.name}}
{{#each sensorReport}}
Captured at
{{time}}
Sensor type
Reading
{{value}}{{uom}}
{{/each}}
Integrity proof
{{/each}}
{{!-- TODO: to be confirmed, since the SensorElementList.sensorIntegrityProof duplicate --}} {{!-- being assumed --}} Event location information
{{processType}}
{{bizStep}} {{eventTime}}
Object event
Object list
{{#each epcList}}
{{name}}
View
{{/each}} {{#each quantityList}}
{{quantity}}{{uom}} {{productName}}
View
{{/each}}
Event sensor information
{{#each sensorElementList}}
{{sensorMetadata.device.name}}
{{#each sensorReport}}
Captured at
{{time}}
Sensor type
Reading
{{value}}{{uom}}
{{/each}}
Integrity proof
{{/each}}
{{!-- TODO: to be confirmed, since the SensorElementList.sensorIntegrityProof duplicate --}} {{!-- being assumed --}} Event location information
{{processType}}
{{bizStep}} {{eventTime}}
Aggregation
{{parentEPC.name}}
View

Aggregated

Child list
{{#each childEPCList}}
{{name}}
View
{{/each}} {{#each childQuantityList}}
{{quantity}}{{uom}} {{productName}}
View
{{/each}}
Event sensor information
{{#each sensorElementList}}
{{sensorMetadata.device.name}}
{{#each sensorReport}}
Captured at
{{time}}
Sensor type
Reading
{{value}}{{uom}}
{{/each}}
Integrity proof
{{/each}}
{{!-- TODO: to be confirmed, since the SensorElementList.sensorIntegrityProof duplicate --}} {{!-- being assumed --}} Event location information
{{processType}}
{{bizStep}} {{eventTime}}
Association
{{parentEPC.name}}
View

Assembled

Child list
{{#each childEPCList}}
{{name}}
View
{{/each}} {{#each childQuantityList}}
{{quantity}}{{uom}} {{productName}}
View
{{/each}}
Event sensor information
{{#each sensorElementList}}
{{sensorMetadata.device.name}}
{{#each sensorReport}}
Captured at
{{time}}
Sensor type
Reading
{{value}}{{uom}}
{{/each}}
Integrity proof
{{/each}}
{{!-- TODO: to be confirmed, since the SensorElementList.sensorIntegrityProof duplicate --}} {{!-- being assumed --}} Event location information
{{/each}}
Issuing details
Issued by
Valid from
{{validFrom}}
", + "@type": "WebRenderingTemplate2022" + } + ], + "type": ["DigitalTraceabilityEvent"], + "dlrLinkTitle": "Traceability Event", + "dlrVerificationPage": "http://localhost:3003/verify" + }, + "dlr": { + "dlrAPIUrl": "http://localhost:3000", + "dlrAPIKey": "test123", + "namespace": "gs1", + "linkRegisterPath": "/api/resolver" + }, + "storage": { + "url": "http://localhost:3334/v1/documents", + "params": { + "bucket": "verifiable-credentials" + }, + "options": { + "method": "POST", + "headers": { + "Content-Type": "application/json" + } + } + }, + "identifierKeyPath": "/0/id", + "eventTypePath": "/0/type/0" } - } - }, - { - "name": "CustomButton", - "type": "Submit", - "props": {} + ] } - ], - "services": [ - { "name": "convertObjectToArray1Item", "parameters": [{ "path": "/data" }] }, + ] + }, + { + "name": "Issue Traceability Aggregation Event", + "id": "issue_traceability_aggregation_event", + "components": [ { - "name": "processTransformationEventOnly", - "parameters": [ - { - "vckit": { - "vckitAPIUrl": "http://localhost:3332/v2", - "issuer": { - "id": "did:web:uncefact.github.io:project-vckit:test-and-development", - "name": "Orchard Facility" + "name": "JsonForm", + "type": "EntryData", + "props": { + "schema": { + "type": "array", + "items": { + "$ref": "#/$defs/Event" + }, + "$defs": { + "CredentialIssuer": { + "type": "object", + "additionalProperties": false, + "properties": { + "type": { + "type": "array", + "readOnly": true, + "const": ["CredentialIssuer"], + "default": ["CredentialIssuer"], + "items": { + "type": "string", + "enum": ["CredentialIssuer"] + } + }, + "id": { + "example": "did:web:identifiers.example-company.com:12345", + "type": "string", + "format": "uri", + "description": "The W3C DID of the issuer - should be a did:web or did:tdw" + }, + "name": { + "example": "Example Company Pty Ltd", + "type": "string", + "description": "The name of the issuer person or organisation" + }, + "otherIdentifier": { + "type": "array", + "items": { + "$ref": "#/$defs/Identifier" + }, + "description": "An optional list of other registered identifiers for this credential issuer " + } + }, + "description": "The issuer party (person or organisation) of a verifiable credential.", + "required": ["id", "name"] + }, + "Identifier": { + "type": "object", + "additionalProperties": false, + "properties": { + "type": { + "type": "array", + "readOnly": true, + "const": ["Identifier"], + "default": ["Identifier"], + "items": { + "type": "string", + "enum": ["Identifier"] + } + }, + "id": { + "example": "https://id.gs1.org/01/09520123456788/21/12345", + "type": "string", + "format": "uri", + "description": "The globally unique ID of the entity as a resolvable URL according to ISO 18975. ExamplesProduct - id.gs1.org/01/09520123456788/21/12345 Party - abr.business.gov.au/ABN/View?abn=90664869327. Facility - did:web:facilities.example-company.com:123. " + }, + "name": { + "example": "EV battery 300Ah.", + "type": "string", + "description": "The registered name of the entity within the identifier scheme. Examples: product - EV battery 300Ah, Party - Sample Company Pty Ltd, Facility - Green Acres battery factory" + }, + "registeredId": { + "example": "90664869327", + "type": "string", + "description": "The registration number (alphanumeric) of the entity within the register. Unique within the register." + }, + "idScheme": { + "$ref": "#/$defs/IdentifierScheme", + "description": "The identifier scheme. Examples : Product - id.gs1.org/01, Party - business.gov.au/abn, Facility - did:web:facilities.acme.com. " + } + }, + "description": "The ID and Name of an identified entity such as a product, facility, party, standard, etc. If the identifier is a W3C DID then the corresponding DID document SHOULD include a serviceEndpoint of type \"IdentityResolver\". If the identifier is not a W3C DID then the id property SHOULD be an identity resolver URL.", + "required": ["id", "name"] + }, + "IdentifierScheme": { + "type": "object", + "additionalProperties": false, + "properties": { + "type": { + "type": "array", + "readOnly": true, + "const": ["IdentifierScheme"], + "default": ["IdentifierScheme"], + "items": { + "type": "string", + "enum": ["IdentifierScheme"] + } + }, + "id": { + "example": "https://id.gs1.org/01/", + "type": "string", + "format": "uri", + "description": "The globally unique identifier of the registration scheme. The scheme should be registered and discoverable from vocabulary.uncefact.org/identifierSchemes" + }, + "name": { + "example": "Global Trade Identification Number (GTIN)", + "type": "string", + "description": "The name of the identifier scheme. " + } + }, + "description": "An identifier registration scheme for products, facilities, or organisations. Typically operated by a state, national or global authority." + }, + "TransformationEvent": { + "type": "object", + "additionalProperties": true, + "properties": { + "type": { + "type": "array", + "readOnly": true, + "const": ["TransformationEvent", "Event"], + "default": ["TransformationEvent", "Event"], + "items": { + "type": "string", + "enum": ["TransformationEvent", "Event"] + } + }, + "id": { + "readOnly": true, + "example": "https://events.sample.com/01/09359502000034/21/123456", + "type": "string", + "format": "uri", + "description": "The unique identifier of this event - SHOULD be a UUID" + }, + "processType": { + "example": "Weaving", + "type": "string", + "description": "A human readable name for industry specific process represented by this event." + }, + "eventTime": { + "example": "2024-09-01T12:00:00", + "type": "string", + "format": "date-time", + "description": "The ISO-8601 date time when the event occurred." + }, + "action": { + "type": "string", + "enum": ["observe", "add", "delete"], + "example": "observe", + "description": "Code describing how an event relates to the life-cycle of the entity impacted by the event." + }, + "disposition": { + "type": "string", + "x-external-enumeration": "https://ref.gs1.org/cbv/Disp", + "description": "Disposition code describing the state of the item after the event. \n\n This is an enumerated value, but the list of valid values are too big, or change too often to include here. You can access the list of allowable values at this URL: https://ref.gs1.org/cbv/Disp\n " + }, + "bizStep": { + "type": "string", + "x-external-enumeration": "https://ref.gs1.org/cbv/BizStep", + "description": "A business step code drawn from a controlled vocabulary.\n\n This is an enumerated value, but the list of valid values are too big, or change too often to include here. You can access the list of allowable values at this URL: https://ref.gs1.org/cbv/BizStep\n " + }, + "bizLocation": { + "example": "https://id.gs1.org/414/9520123456788", + "type": "string", + "format": "uri", + "description": "A Business Location is a uniquely identified and discretely recorded geospatial location that is meant to designate the specific place where an object is assumed to be following an event until it is reported to be at a different Business Location by a subsequent event. The bizLocation must be a resolvable URI that links to facility information and geo-location data." + }, + "sensorElementList": { + "type": "array", + "items": { + "$ref": "#/$defs/SensorElement" + }, + "description": "An array (one for each sensor) of sensor device data sets associated with the event. " + }, + "outputEPCList": { + "type": "array", + "items": { + "$ref": "#/$defs/Item" + }, + "description": "The list of uniquely identified items that are the output of this transformation event - for example a list of individually identified bolts of cloth that are the output of a weaving process." + }, + "inputEPCList": { + "type": "array", + "items": { + "$ref": "#/$defs/Item" + }, + "description": "The list of uniquely identified items that are the input of this transformation event - for example a list of individually identified bobbins of yarn that are the input of a weaving process." + }, + "inputQuantityList": { + "type": "array", + "items": { + "$ref": "#/$defs/QuantityElement" + }, + "description": "The quantified list of product classes that are the input of this transformation event - used when each item does not have a unique identity. for example the weight of raw cotton that is the input to a ginning process." + }, + "outputQuantityList": { + "type": "array", + "items": { + "$ref": "#/$defs/QuantityElement" + }, + "description": "The quantified list of product classes that are the output of this transformation event - used when each item does not have a unique identity. for example a count of the bales of cleaned cotton that are the output of a ginning process." + } + }, + "description": "Transformation represents an event in which input objects are fully or partially consumed and output objects are produced, such that any of the input objects may have contributed to all of the output objects - for example consuming bales of cotton to produce yarn." + }, + "SensorElement": { + "type": "object", + "additionalProperties": false, + "properties": { + "type": { + "type": "array", + "readOnly": true, + "const": ["SensorElement"], + "default": ["SensorElement"], + "items": { + "type": "string", + "enum": ["SensorElement"] + } + }, + "sensorMetadata": { + "$ref": "#/$defs/Sensor", + "description": "Data that describes the physical sensor that recorded the sensor data set." + }, + "sensorReport": { + "type": "array", + "items": { + "$ref": "#/$defs/SensorData" + }, + "description": "A list of sensor readings from the given sensor relevant to the traceability event context." + }, + "sensorIntegrityProof": { + "type": "string", + "format": "uri", + "description": "An optional reference to a verifiable credential signed by the sensor device or device manufacturer that contains the digitally signed raw data associated with this sensor report." + } + }, + "description": "A SensorElement is used to carry data related to an event that is captured one sensor such as an IoT device. Include one sensor property and an array of sensor data values." }, - "headers": { - "Authorization": "Bearer test123" - } - }, - "traceabilityEvent": { - "context": ["https://test.uncefact.org/vocabulary/untp/dte/0.5.0/"], - "renderTemplate": [ - { - "template": "
DIGITAL TRACEABILITY EVENT
{{#each credentialSubject}}
{{processType}}
{{bizStep}} {{eventTime}}
Transformation
Output
{{#each outputEPCList}}
{{name}}
View
{{/each}} {{#each outputQuantityList}}
{{quantity}}{{uom}} {{productName}}
View
{{/each}}

Transformed

Input
{{#each inputEPCList}}
{{name}}
View
{{/each}} {{#each inputQuantityList}}
{{quantity}}{{uom}} {{productName}}
View
{{/each}}
Event sensor information
{{#each sensorElementList}}
{{sensorMetadata.device.name}}
{{#each sensorReport}}
Captured at
{{time}}
Sensor type
Reading
{{value}}{{uom}}
{{/each}}
Integrity proof
{{/each}}
{{!-- TODO: to be confirmed, since the SensorElementList.sensorIntegrityProof duplicate --}} {{!-- being assumed --}} Event location information
{{processType}}
{{bizStep}} {{eventTime}}
Transaction
Source
{{!-- TODO: to be confirmed, since the navigation link wasn't provided --}} {{!-- being assumed --}}
View
Destination
{{!-- TODO: to be confirmed, since the navigation link wasn't provided --}} {{!-- being assumed --}}
View
Object list
{{#each epcList}}
{{name}}
View
{{/each}} {{#each quantityList}}
{{quantity}}{{uom}} {{productName}}
View
{{/each}}
Event sensor information
{{#each sensorElementList}}
{{sensorMetadata.device.name}}
{{#each sensorReport}}
Captured at
{{time}}
Sensor type
Reading
{{value}}{{uom}}
{{/each}}
Integrity proof
{{/each}}
{{!-- TODO: to be confirmed, since the SensorElementList.sensorIntegrityProof duplicate --}} {{!-- being assumed --}} Event location information
{{processType}}
{{bizStep}} {{eventTime}}
Object event
Object list
{{#each epcList}}
{{name}}
View
{{/each}} {{#each quantityList}}
{{quantity}}{{uom}} {{productName}}
View
{{/each}}
Event sensor information
{{#each sensorElementList}}
{{sensorMetadata.device.name}}
{{#each sensorReport}}
Captured at
{{time}}
Sensor type
Reading
{{value}}{{uom}}
{{/each}}
Integrity proof
{{/each}}
{{!-- TODO: to be confirmed, since the SensorElementList.sensorIntegrityProof duplicate --}} {{!-- being assumed --}} Event location information
{{processType}}
{{bizStep}} {{eventTime}}
Aggregation
{{parentEPC.name}}
View

Aggregated

Child list
{{#each childEPCList}}
{{name}}
View
{{/each}} {{#each childQuantityList}}
{{quantity}}{{uom}} {{productName}}
View
{{/each}}
Event sensor information
{{#each sensorElementList}}
{{sensorMetadata.device.name}}
{{#each sensorReport}}
Captured at
{{time}}
Sensor type
Reading
{{value}}{{uom}}
{{/each}}
Integrity proof
{{/each}}
{{!-- TODO: to be confirmed, since the SensorElementList.sensorIntegrityProof duplicate --}} {{!-- being assumed --}} Event location information
{{processType}}
{{bizStep}} {{eventTime}}
Association
{{parentEPC.name}}
View

Assembled

Child list
{{#each childEPCList}}
{{name}}
View
{{/each}} {{#each childQuantityList}}
{{quantity}}{{uom}} {{productName}}
View
{{/each}}
Event sensor information
{{#each sensorElementList}}
{{sensorMetadata.device.name}}
{{#each sensorReport}}
Captured at
{{time}}
Sensor type
Reading
{{value}}{{uom}}
{{/each}}
Integrity proof
{{/each}}
{{!-- TODO: to be confirmed, since the SensorElementList.sensorIntegrityProof duplicate --}} {{!-- being assumed --}} Event location information
{{/each}}
Issuing details
Issued by
Valid from
{{validFrom}}
", - "@type": "WebRenderingTemplate2022" - } - ], - "type": ["DigitalTraceabilityEvent"], - "dlrLinkTitle": "Transformation Event", - "dlrVerificationPage": "http://localhost:3003/verify" - }, - "dlr": { - "dlrAPIUrl": "http://localhost:3000", - "dlrAPIKey": "test123", - "namespace": "gs1", - "linkRegisterPath": "/api/resolver" - }, - "storage": { - "url": "http://localhost:3334/v1/documents", - "params": { - "bucket": "verifiable-credentials" + "Sensor": { + "type": "object", + "additionalProperties": false, + "properties": { + "type": { + "type": "array", + "readOnly": true, + "const": ["Sensor"], + "default": ["Sensor"], + "items": { + "type": "string", + "enum": ["Sensor"] + } + }, + "device": { + "$ref": "#/$defs/Item", + "description": "The device Identifier for the sensor as a URI (typically an EPC)" + }, + "dataProcessingMethod": { + "example": "https://standards.org/sensorMethod#1234", + "type": "string", + "format": "uri", + "description": "The data processing method used by the sensor - should reference a documented standard criteria as a URI" + } + }, + "description": "A physical sensor that records a sensor data set." }, - "options": { - "method": "POST", - "headers": { - "Content-Type": "application/json" - } - } - }, - "identifierKeyPath": "/0/id" - } - ] - } - ] - }, - { - "name": "Issue DFR", - "id": "produce_product", - "components": [ - { - "name": "JsonForm", - "type": "EntryData", - "props": { - "schema": { - "url": "https://jargon.sh/user/unece/DigitalFacilityRecord/v/working/artefacts/jsonSchemas/Facility.json?class=Facility" - }, - "data": { - "type": ["Facility"], - "id": "https://id.gs1.org/414/9359502000034", - "registeredId": "4149359502000034", - "description": "LiFePO4 Battery plant number 7", - "name": "Example facility 7", - "idScheme": { - "type": ["IdentifierScheme"], - "id": "https://id.gs1.org/01/", - "name": "Global Trade Identification Number (GTIN)" - }, - "countryOfOperation": "AU", - "processCategory": [ - { - "type": ["Classification"], - "id": "https://unstats.un.org/unsd/classifications/Econ/cpc/46410", - "code": "46410", - "name": "Primary cells and primary batteries", - "schemeID": "https://unstats.un.org/unsd/classifications/Econ/cpc/", - "schemeName": "UN Central Product Classification (CPC)" + "Item": { + "type": "object", + "additionalProperties": false, + "properties": { + "type": { + "type": "array", + "readOnly": true, + "const": ["Item"], + "default": ["Item"], + "items": { + "type": "string", + "enum": ["Item"] + } + }, + "id": { + "example": "https://id.gs1.org/01/09520123456788/21/12345", + "type": "string", + "format": "uri", + "description": "The globally unique ID of the product as a URI. Ideally as a resolvable URL according to ISO 18975. " + }, + "name": { + "example": "EV battery 300Ah.", + "type": "string", + "description": "The name of the product class to which the product item belongs. " + } + }, + "description": "A specific serialised trade item which is an instance of a more generic product. ", + "required": ["id", "name"] }, - { - "type": ["Classification"], - "id": "https://unstats.un.org/unsd/classifications/Econ/cpc/46410", - "code": "46410", - "name": "Primary cells and primary batteries", - "schemeID": "https://unstats.un.org/unsd/classifications/Econ/cpc/", - "schemeName": "UN Central Product Classification (CPC)" - } - ], - "operatedByParty": { - "type": ["Identifier"], - "id": "https://id.gs1.org/01/09520123456788/21/12345", - "name": "EV battery 300Ah.", - "registeredId": "90664869327", - "idScheme": { - "type": ["IdentifierScheme"], - "id": "https://id.gs1.org/01/", - "name": "Global Trade Identification Number (GTIN)" - } - }, - "otherIdentifier": [ - { - "type": ["Identifier"], - "id": "https://id.gs1.org/01/09520123456788/21/12345", - "name": "EV battery 300Ah.", - "registeredId": "90664869327", - "idScheme": { - "type": ["IdentifierScheme"], - "id": "https://id.gs1.org/01/", - "name": "Global Trade Identification Number (GTIN)" - } + "SensorData": { + "type": "object", + "additionalProperties": false, + "properties": { + "type": { + "type": "array", + "readOnly": true, + "const": ["SensorData"], + "default": ["SensorData"], + "items": { + "type": "string", + "enum": ["SensorData"] + } + }, + "time": { + "example": "2024-07-24T12:00:00", + "type": "string", + "format": "date-time", + "description": "the timestamp at which the sensor reading was made." + }, + "sensorType": { + "example": "https://samplesensors.com/model1234", + "type": "string", + "format": "uri", + "description": "the measurement type of the sensor reading, as a URI reference to a measurement method specification." + }, + "value": { + "example": 25, + "type": "number", + "description": "the sensor reading" + }, + "uom": { + "type": "string", + "x-external-enumeration": "https://vocabulary.uncefact.org/UnitMeasureCode", + "description": "the unit of measure for the sensor reading, drawn from UNECE rec20 code list.\n\n This is an enumerated value, but the list of valid values are too big, or change too often to include here. You can access the list of allowable values at this URL: https://vocabulary.uncefact.org/UnitMeasureCode\n " + } + }, + "description": "A data point read by a sensor." }, - { - "type": ["Identifier"], - "id": "https://id.gs1.org/01/09520123456788/21/12345", - "name": "EV battery 300Ah.", - "registeredId": "90664869327", - "idScheme": { - "type": ["IdentifierScheme"], - "id": "https://id.gs1.org/01/", - "name": "Global Trade Identification Number (GTIN)" - } - } - ], - "address": { - "streetAddress": "level 11, 15 London Circuit", - "postalCode": "2601", - "addressLocality": "Acton", - "addressRegion": "ACT", - "addressCountry": "AU" - }, - "locationInformation": { - "plusCode": "https://plus.codes/8CGRC78W+MM", - "geoLocation": { - "type": "Point", - "coordinates": [3.141579, 3.141579] + "QuantityElement": { + "type": "object", + "additionalProperties": false, + "properties": { + "type": { + "type": "array", + "readOnly": true, + "const": ["QuantityElement"], + "default": ["QuantityElement"], + "items": { + "type": "string", + "enum": ["QuantityElement"] + } + }, + "productId": { + "example": "https://id.gs1.org/01/09520123456788/21/12345", + "type": "string", + "format": "uri", + "description": "THe identifier of a product class (as opposed to a product instance) such as a GTIN code for a manufactured product." + }, + "productName": { + "example": "EV battery 300Ah.", + "type": "string", + "description": "The registered name of the product within the identifier scheme. " + }, + "quantity": { + "example": 20, + "type": "number", + "description": "The numeric quantity of the product class (eg 100 kg of cotton)" + }, + "uom": { + "type": "string", + "x-external-enumeration": "https://vocabulary.uncefact.org/UnitMeasureCode", + "description": "The unit of measure for the quantity value (eg Kg or meters etc) using the UNECE Rec 20 unit of measure codelist.\n\n This is an enumerated value, but the list of valid values are too big, or change too often to include here. You can access the list of allowable values at this URL: https://vocabulary.uncefact.org/UnitMeasureCode\n " + } + }, + "description": "The quantity element is used to define the quantity (eg 100 kg of a product class. Used when serialised items are not applicable.", + "required": ["productId", "productName", "quantity"] }, - "geoBoundary": { - "type": "Polygon", - "coordinates": [[[3.141579, 3.141579]]] - } - }, - "conformityClaim": [ - { - "type": ["Claim", "Declaration"], - "assessmentDate": "2024-04-25", - "id": "https://products.example-company.com/09520123456788/declarations/12345", - "referenceStandard": { - "type": ["Standard"], - "id": "https://www.globalbattery.org/media/publications/gba-rulebook-v2.0-master.pdf", - "name": "GBA Battery Passport Greenhouse Gas Rulebook - V.2.0", - "issuingParty": { - "type": ["Identifier"], - "id": "https://id.gs1.org/01/09520123456788/21/12345", - "name": "EV battery 300Ah.", - "registeredId": "90664869327", - "idScheme": { - "type": ["IdentifierScheme"], - "id": "https://id.gs1.org/01/", - "name": "Global Trade Identification Number (GTIN)" + "ObjectEvent": { + "type": "object", + "additionalProperties": true, + "properties": { + "type": { + "type": "array", + "readOnly": true, + "const": ["ObjectEvent", "Event"], + "default": ["ObjectEvent", "Event"], + "items": { + "type": "string", + "enum": ["ObjectEvent", "Event"] } }, - "issueDate": "2023-12-05" + "id": { + "readOnly": true, + "example": "https://events.sample.com/01/09359502000034/21/123456", + "type": "string", + "format": "uri", + "description": "The unique identifier of this event - SHOULD be a UUID" + }, + "processType": { + "example": "Weaving", + "type": "string", + "description": "A human readable name for industry specific process represented by this event." + }, + "eventTime": { + "example": "2024-09-01T12:00:00", + "type": "string", + "format": "date-time", + "description": "The ISO-8601 date time when the event occurred." + }, + "action": { + "type": "string", + "enum": ["observe", "add", "delete"], + "example": "observe", + "description": "Code describing how an event relates to the life-cycle of the entity impacted by the event." + }, + "disposition": { + "type": "string", + "x-external-enumeration": "https://ref.gs1.org/cbv/Disp", + "description": "Disposition code describing the state of the item after the event. \n\n This is an enumerated value, but the list of valid values are too big, or change too often to include here. You can access the list of allowable values at this URL: https://ref.gs1.org/cbv/Disp\n " + }, + "bizStep": { + "type": "string", + "x-external-enumeration": "https://ref.gs1.org/cbv/BizStep", + "description": "A business step code drawn from a controlled vocabulary.\n\n This is an enumerated value, but the list of valid values are too big, or change too often to include here. You can access the list of allowable values at this URL: https://ref.gs1.org/cbv/BizStep\n " + }, + "bizLocation": { + "example": "https://id.gs1.org/414/9520123456788", + "type": "string", + "format": "uri", + "description": "A Business Location is a uniquely identified and discretely recorded geospatial location that is meant to designate the specific place where an object is assumed to be following an event until it is reported to be at a different Business Location by a subsequent event. The bizLocation must be a resolvable URI that links to facility information and geo-location data." + }, + "sensorElementList": { + "type": "array", + "items": { + "$ref": "#/$defs/SensorElement" + }, + "description": "An array (one for each sensor) of sensor device data sets associated with the event. " + }, + "epcList": { + "type": "array", + "items": { + "$ref": "#/$defs/Item" + }, + "description": "A list of uniquely identified items (eg specific items serial numbers or tagged shipments / packages) that are the focus of this object event. " + }, + "quantityList": { + "type": "array", + "items": { + "$ref": "#/$defs/QuantityElement" + }, + "description": "A quantified list of product classes (eg GS1 GTINs) that are the focus of this object event" + } }, - "referenceRegulation": { - "type": ["Regulation"], - "id": "https://www.legislation.gov.au/F2008L02309/latest/versions", - "name": "NNational Greenhouse and Energy Reporting (Measurement) Determination", - "jurisdictionCountry": "Enumeration Value", - "administeredBy": { - "type": ["Identifier"], - "id": "https://id.gs1.org/01/09520123456788/21/12345", - "name": "EV battery 300Ah.", - "registeredId": "90664869327", - "idScheme": { - "type": ["IdentifierScheme"], - "id": "https://id.gs1.org/01/", - "name": "Global Trade Identification Number (GTIN)" + "description": "Object represents an event that happened to one or more physical or digital objects - such as an inspection or certification of a product or shipment. The physical objects may be identified either as specific items (eg a unique consignment number) or as a quantified amount of a product class (eg 100Kg of cotton yarn)" + }, + "AggregationEvent": { + "type": "object", + "additionalProperties": true, + "properties": { + "type": { + "type": "array", + "readOnly": true, + "const": ["AggregationEvent", "Event"], + "default": ["AggregationEvent", "Event"], + "items": { + "type": "string", + "enum": ["AggregationEvent", "Event"] + } + }, + "id": { + "readOnly": true, + "example": "https://events.sample.com/01/09359502000034/21/123456", + "type": "string", + "format": "uri", + "description": "The unique identifier of this event - SHOULD be a UUID" + }, + "processType": { + "example": "Weaving", + "type": "string", + "description": "A human readable name for industry specific process represented by this event." + }, + "eventTime": { + "example": "2024-09-01T12:00:00", + "type": "string", + "format": "date-time", + "description": "The ISO-8601 date time when the event occurred." + }, + "action": { + "type": "string", + "enum": ["observe", "add", "delete"], + "example": "observe", + "description": "Code describing how an event relates to the life-cycle of the entity impacted by the event." + }, + "disposition": { + "type": "string", + "x-external-enumeration": "https://ref.gs1.org/cbv/Disp", + "description": "Disposition code describing the state of the item after the event. \n\n This is an enumerated value, but the list of valid values are too big, or change too often to include here. You can access the list of allowable values at this URL: https://ref.gs1.org/cbv/Disp\n " + }, + "bizStep": { + "type": "string", + "x-external-enumeration": "https://ref.gs1.org/cbv/BizStep", + "description": "A business step code drawn from a controlled vocabulary.\n\n This is an enumerated value, but the list of valid values are too big, or change too often to include here. You can access the list of allowable values at this URL: https://ref.gs1.org/cbv/BizStep\n " + }, + "bizLocation": { + "example": "https://id.gs1.org/414/9520123456788", + "type": "string", + "format": "uri", + "description": "A Business Location is a uniquely identified and discretely recorded geospatial location that is meant to designate the specific place where an object is assumed to be following an event until it is reported to be at a different Business Location by a subsequent event. The bizLocation must be a resolvable URI that links to facility information and geo-location data." + }, + "sensorElementList": { + "type": "array", + "items": { + "$ref": "#/$defs/SensorElement" + }, + "description": "An array (one for each sensor) of sensor device data sets associated with the event. " + }, + "parentEPC": { + "$ref": "#/$defs/Item", + "description": "The unique item identifier that is the result of this aggregation. Typically a packaging ID used in shipments that represents a box/ pallet / container of contained items." + }, + "childEPCList": { + "type": "array", + "items": { + "$ref": "#/$defs/Item" + }, + "description": "The list of child items that have been aggregated into the parent (or dis-aggregated from the parent). Maybe a list of package references (eg boxes on a pallet) or may be individual items (eg products in a box)." + }, + "childQuantityList": { + "type": "array", + "items": { + "$ref": "#/$defs/QuantityElement" + }, + "description": "List of quantified product classes that have been aggregated into the parent. Used when the child items do not have unique identifiers (eg 100 Kg of cotton bales)" + } + }, + "description": "Aggregation represents an event that happened to one or more objects that are physically aggregated together (physically constrained to be in the same place at the same time, as when cases are aggregated to a pallet). This event is also used to represent de-aggregation (eg unpacking) when businessStepCode is unpacking." + }, + "TransactionEvent": { + "type": "object", + "additionalProperties": true, + "properties": { + "type": { + "type": "array", + "readOnly": true, + "const": ["TransactionEvent", "Event"], + "default": ["TransactionEvent", "Event"], + "items": { + "type": "string", + "enum": ["TransactionEvent", "Event"] } }, - "effectiveDate": "2024-03-20" - }, - "assessmentCriteria": [ - { - "type": ["Criterion"], - "id": "https://www.globalbattery.org/media/publications/gba-rulebook-v2.0-master.pdf#BatteryAssembly", - "name": "GBA Battery rule book v2.0 battery assembly guidelines.", - "thresholdValues": [ - { - "metricName": "GHG emissions intensity", - "metricValue": { - "value": 10, - "unit": "KGM" - }, - "score": "BB", - "accuracy": 0.05 - }, - { - "metricName": "GHG emissions intensity", - "metricValue": { - "value": 10, - "unit": "KGM" - }, - "score": "BB", - "accuracy": 0.05 - } - ] + "id": { + "readOnly": true, + "example": "https://events.sample.com/01/09359502000034/21/123456", + "type": "string", + "format": "uri", + "description": "The unique identifier of this event - SHOULD be a UUID" + }, + "processType": { + "example": "Weaving", + "type": "string", + "description": "A human readable name for industry specific process represented by this event." + }, + "eventTime": { + "example": "2024-09-01T12:00:00", + "type": "string", + "format": "date-time", + "description": "The ISO-8601 date time when the event occurred." + }, + "action": { + "type": "string", + "enum": ["observe", "add", "delete"], + "example": "observe", + "description": "Code describing how an event relates to the life-cycle of the entity impacted by the event." + }, + "disposition": { + "type": "string", + "x-external-enumeration": "https://ref.gs1.org/cbv/Disp", + "description": "Disposition code describing the state of the item after the event. \n\n This is an enumerated value, but the list of valid values are too big, or change too often to include here. You can access the list of allowable values at this URL: https://ref.gs1.org/cbv/Disp\n " + }, + "bizStep": { + "type": "string", + "x-external-enumeration": "https://ref.gs1.org/cbv/BizStep", + "description": "A business step code drawn from a controlled vocabulary.\n\n This is an enumerated value, but the list of valid values are too big, or change too often to include here. You can access the list of allowable values at this URL: https://ref.gs1.org/cbv/BizStep\n " + }, + "bizLocation": { + "example": "https://id.gs1.org/414/9520123456788", + "type": "string", + "format": "uri", + "description": "A Business Location is a uniquely identified and discretely recorded geospatial location that is meant to designate the specific place where an object is assumed to be following an event until it is reported to be at a different Business Location by a subsequent event. The bizLocation must be a resolvable URI that links to facility information and geo-location data." + }, + "sensorElementList": { + "type": "array", + "items": { + "$ref": "#/$defs/SensorElement" + }, + "description": "An array (one for each sensor) of sensor device data sets associated with the event. " }, - { - "type": ["Criterion"], - "id": "https://www.globalbattery.org/media/publications/gba-rulebook-v2.0-master.pdf#BatteryAssembly", - "name": "GBA Battery rule book v2.0 battery assembly guidelines.", - "thresholdValues": [ - { - "metricName": "GHG emissions intensity", - "metricValue": { - "value": 10, - "unit": "KGM" - }, - "score": "BB", - "accuracy": 0.05 - }, - { - "metricName": "GHG emissions intensity", - "metricValue": { - "value": 10, - "unit": "KGM" - }, - "score": "BB", - "accuracy": 0.05 - } - ] - } - ], - "declaredValue": [ - { - "metricName": "GHG emissions intensity", - "metricValue": { - "value": 10, - "unit": "KGM" + "sourcePartyId": { + "example": "https://abr.business.gov.au/ABN/View?abn=90664869327", + "type": "string", + "format": "uri", + "description": "The source party for this supply chain transaction - typically the seller party" + }, + "destinationPartyId": { + "example": "https://abr.business.gov.au/ABN/View?abn=90664869327", + "type": "string", + "format": "uri", + "description": "The destination party for this supply chain transaction - typically the buyer party." + }, + "bizTransaction": { + "type": "string", + "x-external-enumeration": "https://ref.gs1.org/cbv/BTT", + "description": "The document type representing the trade transaction drawn from the business transaction type vocabulary.\n\n This is an enumerated value, but the list of valid values are too big, or change too often to include here. You can access the list of allowable values at this URL: https://ref.gs1.org/cbv/BTT\n " + }, + "epcList": { + "type": "array", + "items": { + "$ref": "#/$defs/Item" }, - "score": "BB", - "accuracy": 0.05 + "description": "The list of uniquely identified trade items included in this supply chain transaction." }, - { - "metricName": "GHG emissions intensity", - "metricValue": { - "value": 10, - "unit": "KGM" + "quantityList": { + "type": "array", + "items": { + "$ref": "#/$defs/QuantityElement" }, - "score": "BB", - "accuracy": 0.05 + "description": "List of quantified product classes that are included in this transaction. Used when the trade items do not have unique identifiers (eg 100 reels of yarn)" } - ], - "conformance": true, - "conformityTopic": "environment.emissions", - "conformityEvidence": { - "linkURL": "https://files.example-certifier.com/1234567.json", - "linkName": "GBA rule book conformity certificate", - "linkType": "https://test.uncefact.org/vocabulary/linkTypes/dcc", - "hashDigest": "6239119", - "hashMethod": "SHA-256", - "encryptionMethod": "AES" - } + }, + "description": "Transaction represents an event in which one or more objects become associated or disassociated with one or more identified business transactions - such as the purchase / shipment of goods between buyer and seller.", + "required": ["sourcePartyId", "destinationPartyId"] }, - { - "type": ["Claim", "Declaration"], - "assessmentDate": "2024-03-15", - "id": "https://products.example-company.com/09520123456788/declarations/12345", - "referenceStandard": { - "type": ["Standard"], - "id": "https://www.globalbattery.org/media/publications/gba-rulebook-v2.0-master.pdf", - "name": "GBA Battery Passport Greenhouse Gas Rulebook - V.2.0", - "issuingParty": { - "type": ["Identifier"], - "id": "https://id.gs1.org/01/09520123456788/21/12345", - "name": "EV battery 300Ah.", - "registeredId": "90664869327", - "idScheme": { - "type": ["IdentifierScheme"], - "id": "https://id.gs1.org/01/", - "name": "Global Trade Identification Number (GTIN)" + "AssociationEvent": { + "type": "object", + "additionalProperties": true, + "properties": { + "type": { + "type": "array", + "readOnly": true, + "const": ["AssociationEvent", "Event"], + "default": ["AssociationEvent", "Event"], + "items": { + "type": "string", + "enum": ["AssociationEvent", "Event"] } }, - "issueDate": "2023-12-05" - }, - "referenceRegulation": { - "type": ["Regulation"], - "id": "https://www.legislation.gov.au/F2008L02309/latest/versions", - "name": "NNational Greenhouse and Energy Reporting (Measurement) Determination", - "jurisdictionCountry": "Enumeration Value", - "administeredBy": { - "type": ["Identifier"], - "id": "https://id.gs1.org/01/09520123456788/21/12345", - "name": "EV battery 300Ah.", - "registeredId": "90664869327", - "idScheme": { - "type": ["IdentifierScheme"], - "id": "https://id.gs1.org/01/", - "name": "Global Trade Identification Number (GTIN)" - } + "id": { + "readOnly": true, + "example": "https://events.sample.com/01/09359502000034/21/123456", + "type": "string", + "format": "uri", + "description": "The unique identifier of this event - SHOULD be a UUID" }, - "effectiveDate": "2024-03-20" + "processType": { + "example": "Weaving", + "type": "string", + "description": "A human readable name for industry specific process represented by this event." + }, + "eventTime": { + "example": "2024-09-01T12:00:00", + "type": "string", + "format": "date-time", + "description": "The ISO-8601 date time when the event occurred." + }, + "action": { + "type": "string", + "enum": ["observe", "add", "delete"], + "example": "observe", + "description": "Code describing how an event relates to the life-cycle of the entity impacted by the event." + }, + "disposition": { + "type": "string", + "x-external-enumeration": "https://ref.gs1.org/cbv/Disp", + "description": "Disposition code describing the state of the item after the event. \n\n This is an enumerated value, but the list of valid values are too big, or change too often to include here. You can access the list of allowable values at this URL: https://ref.gs1.org/cbv/Disp\n " + }, + "bizStep": { + "type": "string", + "x-external-enumeration": "https://ref.gs1.org/cbv/BizStep", + "description": "A business step code drawn from a controlled vocabulary.\n\n This is an enumerated value, but the list of valid values are too big, or change too often to include here. You can access the list of allowable values at this URL: https://ref.gs1.org/cbv/BizStep\n " + }, + "bizLocation": { + "example": "https://id.gs1.org/414/9520123456788", + "type": "string", + "format": "uri", + "description": "A Business Location is a uniquely identified and discretely recorded geospatial location that is meant to designate the specific place where an object is assumed to be following an event until it is reported to be at a different Business Location by a subsequent event. The bizLocation must be a resolvable URI that links to facility information and geo-location data." + }, + "sensorElementList": { + "type": "array", + "items": { + "$ref": "#/$defs/SensorElement" + }, + "description": "An array (one for each sensor) of sensor device data sets associated with the event. " + }, + "parentEPC": { + "$ref": "#/$defs/Item", + "description": "The unique item identifier that is the parent of this association. Typically an assembled product ID such as a desktop computer that is built from the associated child components." + }, + "childEPCList": { + "type": "array", + "items": { + "$ref": "#/$defs/Item" + }, + "description": "The list of child items that have been assembled to create the parent - for example the power supply or hard drive components of a desktop computer." + }, + "childQuantityList": { + "type": "array", + "items": { + "$ref": "#/$defs/QuantityElement" + }, + "description": "List of quantified product classes that have been assembled into the parent. Used when the child items do not have unique identifiers (eg brackets and screws used in the assembly of a desktop computer)" + } }, - "assessmentCriteria": [ + "description": "The association event represents the assembly of child sub-components to create a parent assembled item. For example a desktop computer assembled from power supply, hard drive, and motherboard. The association event is very similar in structure to the aggregation event but is used for physical assembly. An association event may represent a bill of materials used to assemble a product whilst an aggregation event may represent a packing list or items for transport. " + }, + "Event": { + "type": "object", + "oneOf": [ { - "type": ["Criterion"], - "id": "https://www.globalbattery.org/media/publications/gba-rulebook-v2.0-master.pdf#BatteryAssembly", - "name": "GBA Battery rule book v2.0 battery assembly guidelines.", - "thresholdValues": [ - { - "metricName": "GHG emissions intensity", - "metricValue": { - "value": 10, - "unit": "KGM" - }, - "score": "BB", - "accuracy": 0.05 - }, - { - "metricName": "GHG emissions intensity", - "metricValue": { - "value": 10, - "unit": "KGM" - }, - "score": "BB", - "accuracy": 0.05 - } - ] + "$ref": "#/$defs/AggregationEvent" }, { - "type": ["Criterion"], - "id": "https://www.globalbattery.org/media/publications/gba-rulebook-v2.0-master.pdf#BatteryAssembly", - "name": "GBA Battery rule book v2.0 battery assembly guidelines.", - "thresholdValues": [ - { - "metricName": "GHG emissions intensity", - "metricValue": { - "value": 10, - "unit": "KGM" - }, - "score": "BB", - "accuracy": 0.05 - }, - { - "metricName": "GHG emissions intensity", - "metricValue": { - "value": 10, - "unit": "KGM" - }, - "score": "BB", - "accuracy": 0.05 - } - ] - } - ], - "declaredValue": [ + "$ref": "#/$defs/TransformationEvent" + }, { - "metricName": "GHG emissions intensity", - "metricValue": { - "value": 10, - "unit": "KGM" - }, - "score": "BB", - "accuracy": 0.05 + "$ref": "#/$defs/ObjectEvent" }, + { - "metricName": "GHG emissions intensity", - "metricValue": { - "value": 10, - "unit": "KGM" - }, - "score": "BB", - "accuracy": 0.05 + "$ref": "#/$defs/TransactionEvent" + }, + { + "$ref": "#/$defs/AssociationEvent" } ], - "conformance": true, - "conformityTopic": "environment.emissions", - "conformityEvidence": { - "linkURL": "https://files.example-certifier.com/1234567.json", - "linkName": "GBA rule book conformity certificate", - "linkType": "https://test.uncefact.org/vocabulary/linkTypes/dcc", - "hashDigest": "6239119", - "hashMethod": "SHA-256", - "encryptionMethod": "AES" - } + "description": "This abstract event structure provides a common language to describe supply chain events such as shipments, inspections, manufacturing processes, etc. There are four types of EPCIS event but this is an abstract class representing all common properties of an EPCIS event.", + "additionalProperties": true } - ] + } }, + "data": [ + { + "type": ["AggregationEvent", "Event"], + "id": "https://events.sample.com/01/09359502000034/21/123456", + "processType": "Weaving", + "eventTime": "2024-09-01T12:00:00", + "action": "add", + "disposition": "https://ref.gs1.org/cbv/Disp-active", + "bizStep": "https://ref.gs1.org/cbv/BizStep-commissioning", + "bizLocation": "https://id.gs1.org/414/9520123456788", + "sensorElementList": [ + { + "sensorMetadata": { + "device": { + "type": ["Item"], + "id": "https://id.gs1.org/01/09520123456788/21/12345", + "name": "EV battery 300Ah." + }, + "dataProcessingMethod": "https://standards.org/sensorMethod#1234" + }, + "sensorReport": [ + { + "time": "2024-07-24T12:00:00", + "sensorType": "https://samplesensors.com/model1234", + "value": 25, + "uom": "KGM" + }, + { + "time": "2024-07-24T12:00:00", + "sensorType": "https://samplesensors.com/model1234", + "value": 25, + "uom": "KGM" + } + ], + "sensorIntegrityProof": "https://jargon.sh" + }, + { + "sensorMetadata": { + "device": { + "type": ["Item"], + "id": "https://id.gs1.org/01/09520123456788/21/12345", + "name": "EV battery 300Ah." + }, + "dataProcessingMethod": "https://standards.org/sensorMethod#1234" + }, + "sensorReport": [ + { + "time": "2024-07-24T12:00:00", + "sensorType": "https://samplesensors.com/model1234", + "value": 25, + "uom": "KGM" + }, + { + "time": "2024-07-24T12:00:00", + "sensorType": "https://samplesensors.com/model1234", + "value": 25, + "uom": "KGM" + } + ], + "sensorIntegrityProof": "https://jargon.sh" + } + ], + "parentEPC": { + "type": ["Item"], + "id": "https://id.gs1.org/01/09520123456788/21/12345", + "name": "EV battery 300Ah." + }, + "childEPCList": [ + { + "type": ["Item"], + "id": "https://id.gs1.org/01/09520123456788/21/12345", + "name": "EV battery 300Ah." + }, + { + "type": ["Item"], + "id": "https://id.gs1.org/01/09520123456788/21/12345", + "name": "EV battery 300Ah." + } + ], + "childQuantityList": [ + { + "productId": "https://id.gs1.org/01/09520123456788/21/12345", + "productName": "EV battery 300Ah.", + "quantity": 20, + "uom": "KGM" + }, + { + "productId": "https://id.gs1.org/01/09520123456788/21/12345", + "productName": "EV battery 300Ah.", + "quantity": 20, + "uom": "KGM" + } + ] + } + ], "constructData": { "mappingFields": [], "dummyFields": [], @@ -5614,102 +7024,7 @@ ], "services": [ { - "name": "processDigitalFacilityRecord", - "parameters": [ - { - "vckit": { - "vckitAPIUrl": "http://localhost:3332/v2", - "issuer": { - "id": "did:web:uncefact.github.io:project-vckit:test-and-development", - "name": "Orchard Facility" - }, - "headers": { - "Authorization": "Bearer test123" - } - }, - "digitalFacilityRecord": { - "context": ["https://test.uncefact.org/vocabulary/untp/dfr/0.5.0/"], - "renderTemplate": [ - { - "template": " Digital Facility Record
FACILITY RECORD

{{credentialSubject.name}}

{{credentialSubject.description}}

Country
{{credentialSubject.countryOfOperation}}
Address
{{!-- TODO 1: plain text --}} {{!--
{{credentialSubject.address.streetAddress}} {{credentialSubject.address.addressLocality}}, {{credentialSubject.address.postalCode}}
--}} {{!-- TODO 2: confirm --}} {{!-- {{credentialSubject.address.streetAddress}} --}} {{!-- TODO 3: confirm --}} {{credentialSubject.address.streetAddress}} {{credentialSubject.address.addressLocality}}, {{credentialSubject.address.postalCode}}
Processes
{{#each credentialSubject.processCategory}} {{name}} {{/each}}
Geolocation
Show on map
Declarations
{{#each credentialSubject.conformityClaim}}
Conformance:
{{#if conformance}}Yes{{else}}No{{/if}}
Assessed: {{assessmentDate}}
{{conformityEvidence.linkName}}

{{referenceRegulation.name}} administered in {{referenceRegulation.jurisdictionCountry}} by {{referenceRegulation.administeredBy.name}}

{{referenceStandard.name}} issued by {{referenceStandard.issuingParty.name}}

{{#each declaredValue}}

{{metricName}} is {{metricValue.value}}{{metricValue.unit}}

Score: {{score}} | Accuracy {{accuracy}}

{{/each}}
Evidence
{{/each}}
Issuing details
Issued by
Valid from
{{validFrom}}
Valid until
{{validUntil}}
", - "@type": "WebRenderingTemplate2022" - } - ], - "type": ["DigitalFacilityRecord"], - "dlrLinkTitle": "DigitalFacilityRecord", - "dlrVerificationPage": "http://localhost:3003/verify" - }, - "dlr": { - "dlrAPIUrl": "http://localhost:3000", - "dlrAPIKey": "test123", - "namespace": "gs1", - "linkRegisterPath": "/api/resolver" - }, - "storage": { - "url": "http://localhost:3334/v1/documents", - "params": { - "bucket": "verifiable-credentials" - }, - "options": { - "method": "POST", - "headers": { - "Content-Type": "application/json" - } - } - }, - "identifierKeyPath": "/id" - } - ] - } - ] - }, - { - "name": "Issue DIA", - "id": "produce_product", - "components": [ - { - "name": "JsonForm", - "type": "EntryData", - "props": { - "schema": { - "url": "https://jargon.sh/user/unece/DigitalIdentityAnchor/v/working/artefacts/jsonSchemas/RegisteredIdentity.json?class=RegisteredIdentity" - }, - "data": { - "type": ["RegisteredIdentity", "Identifier"], - "id": "https://id.gs1.org/01/09359502000010", - "name": "Sample business Ltd", - "registeredId": "0109359502000010", - "idScheme": { - "type": ["IdentifierScheme"], - "id": "https://id.gs1.org/01/", - "name": "Global Trade Identification Number (GTIN)" - }, - "registerType": "Business", - "registrationScopeList": ["https://jargon.sh", "https://jargon.sh"] - }, - "style": {}, - "className": "", - "constructData": { - "mappingFields": [], - "dummyFields": [], - "generationFields": [] - } - } - }, - { - "name": "CustomButton", - "type": "Submit", - "props": { - "label": "Issue DIA", - "description": "", - "includeDownload": false, - "downloadFileName": "" - } - } - ], - "services": [ - { - "name": "processDigitalIdentityAnchor", + "name": "processTraceabilityEvent", "parameters": [ { "vckit": { @@ -5722,16 +7037,16 @@ "Authorization": "Bearer test123" } }, - "digitalIdentityAnchor": { - "context": ["https://test.uncefact.org/vocabulary/untp/dia/0.2.1/"], + "traceabilityEvent": { + "context": ["https://test.uncefact.org/vocabulary/untp/dte/0.5.0/"], "renderTemplate": [ { - "template": " Digital Identity Anchor
DIGITAL IDENTITY ANCHOR

{{credentialSubject.name}}

{{credentialSubject.id}}

{{credentialSubject.idScheme.name}}

{{credentialSubject.registeredId}}

Type

{{credentialSubject.registerType}}

Issuing details
Issued by
Valid from
{{validFrom}}
Valid until
{{validUntil}}
", + "template": "
DIGITAL TRACEABILITY EVENT
{{#each credentialSubject}}
{{processType}}
{{bizStep}} {{eventTime}}
Transformation
Output
{{#each outputEPCList}}
{{name}}
View
{{/each}} {{#each outputQuantityList}}
{{quantity}}{{uom}} {{productName}}
View
{{/each}}

Transformed

Input
{{#each inputEPCList}}
{{name}}
View
{{/each}} {{#each inputQuantityList}}
{{quantity}}{{uom}} {{productName}}
View
{{/each}}
Event sensor information
{{#each sensorElementList}}
{{sensorMetadata.device.name}}
{{#each sensorReport}}
Captured at
{{time}}
Sensor type
Reading
{{value}}{{uom}}
{{/each}}
Integrity proof
{{/each}}
{{!-- TODO: to be confirmed, since the SensorElementList.sensorIntegrityProof duplicate --}} {{!-- being assumed --}} Event location information
{{processType}}
{{bizStep}} {{eventTime}}
Transaction
Source
{{!-- TODO: to be confirmed, since the navigation link wasn't provided --}} {{!-- being assumed --}}
View
Destination
{{!-- TODO: to be confirmed, since the navigation link wasn't provided --}} {{!-- being assumed --}}
View
Object list
{{#each epcList}}
{{name}}
View
{{/each}} {{#each quantityList}}
{{quantity}}{{uom}} {{productName}}
View
{{/each}}
Event sensor information
{{#each sensorElementList}}
{{sensorMetadata.device.name}}
{{#each sensorReport}}
Captured at
{{time}}
Sensor type
Reading
{{value}}{{uom}}
{{/each}}
Integrity proof
{{/each}}
{{!-- TODO: to be confirmed, since the SensorElementList.sensorIntegrityProof duplicate --}} {{!-- being assumed --}} Event location information
{{processType}}
{{bizStep}} {{eventTime}}
Object event
Object list
{{#each epcList}}
{{name}}
View
{{/each}} {{#each quantityList}}
{{quantity}}{{uom}} {{productName}}
View
{{/each}}
Event sensor information
{{#each sensorElementList}}
{{sensorMetadata.device.name}}
{{#each sensorReport}}
Captured at
{{time}}
Sensor type
Reading
{{value}}{{uom}}
{{/each}}
Integrity proof
{{/each}}
{{!-- TODO: to be confirmed, since the SensorElementList.sensorIntegrityProof duplicate --}} {{!-- being assumed --}} Event location information
{{processType}}
{{bizStep}} {{eventTime}}
Aggregation
{{parentEPC.name}}
View

Aggregated

Child list
{{#each childEPCList}}
{{name}}
View
{{/each}} {{#each childQuantityList}}
{{quantity}}{{uom}} {{productName}}
View
{{/each}}
Event sensor information
{{#each sensorElementList}}
{{sensorMetadata.device.name}}
{{#each sensorReport}}
Captured at
{{time}}
Sensor type
Reading
{{value}}{{uom}}
{{/each}}
Integrity proof
{{/each}}
{{!-- TODO: to be confirmed, since the SensorElementList.sensorIntegrityProof duplicate --}} {{!-- being assumed --}} Event location information
{{processType}}
{{bizStep}} {{eventTime}}
Association
{{parentEPC.name}}
View

Assembled

Child list
{{#each childEPCList}}
{{name}}
View
{{/each}} {{#each childQuantityList}}
{{quantity}}{{uom}} {{productName}}
View
{{/each}}
Event sensor information
{{#each sensorElementList}}
{{sensorMetadata.device.name}}
{{#each sensorReport}}
Captured at
{{time}}
Sensor type
Reading
{{value}}{{uom}}
{{/each}}
Integrity proof
{{/each}}
{{!-- TODO: to be confirmed, since the SensorElementList.sensorIntegrityProof duplicate --}} {{!-- being assumed --}} Event location information
{{/each}}
Issuing details
Issued by
Valid from
{{validFrom}}
", "@type": "WebRenderingTemplate2022" } ], - "type": ["DigitalIdentityAnchor"], - "dlrLinkTitle": "DigitalIdentityAnchor", + "type": ["DigitalTraceabilityEvent"], + "dlrLinkTitle": "Traceability Event", "dlrVerificationPage": "http://localhost:3003/verify" }, "dlr": { @@ -5752,7 +7067,8 @@ } } }, - "identifierKeyPath": "/id" + "identifierKeyPath": "/0/id", + "eventTypePath": "/0/type/0" } ] } diff --git a/e2e/cypress/support/commands/issue-commands.ts b/e2e/cypress/support/commands/issue-commands.ts index ccf7245f..aef46497 100644 --- a/e2e/cypress/support/commands/issue-commands.ts +++ b/e2e/cypress/support/commands/issue-commands.ts @@ -18,14 +18,25 @@ Cypress.Commands.add( (feature: { name: string }) => feature.name === workflowName, ); - const schemaURL = feature?.components[0].props?.schema?.url ?? ''; - const appService = feature?.services[0]?.parameters[0] ?? {}; + const components = feature?.components?.[0]?.props; + const urlWithoutStorage = components?.schema?.url || ''; + const urlWithStorage = components?.nestedComponents?.[0]?.props?.schema?.url || ''; + const schemaURL = urlWithoutStorage || urlWithStorage || ''; - cy.interceptAPI('GET', schemaURL, `get${schemaName}`); + if (schemaURL) { + cy.interceptAPI('GET', schemaURL, `get${schemaName}`); - cy.navigateTo(workflowName); + // Wait for the API response, then render the page + cy.navigateTo(workflowName); - cy.waitForAPIResponse(`get${schemaName}`, 200); + cy.waitForAPIResponse(`get${schemaName}`, 200); + } else { + cy.navigateTo(workflowName); + } + + const findProcessService = feature?.services?.find((service: any) => service.name.includes('process')) + ?.parameters?.[0]; + const appService = findProcessService ?? {}; const API_ENDPOINT = { ISSUE_BITSTRING_STATUS_LIST: '/agent/issueBitstringStatusList', diff --git a/package.json b/package.json index 12f7c9e3..bd915a0b 100644 --- a/package.json +++ b/package.json @@ -25,8 +25,8 @@ "test:vc-test-suite": "cd packages/vc-test-suite && yarn run test", "test:untp-playground": "cd packages/untp-playground && yarn run test", "test:integration:untp-test-suite": "cd packages/untp-test-suite && yarn run test:integration", - "test:run-cypress":"cd e2e && yarn cypress run", - "test:open-cypress":"cd e2e && yarn cypress open", + "test:run-cypress": "cd e2e && yarn cypress run", + "test:open-cypress": "cd e2e && yarn cypress open", "storybook:components": "cd packages/components && yarn run storybook", "storybook:mock-app": "cd packages/mock-app && yarn run storybook", "untp": "node ./packages/untp-test-suite/build/interfaces/cli/cli.js",