diff --git a/app-config.json b/app-config.json index 0a43e4e3..f476166b 100644 --- a/app-config.json +++ b/app-config.json @@ -46,7 +46,7 @@ "type": ["Product"], "id": "https://example.com/01/09359502000034", "name": "EcoCharge Lithium-Ion Battery", - "registeredId": "095201234", + "registeredId": "09359502000034", "idScheme": { "type": ["IdentifierScheme"], "id": "https://id.gs1.org/01/", @@ -651,6 +651,721 @@ "name": "CustomButton", "type": "Submit", "props": {} + }, + { + "name": "BarcodeGenerator", + "type": "Result", + "props": { + "dataPath": { + "primary": { + "ai": "01", + "path": "/decodedEnvelopedVC/credentialSubject/registeredId" + }, + "qualifiers": [ + { + "ai": "10", + "path": "/decodedEnvelopedVC/credentialSubject/batchNumber" + } + ] + } + } + } + ], + "services": [ + { + "name": "processDPP", + "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" + } + }, + "dpp": { + "context": ["https://vocabulary.uncefact.org/untp/dpp/0.5.0/"], + "renderTemplate": [ + { + "template": " Digital Product Passport

PRODUCT PASSPORT

{{credentialSubject.name}}

{{credentialSubject.description}}
{{#each credentialSubject.furtherInformation}} {{linkName}} {{/each}}
{{#if credentialSubject.characteristic}}
Characteristics
{{#each credentialSubject.characteristic}}
{{@key}}

{{this}}

{{/each}}
{{/if}}

Circularity Scorecard

The circularity Scorecard provides a simple high level summary of circularity performance of the product.

{{credentialSubject.circularityScorecard.recyclableContent}}%

Recyclable content

{{credentialSubject.circularityScorecard.recycledContent}}%

Recycled content

{{credentialSubject.circularityScorecard.utilityFactor}}

Utility factor

{{credentialSubject.circularityScorecard.materialCircularityIndicator}}

Material circularity*

*The Material Circularity Indicator provides an overall circularity score which is a function of all three of the earlier measures.

Emissions Scorecard

The Emissions Scorecard gives a clear snapshot of the product's greenhouse gas (GHG) emissions performance, providing a single indicator to assess its overall environmental impact.

{{credentialSubject.emissionsScorecard.carbonFootprint}}{{credentialSubject.emissionsScorecard.declaredUnit}}

Co2Eq

Scope includes

{{credentialSubject.emissionsScorecard.operationalScope}}

Primary sourced ratio*

{{credentialSubject.emissionsScorecard.primarySourcedRatio}}% primary sources

Issue date

{{credentialSubject.emissionsScorecard.reportingStandard.issueDate}}

*

The Primary Sourced Ratio shows the percentage of scope 3 emissions data that is directly collected from actual sources, rather than being based on estimates.

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}}
Production
Product category

{{#each credentialSubject.productCategory}}{{name}}{{#unless @last}},{{/unless}} {{/each}}

Date produced

{{credentialSubject.productionDate}}

Country

{{credentialSubject.countryOfProduction}}

Dimensions

Weight: {{credentialSubject.dimensions.weight.value}}{{credentialSubject.dimensions.weight.unit}} Length: {{credentialSubject.dimensions.length.value}}{{credentialSubject.dimensions.length.unit}} Width: {{credentialSubject.dimensions.width.value}}{{credentialSubject.dimensions.width.unit}} Height: {{credentialSubject.dimensions.height.value}}{{credentialSubject.dimensions.height.unit}} Volume: {{credentialSubject.dimensions.volume.value}}{{credentialSubject.dimensions.volume.unit}}

Product composition

A complete list of materials that make up the composition of this product.

{{#each credentialSubject.materialsProvenance}}

{{massFraction}}%

{{massAmount.value}}{{massAmount.unit}} {{name}}

Recycled {{recycledAmount}}%

Hazard {{#if hazardous}}Yes{{else}}No{{/if}}

{{materialSafetyInformation.linkName}}
{{originCountry}}
{{/each}}

History

{{!-- start: Supply chain due diligence report --}}
Supply chain due diligence report
{{!-- end: Supply chain due diligence report --}}

{{credentialSubject.traceabilityInformation.valueChainProcess}}

Verified ratio {{credentialSubject.traceabilityInformation.verifiedRatio}}

{{#each credentialSubject.traceabilityInformation.traceabilityEvent}}
{{linkName}} View
{{/each}}

Passport issued by

Organisation

{{issuer.name}}

Registered ID {{issuer.id}}
Valid from

{{validFrom}}

Valid to

{{validUntil}}

This Digital Product Passport (DPP) is a digital record of the product's sustainability and environmental performance, ensuring transparency and accountability in line with UNTP standards. The DPP can be verified at any time using the QR code or visiting www.untp-certification.org with the passport ID.

PRODUCT PASSPORT
{{credentialSubject.name}}
Batch: {{credentialSubject.batchNumber}}
Serial: {{credentialSubject.serialNumber}}

{{credentialSubject.description}}

{{#each credentialSubject.furtherInformation}}
{{linkName}}
{{/each}}
{{#if credentialSubject.characteristic}}
Characteristics
{{#each credentialSubject.characteristic}}
{{@key}}
{{this}}
{{/each}}
{{/if}}
Circularity Scorecard

The circularity Scorecard provides a simple high level summary of circularity performance of the product.

{{credentialSubject.circularityScorecard.recyclableContent}}%
Recyclable content
{{credentialSubject.circularityScorecard.recycledContent}}%
Recycled content
{{credentialSubject.circularityScorecard.utilityFactor}}
Utility factor
{{credentialSubject.circularityScorecard.materialCircularityIndicator}}
Material circularity*

*The Material Circularity Indicator provides an overall circularity score which is a function of all three of the earlier measures.

Emissions Scorecard

The Emissions Scorecard gives a clear snapshot of the product's greenhouse gas (GHG) emissions performance, providing a single indicator to assess its overall environmental impact.

{{credentialSubject.emissionsScorecard.carbonFootprint}}{{credentialSubject.emissionsScorecard.declaredUnit}}

Co2Eq

Scope includes
{{credentialSubject.emissionsScorecard.operationalScope}}
Primary sourced ratio*
{{credentialSubject.emissionsScorecard.primarySourcedRatio}}% primary sources

The Primary Sourced Ratio shows the percentage of scope 3 emissions data that is directly collected from actual sources, rather than being based on estimates.

Issue date
{{credentialSubject.emissionsScorecard.reportingStandard.issueDate}}
*
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}}
Production
Product category
{{#each credentialSubject.productCategory}}{{name}}{{#unless @last}},{{/unless}} {{/each}}
Date produced
{{credentialSubject.productionDate}}
Country
{{credentialSubject.countryOfProduction}}
Dimensions
Weight: {{credentialSubject.dimensions.weight.value}}{{credentialSubject.dimensions.weight.unit}} Length: {{credentialSubject.dimensions.length.value}}{{credentialSubject.dimensions.length.unit}} Width: {{credentialSubject.dimensions.width.value}}{{credentialSubject.dimensions.width.unit}} Height: {{credentialSubject.dimensions.height.value}}{{credentialSubject.dimensions.height.unit}} Volume: {{credentialSubject.dimensions.volume.value}}{{credentialSubject.dimensions.volume.unit}}
Composition

The Product Composition List details the materials and components used in the product, providing transparency on the origin and nature of each element.

{{#each credentialSubject.materialsProvenance}}
{{massFraction}}%
{{massAmount.value}}{{massAmount.unit}} {{name}}
Recycled {{#if recycledAmount}}{{recycledAmount}}{{else}}0{{/if}}%
Hazard {{#if hazardous}}Yes{{else}}No{{/if}}
{{originCountry}}
{{/each}}
History
{{!-- start: Supply chain due diligence report --}}
Supply chain due diligence report
{{!-- end: Supply chain due diligence report --}}

{{credentialSubject.traceabilityInformation.valueChainProcess}}

Verified ratio {{credentialSubject.traceabilityInformation.verifiedRatio}}

{{#each credentialSubject.traceabilityInformation.traceabilityEvent}}
{{linkName}} View
{{/each}}
Passport issued by
Organisation
{{issuer.name}}
Registered ID
Valid from
{{validFrom}}
Valid to
{{validUntil}}

This Digital Product Passport (DPP) is a digital record of the product’s sustainability and environmental performance, ensuring transparency and accountability in line with UNTP standards. The DPP can be verified at any time using the QR code or visiting www.untp-certification.org with the passport ID.

", + "@type": "WebRenderingTemplate2022" + } + ], + "type": ["DigitalProductPassport"], + "dlrLinkTitle": "Cherries Product Passport", + "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": { + "resultPath": "/uri", + "bucket": "verifiable-credentials" + }, + "options": { + "method": "POST", + "headers": { + "Content-Type": "application/json" + } + } + }, + "identifierKeyPath": { + "primary": { + "ai": "01", + "path": "/registeredId" + }, + "qualifiers": [ + { + "ai": "10", + "path": "/batchNumber" + } + ] + } + } + ] + } + ] + }, + { + "name": "Issue DLP", + "id": "produce_product", + "components": [ + { + "name": "JsonForm", + "type": "EntryData", + "props": { + "schema": { + "url": "https://jargon.sh/user/unece/DigitalProductPassport/v/working/artefacts/jsonSchemas/Product.json?class=Product" + }, + "data": { + "type": ["Product"], + "id": "https://example.com/01/3ABCD123XBDC0447", + "name": "EcoCharge Lithium-Ion Battery", + "registeredId": "3ABCD123XBDC0447", + "idScheme": { + "type": ["IdentifierScheme"], + "id": "https://id.gs1.org/01/", + "name": "Global Trade Identification Number (GTIN)" + }, + "serialNumber": "12345678", + "batchNumber": "6789", + "productImage": { + "type": ["Link"], + "linkURL": "https://c.animaapp.com/b3vf2M20/img/pp-header@2x.png", + "linkName": "EV Battery 300Ah Image" + }, + "description": "The EcoCharge EC-5000 Lithium-Ion Battery is a high-capacity, 5000mAh battery designed for performance and sustainability. Manufactured with responsibly sourced materials and a 95% recyclability rate, it reduces lifecycle emissions through eco-friendly production and verified recycling programs.", + "productCategory": [ + { + "type": ["Classification"], + "id": "https://unstats.un.org/unsd/classifications/Econ/cpc/46410", + "code": "46410", + "name": "Primary cells", + "schemeID": "https://unstats.un.org/unsd/classifications/Econ/cpc/", + "schemeName": "UN Central Product Classification (CPC)" + }, + { + "type": ["Classification"], + "id": "https://unstats.un.org/unsd/classifications/Econ/cpc/46410", + "code": "46410", + "name": "Primary batteries", + "schemeID": "https://unstats.un.org/unsd/classifications/Econ/cpc/", + "schemeName": "UN Central Product Classification (CPC)" + } + ], + "furtherInformation": [ + { + "type": ["Link"], + "linkURL": "https://example-company.com/product-information/1234567", + "linkName": "Name of document that is further information" + }, + { + "type": ["Link"], + "linkURL": "https://example-company.com/product-information/1234567", + "linkName": "Name of additional document that is further information" + } + ], + "producedByParty": { + "type": ["Identifier"], + "id": "https://id.example-company.com/party/6789", + "name": "Example Manufacturing Co." + }, + "producedAtFacility": { + "type": ["Identifier"], + "id": "https://id.example-company.com/facility/123", + "name": "Green Acres Battery Factory" + }, + "dimensions": { + "type": ["Dimension"], + "weight": { "value": 10, "unit": "kg" }, + "length": { "value": 90, "unit": "mm" }, + "width": { "value": 60, "unit": "mm" }, + "height": { "value": 10, "unit": "mm" }, + "volume": { "value": 7.5, "unit": "L" } + }, + "characteristic": { + "Battery status": "Recycled", + "Battery cell type": "Prismatic", + "Number of cells per battery": "180", + "Total energy": "100kwh" + }, + "productionDate": "2024-04-24", + "countryOfProduction": "Australia", + "granularityLevel": "item", + "dueDiligenceDeclaration": { + "type": ["Link"], + "linkURL": "https://example-company.com/due-diligence/1234567", + "linkName": "Due Diligence Declaration" + }, + "materialsProvenance": [ + { + "type": ["Material"], + "name": "Material", + "originCountry": "AU", + "materialType": { + "type": ["Classification"], + "id": "https://unfc.org/material-type/Lithium", + "name": "Lithium" + }, + "massFraction": 20, + "massAmount": { "value": 1.0, "unit": "kg" }, + "recycledAmount": 0, + "hazardous": false + }, + { + "type": ["Material"], + "name": "Material", + "originCountry": "AU", + "materialType": { + "type": ["Classification"], + "id": "https://unfc.org/material-type/Lithium", + "name": "Lithium" + }, + "massFraction": 20, + "massAmount": { "value": 1.0, "unit": "kg" }, + "recycledAmount": 10, + "hazardous": true, + "materialSafetyInformation": { + "type": ["Link"], + "linkURL": "https://example.com/safety-info/lithium-spodumene.pdf", + "linkName": "Material Safety Data Sheet", + "linkType": "https://test.uncefact.org/vocabulary/linkTypes/safetyData" + } + }, + { + "type": ["Material"], + "name": "Material", + "originCountry": "AU", + "materialType": { + "type": ["Classification"], + "id": "https://unfc.org/material-type/Lithium", + "name": "Lithium" + }, + "massFraction": 20, + "massAmount": { "value": 1.0, "unit": "kg" }, + "recycledAmount": 0, + "hazardous": false + }, + { + "type": ["Material"], + "name": "Material", + "originCountry": "AU", + "materialType": { + "type": ["Classification"], + "id": "https://unfc.org/material-type/Lithium", + "name": "Lithium" + }, + "massFraction": 20, + "massAmount": { "value": 1.0, "unit": "kg" }, + "recycledAmount": 0, + "hazardous": false + } + ], + "conformityClaim": [ + { + "type": ["Claim", "Declaration"], + "assessmentDate": "2024-04-25", + "declaredValue": [ + { + "type": ["Metric"], + "metricName": "GHG emissions intensity", + "metricValue": { "value": 1.5, "unit": "kg" }, + "score": "1.2", + "accuracy": 0.8 + }, + { + "type": ["Metric"], + "metricName": "GHG emissions intensity", + "metricValue": { "value": 1.5, "unit": "kg" }, + "score": "1.2", + "accuracy": 0.8 + } + ], + "id": "https://products.example-company.com/09520123456788/declarations/12345", + "referenceStandard": { + "type": ["Standard"], + "id": "https://www.iso.org/standard/60857.html", + "name": "Standard", + "issuingParty": { + "type": ["Identifier"], + "id": "https://iso.org/issuing-party/123", + "name": "International Organization" + }, + "issueDate": "2024-04-25" + }, + "referenceRegulation": { + "type": ["Regulation"], + "id": "https://www.legislation.gov.au/F2008L02309/latest/versions", + "name": "National Greenhouse", + "jurisdictionCountry": "Australia", + "administeredBy": { + "type": ["Identifier"], + "id": "https://gov.au/admin-body/12345", + "name": "Australian Government" + }, + "effectiveDate": "2024-03-20" + }, + "assessmentCriteria": [ + { + "type": ["Criterion"], + "id": "https://www.globalbattery.org/media/publications/gba-rulebook-v2.0-master.pdf#BatteryAssembly", + "name": "Battery Assembly Guidelines", + "thresholdValues": [ + { + "type": ["Metric"], + "metricName": "Minimum compressive strength", + "metricValue": { "value": 500, "unit": "MPA" } + } + ] + } + ], + "conformance": true, + "conformityTopic": "environment.energy", + "conformityEvidence": { + "type": ["SecureLink", "Link"], + "linkURL": "https://example-certifier.com/evidence/1234567.json", + "hashDigest": "6239119dda5bd4c8a6ffb832fe16feaa5c27b7dba154d24c53d4470a2c69adc2", + "hashMethod": "SHA-256", + "linkName": "Declaration link name", + "linkType": "https://test.uncefact.org/vocabulary/linkTypes/dcc", + "encryptionMethod": "AES" + } + }, + { + "type": ["Claim", "Declaration"], + "assessmentDate": "2024-04-25", + "declaredValue": [ + { + "type": ["Metric"], + "metricName": "GHG emissions intensity", + "metricValue": { "value": 1.5, "unit": "kg" }, + "score": "1.2", + "accuracy": 0.8 + }, + { + "type": ["Metric"], + "metricName": "GHG emissions intensity", + "metricValue": { "value": 1.5, "unit": "kg" }, + "score": "1.2", + "accuracy": 0.8 + } + ], + "id": "https://products.example-company.com/09520123456788/declarations/12345", + "referenceStandard": { + "type": ["Standard"], + "id": "https://www.iso.org/standard/60857.html", + "name": "Standard", + "issuingParty": { + "type": ["Identifier"], + "id": "https://iso.org/issuing-party/123", + "name": "International Organization" + }, + "issueDate": "2023-12-05" + }, + "referenceRegulation": { + "type": ["Regulation"], + "id": "https://www.legislation.gov.au/F2008L02309/latest/versions", + "name": "National Greenhouse", + "jurisdictionCountry": "Australia", + "administeredBy": { + "type": ["Identifier"], + "id": "https://gov.au/admin-body/12345", + "name": "Australian Government" + }, + "effectiveDate": "2024-03-20" + }, + "assessmentCriteria": [ + { + "type": ["Criterion"], + "id": "https://www.globalbattery.org/media/publications/gba-rulebook-v2.0-master.pdf#BatteryAssembly", + "name": "Battery Assembly Guidelines", + "thresholdValues": [ + { + "type": ["Metric"], + "metricName": "Minimum compressive strength", + "metricValue": { "value": 500, "unit": "MPA" } + } + ] + } + ], + "conformance": false, + "conformityTopic": "environment.energy", + "conformityEvidence": { + "type": ["SecureLink", "Link"], + "linkURL": "https://example-certifier.com/evidence/1234567.json", + "hashDigest": "6239119dda5bd4c8a6ffb832fe16feaa5c27b7dba154d24c53d4470a2c69adc2", + "hashMethod": "SHA-256", + "linkName": "Declaration link name", + "linkType": "https://test.uncefact.org/vocabulary/linkTypes/dcc", + "encryptionMethod": "AES" + } + }, + { + "type": ["Claim", "Declaration"], + "assessmentDate": "2024-04-25", + "declaredValue": [ + { + "type": ["Metric"], + "metricName": "GHG emissions intensity", + "metricValue": { "value": 1.5, "unit": "kg" }, + "score": "1.2", + "accuracy": 0.8 + }, + { + "type": ["Metric"], + "metricName": "GHG emissions intensity", + "metricValue": { "value": 1.5, "unit": "kg" }, + "score": "1.2", + "accuracy": 0.8 + } + ], + "id": "https://products.example-company.com/09520123456788/declarations/12345", + "referenceStandard": { + "type": ["Standard"], + "id": "https://www.iso.org/standard/60857.html", + "name": "Standard", + "issuingParty": { + "type": ["Identifier"], + "id": "https://iso.org/issuing-party/123", + "name": "International Organization" + }, + "issueDate": "2023-12-05" + }, + "referenceRegulation": { + "type": ["Regulation"], + "id": "https://www.legislation.gov.au/F2008L02309/latest/versions", + "name": "National Greenhouse", + "jurisdictionCountry": "Australia", + "administeredBy": { + "type": ["Identifier"], + "id": "https://gov.au/admin-body/12345", + "name": "Australian Government" + }, + "effectiveDate": "2024-03-20" + }, + "assessmentCriteria": [ + { + "type": ["Criterion"], + "id": "https://www.globalbattery.org/media/publications/gba-rulebook-v2.0-master.pdf#BatteryAssembly", + "name": "Battery Assembly Guidelines", + "thresholdValues": [ + { + "type": ["Metric"], + "metricName": "Minimum compressive strength", + "metricValue": { "value": 500, "unit": "MPA" } + } + ] + } + ], + "conformance": false, + "conformityTopic": "environment.energy", + "conformityEvidence": { + "type": ["SecureLink", "Link"], + "linkURL": "https://example-certifier.com/evidence/1234567.json", + "hashDigest": "6239119dda5bd4c8a6ffb832fe16feaa5c27b7dba154d24c53d4470a2c69adc2", + "hashMethod": "SHA-256", + "linkName": "Declaration link name", + "linkType": "https://test.uncefact.org/vocabulary/linkTypes/dcc", + "encryptionMethod": "AES" + } + }, + { + "type": ["Claim", "Declaration"], + "assessmentDate": "2024-04-25", + "declaredValue": [ + { + "type": ["Metric"], + "metricName": "GHG emissions intensity", + "metricValue": { "value": 1.5, "unit": "kg" }, + "score": "1.2", + "accuracy": 0.8 + }, + { + "type": ["Metric"], + "metricName": "GHG emissions intensity", + "metricValue": { "value": 1.5, "unit": "kg" }, + "score": "1.2", + "accuracy": 0.8 + } + ], + "id": "https://products.example-company.com/09520123456788/declarations/12345", + "referenceStandard": { + "type": ["Standard"], + "id": "https://www.iso.org/standard/60857.html", + "name": "Standard", + "issuingParty": { + "type": ["Identifier"], + "id": "https://iso.org/issuing-party/123", + "name": "International Organization" + }, + "issueDate": "2023-12-05" + }, + "referenceRegulation": { + "type": ["Regulation"], + "id": "https://www.legislation.gov.au/F2008L02309/latest/versions", + "name": "National Greenhouse", + "jurisdictionCountry": "Australia", + "administeredBy": { + "type": ["Identifier"], + "id": "https://gov.au/admin-body/12345", + "name": "Australian Government" + }, + "effectiveDate": "2024-03-20" + }, + "assessmentCriteria": [ + { + "type": ["Criterion"], + "id": "https://www.globalbattery.org/media/publications/gba-rulebook-v2.0-master.pdf#BatteryAssembly", + "name": "Battery Assembly Guidelines", + "thresholdValues": [ + { + "type": ["Metric"], + "metricName": "Minimum compressive strength", + "metricValue": { "value": 500, "unit": "MPA" } + } + ] + } + ], + "conformance": false, + "conformityTopic": "environment.energy", + "conformityEvidence": { + "type": ["SecureLink", "Link"], + "linkURL": "https://example-certifier.com/evidence/1234567.json", + "hashDigest": "6239119dda5bd4c8a6ffb832fe16feaa5c27b7dba154d24c53d4470a2c69adc2", + "hashMethod": "SHA-256", + "linkName": "Declaration link name", + "linkType": "https://test.uncefact.org/vocabulary/linkTypes/dcc", + "encryptionMethod": "AES" + } + }, + { + "type": ["Claim", "Declaration"], + "assessmentDate": "2024-04-25", + "declaredValue": [ + { + "type": ["Metric"], + "metricName": "GHG emissions intensity", + "metricValue": { "value": 1.5, "unit": "kg" }, + "score": "1.2", + "accuracy": 0.8 + }, + { + "type": ["Metric"], + "metricName": "GHG emissions intensity", + "metricValue": { "value": 1.5, "unit": "kg" }, + "score": "1.2", + "accuracy": 0.8 + } + ], + "id": "https://products.example-company.com/09520123456788/declarations/12345", + "referenceStandard": { + "type": ["Standard"], + "id": "https://www.iso.org/standard/60857.html", + "name": "Standard", + "issuingParty": { + "type": ["Identifier"], + "id": "https://iso.org/issuing-party/123", + "name": "International Organization" + }, + "issueDate": "2023-12-05" + }, + "referenceRegulation": { + "type": ["Regulation"], + "id": "https://www.legislation.gov.au/F2008L02309/latest/versions", + "name": "National Greenhouse", + "jurisdictionCountry": "Australia", + "administeredBy": { + "type": ["Identifier"], + "id": "https://gov.au/admin-body/12345", + "name": "Australian Government" + }, + "effectiveDate": "2024-03-20" + }, + "assessmentCriteria": [ + { + "type": ["Criterion"], + "id": "https://www.globalbattery.org/media/publications/gba-rulebook-v2.0-master.pdf#BatteryAssembly", + "name": "Battery Assembly Guidelines", + "thresholdValues": [ + { + "type": ["Metric"], + "metricName": "Minimum compressive strength", + "metricValue": { "value": 500, "unit": "MPA" } + } + ] + } + ], + "conformance": false, + "conformityTopic": "environment.energy", + "conformityEvidence": { + "type": ["SecureLink", "Link"], + "linkURL": "https://example-certifier.com/evidence/1234567.json", + "hashDigest": "6239119dda5bd4c8a6ffb832fe16feaa5c27b7dba154d24c53d4470a2c69adc2", + "hashMethod": "SHA-256", + "linkName": "Declaration link name", + "linkType": "https://test.uncefact.org/vocabulary/linkTypes/dcc", + "encryptionMethod": "AES" + } + } + ], + "circularityScorecard": { + "type": ["CircularityPerformance"], + "recyclingInformation": { + "type": ["Link"], + "linkURL": "https://example-company.com/recycling/1234567", + "linkName": "Recycling Information" + }, + "repairInformation": { + "type": ["Link"], + "linkURL": "https://example-company.com/repair/1234567", + "linkName": "Repair Instructions" + }, + "recyclableContent": 67, + "recycledContent": 86, + "utilityFactor": 1.2, + "materialCircularityIndicator": 0.67 + }, + "emissionsScorecard": { + "type": ["EmissionsPerformance"], + "carbonFootprint": 12.5, + "declaredUnit": "kg", + "operationalScope": "CradleToGate", + "primarySourcedRatio": 75, + "reportingStandard": { + "type": ["Standard"], + "id": "https://www.ifrs.org/standards/issb/s2", + "name": "WBSCD Pathfinder framework - V.2.0", + "issuingParty": { + "type": ["Identifier"], + "id": "https://id.ifrs.org/issuing-party/123", + "name": "International Financial Reporting Standards Foundation", + "registeredId": "90664869327", + "idScheme": { + "type": ["IdentifierScheme"], + "id": "https://id.ifrs.org/issuing-party/", + "name": "IFRS Issuing Party" + } + }, + "issueDate": "2024-04-25" + } + }, + "traceabilityInformation": { + "valueChainProcess": "Spinning", + "verifiedRatio": 0.5, + "traceabilityEvent": [ + { + "linkURL": "https://files.example-certifier.com/1234567.json", + "linkName": "Object Event", + "linkType": "https://test.uncefact.org/vocabulary/linkTypes/dcc", + "hashDigest": "6239119", + "hashMethod": "SHA-256", + "encryptionMethod": "AES" + }, + { + "linkURL": "https://files.example-certifier.com/1234567.json", + "linkName": "Transformation Event", + "linkType": "https://test.uncefact.org/vocabulary/linkTypes/dcc", + "hashDigest": "6239119", + "hashMethod": "SHA-256", + "encryptionMethod": "AES" + }, + { + "linkURL": "https://files.example-certifier.com/1234567.json", + "linkName": "Transaction Event", + "linkType": "https://test.uncefact.org/vocabulary/linkTypes/dcc", + "hashDigest": "6239119", + "hashMethod": "SHA-256", + "encryptionMethod": "AES" + }, + { + "linkURL": "https://files.example-certifier.com/1234567.json", + "linkName": "Aggregation Event", + "linkType": "https://test.uncefact.org/vocabulary/linkTypes/dcc", + "hashDigest": "6239119", + "hashMethod": "SHA-256", + "encryptionMethod": "AES" + }, + { + "linkURL": "https://files.example-certifier.com/1234567.json", + "linkName": "Association Event", + "linkType": "https://test.uncefact.org/vocabulary/linkTypes/dcc", + "hashDigest": "6239119", + "hashMethod": "SHA-256", + "encryptionMethod": "AES" + }, + { + "linkURL": "https://files.example-certifier.com/1234567.json", + "linkName": "Object Event", + "linkType": "https://test.uncefact.org/vocabulary/linkTypes/dcc", + "hashDigest": "6239119", + "hashMethod": "SHA-256", + "encryptionMethod": "AES" + } + ] + } + }, + "constructData": { + "mappingFields": [], + "dummyFields": [], + "generationFields": [ + { + "path": "/eventID", + "handler": "generateIdWithSerialNumber" + } + ] + }, + "className": "json-form", + "style": { + "margin": "40px auto", + "paddingTop": "40px", + "width": "80%" + } + } + }, + { + "name": "CustomButton", + "type": "Submit", + "props": {} + }, + { + "name": "BarcodeGenerator", + "type": "Result", + "props": { + "dataPath": { + "primary": { + "ai": "01", + "path": "/decodedEnvelopedVC/credentialSubject/registeredId" + } + } + } } ], "services": [ @@ -678,13 +1393,12 @@ ], "type": ["DigitalProductPassport"], "dlrLinkTitle": "Cherries Product Passport", - "dlrIdentificationKeyType": "gtin", "dlrVerificationPage": "http://localhost:3003/verify" }, "dlr": { "dlrAPIUrl": "http://localhost:3000", "dlrAPIKey": "test123", - "namespace": "gs1", + "namespace": "nlis", "linkRegisterPath": "/api/resolver" }, "storage": { @@ -700,16 +1414,12 @@ } } }, - "identifierKeyPath": "/id" - } - ] - }, - { - "name": "mergeToLocalStorage", - "parameters": [ - { - "storageKey": "CherriesFarm_dpps", - "objectKeyPath": "/decodedEnvelopedVC/credentialSubject/id" + "identifierKeyPath": { + "primary": { + "ai": "01", + "path": "/registeredId" + } + } } ] } @@ -892,7 +1602,6 @@ ], "type": ["DigitalTraceabilityEvent"], "dlrLinkTitle": "Transaction Event", - "dlrIdentificationKeyType": "gtin", "dlrVerificationPage": "http://localhost:3003/verify" }, "dlr": { @@ -1832,7 +2541,6 @@ ], "type": ["DigitalTraceabilityEvent"], "dlrLinkTitle": "Traceability Event", - "dlrIdentificationKeyType": "gtin", "dlrVerificationPage": "http://localhost:3003/verify" }, "dlr": { @@ -2010,7 +2718,6 @@ ], "type": ["DigitalTraceabilityEvent"], "dlrLinkTitle": "Object Event", - "dlrIdentificationKeyType": "gtin", "dlrVerificationPage": "http://localhost:3003/verify" }, "dlr": { @@ -2192,7 +2899,6 @@ ], "type": ["DigitalTraceabilityEvent"], "dlrLinkTitle": "Association Event", - "dlrIdentificationKeyType": "gtin", "dlrVerificationPage": "http://localhost:3003/verify" }, "dlr": { @@ -2374,7 +3080,6 @@ ], "type": ["DigitalTraceabilityEvent"], "dlrLinkTitle": "Aggregation Event", - "dlrIdentificationKeyType": "gtin", "dlrVerificationPage": "http://localhost:3003/verify" }, "dlr": { @@ -2577,7 +3282,6 @@ ], "type": ["DigitalTraceabilityEvent"], "dlrLinkTitle": "Transformation Event", - "dlrIdentificationKeyType": "gtin", "dlrVerificationPage": "http://localhost:3003/verify" }, "dlr": { @@ -3079,7 +3783,6 @@ ], "type": ["DigitalConformityCredential"], "dlrLinkTitle": "DigitalConformityCredential", - "dlrIdentificationKeyType": "gtin", "dlrVerificationPage": "http://localhost:3003/verify" }, "dlr": { @@ -3497,7 +4200,6 @@ ], "type": ["DigitalFacilityRecord"], "dlrLinkTitle": "DigitalFacilityRecord", - "dlrIdentificationKeyType": "gln", "dlrVerificationPage": "http://localhost:3003/verify" }, "dlr": { @@ -4161,7 +4863,6 @@ ], "type": ["DigitalProductPassport"], "dlrLinkTitle": "Cherries Product Passport", - "dlrIdentificationKeyType": "gtin", "dlrVerificationPage": "http://localhost:3003/verify" }, "dlr": { @@ -4375,7 +5076,6 @@ ], "type": ["DigitalTraceabilityEvent"], "dlrLinkTitle": "Transaction Event", - "dlrIdentificationKeyType": "gtin", "dlrVerificationPage": "http://localhost:3003/verify" }, "dlr": { @@ -5049,7 +5749,6 @@ ], "type": ["DigitalProductPassport"], "dlrLinkTitle": "Cherries Product Passport", - "dlrIdentificationKeyType": "gtin", "dlrVerificationPage": "http://localhost:3003/verify" }, "dlr": { @@ -5263,7 +5962,6 @@ ], "type": ["DigitalTraceabilityEvent"], "dlrLinkTitle": "Transaction Event", - "dlrIdentificationKeyType": "gtin", "dlrVerificationPage": "http://localhost:3003/verify" }, "dlr": { @@ -5937,7 +6635,6 @@ ], "type": ["DigitalProductPassport"], "dlrLinkTitle": "Cherries Product Passport", - "dlrIdentificationKeyType": "gtin", "dlrVerificationPage": "http://localhost:3003/verify" }, "dlr": { @@ -6151,7 +6848,6 @@ ], "type": ["DigitalTraceabilityEvent"], "dlrLinkTitle": "Transaction Event", - "dlrIdentificationKeyType": "gtin", "dlrVerificationPage": "http://localhost:3003/verify" }, "dlr": { @@ -6197,6 +6893,18 @@ "url": "http://localhost:3001", "namespace": "gs1" }, + "identifierSchemes": [ + { + "type": "gtin", + "format": "(\\d{12,14}|\\d{8})", + "carriers": ["barcode"] + }, + { + "type": "nlis", + "format": "^3ABCD123[a-zA-Z0-9]{8}$", + "carriers": ["manual_entry"] + } + ], "defaultVerificationServiceLink": { "title": "Default Verification Service", "context": "Default Verification Service", diff --git a/documentation/docs/mock-apps/common/construct-ai-data.md b/documentation/docs/mock-apps/common/construct-ai-data.md new file mode 100644 index 00000000..fb37afc9 --- /dev/null +++ b/documentation/docs/mock-apps/common/construct-ai-data.md @@ -0,0 +1,47 @@ +--- +sidebar_position: 57 +title: Construct Application Identifier Data +--- + +import Disclaimer from '../.././\_disclaimer.mdx'; + + + +## Description + +The `constructAiData` object defines the schema for constructing event data for getting Application Identifier (AI) data. It will be used to fetch the AI data from the JSON form or the credential object which are not explicitly defined the data model. + +### Example + +```json +{ + "primary": { + "ai": "01", + "path": "/registeredId" + }, + "qualifiers": [ + { + "ai": "21", + "path": "/serialNumber" + }, + { + "ai": "10", + "path": "/batchNumber" + } + ] +} +``` + +### Definitions + +| Property | Required | Description | Type | +| ---------- | :------: | ---------------------------------------------------------------------------------- | ----------------------------------------------------------------- | +| primary | Yes | The primary AI that defines the AI code and the path for primary AI value | [AI config](/docs/mock-apps/common/construct-ai-data#ai-config) | +| qualifiers | No | The list of qualifiers that define the AI code and the path for qualifier AI value | [AI config](/docs/mock-apps/common/construct-ai-data#ai-config)[] | + +#### AI config + +| Property | Required | Description | Type | +| -------- | :------: | ----------------------------------------------------------------------- | ------ | +| ai | Yes | The AI code that defines the AI data | String | +| path | Yes | The JSON pointer path to extract the AI data from the credential object | String | diff --git a/documentation/docs/mock-apps/common/credential.md b/documentation/docs/mock-apps/common/credential.md index d9f20fda..977c6725 100644 --- a/documentation/docs/mock-apps/common/credential.md +++ b/documentation/docs/mock-apps/common/credential.md @@ -12,12 +12,13 @@ import Disclaimer from '../.././\_disclaimer.mdx'; The `Credential` object defines the structure and properties of the compliant [Verifiable Credential](https://uncefact.github.io/spec-untp/docs/specification/VerifiableCredentials), including its context, rendering template, and associated metadata. ## Definition + -| Property | Required | Description | Type | -|----------|----------|-------------|------| -| context | Yes | JSON-LD context for the Verifiable Credential | String[] | -| renderTemplate | No | Templates for rendering the Verifiable Credential | [RenderTemplate](/docs/mock-apps/common/render-template)[] | -| type | Yes | Types of the Verifiable Credential | String[] | -| dlrLinkTitle | Yes | Title for the Identity Register link | String | -| dlrIdentificationKeyType | Yes | Type of identification key for IDR. E.g. gtin | [IdentificationKeyType](#) | -| dlrVerificationPage | Yes | URL of the verification page used to verify and render the credential | String | \ No newline at end of file + +| Property | Required | Description | Type | +| ------------------- | -------- | --------------------------------------------------------------------- | ---------------------------------------------------------- | +| context | Yes | JSON-LD context for the Verifiable Credential | String[] | +| renderTemplate | No | Templates for rendering the Verifiable Credential | [RenderTemplate](/docs/mock-apps/common/render-template)[] | +| type | Yes | Types of the Verifiable Credential | String[] | +| dlrLinkTitle | Yes | Title for the Identity Register link | String | +| dlrVerificationPage | Yes | URL of the verification page used to verify and render the credential | String | diff --git a/documentation/docs/mock-apps/common/identifier-key-path.md b/documentation/docs/mock-apps/common/identifier-key-path.md index 6af75910..2c9814e5 100644 --- a/documentation/docs/mock-apps/common/identifier-key-path.md +++ b/documentation/docs/mock-apps/common/identifier-key-path.md @@ -9,13 +9,13 @@ import Disclaimer from '../.././\_disclaimer.mdx'; ## Description -The `IdentifierKeyPath` is a property of services that interact with the data issued to get the identifier to be used for the [IDR](/docs/mock-apps/common/idr) registration. It can be a JSON path of the identifier of the data issued or an object that contains the function `concatService` and the `args` to be used to get the identifier. +The `IdentifierKeyPath` can be an object or a string that defines the path to extract the identifier data from the [Json Form component](/docs/mock-apps/components/json-form). When the `identifierKeyPath` is a string, it should be a link resolver URL. When the `identifierKeyPath` is an object, it should contain AI codes and JSON pointer paths to extract the appropriate data for identifier generation. ## Example ```json { - "identifierKeyPath": "/eventID" + "identifierKeyPath": "/id" // Example of a link resolver URL: https://example.com/gs1/01/0123456789123/21/123456/10/123456 } ``` @@ -24,22 +24,26 @@ or ```json { "identifierKeyPath": { - "function": "concatService", - "args": [ - { "type": "text", "value": "(01)" }, - { "type": "path", "value": "/productIdentifier/0/identifierValue" }, - { "type": "text", "value": "(10)" }, - { "type": "path", "value": "/batchIdentifier/0/identifierValue" }, - { "type": "text", "value": "(21)" }, - { "type": "path", "value": "/itemIdentifier/0/identifierValue" } + "primary": { + "ai": "01", + "path": "/registeredId" + }, + "qualifiers": [ + { + "ai": "21", + "path": "/serialNumber" + }, + { + "ai": "10", + "path": "/batchNumber" + } ] } } ``` -## Definition for object +## Definition -| Property | Required | Description | Type | -| -------- | :------: | ------------------------------------------------ | ------ | -| function | Yes | The concat function supported | String | -| args | Yes | The array of object that can be `text` or `path` | Array | +| Property | Required | Description | Type | +| ----------------- | :------: | --------------------------------------- | ------------------------------------------------------------ | +| identifierKeyPath | Yes | The path to extract the identifier data | String or [AIData](/docs/mock-apps/common/construct-ai-data) | diff --git a/documentation/docs/mock-apps/components/barcode-generator.md b/documentation/docs/mock-apps/components/barcode-generator.md index 64280f81..41c6167c 100644 --- a/documentation/docs/mock-apps/components/barcode-generator.md +++ b/documentation/docs/mock-apps/components/barcode-generator.md @@ -3,7 +3,7 @@ sidebar_position: 18 title: Barcode Generator --- -import Disclaimer from '../../_disclaimer.mdx'; +import Disclaimer from '../../\_disclaimer.mdx'; @@ -16,11 +16,12 @@ The component uses its `data` and `dataPath` props to extract the necessary info The BarcodeGenerator is typically used as follows: 1. Passing the credential object: + - The `data` prop receives the entire credential object generated by the previous step in the process. - This prop is usually not specified directly in the component configuration, as it's automatically populated with the credential generate in the previous step. 2. Specifying the data path: - - Use the `dataPath` prop to specify a JSON pointer path to extract barcode data from the credential object. + - Use the `dataPath` prop to specify the AI codes and JSON pointer paths to extract the appropriate data for barcode generation. ## Example @@ -29,7 +30,22 @@ The BarcodeGenerator is typically used as follows: "name": "BarcodeGenerator", "type": "Result", "props": { - "dataPath": "/credentialSubject/outputEPCList/index/name" + "dataPath": { + "primary": { + "ai": "01", + "path": "/registeredId" + }, + "qualifiers": [ + { + "ai": "21", + "path": "/serialNumber" + }, + { + "ai": "10", + "path": "/batchNumber" + } + ] + } } } ``` @@ -38,15 +54,15 @@ This example specifies that for each item in the `outputEPCList`, the `name` fie ## Definitions -| Property | Required | Description | Type | -|----------|----------|-------------|------| -| name | Yes | The name of the component (should be "BarcodeGenerator")| String | -| type | Yes | The type of the component (should be "Result") | [ComponentType](/docs/mock-apps/common/component-type) | -| props | Yes | The properties for the BarcodeGenerator | [Props](/docs/mock-apps/components/barcode-generator#props) | +| Property | Required | Description | Type | +| -------- | -------- | -------------------------------------------------------- | ----------------------------------------------------------- | +| name | Yes | The name of the component (should be "BarcodeGenerator") | String | +| type | Yes | The type of the component (should be "Result") | [ComponentType](/docs/mock-apps/common/component-type) | +| props | Yes | The properties for the BarcodeGenerator | [Props](/docs/mock-apps/components/barcode-generator#props) | ### Props -| Property | Required | Description | Type | -|----------|----------|-------------|------| -| data | No | The credential object containing the data for barcode generation (usually automatically provided) | Object | -| dataPath | Yes | A JSON pointer path to extract barcode data from the credential object | String | +| Property | Required | Description | Type | +| -------- | -------- | ------------------------------------------------------------------------------------------------- | -------------------------------------------------- | +| data | No | The credential object containing the data for barcode generation (usually automatically provided) | Object | +| dataPath | Yes | A JSON pointer path to extract barcode data from the credential object | [AIData](/docs/mock-apps/common/construct-ai-data) | diff --git a/documentation/docs/mock-apps/services/index.md b/documentation/docs/mock-apps/services/index.md index 390788c3..b75bb1e8 100644 --- a/documentation/docs/mock-apps/services/index.md +++ b/documentation/docs/mock-apps/services/index.md @@ -66,7 +66,6 @@ graph TD "renderTemplate": [], "type": ["VerifiableCredential", " DigitalProductPassport"], "dlrLinkTitle": "Steel Passport", - "dlrIdentificationKeyType": "gtin", "dlrVerificationPage": "http://localhost:3000/verify" }, "dlr": { diff --git a/documentation/docs/mock-apps/services/process-aggregation-event.md b/documentation/docs/mock-apps/services/process-aggregation-event.md index b744a765..8a11b5b6 100644 --- a/documentation/docs/mock-apps/services/process-aggregation-event.md +++ b/documentation/docs/mock-apps/services/process-aggregation-event.md @@ -55,7 +55,6 @@ P-->>C: Return VC and resolver URL "template": "

Aggregation Event

Parent: {{parentItem.epc}}

" } ], - "dlrIdentificationKeyType": "sscc", "dlrLinkTitle": "Aggregation Event", "dlrVerificationPage": "https://verify.example.com" }, diff --git a/documentation/docs/mock-apps/services/process-association-event.md b/documentation/docs/mock-apps/services/process-association-event.md index 356da11a..64b81438 100644 --- a/documentation/docs/mock-apps/services/process-association-event.md +++ b/documentation/docs/mock-apps/services/process-association-event.md @@ -57,7 +57,6 @@ P-->>C: Return association event VC and resolver URL "@type": "WebRenderingTemplate2022" } ], - "dlrIdentificationKeyType": "gtin", "dlrLinkTitle": "Association Event", "dlrVerificationPage": "https://verify.example.com" }, diff --git a/documentation/docs/mock-apps/services/process-digital-conformity-credential.md b/documentation/docs/mock-apps/services/process-digital-conformity-credential.md index bdda50d9..2918db16 100644 --- a/documentation/docs/mock-apps/services/process-digital-conformity-credential.md +++ b/documentation/docs/mock-apps/services/process-digital-conformity-credential.md @@ -57,7 +57,6 @@ P-->>C: Return digital conformity credential VC and resolver URL "@type": "WebRenderingTemplate2022" } ], - "dlrIdentificationKeyType": "gtin", "dlrLinkTitle": "DigitalConformityCredential", "dlrVerificationPage": "https://verify.example.com" }, diff --git a/documentation/docs/mock-apps/services/process-digital-facility-record.md b/documentation/docs/mock-apps/services/process-digital-facility-record.md index ab47d54c..00bda504 100644 --- a/documentation/docs/mock-apps/services/process-digital-facility-record.md +++ b/documentation/docs/mock-apps/services/process-digital-facility-record.md @@ -55,7 +55,6 @@ P-->>C: Return digital facility record VC and resolver URL "@type": "WebRenderingTemplate2022" } ], - "dlrIdentificationKeyType": "gln", "dlrLinkTitle": "DigitalFacilityRecord", "dlrVerificationPage": "https://verify.example.com" }, diff --git a/documentation/docs/mock-apps/services/process-digital-identity-anchor.md b/documentation/docs/mock-apps/services/process-digital-identity-anchor.md index 1cb0d1de..dc2c5e49 100644 --- a/documentation/docs/mock-apps/services/process-digital-identity-anchor.md +++ b/documentation/docs/mock-apps/services/process-digital-identity-anchor.md @@ -55,7 +55,6 @@ P-->>C: Return digital identity anchor VC and resolver URL "@type": "WebRenderingTemplate2022" } ], - "dlrIdentificationKeyType": "gtin", "dlrLinkTitle": "DigitalIdentityAnchor", "dlrVerificationPage": "https://verify.example.com" }, diff --git a/documentation/docs/mock-apps/services/process-dpp.md b/documentation/docs/mock-apps/services/process-dpp.md index 46e3733c..3d4a2d3e 100644 --- a/documentation/docs/mock-apps/services/process-dpp.md +++ b/documentation/docs/mock-apps/services/process-dpp.md @@ -73,7 +73,6 @@ P-->>C: Return VC and resolver URL ], "type": ["DigitalProductPassport"], "dlrLinkTitle": "Steel Passport", - "dlrIdentificationKeyType": "gtin", "dlrVerificationPage": "http://localhost:3332/verify" }, "dlr": { diff --git a/documentation/docs/mock-apps/services/process-object-event.md b/documentation/docs/mock-apps/services/process-object-event.md index 56ed55c9..daacdffb 100644 --- a/documentation/docs/mock-apps/services/process-object-event.md +++ b/documentation/docs/mock-apps/services/process-object-event.md @@ -55,7 +55,6 @@ P-->>C: Return object event VC and resolver URL "@type": "WebRenderingTemplate2022" } ], - "dlrIdentificationKeyType": "gtin", "dlrLinkTitle": "Object Event", "dlrVerificationPage": "https://verify.example.com" }, diff --git a/documentation/docs/mock-apps/services/process-traceability-event.md b/documentation/docs/mock-apps/services/process-traceability-event.md index 63a7759d..f19155ee 100644 --- a/documentation/docs/mock-apps/services/process-traceability-event.md +++ b/documentation/docs/mock-apps/services/process-traceability-event.md @@ -49,7 +49,6 @@ P-->>C: Return event VC and resolver URL "@type": "WebRenderingTemplate2022" } ], - "dlrIdentificationKeyType": "gtin", "dlrLinkTitle": "Traceability Event", "dlrVerificationPage": "https://verify.example.com" }, diff --git a/documentation/docs/mock-apps/services/process-transaction-event.md b/documentation/docs/mock-apps/services/process-transaction-event.md index 27c7bdeb..f80047c6 100644 --- a/documentation/docs/mock-apps/services/process-transaction-event.md +++ b/documentation/docs/mock-apps/services/process-transaction-event.md @@ -57,7 +57,6 @@ P-->>C: Return VC and resolver URL "template": "

Transaction Event

ID: {{transactionId}}

" } ], - "dlrIdentificationKeyType": "gtin", "dlrLinkTitle": "Transaction Event", "dlrVerificationPage": "https://verify.example.com" }, diff --git a/documentation/docs/mock-apps/services/process-transformation-event-only.md b/documentation/docs/mock-apps/services/process-transformation-event-only.md index 840e0981..86d9c9cd 100644 --- a/documentation/docs/mock-apps/services/process-transformation-event-only.md +++ b/documentation/docs/mock-apps/services/process-transformation-event-only.md @@ -57,7 +57,6 @@ P-->>C: Return transformation event VC and resolver URL "@type": "WebRenderingTemplate2022" } ], - "dlrIdentificationKeyType": "gtin", "dlrLinkTitle": "Transformation Event", "dlrVerificationPage": "https://verify.example.com" }, diff --git a/package.json b/package.json index 58fb5013..d200a7dc 100644 --- a/package.json +++ b/package.json @@ -6,8 +6,9 @@ "packages/*" ], "scripts": { - "start": "cp app-config.json packages/mock-app/src/constants/app-config.json && cd packages/mock-app && yarn start", - "build": "yarn build:services && yarn build:components && yarn build:untp-test-suite", + "copy-config": "cp app-config.json packages/mock-app/src/constants/app-config.json && cp app-config.json packages/components/src/constants/app-config.json", + "start": "yarn copy-config && cd packages/mock-app && yarn start", + "build": "yarn copy-config && yarn build:services && yarn build:components && yarn build:untp-test-suite", "build:services": "cd packages/services && yarn run build", "build:components": "cd packages/components && yarn run build", "build:untp-test-suite": "cd packages/untp-test-suite && yarn run build", diff --git a/packages/components/src/components/BarcodeGenerator/BarcodeGenerator.tsx b/packages/components/src/components/BarcodeGenerator/BarcodeGenerator.tsx index 813b6455..8a18cbda 100644 --- a/packages/components/src/components/BarcodeGenerator/BarcodeGenerator.tsx +++ b/packages/components/src/components/BarcodeGenerator/BarcodeGenerator.tsx @@ -1,8 +1,10 @@ -import { allowedIndexKeys, extractFromElementString } from '@mock-app/services'; +import { extractFromElementString, constructIdentifierData, constructElementString } from '@mock-app/services'; import { Box } from '@mui/material'; -import JSONPointer from 'jsonpointer'; import { useEffect, useState } from 'react'; import Barcode from 'react-barcode'; +import appConfig from '../../constants/app-config.json'; +import { DataCarrierType } from '../../types/common.types'; +import { toastMessage, Status } from '../ToastMessage/ToastMessage'; export interface IBarcodeProps { data?: string[]; @@ -12,27 +14,33 @@ export const BarcodeGenerator = (props: IBarcodeProps) => { const [values, setValues] = useState([]); useEffect(() => { if (props.data && props.dataPath) { - const pathIndex = props.dataPath.split('/').findIndex((key) => allowedIndexKeys.includes(key)); - - if (pathIndex === -1) { - setValues([constructBarcode(JSONPointer.get(props.data, props.dataPath))]); + const aiData = constructIdentifierData(props.dataPath, props.data); + if (validateData(aiData)) { + const elementString = constructElementString(aiData); + setValues([constructBarcode(elementString)]); } else { - const headPath = props.dataPath.split('/').slice(0, pathIndex).join('/'); - const tailPath = props.dataPath - .split('/') - .slice(pathIndex + 1) - .join('/'); - const array = JSONPointer.get(props.data, headPath); - const values = array.map((item: any) => JSONPointer.get(item, `/${tailPath}`)); - const parsedValues = values.map((item: any) => { - return constructBarcode(item); - }); - - setValues(parsedValues); + toastMessage({ status: Status.warning, message: 'Invalid data for barcode generation' }); } } }, [props.data, props.dataPath]); + const validateData = (aiData: any) => { + if (!aiData) return false; + if (!aiData.primary || !aiData.primary.ai || !aiData.primary.value) return false; + const identifierSchemesForBarcode = (appConfig.identifierSchemes || []).filter( + (scheme) => scheme.carriers && scheme.carriers.includes(DataCarrierType.Barcode), + ); + if (identifierSchemesForBarcode.length === 0) return false; + + return identifierSchemesForBarcode.some((scheme) => { + const regex = new RegExp(scheme.format); + if (regex.test(aiData.primary.value)) { + return true; + } + return false; + }); + }; + const constructBarcode = (data: string) => { const convertToGS1String = (obj: any) => { if (typeof obj !== 'object' || obj === null) return ''; @@ -66,9 +74,9 @@ export const BarcodeGenerator = (props: IBarcodeProps) => { return ( - {values.map((item) => { + {values.map((item, idx) => { return ( - + ); diff --git a/packages/components/src/constants/app-config.json b/packages/components/src/constants/app-config.json new file mode 100644 index 00000000..fa3c61d4 --- /dev/null +++ b/packages/components/src/constants/app-config.json @@ -0,0 +1,6919 @@ +{ + "name": "CHERRIES SUPPLY CHAIN TRACEABILITY", + "styles": { + "primaryColor": "rgb(35, 138, 186)", + "secondaryColor": "black", + "tertiaryColor": "black" + }, + "generalFeatures": [ + { + "name": "General features", + "type": "", + "styles": { + "primaryColor": "rgb(35, 138, 186)", + "secondaryColor": "black", + "tertiaryColor": "black" + }, + "features": [] + } + ], + "apps": [ + { + "name": "Orchard Facility", + "type": "producer", + "assets": { + "logo": "Cherries-farm-logo.webp", + "brandTitle": "Orchard Facility" + }, + "styles": { + "primaryColor": "#b5651d", + "secondaryColor": "#391561", + "tertiaryColor": "#ffffff" + }, + "features": [ + { + "name": "Issue DPP", + "id": "produce_product", + "components": [ + { + "name": "JsonForm", + "type": "EntryData", + "props": { + "schema": { + "url": "https://jargon.sh/user/unece/DigitalProductPassport/v/working/artefacts/jsonSchemas/Product.json?class=Product" + }, + "data": { + "type": ["Product"], + "id": "https://example.com/01/09359502000034", + "name": "EcoCharge Lithium-Ion Battery", + "registeredId": "09359502000034", + "idScheme": { + "type": ["IdentifierScheme"], + "id": "https://id.gs1.org/01/", + "name": "Global Trade Identification Number (GTIN)" + }, + "serialNumber": "12345678", + "batchNumber": "6789", + "productImage": { + "type": ["Link"], + "linkURL": "https://c.animaapp.com/b3vf2M20/img/pp-header@2x.png", + "linkName": "EV Battery 300Ah Image" + }, + "description": "The EcoCharge EC-5000 Lithium-Ion Battery is a high-capacity, 5000mAh battery designed for performance and sustainability. Manufactured with responsibly sourced materials and a 95% recyclability rate, it reduces lifecycle emissions through eco-friendly production and verified recycling programs.", + "productCategory": [ + { + "type": ["Classification"], + "id": "https://unstats.un.org/unsd/classifications/Econ/cpc/46410", + "code": "46410", + "name": "Primary cells", + "schemeID": "https://unstats.un.org/unsd/classifications/Econ/cpc/", + "schemeName": "UN Central Product Classification (CPC)" + }, + { + "type": ["Classification"], + "id": "https://unstats.un.org/unsd/classifications/Econ/cpc/46410", + "code": "46410", + "name": "Primary batteries", + "schemeID": "https://unstats.un.org/unsd/classifications/Econ/cpc/", + "schemeName": "UN Central Product Classification (CPC)" + } + ], + "furtherInformation": [ + { + "type": ["Link"], + "linkURL": "https://example-company.com/product-information/1234567", + "linkName": "Name of document that is further information" + }, + { + "type": ["Link"], + "linkURL": "https://example-company.com/product-information/1234567", + "linkName": "Name of additional document that is further information" + } + ], + "producedByParty": { + "type": ["Identifier"], + "id": "https://id.example-company.com/party/6789", + "name": "Example Manufacturing Co." + }, + "producedAtFacility": { + "type": ["Identifier"], + "id": "https://id.example-company.com/facility/123", + "name": "Green Acres Battery Factory" + }, + "dimensions": { + "type": ["Dimension"], + "weight": { "value": 10, "unit": "kg" }, + "length": { "value": 90, "unit": "mm" }, + "width": { "value": 60, "unit": "mm" }, + "height": { "value": 10, "unit": "mm" }, + "volume": { "value": 7.5, "unit": "L" } + }, + "characteristic": { + "Battery status": "Recycled", + "Battery cell type": "Prismatic", + "Number of cells per battery": "180", + "Total energy": "100kwh" + }, + "productionDate": "2024-04-24", + "countryOfProduction": "Australia", + "granularityLevel": "item", + "dueDiligenceDeclaration": { + "type": ["Link"], + "linkURL": "https://example-company.com/due-diligence/1234567", + "linkName": "Due Diligence Declaration" + }, + "materialsProvenance": [ + { + "type": ["Material"], + "name": "Material", + "originCountry": "AU", + "materialType": { + "type": ["Classification"], + "id": "https://unfc.org/material-type/Lithium", + "name": "Lithium" + }, + "massFraction": 20, + "massAmount": { "value": 1.0, "unit": "kg" }, + "recycledAmount": 0, + "hazardous": false + }, + { + "type": ["Material"], + "name": "Material", + "originCountry": "AU", + "materialType": { + "type": ["Classification"], + "id": "https://unfc.org/material-type/Lithium", + "name": "Lithium" + }, + "massFraction": 20, + "massAmount": { "value": 1.0, "unit": "kg" }, + "recycledAmount": 10, + "hazardous": true, + "materialSafetyInformation": { + "type": ["Link"], + "linkURL": "https://example.com/safety-info/lithium-spodumene.pdf", + "linkName": "Material Safety Data Sheet", + "linkType": "https://test.uncefact.org/vocabulary/linkTypes/safetyData" + } + }, + { + "type": ["Material"], + "name": "Material", + "originCountry": "AU", + "materialType": { + "type": ["Classification"], + "id": "https://unfc.org/material-type/Lithium", + "name": "Lithium" + }, + "massFraction": 20, + "massAmount": { "value": 1.0, "unit": "kg" }, + "recycledAmount": 0, + "hazardous": false + }, + { + "type": ["Material"], + "name": "Material", + "originCountry": "AU", + "materialType": { + "type": ["Classification"], + "id": "https://unfc.org/material-type/Lithium", + "name": "Lithium" + }, + "massFraction": 20, + "massAmount": { "value": 1.0, "unit": "kg" }, + "recycledAmount": 0, + "hazardous": false + } + ], + "conformityClaim": [ + { + "type": ["Claim", "Declaration"], + "assessmentDate": "2024-04-25", + "declaredValue": [ + { + "type": ["Metric"], + "metricName": "GHG emissions intensity", + "metricValue": { "value": 1.5, "unit": "kg" }, + "score": "1.2", + "accuracy": 0.8 + }, + { + "type": ["Metric"], + "metricName": "GHG emissions intensity", + "metricValue": { "value": 1.5, "unit": "kg" }, + "score": "1.2", + "accuracy": 0.8 + } + ], + "id": "https://products.example-company.com/09520123456788/declarations/12345", + "referenceStandard": { + "type": ["Standard"], + "id": "https://www.iso.org/standard/60857.html", + "name": "Standard", + "issuingParty": { + "type": ["Identifier"], + "id": "https://iso.org/issuing-party/123", + "name": "International Organization" + }, + "issueDate": "2024-04-25" + }, + "referenceRegulation": { + "type": ["Regulation"], + "id": "https://www.legislation.gov.au/F2008L02309/latest/versions", + "name": "National Greenhouse", + "jurisdictionCountry": "Australia", + "administeredBy": { + "type": ["Identifier"], + "id": "https://gov.au/admin-body/12345", + "name": "Australian Government" + }, + "effectiveDate": "2024-03-20" + }, + "assessmentCriteria": [ + { + "type": ["Criterion"], + "id": "https://www.globalbattery.org/media/publications/gba-rulebook-v2.0-master.pdf#BatteryAssembly", + "name": "Battery Assembly Guidelines", + "thresholdValues": [ + { + "type": ["Metric"], + "metricName": "Minimum compressive strength", + "metricValue": { "value": 500, "unit": "MPA" } + } + ] + } + ], + "conformance": true, + "conformityTopic": "environment.energy", + "conformityEvidence": { + "type": ["SecureLink", "Link"], + "linkURL": "https://example-certifier.com/evidence/1234567.json", + "hashDigest": "6239119dda5bd4c8a6ffb832fe16feaa5c27b7dba154d24c53d4470a2c69adc2", + "hashMethod": "SHA-256", + "linkName": "Declaration link name", + "linkType": "https://test.uncefact.org/vocabulary/linkTypes/dcc", + "encryptionMethod": "AES" + } + }, + { + "type": ["Claim", "Declaration"], + "assessmentDate": "2024-04-25", + "declaredValue": [ + { + "type": ["Metric"], + "metricName": "GHG emissions intensity", + "metricValue": { "value": 1.5, "unit": "kg" }, + "score": "1.2", + "accuracy": 0.8 + }, + { + "type": ["Metric"], + "metricName": "GHG emissions intensity", + "metricValue": { "value": 1.5, "unit": "kg" }, + "score": "1.2", + "accuracy": 0.8 + } + ], + "id": "https://products.example-company.com/09520123456788/declarations/12345", + "referenceStandard": { + "type": ["Standard"], + "id": "https://www.iso.org/standard/60857.html", + "name": "Standard", + "issuingParty": { + "type": ["Identifier"], + "id": "https://iso.org/issuing-party/123", + "name": "International Organization" + }, + "issueDate": "2023-12-05" + }, + "referenceRegulation": { + "type": ["Regulation"], + "id": "https://www.legislation.gov.au/F2008L02309/latest/versions", + "name": "National Greenhouse", + "jurisdictionCountry": "Australia", + "administeredBy": { + "type": ["Identifier"], + "id": "https://gov.au/admin-body/12345", + "name": "Australian Government" + }, + "effectiveDate": "2024-03-20" + }, + "assessmentCriteria": [ + { + "type": ["Criterion"], + "id": "https://www.globalbattery.org/media/publications/gba-rulebook-v2.0-master.pdf#BatteryAssembly", + "name": "Battery Assembly Guidelines", + "thresholdValues": [ + { + "type": ["Metric"], + "metricName": "Minimum compressive strength", + "metricValue": { "value": 500, "unit": "MPA" } + } + ] + } + ], + "conformance": false, + "conformityTopic": "environment.energy", + "conformityEvidence": { + "type": ["SecureLink", "Link"], + "linkURL": "https://example-certifier.com/evidence/1234567.json", + "hashDigest": "6239119dda5bd4c8a6ffb832fe16feaa5c27b7dba154d24c53d4470a2c69adc2", + "hashMethod": "SHA-256", + "linkName": "Declaration link name", + "linkType": "https://test.uncefact.org/vocabulary/linkTypes/dcc", + "encryptionMethod": "AES" + } + }, + { + "type": ["Claim", "Declaration"], + "assessmentDate": "2024-04-25", + "declaredValue": [ + { + "type": ["Metric"], + "metricName": "GHG emissions intensity", + "metricValue": { "value": 1.5, "unit": "kg" }, + "score": "1.2", + "accuracy": 0.8 + }, + { + "type": ["Metric"], + "metricName": "GHG emissions intensity", + "metricValue": { "value": 1.5, "unit": "kg" }, + "score": "1.2", + "accuracy": 0.8 + } + ], + "id": "https://products.example-company.com/09520123456788/declarations/12345", + "referenceStandard": { + "type": ["Standard"], + "id": "https://www.iso.org/standard/60857.html", + "name": "Standard", + "issuingParty": { + "type": ["Identifier"], + "id": "https://iso.org/issuing-party/123", + "name": "International Organization" + }, + "issueDate": "2023-12-05" + }, + "referenceRegulation": { + "type": ["Regulation"], + "id": "https://www.legislation.gov.au/F2008L02309/latest/versions", + "name": "National Greenhouse", + "jurisdictionCountry": "Australia", + "administeredBy": { + "type": ["Identifier"], + "id": "https://gov.au/admin-body/12345", + "name": "Australian Government" + }, + "effectiveDate": "2024-03-20" + }, + "assessmentCriteria": [ + { + "type": ["Criterion"], + "id": "https://www.globalbattery.org/media/publications/gba-rulebook-v2.0-master.pdf#BatteryAssembly", + "name": "Battery Assembly Guidelines", + "thresholdValues": [ + { + "type": ["Metric"], + "metricName": "Minimum compressive strength", + "metricValue": { "value": 500, "unit": "MPA" } + } + ] + } + ], + "conformance": false, + "conformityTopic": "environment.energy", + "conformityEvidence": { + "type": ["SecureLink", "Link"], + "linkURL": "https://example-certifier.com/evidence/1234567.json", + "hashDigest": "6239119dda5bd4c8a6ffb832fe16feaa5c27b7dba154d24c53d4470a2c69adc2", + "hashMethod": "SHA-256", + "linkName": "Declaration link name", + "linkType": "https://test.uncefact.org/vocabulary/linkTypes/dcc", + "encryptionMethod": "AES" + } + }, + { + "type": ["Claim", "Declaration"], + "assessmentDate": "2024-04-25", + "declaredValue": [ + { + "type": ["Metric"], + "metricName": "GHG emissions intensity", + "metricValue": { "value": 1.5, "unit": "kg" }, + "score": "1.2", + "accuracy": 0.8 + }, + { + "type": ["Metric"], + "metricName": "GHG emissions intensity", + "metricValue": { "value": 1.5, "unit": "kg" }, + "score": "1.2", + "accuracy": 0.8 + } + ], + "id": "https://products.example-company.com/09520123456788/declarations/12345", + "referenceStandard": { + "type": ["Standard"], + "id": "https://www.iso.org/standard/60857.html", + "name": "Standard", + "issuingParty": { + "type": ["Identifier"], + "id": "https://iso.org/issuing-party/123", + "name": "International Organization" + }, + "issueDate": "2023-12-05" + }, + "referenceRegulation": { + "type": ["Regulation"], + "id": "https://www.legislation.gov.au/F2008L02309/latest/versions", + "name": "National Greenhouse", + "jurisdictionCountry": "Australia", + "administeredBy": { + "type": ["Identifier"], + "id": "https://gov.au/admin-body/12345", + "name": "Australian Government" + }, + "effectiveDate": "2024-03-20" + }, + "assessmentCriteria": [ + { + "type": ["Criterion"], + "id": "https://www.globalbattery.org/media/publications/gba-rulebook-v2.0-master.pdf#BatteryAssembly", + "name": "Battery Assembly Guidelines", + "thresholdValues": [ + { + "type": ["Metric"], + "metricName": "Minimum compressive strength", + "metricValue": { "value": 500, "unit": "MPA" } + } + ] + } + ], + "conformance": false, + "conformityTopic": "environment.energy", + "conformityEvidence": { + "type": ["SecureLink", "Link"], + "linkURL": "https://example-certifier.com/evidence/1234567.json", + "hashDigest": "6239119dda5bd4c8a6ffb832fe16feaa5c27b7dba154d24c53d4470a2c69adc2", + "hashMethod": "SHA-256", + "linkName": "Declaration link name", + "linkType": "https://test.uncefact.org/vocabulary/linkTypes/dcc", + "encryptionMethod": "AES" + } + }, + { + "type": ["Claim", "Declaration"], + "assessmentDate": "2024-04-25", + "declaredValue": [ + { + "type": ["Metric"], + "metricName": "GHG emissions intensity", + "metricValue": { "value": 1.5, "unit": "kg" }, + "score": "1.2", + "accuracy": 0.8 + }, + { + "type": ["Metric"], + "metricName": "GHG emissions intensity", + "metricValue": { "value": 1.5, "unit": "kg" }, + "score": "1.2", + "accuracy": 0.8 + } + ], + "id": "https://products.example-company.com/09520123456788/declarations/12345", + "referenceStandard": { + "type": ["Standard"], + "id": "https://www.iso.org/standard/60857.html", + "name": "Standard", + "issuingParty": { + "type": ["Identifier"], + "id": "https://iso.org/issuing-party/123", + "name": "International Organization" + }, + "issueDate": "2023-12-05" + }, + "referenceRegulation": { + "type": ["Regulation"], + "id": "https://www.legislation.gov.au/F2008L02309/latest/versions", + "name": "National Greenhouse", + "jurisdictionCountry": "Australia", + "administeredBy": { + "type": ["Identifier"], + "id": "https://gov.au/admin-body/12345", + "name": "Australian Government" + }, + "effectiveDate": "2024-03-20" + }, + "assessmentCriteria": [ + { + "type": ["Criterion"], + "id": "https://www.globalbattery.org/media/publications/gba-rulebook-v2.0-master.pdf#BatteryAssembly", + "name": "Battery Assembly Guidelines", + "thresholdValues": [ + { + "type": ["Metric"], + "metricName": "Minimum compressive strength", + "metricValue": { "value": 500, "unit": "MPA" } + } + ] + } + ], + "conformance": false, + "conformityTopic": "environment.energy", + "conformityEvidence": { + "type": ["SecureLink", "Link"], + "linkURL": "https://example-certifier.com/evidence/1234567.json", + "hashDigest": "6239119dda5bd4c8a6ffb832fe16feaa5c27b7dba154d24c53d4470a2c69adc2", + "hashMethod": "SHA-256", + "linkName": "Declaration link name", + "linkType": "https://test.uncefact.org/vocabulary/linkTypes/dcc", + "encryptionMethod": "AES" + } + } + ], + "circularityScorecard": { + "type": ["CircularityPerformance"], + "recyclingInformation": { + "type": ["Link"], + "linkURL": "https://example-company.com/recycling/1234567", + "linkName": "Recycling Information" + }, + "repairInformation": { + "type": ["Link"], + "linkURL": "https://example-company.com/repair/1234567", + "linkName": "Repair Instructions" + }, + "recyclableContent": 67, + "recycledContent": 86, + "utilityFactor": 1.2, + "materialCircularityIndicator": 0.67 + }, + "emissionsScorecard": { + "type": ["EmissionsPerformance"], + "carbonFootprint": 12.5, + "declaredUnit": "kg", + "operationalScope": "CradleToGate", + "primarySourcedRatio": 75, + "reportingStandard": { + "type": ["Standard"], + "id": "https://www.ifrs.org/standards/issb/s2", + "name": "WBSCD Pathfinder framework - V.2.0", + "issuingParty": { + "type": ["Identifier"], + "id": "https://id.ifrs.org/issuing-party/123", + "name": "International Financial Reporting Standards Foundation", + "registeredId": "90664869327", + "idScheme": { + "type": ["IdentifierScheme"], + "id": "https://id.ifrs.org/issuing-party/", + "name": "IFRS Issuing Party" + } + }, + "issueDate": "2024-04-25" + } + }, + "traceabilityInformation": { + "valueChainProcess": "Spinning", + "verifiedRatio": 0.5, + "traceabilityEvent": [ + { + "linkURL": "https://files.example-certifier.com/1234567.json", + "linkName": "Object Event", + "linkType": "https://test.uncefact.org/vocabulary/linkTypes/dcc", + "hashDigest": "6239119", + "hashMethod": "SHA-256", + "encryptionMethod": "AES" + }, + { + "linkURL": "https://files.example-certifier.com/1234567.json", + "linkName": "Transformation Event", + "linkType": "https://test.uncefact.org/vocabulary/linkTypes/dcc", + "hashDigest": "6239119", + "hashMethod": "SHA-256", + "encryptionMethod": "AES" + }, + { + "linkURL": "https://files.example-certifier.com/1234567.json", + "linkName": "Transaction Event", + "linkType": "https://test.uncefact.org/vocabulary/linkTypes/dcc", + "hashDigest": "6239119", + "hashMethod": "SHA-256", + "encryptionMethod": "AES" + }, + { + "linkURL": "https://files.example-certifier.com/1234567.json", + "linkName": "Aggregation Event", + "linkType": "https://test.uncefact.org/vocabulary/linkTypes/dcc", + "hashDigest": "6239119", + "hashMethod": "SHA-256", + "encryptionMethod": "AES" + }, + { + "linkURL": "https://files.example-certifier.com/1234567.json", + "linkName": "Association Event", + "linkType": "https://test.uncefact.org/vocabulary/linkTypes/dcc", + "hashDigest": "6239119", + "hashMethod": "SHA-256", + "encryptionMethod": "AES" + }, + { + "linkURL": "https://files.example-certifier.com/1234567.json", + "linkName": "Object Event", + "linkType": "https://test.uncefact.org/vocabulary/linkTypes/dcc", + "hashDigest": "6239119", + "hashMethod": "SHA-256", + "encryptionMethod": "AES" + } + ] + } + }, + "constructData": { + "mappingFields": [], + "dummyFields": [], + "generationFields": [ + { + "path": "/eventID", + "handler": "generateIdWithSerialNumber" + } + ] + }, + "className": "json-form", + "style": { + "margin": "40px auto", + "paddingTop": "40px", + "width": "80%" + } + } + }, + { + "name": "CustomButton", + "type": "Submit", + "props": {} + }, + { + "name": "BarcodeGenerator", + "type": "Result", + "props": { + "dataPath": { + "primary": { + "ai": "01", + "path": "/decodedEnvelopedVC/credentialSubject/registeredId" + }, + "qualifiers": [ + { + "ai": "10", + "path": "/decodedEnvelopedVC/credentialSubject/batchNumber" + } + ] + } + } + } + ], + "services": [ + { + "name": "processDPP", + "parameters": [ + { + "vckit": { + "vckitAPIUrl": "http://localhost:3332/v2", + "issuer": { + "id": "did:web:6028-115-79-212-164.ngrok-free.app", + "name": "Orchard Facility" + }, + "headers": { + "Authorization": "Bearer test123" + } + }, + "dpp": { + "context": ["https://vocabulary.uncefact.org/untp/dpp/0.5.0/"], + "renderTemplate": [ + { + "template": " Digital Product Passport

PRODUCT PASSPORT

{{credentialSubject.name}}

{{credentialSubject.description}}
{{#each credentialSubject.furtherInformation}} {{linkName}} {{/each}}
{{#if credentialSubject.characteristic}}
Characteristics
{{#each credentialSubject.characteristic}}
{{@key}}

{{this}}

{{/each}}
{{/if}}

Circularity Scorecard

The circularity Scorecard provides a simple high level summary of circularity performance of the product.

{{credentialSubject.circularityScorecard.recyclableContent}}%

Recyclable content

{{credentialSubject.circularityScorecard.recycledContent}}%

Recycled content

{{credentialSubject.circularityScorecard.utilityFactor}}

Utility factor

{{credentialSubject.circularityScorecard.materialCircularityIndicator}}

Material circularity*

*The Material Circularity Indicator provides an overall circularity score which is a function of all three of the earlier measures.

Emissions Scorecard

The Emissions Scorecard gives a clear snapshot of the product's greenhouse gas (GHG) emissions performance, providing a single indicator to assess its overall environmental impact.

{{credentialSubject.emissionsScorecard.carbonFootprint}}{{credentialSubject.emissionsScorecard.declaredUnit}}

Co2Eq

Scope includes

{{credentialSubject.emissionsScorecard.operationalScope}}

Primary sourced ratio*

{{credentialSubject.emissionsScorecard.primarySourcedRatio}}% primary sources

Issue date

{{credentialSubject.emissionsScorecard.reportingStandard.issueDate}}

*

The Primary Sourced Ratio shows the percentage of scope 3 emissions data that is directly collected from actual sources, rather than being based on estimates.

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}}
Production
Product category

{{#each credentialSubject.productCategory}}{{name}}{{#unless @last}},{{/unless}} {{/each}}

Date produced

{{credentialSubject.productionDate}}

Country

{{credentialSubject.countryOfProduction}}

Dimensions

Weight: {{credentialSubject.dimensions.weight.value}}{{credentialSubject.dimensions.weight.unit}} Length: {{credentialSubject.dimensions.length.value}}{{credentialSubject.dimensions.length.unit}} Width: {{credentialSubject.dimensions.width.value}}{{credentialSubject.dimensions.width.unit}} Height: {{credentialSubject.dimensions.height.value}}{{credentialSubject.dimensions.height.unit}} Volume: {{credentialSubject.dimensions.volume.value}}{{credentialSubject.dimensions.volume.unit}}

Product composition

A complete list of materials that make up the composition of this product.

{{#each credentialSubject.materialsProvenance}}

{{massFraction}}%

{{massAmount.value}}{{massAmount.unit}} {{name}}

Recycled {{recycledAmount}}%

Hazard {{#if hazardous}}Yes{{else}}No{{/if}}

{{materialSafetyInformation.linkName}}
{{originCountry}}
{{/each}}

History

{{!-- start: Supply chain due diligence report --}}
Supply chain due diligence report
{{!-- end: Supply chain due diligence report --}}

{{credentialSubject.traceabilityInformation.valueChainProcess}}

Verified ratio {{credentialSubject.traceabilityInformation.verifiedRatio}}

{{#each credentialSubject.traceabilityInformation.traceabilityEvent}}
{{linkName}} View
{{/each}}

Passport issued by

Organisation

{{issuer.name}}

Registered ID {{issuer.id}}
Valid from

{{validFrom}}

Valid to

{{validUntil}}

This Digital Product Passport (DPP) is a digital record of the product's sustainability and environmental performance, ensuring transparency and accountability in line with UNTP standards. The DPP can be verified at any time using the QR code or visiting www.untp-certification.org with the passport ID.

PRODUCT PASSPORT
{{credentialSubject.name}}
Batch: {{credentialSubject.batchNumber}}
Serial: {{credentialSubject.serialNumber}}

{{credentialSubject.description}}

{{#each credentialSubject.furtherInformation}}
{{linkName}}
{{/each}}
{{#if credentialSubject.characteristic}}
Characteristics
{{#each credentialSubject.characteristic}}
{{@key}}
{{this}}
{{/each}}
{{/if}}
Circularity Scorecard

The circularity Scorecard provides a simple high level summary of circularity performance of the product.

{{credentialSubject.circularityScorecard.recyclableContent}}%
Recyclable content
{{credentialSubject.circularityScorecard.recycledContent}}%
Recycled content
{{credentialSubject.circularityScorecard.utilityFactor}}
Utility factor
{{credentialSubject.circularityScorecard.materialCircularityIndicator}}
Material circularity*

*The Material Circularity Indicator provides an overall circularity score which is a function of all three of the earlier measures.

Emissions Scorecard

The Emissions Scorecard gives a clear snapshot of the product's greenhouse gas (GHG) emissions performance, providing a single indicator to assess its overall environmental impact.

{{credentialSubject.emissionsScorecard.carbonFootprint}}{{credentialSubject.emissionsScorecard.declaredUnit}}

Co2Eq

Scope includes
{{credentialSubject.emissionsScorecard.operationalScope}}
Primary sourced ratio*
{{credentialSubject.emissionsScorecard.primarySourcedRatio}}% primary sources

The Primary Sourced Ratio shows the percentage of scope 3 emissions data that is directly collected from actual sources, rather than being based on estimates.

Issue date
{{credentialSubject.emissionsScorecard.reportingStandard.issueDate}}
*
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}}
Production
Product category
{{#each credentialSubject.productCategory}}{{name}}{{#unless @last}},{{/unless}} {{/each}}
Date produced
{{credentialSubject.productionDate}}
Country
{{credentialSubject.countryOfProduction}}
Dimensions
Weight: {{credentialSubject.dimensions.weight.value}}{{credentialSubject.dimensions.weight.unit}} Length: {{credentialSubject.dimensions.length.value}}{{credentialSubject.dimensions.length.unit}} Width: {{credentialSubject.dimensions.width.value}}{{credentialSubject.dimensions.width.unit}} Height: {{credentialSubject.dimensions.height.value}}{{credentialSubject.dimensions.height.unit}} Volume: {{credentialSubject.dimensions.volume.value}}{{credentialSubject.dimensions.volume.unit}}
Composition

The Product Composition List details the materials and components used in the product, providing transparency on the origin and nature of each element.

{{#each credentialSubject.materialsProvenance}}
{{massFraction}}%
{{massAmount.value}}{{massAmount.unit}} {{name}}
Recycled {{#if recycledAmount}}{{recycledAmount}}{{else}}0{{/if}}%
Hazard {{#if hazardous}}Yes{{else}}No{{/if}}
{{originCountry}}
{{/each}}
History
{{!-- start: Supply chain due diligence report --}}
Supply chain due diligence report
{{!-- end: Supply chain due diligence report --}}

{{credentialSubject.traceabilityInformation.valueChainProcess}}

Verified ratio {{credentialSubject.traceabilityInformation.verifiedRatio}}

{{#each credentialSubject.traceabilityInformation.traceabilityEvent}}
{{linkName}} View
{{/each}}
Passport issued by
Organisation
{{issuer.name}}
Registered ID
Valid from
{{validFrom}}
Valid to
{{validUntil}}

This Digital Product Passport (DPP) is a digital record of the product’s sustainability and environmental performance, ensuring transparency and accountability in line with UNTP standards. The DPP can be verified at any time using the QR code or visiting www.untp-certification.org with the passport ID.

", + "@type": "WebRenderingTemplate2022" + } + ], + "type": ["DigitalProductPassport"], + "dlrLinkTitle": "Cherries Product Passport", + "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": { + "resultPath": "/uri", + "bucket": "verifiable-credentials" + }, + "options": { + "method": "POST", + "headers": { + "Content-Type": "application/json" + } + } + }, + "identifierKeyPath": { + "primary": { + "ai": "01", + "path": "/registeredId" + }, + "qualifiers": [ + { + "ai": "10", + "path": "/batchNumber" + } + ] + } + } + ] + } + ] + }, + { + "name": "Issue DLP", + "id": "produce_product", + "components": [ + { + "name": "JsonForm", + "type": "EntryData", + "props": { + "schema": { + "url": "https://jargon.sh/user/unece/DigitalProductPassport/v/working/artefacts/jsonSchemas/Product.json?class=Product" + }, + "data": { + "type": ["Product"], + "id": "https://example.com/01/3ABCD123XBDC0447", + "name": "EcoCharge Lithium-Ion Battery", + "registeredId": "3ABCD123XBDC0447", + "idScheme": { + "type": ["IdentifierScheme"], + "id": "https://id.gs1.org/01/", + "name": "Global Trade Identification Number (GTIN)" + }, + "serialNumber": "12345678", + "batchNumber": "6789", + "productImage": { + "type": ["Link"], + "linkURL": "https://c.animaapp.com/b3vf2M20/img/pp-header@2x.png", + "linkName": "EV Battery 300Ah Image" + }, + "description": "The EcoCharge EC-5000 Lithium-Ion Battery is a high-capacity, 5000mAh battery designed for performance and sustainability. Manufactured with responsibly sourced materials and a 95% recyclability rate, it reduces lifecycle emissions through eco-friendly production and verified recycling programs.", + "productCategory": [ + { + "type": ["Classification"], + "id": "https://unstats.un.org/unsd/classifications/Econ/cpc/46410", + "code": "46410", + "name": "Primary cells", + "schemeID": "https://unstats.un.org/unsd/classifications/Econ/cpc/", + "schemeName": "UN Central Product Classification (CPC)" + }, + { + "type": ["Classification"], + "id": "https://unstats.un.org/unsd/classifications/Econ/cpc/46410", + "code": "46410", + "name": "Primary batteries", + "schemeID": "https://unstats.un.org/unsd/classifications/Econ/cpc/", + "schemeName": "UN Central Product Classification (CPC)" + } + ], + "furtherInformation": [ + { + "type": ["Link"], + "linkURL": "https://example-company.com/product-information/1234567", + "linkName": "Name of document that is further information" + }, + { + "type": ["Link"], + "linkURL": "https://example-company.com/product-information/1234567", + "linkName": "Name of additional document that is further information" + } + ], + "producedByParty": { + "type": ["Identifier"], + "id": "https://id.example-company.com/party/6789", + "name": "Example Manufacturing Co." + }, + "producedAtFacility": { + "type": ["Identifier"], + "id": "https://id.example-company.com/facility/123", + "name": "Green Acres Battery Factory" + }, + "dimensions": { + "type": ["Dimension"], + "weight": { "value": 10, "unit": "kg" }, + "length": { "value": 90, "unit": "mm" }, + "width": { "value": 60, "unit": "mm" }, + "height": { "value": 10, "unit": "mm" }, + "volume": { "value": 7.5, "unit": "L" } + }, + "characteristic": { + "Battery status": "Recycled", + "Battery cell type": "Prismatic", + "Number of cells per battery": "180", + "Total energy": "100kwh" + }, + "productionDate": "2024-04-24", + "countryOfProduction": "Australia", + "granularityLevel": "item", + "dueDiligenceDeclaration": { + "type": ["Link"], + "linkURL": "https://example-company.com/due-diligence/1234567", + "linkName": "Due Diligence Declaration" + }, + "materialsProvenance": [ + { + "type": ["Material"], + "name": "Material", + "originCountry": "AU", + "materialType": { + "type": ["Classification"], + "id": "https://unfc.org/material-type/Lithium", + "name": "Lithium" + }, + "massFraction": 20, + "massAmount": { "value": 1.0, "unit": "kg" }, + "recycledAmount": 0, + "hazardous": false + }, + { + "type": ["Material"], + "name": "Material", + "originCountry": "AU", + "materialType": { + "type": ["Classification"], + "id": "https://unfc.org/material-type/Lithium", + "name": "Lithium" + }, + "massFraction": 20, + "massAmount": { "value": 1.0, "unit": "kg" }, + "recycledAmount": 10, + "hazardous": true, + "materialSafetyInformation": { + "type": ["Link"], + "linkURL": "https://example.com/safety-info/lithium-spodumene.pdf", + "linkName": "Material Safety Data Sheet", + "linkType": "https://test.uncefact.org/vocabulary/linkTypes/safetyData" + } + }, + { + "type": ["Material"], + "name": "Material", + "originCountry": "AU", + "materialType": { + "type": ["Classification"], + "id": "https://unfc.org/material-type/Lithium", + "name": "Lithium" + }, + "massFraction": 20, + "massAmount": { "value": 1.0, "unit": "kg" }, + "recycledAmount": 0, + "hazardous": false + }, + { + "type": ["Material"], + "name": "Material", + "originCountry": "AU", + "materialType": { + "type": ["Classification"], + "id": "https://unfc.org/material-type/Lithium", + "name": "Lithium" + }, + "massFraction": 20, + "massAmount": { "value": 1.0, "unit": "kg" }, + "recycledAmount": 0, + "hazardous": false + } + ], + "conformityClaim": [ + { + "type": ["Claim", "Declaration"], + "assessmentDate": "2024-04-25", + "declaredValue": [ + { + "type": ["Metric"], + "metricName": "GHG emissions intensity", + "metricValue": { "value": 1.5, "unit": "kg" }, + "score": "1.2", + "accuracy": 0.8 + }, + { + "type": ["Metric"], + "metricName": "GHG emissions intensity", + "metricValue": { "value": 1.5, "unit": "kg" }, + "score": "1.2", + "accuracy": 0.8 + } + ], + "id": "https://products.example-company.com/09520123456788/declarations/12345", + "referenceStandard": { + "type": ["Standard"], + "id": "https://www.iso.org/standard/60857.html", + "name": "Standard", + "issuingParty": { + "type": ["Identifier"], + "id": "https://iso.org/issuing-party/123", + "name": "International Organization" + }, + "issueDate": "2024-04-25" + }, + "referenceRegulation": { + "type": ["Regulation"], + "id": "https://www.legislation.gov.au/F2008L02309/latest/versions", + "name": "National Greenhouse", + "jurisdictionCountry": "Australia", + "administeredBy": { + "type": ["Identifier"], + "id": "https://gov.au/admin-body/12345", + "name": "Australian Government" + }, + "effectiveDate": "2024-03-20" + }, + "assessmentCriteria": [ + { + "type": ["Criterion"], + "id": "https://www.globalbattery.org/media/publications/gba-rulebook-v2.0-master.pdf#BatteryAssembly", + "name": "Battery Assembly Guidelines", + "thresholdValues": [ + { + "type": ["Metric"], + "metricName": "Minimum compressive strength", + "metricValue": { "value": 500, "unit": "MPA" } + } + ] + } + ], + "conformance": true, + "conformityTopic": "environment.energy", + "conformityEvidence": { + "type": ["SecureLink", "Link"], + "linkURL": "https://example-certifier.com/evidence/1234567.json", + "hashDigest": "6239119dda5bd4c8a6ffb832fe16feaa5c27b7dba154d24c53d4470a2c69adc2", + "hashMethod": "SHA-256", + "linkName": "Declaration link name", + "linkType": "https://test.uncefact.org/vocabulary/linkTypes/dcc", + "encryptionMethod": "AES" + } + }, + { + "type": ["Claim", "Declaration"], + "assessmentDate": "2024-04-25", + "declaredValue": [ + { + "type": ["Metric"], + "metricName": "GHG emissions intensity", + "metricValue": { "value": 1.5, "unit": "kg" }, + "score": "1.2", + "accuracy": 0.8 + }, + { + "type": ["Metric"], + "metricName": "GHG emissions intensity", + "metricValue": { "value": 1.5, "unit": "kg" }, + "score": "1.2", + "accuracy": 0.8 + } + ], + "id": "https://products.example-company.com/09520123456788/declarations/12345", + "referenceStandard": { + "type": ["Standard"], + "id": "https://www.iso.org/standard/60857.html", + "name": "Standard", + "issuingParty": { + "type": ["Identifier"], + "id": "https://iso.org/issuing-party/123", + "name": "International Organization" + }, + "issueDate": "2023-12-05" + }, + "referenceRegulation": { + "type": ["Regulation"], + "id": "https://www.legislation.gov.au/F2008L02309/latest/versions", + "name": "National Greenhouse", + "jurisdictionCountry": "Australia", + "administeredBy": { + "type": ["Identifier"], + "id": "https://gov.au/admin-body/12345", + "name": "Australian Government" + }, + "effectiveDate": "2024-03-20" + }, + "assessmentCriteria": [ + { + "type": ["Criterion"], + "id": "https://www.globalbattery.org/media/publications/gba-rulebook-v2.0-master.pdf#BatteryAssembly", + "name": "Battery Assembly Guidelines", + "thresholdValues": [ + { + "type": ["Metric"], + "metricName": "Minimum compressive strength", + "metricValue": { "value": 500, "unit": "MPA" } + } + ] + } + ], + "conformance": false, + "conformityTopic": "environment.energy", + "conformityEvidence": { + "type": ["SecureLink", "Link"], + "linkURL": "https://example-certifier.com/evidence/1234567.json", + "hashDigest": "6239119dda5bd4c8a6ffb832fe16feaa5c27b7dba154d24c53d4470a2c69adc2", + "hashMethod": "SHA-256", + "linkName": "Declaration link name", + "linkType": "https://test.uncefact.org/vocabulary/linkTypes/dcc", + "encryptionMethod": "AES" + } + }, + { + "type": ["Claim", "Declaration"], + "assessmentDate": "2024-04-25", + "declaredValue": [ + { + "type": ["Metric"], + "metricName": "GHG emissions intensity", + "metricValue": { "value": 1.5, "unit": "kg" }, + "score": "1.2", + "accuracy": 0.8 + }, + { + "type": ["Metric"], + "metricName": "GHG emissions intensity", + "metricValue": { "value": 1.5, "unit": "kg" }, + "score": "1.2", + "accuracy": 0.8 + } + ], + "id": "https://products.example-company.com/09520123456788/declarations/12345", + "referenceStandard": { + "type": ["Standard"], + "id": "https://www.iso.org/standard/60857.html", + "name": "Standard", + "issuingParty": { + "type": ["Identifier"], + "id": "https://iso.org/issuing-party/123", + "name": "International Organization" + }, + "issueDate": "2023-12-05" + }, + "referenceRegulation": { + "type": ["Regulation"], + "id": "https://www.legislation.gov.au/F2008L02309/latest/versions", + "name": "National Greenhouse", + "jurisdictionCountry": "Australia", + "administeredBy": { + "type": ["Identifier"], + "id": "https://gov.au/admin-body/12345", + "name": "Australian Government" + }, + "effectiveDate": "2024-03-20" + }, + "assessmentCriteria": [ + { + "type": ["Criterion"], + "id": "https://www.globalbattery.org/media/publications/gba-rulebook-v2.0-master.pdf#BatteryAssembly", + "name": "Battery Assembly Guidelines", + "thresholdValues": [ + { + "type": ["Metric"], + "metricName": "Minimum compressive strength", + "metricValue": { "value": 500, "unit": "MPA" } + } + ] + } + ], + "conformance": false, + "conformityTopic": "environment.energy", + "conformityEvidence": { + "type": ["SecureLink", "Link"], + "linkURL": "https://example-certifier.com/evidence/1234567.json", + "hashDigest": "6239119dda5bd4c8a6ffb832fe16feaa5c27b7dba154d24c53d4470a2c69adc2", + "hashMethod": "SHA-256", + "linkName": "Declaration link name", + "linkType": "https://test.uncefact.org/vocabulary/linkTypes/dcc", + "encryptionMethod": "AES" + } + }, + { + "type": ["Claim", "Declaration"], + "assessmentDate": "2024-04-25", + "declaredValue": [ + { + "type": ["Metric"], + "metricName": "GHG emissions intensity", + "metricValue": { "value": 1.5, "unit": "kg" }, + "score": "1.2", + "accuracy": 0.8 + }, + { + "type": ["Metric"], + "metricName": "GHG emissions intensity", + "metricValue": { "value": 1.5, "unit": "kg" }, + "score": "1.2", + "accuracy": 0.8 + } + ], + "id": "https://products.example-company.com/09520123456788/declarations/12345", + "referenceStandard": { + "type": ["Standard"], + "id": "https://www.iso.org/standard/60857.html", + "name": "Standard", + "issuingParty": { + "type": ["Identifier"], + "id": "https://iso.org/issuing-party/123", + "name": "International Organization" + }, + "issueDate": "2023-12-05" + }, + "referenceRegulation": { + "type": ["Regulation"], + "id": "https://www.legislation.gov.au/F2008L02309/latest/versions", + "name": "National Greenhouse", + "jurisdictionCountry": "Australia", + "administeredBy": { + "type": ["Identifier"], + "id": "https://gov.au/admin-body/12345", + "name": "Australian Government" + }, + "effectiveDate": "2024-03-20" + }, + "assessmentCriteria": [ + { + "type": ["Criterion"], + "id": "https://www.globalbattery.org/media/publications/gba-rulebook-v2.0-master.pdf#BatteryAssembly", + "name": "Battery Assembly Guidelines", + "thresholdValues": [ + { + "type": ["Metric"], + "metricName": "Minimum compressive strength", + "metricValue": { "value": 500, "unit": "MPA" } + } + ] + } + ], + "conformance": false, + "conformityTopic": "environment.energy", + "conformityEvidence": { + "type": ["SecureLink", "Link"], + "linkURL": "https://example-certifier.com/evidence/1234567.json", + "hashDigest": "6239119dda5bd4c8a6ffb832fe16feaa5c27b7dba154d24c53d4470a2c69adc2", + "hashMethod": "SHA-256", + "linkName": "Declaration link name", + "linkType": "https://test.uncefact.org/vocabulary/linkTypes/dcc", + "encryptionMethod": "AES" + } + }, + { + "type": ["Claim", "Declaration"], + "assessmentDate": "2024-04-25", + "declaredValue": [ + { + "type": ["Metric"], + "metricName": "GHG emissions intensity", + "metricValue": { "value": 1.5, "unit": "kg" }, + "score": "1.2", + "accuracy": 0.8 + }, + { + "type": ["Metric"], + "metricName": "GHG emissions intensity", + "metricValue": { "value": 1.5, "unit": "kg" }, + "score": "1.2", + "accuracy": 0.8 + } + ], + "id": "https://products.example-company.com/09520123456788/declarations/12345", + "referenceStandard": { + "type": ["Standard"], + "id": "https://www.iso.org/standard/60857.html", + "name": "Standard", + "issuingParty": { + "type": ["Identifier"], + "id": "https://iso.org/issuing-party/123", + "name": "International Organization" + }, + "issueDate": "2023-12-05" + }, + "referenceRegulation": { + "type": ["Regulation"], + "id": "https://www.legislation.gov.au/F2008L02309/latest/versions", + "name": "National Greenhouse", + "jurisdictionCountry": "Australia", + "administeredBy": { + "type": ["Identifier"], + "id": "https://gov.au/admin-body/12345", + "name": "Australian Government" + }, + "effectiveDate": "2024-03-20" + }, + "assessmentCriteria": [ + { + "type": ["Criterion"], + "id": "https://www.globalbattery.org/media/publications/gba-rulebook-v2.0-master.pdf#BatteryAssembly", + "name": "Battery Assembly Guidelines", + "thresholdValues": [ + { + "type": ["Metric"], + "metricName": "Minimum compressive strength", + "metricValue": { "value": 500, "unit": "MPA" } + } + ] + } + ], + "conformance": false, + "conformityTopic": "environment.energy", + "conformityEvidence": { + "type": ["SecureLink", "Link"], + "linkURL": "https://example-certifier.com/evidence/1234567.json", + "hashDigest": "6239119dda5bd4c8a6ffb832fe16feaa5c27b7dba154d24c53d4470a2c69adc2", + "hashMethod": "SHA-256", + "linkName": "Declaration link name", + "linkType": "https://test.uncefact.org/vocabulary/linkTypes/dcc", + "encryptionMethod": "AES" + } + } + ], + "circularityScorecard": { + "type": ["CircularityPerformance"], + "recyclingInformation": { + "type": ["Link"], + "linkURL": "https://example-company.com/recycling/1234567", + "linkName": "Recycling Information" + }, + "repairInformation": { + "type": ["Link"], + "linkURL": "https://example-company.com/repair/1234567", + "linkName": "Repair Instructions" + }, + "recyclableContent": 67, + "recycledContent": 86, + "utilityFactor": 1.2, + "materialCircularityIndicator": 0.67 + }, + "emissionsScorecard": { + "type": ["EmissionsPerformance"], + "carbonFootprint": 12.5, + "declaredUnit": "kg", + "operationalScope": "CradleToGate", + "primarySourcedRatio": 75, + "reportingStandard": { + "type": ["Standard"], + "id": "https://www.ifrs.org/standards/issb/s2", + "name": "WBSCD Pathfinder framework - V.2.0", + "issuingParty": { + "type": ["Identifier"], + "id": "https://id.ifrs.org/issuing-party/123", + "name": "International Financial Reporting Standards Foundation", + "registeredId": "90664869327", + "idScheme": { + "type": ["IdentifierScheme"], + "id": "https://id.ifrs.org/issuing-party/", + "name": "IFRS Issuing Party" + } + }, + "issueDate": "2024-04-25" + } + }, + "traceabilityInformation": { + "valueChainProcess": "Spinning", + "verifiedRatio": 0.5, + "traceabilityEvent": [ + { + "linkURL": "https://files.example-certifier.com/1234567.json", + "linkName": "Object Event", + "linkType": "https://test.uncefact.org/vocabulary/linkTypes/dcc", + "hashDigest": "6239119", + "hashMethod": "SHA-256", + "encryptionMethod": "AES" + }, + { + "linkURL": "https://files.example-certifier.com/1234567.json", + "linkName": "Transformation Event", + "linkType": "https://test.uncefact.org/vocabulary/linkTypes/dcc", + "hashDigest": "6239119", + "hashMethod": "SHA-256", + "encryptionMethod": "AES" + }, + { + "linkURL": "https://files.example-certifier.com/1234567.json", + "linkName": "Transaction Event", + "linkType": "https://test.uncefact.org/vocabulary/linkTypes/dcc", + "hashDigest": "6239119", + "hashMethod": "SHA-256", + "encryptionMethod": "AES" + }, + { + "linkURL": "https://files.example-certifier.com/1234567.json", + "linkName": "Aggregation Event", + "linkType": "https://test.uncefact.org/vocabulary/linkTypes/dcc", + "hashDigest": "6239119", + "hashMethod": "SHA-256", + "encryptionMethod": "AES" + }, + { + "linkURL": "https://files.example-certifier.com/1234567.json", + "linkName": "Association Event", + "linkType": "https://test.uncefact.org/vocabulary/linkTypes/dcc", + "hashDigest": "6239119", + "hashMethod": "SHA-256", + "encryptionMethod": "AES" + }, + { + "linkURL": "https://files.example-certifier.com/1234567.json", + "linkName": "Object Event", + "linkType": "https://test.uncefact.org/vocabulary/linkTypes/dcc", + "hashDigest": "6239119", + "hashMethod": "SHA-256", + "encryptionMethod": "AES" + } + ] + } + }, + "constructData": { + "mappingFields": [], + "dummyFields": [], + "generationFields": [ + { + "path": "/eventID", + "handler": "generateIdWithSerialNumber" + } + ] + }, + "className": "json-form", + "style": { + "margin": "40px auto", + "paddingTop": "40px", + "width": "80%" + } + } + }, + { + "name": "CustomButton", + "type": "Submit", + "props": {} + }, + { + "name": "BarcodeGenerator", + "type": "Result", + "props": { + "dataPath": { + "primary": { + "ai": "01", + "path": "/decodedEnvelopedVC/credentialSubject/registeredId" + } + } + } + } + ], + "services": [ + { + "name": "processDPP", + "parameters": [ + { + "vckit": { + "vckitAPIUrl": "http://localhost:3332/v2", + "issuer": { + "id": "did:web:6028-115-79-212-164.ngrok-free.app", + "name": "Orchard Facility" + }, + "headers": { + "Authorization": "Bearer test123" + } + }, + "dpp": { + "context": ["https://vocabulary.uncefact.org/untp/dpp/0.5.0/"], + "renderTemplate": [ + { + "template": " Digital Product Passport

PRODUCT PASSPORT

{{credentialSubject.name}}

{{credentialSubject.description}}
{{#each credentialSubject.furtherInformation}} {{linkName}} {{/each}}
{{#if credentialSubject.characteristic}}
Characteristics
{{#each credentialSubject.characteristic}}
{{@key}}

{{this}}

{{/each}}
{{/if}}

Circularity Scorecard

The circularity Scorecard provides a simple high level summary of circularity performance of the product.

{{credentialSubject.circularityScorecard.recyclableContent}}%

Recyclable content

{{credentialSubject.circularityScorecard.recycledContent}}%

Recycled content

{{credentialSubject.circularityScorecard.utilityFactor}}

Utility factor

{{credentialSubject.circularityScorecard.materialCircularityIndicator}}

Material circularity*

*The Material Circularity Indicator provides an overall circularity score which is a function of all three of the earlier measures.

Emissions Scorecard

The Emissions Scorecard gives a clear snapshot of the product's greenhouse gas (GHG) emissions performance, providing a single indicator to assess its overall environmental impact.

{{credentialSubject.emissionsScorecard.carbonFootprint}}{{credentialSubject.emissionsScorecard.declaredUnit}}

Co2Eq

Scope includes

{{credentialSubject.emissionsScorecard.operationalScope}}

Primary sourced ratio*

{{credentialSubject.emissionsScorecard.primarySourcedRatio}}% primary sources

Issue date

{{credentialSubject.emissionsScorecard.reportingStandard.issueDate}}

*

The Primary Sourced Ratio shows the percentage of scope 3 emissions data that is directly collected from actual sources, rather than being based on estimates.

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}}
Production
Product category

{{#each credentialSubject.productCategory}}{{name}}{{#unless @last}},{{/unless}} {{/each}}

Date produced

{{credentialSubject.productionDate}}

Country

{{credentialSubject.countryOfProduction}}

Dimensions

Weight: {{credentialSubject.dimensions.weight.value}}{{credentialSubject.dimensions.weight.unit}} Length: {{credentialSubject.dimensions.length.value}}{{credentialSubject.dimensions.length.unit}} Width: {{credentialSubject.dimensions.width.value}}{{credentialSubject.dimensions.width.unit}} Height: {{credentialSubject.dimensions.height.value}}{{credentialSubject.dimensions.height.unit}} Volume: {{credentialSubject.dimensions.volume.value}}{{credentialSubject.dimensions.volume.unit}}

Product composition

A complete list of materials that make up the composition of this product.

{{#each credentialSubject.materialsProvenance}}

{{massFraction}}%

{{massAmount.value}}{{massAmount.unit}} {{name}}

Recycled {{recycledAmount}}%

Hazard {{#if hazardous}}Yes{{else}}No{{/if}}

{{materialSafetyInformation.linkName}}
{{originCountry}}
{{/each}}

History

{{!-- start: Supply chain due diligence report --}}
Supply chain due diligence report
{{!-- end: Supply chain due diligence report --}}

{{credentialSubject.traceabilityInformation.valueChainProcess}}

Verified ratio {{credentialSubject.traceabilityInformation.verifiedRatio}}

{{#each credentialSubject.traceabilityInformation.traceabilityEvent}}
{{linkName}} View
{{/each}}

Passport issued by

Organisation

{{issuer.name}}

Registered ID {{issuer.id}}
Valid from

{{validFrom}}

Valid to

{{validUntil}}

This Digital Product Passport (DPP) is a digital record of the product's sustainability and environmental performance, ensuring transparency and accountability in line with UNTP standards. The DPP can be verified at any time using the QR code or visiting www.untp-certification.org with the passport ID.

PRODUCT PASSPORT
{{credentialSubject.name}}
Batch: {{credentialSubject.batchNumber}}
Serial: {{credentialSubject.serialNumber}}

{{credentialSubject.description}}

{{#each credentialSubject.furtherInformation}}
{{linkName}}
{{/each}}
{{#if credentialSubject.characteristic}}
Characteristics
{{#each credentialSubject.characteristic}}
{{@key}}
{{this}}
{{/each}}
{{/if}}
Circularity Scorecard

The circularity Scorecard provides a simple high level summary of circularity performance of the product.

{{credentialSubject.circularityScorecard.recyclableContent}}%
Recyclable content
{{credentialSubject.circularityScorecard.recycledContent}}%
Recycled content
{{credentialSubject.circularityScorecard.utilityFactor}}
Utility factor
{{credentialSubject.circularityScorecard.materialCircularityIndicator}}
Material circularity*

*The Material Circularity Indicator provides an overall circularity score which is a function of all three of the earlier measures.

Emissions Scorecard

The Emissions Scorecard gives a clear snapshot of the product's greenhouse gas (GHG) emissions performance, providing a single indicator to assess its overall environmental impact.

{{credentialSubject.emissionsScorecard.carbonFootprint}}{{credentialSubject.emissionsScorecard.declaredUnit}}

Co2Eq

Scope includes
{{credentialSubject.emissionsScorecard.operationalScope}}
Primary sourced ratio*
{{credentialSubject.emissionsScorecard.primarySourcedRatio}}% primary sources

The Primary Sourced Ratio shows the percentage of scope 3 emissions data that is directly collected from actual sources, rather than being based on estimates.

Issue date
{{credentialSubject.emissionsScorecard.reportingStandard.issueDate}}
*
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}}
Production
Product category
{{#each credentialSubject.productCategory}}{{name}}{{#unless @last}},{{/unless}} {{/each}}
Date produced
{{credentialSubject.productionDate}}
Country
{{credentialSubject.countryOfProduction}}
Dimensions
Weight: {{credentialSubject.dimensions.weight.value}}{{credentialSubject.dimensions.weight.unit}} Length: {{credentialSubject.dimensions.length.value}}{{credentialSubject.dimensions.length.unit}} Width: {{credentialSubject.dimensions.width.value}}{{credentialSubject.dimensions.width.unit}} Height: {{credentialSubject.dimensions.height.value}}{{credentialSubject.dimensions.height.unit}} Volume: {{credentialSubject.dimensions.volume.value}}{{credentialSubject.dimensions.volume.unit}}
Composition

The Product Composition List details the materials and components used in the product, providing transparency on the origin and nature of each element.

{{#each credentialSubject.materialsProvenance}}
{{massFraction}}%
{{massAmount.value}}{{massAmount.unit}} {{name}}
Recycled {{#if recycledAmount}}{{recycledAmount}}{{else}}0{{/if}}%
Hazard {{#if hazardous}}Yes{{else}}No{{/if}}
{{originCountry}}
{{/each}}
History
{{!-- start: Supply chain due diligence report --}}
Supply chain due diligence report
{{!-- end: Supply chain due diligence report --}}

{{credentialSubject.traceabilityInformation.valueChainProcess}}

Verified ratio {{credentialSubject.traceabilityInformation.verifiedRatio}}

{{#each credentialSubject.traceabilityInformation.traceabilityEvent}}
{{linkName}} View
{{/each}}
Passport issued by
Organisation
{{issuer.name}}
Registered ID
Valid from
{{validFrom}}
Valid to
{{validUntil}}

This Digital Product Passport (DPP) is a digital record of the product’s sustainability and environmental performance, ensuring transparency and accountability in line with UNTP standards. The DPP can be verified at any time using the QR code or visiting www.untp-certification.org with the passport ID.

", + "@type": "WebRenderingTemplate2022" + } + ], + "type": ["DigitalProductPassport"], + "dlrLinkTitle": "Cherries Product Passport", + "dlrVerificationPage": "http://localhost:3003/verify" + }, + "dlr": { + "dlrAPIUrl": "http://localhost:3000", + "dlrAPIKey": "test123", + "namespace": "nlis", + "linkRegisterPath": "/api/resolver" + }, + "storage": { + "url": "http://localhost:3334/v1/documents", + "params": { + "resultPath": "/uri", + "bucket": "verifiable-credentials" + }, + "options": { + "method": "POST", + "headers": { + "Content-Type": "application/json" + } + } + }, + "identifierKeyPath": { + "primary": { + "ai": "01", + "path": "/registeredId" + } + } + } + ] + } + ] + }, + { + "name": "Move to Next Facility", + "id": "transaction_product", + "components": [ + { + "name": "LocalStorageLoader", + "type": "EntryData", + "props": { + "storageKey": "CherriesFarm_dpps", + "nestedComponents": [ + { + "name": "JsonForm", + "type": "EntryData", + "props": { + "schema": { + "url": "https://jargon.sh/user/unece/traceabilityEvents/v/working/artefacts/jsonSchemas/TransactionEvent.json?class=TransactionEvent" + } + }, + "constructData": { + "mappingFields": [ + { + "sourcePath": "/decodedEnvelopedVC/credentialSubject/id", + "destinationPath": "/epcList/index/name" + }, + { + "sourcePath": "/linkResolver", + "destinationPath": "/epcList/index/id" + }, + { + "sourcePath": "/decodedEnvelopedVC/credentialSubject/name", + "destinationPath": "/quantityList/0/productName" + }, + { + "sourcePath": "/linkResolver", + "destinationPath": "/quantityList/0/productId" + } + ], + "dummyFields": [ + { + "path": "/type", + "data": ["TransactionEvent", "Event"] + }, + { + "path": "/id", + "data": "https://events.sample.com/01/09359502000034/21/123456" + }, + { + "path": "/processType", + "data": "Weaving" + }, + { + "path": "/eventTime", + "data": "2024-09-01T12:00:00" + }, + { + "path": "/action", + "data": "add" + }, + { + "path": "/disposition", + "data": "https://ref.gs1.org/cbv/Disp-active" + }, + { + "path": "/bizStep", + "data": "https://ref.gs1.org/cbv/BizStep-commissioning" + }, + { + "path": "/bizLocation", + "data": "https://id.gs1.org/414/9520123456788" + }, + { + "path": "/sensorElementList/0/sensorMetadata/device/type", + "data": ["Item"] + }, + { + "path": "/sensorElementList/0/sensorMetadata/device/id", + "data": "https://id.gs1.org/01/09520123456788/21/12345" + }, + { + "path": "/sensorElementList/0/sensorMetadata/device/name", + "data": "EV battery 300Ah." + }, + { + "path": "/sensorElementList/0/sensorMetadata/dataProcessingMethod", + "data": "https://standards.org/sensorMethod#1234" + }, + { + "path": "/sensorElementList/0/sensorReport/0/time", + "data": "2024-07-24T12:00:00" + }, + { + "path": "/sensorElementList/0/sensorReport/0/sensorType", + "data": "https://samplesensors.com/model1234" + }, + { + "path": "/sensorElementList/0/sensorReport/0/value", + "data": 25 + }, + { + "path": "/sensorElementList/0/sensorReport/0/uom", + "data": "KGM" + }, + { + "path": "/sensorElementList/0/sensorIntegrityProof", + "data": "https://jargon.sh" + }, + { + "path": "/sourcePartyId", + "data": "https://abr.business.gov.au/ABN/View?abn=90664869327" + }, + { + "path": "/destinationPartyId", + "data": "https://abr.business.gov.au/ABN/View?abn=90664869327" + }, + { + "path": "/bizTransaction", + "data": "https://ref.gs1.org/cbv/BTT-prodorder" + }, + { + "path": "/epcList/0/type", + "data": ["Item"] + }, + { + "path": "/quantityList/0/quantity", + "data": 20 + }, + { + "path": "/quantityList/0/uom", + "data": "KGM" + } + ], + "generationFields": [ + { + "path": "/eventTime", + "handler": "generateCurrentDatetime" + } + ] + } + } + ] + } + }, + { + "name": "CustomButton", + "type": "Submit", + "props": { + "includeDownload": true, + "downloadFileName": "transaction" + } + } + ], + "services": [ + { "name": "convertObjectToArray1Item", "parameters": [{ "path": "/data" }] }, + { + "name": "processTransactionEvent", + "parameters": [ + { + "vckit": { + "vckitAPIUrl": "http://localhost:3332/v2", + "issuer": { + "id": "did:web:6028-115-79-212-164.ngrok-free.app", + "name": "Orchard Facility" + }, + "headers": { + "Authorization": "Bearer test123" + } + }, + "traceabilityEvent": { + "context": ["https://vocabulary.uncefact.org/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": "Transaction 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": { + "resultPath": "/uri", + "bucket": "verifiable-credentials" + }, + "options": { + "method": "POST", + "headers": { + "Content-Type": "application/json" + } + } + }, + "identifierKeyPath": "/0/id", + "localStorageParams": { "storageKey": "CherriesFarm_dpps", "keyPath": "/0/epcList/index/name" } + } + ] + }, + { + "name": "mergeToLocalStorage", + "parameters": [ + { + "storageKey": "orchard_facility_transaction_event", + "objectKeyPath": "/decodedEnvelopedVC/credentialSubject/0/id" + } + ] + } + ] + }, + { + "name": "Issue traceability Event", + "id": "issue_traceability_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. " + }, + "Event": { + "type": "object", + "oneOf": [ + { + "$ref": "#/$defs/TransformationEvent" + }, + { + "$ref": "#/$defs/ObjectEvent" + }, + { + "$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": ["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." + }, + "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" + } + ], + "outputEPCList": [ + { + "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." + } + ], + "inputEPCList": [ + { + "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." + } + ], + "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" + } + ] + } + ], + "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:6028-115-79-212-164.ngrok-free.app", + "name": "Orchard Facility" + }, + "headers": { + "Authorization": "Bearer test123" + } + }, + "traceabilityEvent": { + "context": ["https://vocabulary.uncefact.org/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": { + "resultPath": "/uri", + "bucket": "verifiable-credentials" + }, + "options": { + "method": "POST", + "headers": { + "Content-Type": "application/json" + } + } + }, + "identifierKeyPath": "/0/id", + "eventTypePath": "/0/type/0" + } + ] + } + ] + }, + { + "name": "Issue Object Event", + "id": "issue_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." + }, + "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": "/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:6028-115-79-212-164.ngrok-free.app", + "name": "Orchard Facility" + }, + "headers": { + "Authorization": "Bearer test123" + } + }, + "traceabilityEvent": { + "context": ["https://vocabulary.uncefact.org/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": { + "resultPath": "/uri", + "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." + }, + "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": [], + "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:6028-115-79-212-164.ngrok-free.app", + "name": "Orchard Facility" + }, + "headers": { + "Authorization": "Bearer test123" + } + }, + "traceabilityEvent": { + "context": ["https://vocabulary.uncefact.org/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": { + "resultPath": "/uri", + "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." + }, + "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": [], + "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:6028-115-79-212-164.ngrok-free.app", + "name": "Orchard Facility" + }, + "headers": { + "Authorization": "Bearer test123" + } + }, + "traceabilityEvent": { + "context": ["https://vocabulary.uncefact.org/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": { + "resultPath": "/uri", + "bucket": "verifiable-credentials" + }, + "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." + }, + "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" + } + ], + "outputEPCList": [ + { + "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." + } + ], + "inputEPCList": [ + { + "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." + } + ], + "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" + } + ] + }, + "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": "processTransformationEventOnly", + "parameters": [ + { + "vckit": { + "vckitAPIUrl": "http://localhost:3332/v2", + "issuer": { + "id": "did:web:6028-115-79-212-164.ngrok-free.app", + "name": "Orchard Facility" + }, + "headers": { + "Authorization": "Bearer test123" + } + }, + "traceabilityEvent": { + "context": ["https://vocabulary.uncefact.org/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": { + "resultPath": "/uri", + "bucket": "verifiable-credentials" + }, + "options": { + "method": "POST", + "headers": { + "Content-Type": "application/json" + } + } + }, + "identifierKeyPath": "/0/id" + } + ] + } + ] + }, + { + "name": "Issue DCC", + "id": "produce_product", + "components": [ + { + "name": "JsonForm", + "type": "EntryData", + "props": { + "schema": { + "url": "https://jargon.sh/user/unece/ConformityCredential/v/working/artefacts/jsonSchemas/ConformityAttestation.json?class=ConformityAttestation" + }, + "data": { + "type": ["ConformityAttestation", "Attestation"], + "id": "https://exampleCAB.com/01/09359502000034", + "name": "Conformity attestation Name e.g. Product GHG Footprint certificate in accordance with GBA Rulebook.", + "assessorLevel": "Self", + "assessmentLevel": "GovtApproval", + "attestationType": "certification", + "description": "Attestation description SampleCAB Inc attests that the product class LiFePO4 EV batteries manufactured at Sample battery facility have reported GHG foorptint that conform to the GBA rulebook version 1.5.", + "issuedToParty": { + "type": ["Party"], + "id": "https://abr.business.gov.au/ABN/View?abn=90664869327", + "name": "ABC Example Company PTY LTD", + "registeredId": "90664869327", + "idScheme": { + "type": ["IdentifierScheme"], + "id": "https://id.gs1.org/01/", + "name": "Global Trade Identification Number (GTIN)" + }, + "description": "A leading electric energy storage company" + }, + "authorisation": [ + { + "type": ["Endorsement"], + "id": "https://authority.gov/schemeABC/123456789", + "name": "Endorsement name e.g. Accreditation of certifiers.com under the Australian National Greenhouse and Energy Reporting scheme (NGER)", + "trustmark": { + "type": ["BinaryFile"], + "fileName": "GHG protocol trust mark", + "fileType": "image/png", + "file": "iVBORw0KGgoAAAANSUhEUgAAADkAAAA2CAYAAAB9TjFQAAAABGdBTUEAAi/9H3pWy6vI9uFdAAAAAElFTkSuQmCC" + }, + "issuingAuthority": { + "type": ["Identifier"], + "id": "https://id.gs1.org/01/09520123456788/21/12345", + "name": "Authorising Entity", + "registeredId": "12345", + "idScheme": { + "type": ["IdentifierScheme"], + "id": "https://id.gs1.org/01/", + "name": "Global Trade Identification Number (GTIN)" + } + }, + "endorsementEvidence": { + "type": ["Link"], + "linkURL": "https://files.example-certifier.com/1234567.json", + "linkName": "GBA rule book conformity certificate", + "linkType": "https://test.uncefact.org/vocabulary/linkTypes/dcc" + } + }, + { + "type": ["Endorsement"], + "id": "https://authority.gov/schemeABC/123456789", + "name": "Endorsement name e.g. Accreditation of certifiers.com under the Australian National Greenhouse and Energy Reporting scheme (NGER)", + "trustmark": { + "type": ["BinaryFile"], + "fileName": "GHG protocol trust mark", + "fileType": "image/png", + "file": "iVBORw0KGgoAAAANSUhEUgAAADkAAAA2CAYAAAB9TjFQAAAABGdBTUEAAi/9H3pWy6vI9uFdAAAAAElFTkSuQmCC" + }, + "issuingAuthority": { + "type": ["Identifier"], + "id": "https://id.gs1.org/01/09520123456788/21/12345", + "name": "Authorising Entity", + "registeredId": "12345", + "idScheme": { + "type": ["IdentifierScheme"], + "id": "https://id.gs1.org/01/", + "name": "Global Trade Identification Number (GTIN)" + } + }, + "endorsementEvidence": { + "type": ["Link"], + "linkURL": "https://files.example-certifier.com/1234567.json", + "linkName": "GBA rule book conformity certificate", + "linkType": "https://test.uncefact.org/vocabulary/linkTypes/dcc" + } + } + ], + "conformityCertificate": { + "type": ["SecureLink", "Link"], + "linkURL": "https://files.example-certifier.com/1234567.json", + "linkName": "GBA rule book conformity certificate", + "linkType": "https://test.uncefact.org/vocabulary/linkTypes/dcc", + "hashDigest": "6239119dda5bd4c8a6ffb832fe16feaa5c27b7dba154d24c53d4470a2c69adc2", + "hashMethod": "SHA-256", + "encryptionMethod": "none" + }, + "auditableEvidence": { + "type": ["SecureLink", "Link"], + "linkURL": "https://files.example-certifier.com/1234567.json", + "linkName": "GBA rule book conformity certificate", + "linkType": "https://test.uncefact.org/vocabulary/linkTypes/dcc", + "hashDigest": "6239119dda5bd4c8a6ffb832fe16feaa5c27b7dba154d24c53d4470a2c69adc2", + "hashMethod": "SHA-256", + "encryptionMethod": "none" + }, + "scope": { + "type": ["ConformityAssessmentScheme", "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": "12345", + "idScheme": { + "type": ["IdentifierScheme"], + "id": "https://id.gs1.org/01/", + "name": "Global Trade Identification Number (GTIN)" + } + }, + "issueDate": "2023-12-05", + "trustmark": { + "type": ["BinaryFile"], + "fileName": "GHG protocol trust mark", + "fileType": "image/png", + "file": "iVBORw0KGgoAAAANSUhEUgAAADkAAAA2CAYAAAB9TjFQAAAABGdBTUEAAi/9H3pWy6vI9uFdAAAAAElFTkSuQmCC" + } + }, + "assessment": [ + { + "type": ["ConformityAssessment", "Declaration"], + "assessmentDate": "2024-04-25", + "id": "https://exampleCAB.com/38f73303-a39e-45a7-b8b7-e73517548f27/01", + "referenceStandard": { + "type": ["Standard"], + "id": "https://www.globalbattery.org/media/publications/gba-rulebook-v2.0-master.pdf", + "name": "GBA Battery Passport", + "issuingParty": { + "type": ["Identifier"], + "id": "https://id.gs1.org/01/09520123456788/21/12345", + "name": "EV battery 300Ah.", + "registeredId": "12345", + "idScheme": { + "type": ["IdentifierScheme"], + "id": "https://id.gs1.org/01/", + "name": "Global Trade Identification Number (GTIN)" + } + }, + "issueDate": "2023-12-05" + }, + "referenceRegulation": { + "type": ["Regulation"], + "id": "https://www.legislation.gov.au/F2008L02309/latest/versions", + "name": "National Greenhouse", + "jurisdictionCountry": "AU", + "administeredBy": { + "type": ["Identifier"], + "id": "https://id.gs1.org/01/09520123456788/21/12345", + "name": "EV battery 300Ah.", + "registeredId": "12345", + "idScheme": { + "type": ["IdentifierScheme"], + "id": "https://id.gs1.org/01/", + "name": "Global Trade Identification Number (GTIN)" + } + }, + "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": [ + { + "type": ["Metric"], + "metricName": "emissions intensity", + "metricValue": { + "type": ["Measure"], + "value": 1.8, + "unit": "kg" + }, + "score": "BB", + "accuracy": 0.05 + }, + { + "type": ["Metric"], + "metricName": "emissions footprint", + "metricValue": { + "type": ["Measure"], + "value": 12, + "unit": "kg" + }, + "score": "BB", + "accuracy": 0.05 + } + ] + }, + { + "type": ["Criterion"], + "id": "https://www.globalbattery.org/media/publications/gba-rulebook-v2.0-master.pdf#BatteryAssembly", + "name": "Other battery assessment criteria rulebook", + "thresholdValues": [ + { + "type": ["Metric"], + "metricName": "emissions intensity", + "metricValue": { + "type": ["Measure"], + "value": 1.8, + "unit": "kg" + }, + "score": "BB", + "accuracy": 0.05 + }, + { + "type": ["Metric"], + "metricName": "emissions footprint", + "metricValue": { + "type": ["Measure"], + "value": 12, + "unit": "kg" + }, + "score": "BB", + "accuracy": 0.05 + } + ] + } + ], + "declaredValue": [ + { + "type": ["Metric"], + "metricName": "emissions intensity", + "metricValue": { + "type": ["Measure"], + "value": 10, + "unit": "kg" + }, + "score": "BB", + "accuracy": 0.05 + }, + { + "type": ["Metric"], + "metricName": "emissions footprint", + "metricValue": { + "type": ["Measure"], + "value": 10, + "unit": "kg" + }, + "score": "BB", + "accuracy": 0.05 + } + ], + "conformance": true, + "conformityTopic": "environment.energy", + "assessedProduct": [ + { + "type": ["Product"], + "id": "https://id.gs1.org/01/09520123456788/21/12345", + "name": "EV battery 300Ah.", + "registeredId": "09520123456788.21.12345", + "idScheme": { + "type": ["IdentifierScheme"], + "id": "https://id.gs1.org/01/", + "name": "Global Trade Identification Number (GTIN)" + }, + "serialNumber": "12345678", + "batchNumber": "6789", + "IDverifiedByCAB": true + }, + { + "type": ["Product"], + "id": "https://id.gs1.org/01/09520123456788/21/12345", + "name": "EV battery 300Ah.", + "registeredId": "09520123456788.21.12345", + "idScheme": { + "type": ["IdentifierScheme"], + "id": "https://id.gs1.org/01/", + "name": "Global Trade Identification Number (GTIN)" + }, + "serialNumber": "12345678", + "batchNumber": "6789", + "IDverifiedByCAB": true + }, + { + "type": ["Product"], + "id": "https://id.gs1.org/01/09520123456788/21/12345", + "name": "EV battery 300Ah.", + "registeredId": "09520123456788.21.12345", + "idScheme": { + "type": ["IdentifierScheme"], + "id": "https://id.gs1.org/01/", + "name": "Global Trade Identification Number (GTIN)" + }, + "serialNumber": "12345678", + "batchNumber": "6789", + "IDverifiedByCAB": true + } + ], + "assessedFacility": [ + { + "type": ["Facility"], + "id": "https://sample-facility-register.com/1234567", + "name": "Greenacres battery factory", + "registeredId": "1234567", + "idScheme": { + "type": ["IdentifierScheme"], + "id": "https://id.gs1.org/01/", + "name": "Global Trade Identification Number (GTIN)" + }, + "locationInformation": { + "type": ["Location"], + "plusCode": "https://plus.codes/8CGRC78W+MM", + "geoLocation": { + "type": "Point", + "coordinates": [12.34, 56.78, 90.12] + }, + "geoBoundary": { + "type": "Polygon", + "coordinates": [[[12.34, 56.78, 90.12]]] + } + }, + "address": { + "type": ["Address"], + "streetAddress": "level 11, 15 London Circuit", + "postalCode": "2601", + "addressLocality": "Acton", + "addressRegion": "ACT", + "addressCountry": "AU" + }, + "IDverifiedByCAB": true + }, + { + "type": ["Facility"], + "id": "https://sample-facility-register.com/1234567", + "name": "Greenacres battery factory", + "registeredId": "1234567", + "idScheme": { + "type": ["IdentifierScheme"], + "id": "https://id.gs1.org/01/", + "name": "Global Trade Identification Number (GTIN)" + }, + "locationInformation": { + "type": ["Location"], + "plusCode": "https://plus.codes/8CGRC78W+MM", + "geoLocation": { + "type": "Point", + "coordinates": [12.34, 56.78, 90.12] + }, + "geoBoundary": { + "type": "Polygon", + "coordinates": [[[12.34, 56.78, 90.12]]] + } + }, + "address": { + "type": ["Address"], + "streetAddress": "level 11, 15 London Circuit", + "postalCode": "2601", + "addressLocality": "Acton", + "addressRegion": "ACT", + "addressCountry": "AU" + }, + "IDverifiedByCAB": true + }, + { + "type": ["Facility"], + "id": "https://sample-facility-register.com/1234567", + "name": "Greenacres battery factory", + "registeredId": "1234567", + "idScheme": { + "type": ["IdentifierScheme"], + "id": "https://id.gs1.org/01/", + "name": "Global Trade Identification Number (GTIN)" + }, + "locationInformation": { + "type": ["Location"], + "plusCode": "https://plus.codes/8CGRC78W+MM", + "geoLocation": { + "type": "Point", + "coordinates": [12.34, 56.78, 90.12] + }, + "geoBoundary": { + "type": "Polygon", + "coordinates": [[[12.34, 56.78, 90.12]]] + } + }, + "address": { + "type": ["Address"], + "streetAddress": "level 11, 15 London Circuit", + "postalCode": "2601", + "addressLocality": "Acton", + "addressRegion": "ACT", + "addressCountry": "AU" + }, + "IDverifiedByCAB": true + } + ], + "assessedOrganisation": { + "type": ["Party"], + "id": "https://abr.business.gov.au/ABN/View?abn=90664869327", + "name": "Sample Company Pty Ltd.", + "registeredId": "90664869327", + "idScheme": { + "type": ["IdentifierScheme"], + "id": "https://id.gs1.org/01/", + "name": "Global Trade Identification Number (GTIN)" + }, + "description": "A leading electric energy storage company" + }, + "auditor": { + "type": ["Party"], + "id": "https://abr.business.gov.au/ABN/View?abn=90664869327", + "name": "Auditor Name", + "registeredId": "90664869327", + "idScheme": { + "type": ["IdentifierScheme"], + "id": "https://id.gs1.org/01/", + "name": "Global Trade Identification Number (GTIN)" + }, + "description": "A leading electric energy storage company" + } + } + ] + }, + "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": "processDigitalConformityCredential", + "parameters": [ + { + "vckit": { + "vckitAPIUrl": "http://localhost:3332/v2", + "issuer": { + "id": "did:web:6028-115-79-212-164.ngrok-free.app", + "name": "Orchard Facility" + }, + "headers": { + "Authorization": "Bearer test123" + } + }, + "digitalConformityCredential": { + "context": ["https://vocabulary.uncefact.org/untp/dcc/0.5.0/"], + "renderTemplate": [ + { + "template": " DigitalConformityCredential
CONFORMITY CREDENTIAL

{{credentialSubject.name}}

{{credentialSubject.description}}

Level of independent assurance:

{{credentialSubject.assessorLevel}}

Type of authority endorsement:

{{credentialSubject.assessmentLevel}}

Type of the attestation credential:

{{credentialSubject.attestationType}}
Assessments

The list of specific assessments made within this conformity attestation.

{{#each credentialSubject.assessment}}

{{conformityTopic}}

Declared values
{{#each declaredValue}}
Name
{{metricName}}
Value
{{metricValue.value}}{{metricValue.unit}}
Accuracy
{{accuracy}}
{{/each}}
Assessment Criteria
{{#each assessmentCriteria}}
{{name}}
    {{#each thresholdValues}}
  • Industry average {{metricName}} is {{metricValue.value}}{{metricValue.unit}}.

  • {{/each}}
{{/each}}
Assessed facilities
{{#each assessedFacility}}

{{name}}

{{/each}}
Assessed products
{{#each assessedProduct}}
{{name}}
{{/each}}
Other details
Assessed
{{assessmentDate}}
Organisation assessed
{{assessedOrganisation.name}}
{{/each}}
Issuer endorsement
{{#each credentialSubject.authorisation}}
trustmark
{{name}} is accredited by {{issuingAuthority.name}}.
{{/each}}
Issuing details
Issued by
Valid from
{{validFrom}}
Valid until
{{validUntil}}
", + "@type": "WebRenderingTemplate2022" + } + ], + "type": ["DigitalConformityCredential"], + "dlrLinkTitle": "DigitalConformityCredential", + "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": { + "resultPath": "/uri", + "bucket": "verifiable-credentials" + }, + "options": { + "method": "POST", + "headers": { + "Content-Type": "application/json" + } + } + }, + "identifierKeyPath": "/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)" + }, + { + "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)" + } + }, + { + "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] + }, + "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)" + } + }, + "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)" + } + }, + "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 + } + ] + }, + { + "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" + }, + "score": "BB", + "accuracy": 0.05 + }, + { + "metricName": "GHG emissions intensity", + "metricValue": { + "value": 10, + "unit": "KGM" + }, + "score": "BB", + "accuracy": 0.05 + } + ], + "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" + } + }, + { + "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)" + } + }, + "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)" + } + }, + "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 + } + ] + }, + { + "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" + }, + "score": "BB", + "accuracy": 0.05 + }, + { + "metricName": "GHG emissions intensity", + "metricValue": { + "value": 10, + "unit": "KGM" + }, + "score": "BB", + "accuracy": 0.05 + } + ], + "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" + } + } + ] + }, + "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": "processDigitalFacilityRecord", + "parameters": [ + { + "vckit": { + "vckitAPIUrl": "http://localhost:3332/v2", + "issuer": { + "id": "did:web:6028-115-79-212-164.ngrok-free.app", + "name": "Orchard Facility" + }, + "headers": { + "Authorization": "Bearer test123" + } + }, + "digitalFacilityRecord": { + "context": ["https://vocabulary.uncefact.org/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
{{!-- TODO: confirm --}}
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": { + "resultPath": "/uri", + "bucket": "verifiable-credentials" + }, + "options": { + "method": "POST", + "headers": { + "Content-Type": "application/json" + } + } + }, + "identifierKeyPath": "/id" + } + ] + } + ] + } + ] + }, + { + "name": "Packhouse Facility", + "type": "producer", + "assets": { + "logo": "Cherries-farm-logo.webp", + "brandTitle": "Packhouse Facility" + }, + "styles": { + "primaryColor": "#b5651d", + "secondaryColor": "#391561", + "tertiaryColor": "#ffffff" + }, + "features": [ + { + "name": "Issue DPP", + "id": "produce_product", + "components": [ + { + "name": "LocalStorageLoader", + "type": "EntryData", + "props": { + "storageKey": "orchard_facility_transaction_event", + "nestedComponents": [ + { + "name": "JsonForm", + "type": "EntryData", + "props": { + "schema": { + "url": "https://jargon.sh/user/unece/DigitalProductPassport/v/working/artefacts/jsonSchemas/Product.json?class=Product" + }, + "data": { + "type": ["Product"], + "id": "https://example.com/01/09359502000034", + "name": "EcoCharge Lithium-Ion Battery", + "registeredId": "095201234", + "idScheme": { + "type": ["IdentifierScheme"], + "id": "https://id.gs1.org/01/", + "name": "Global Trade Identification Number (GTIN)" + }, + "serialNumber": "12345678", + "batchNumber": "6789", + "productImage": { + "type": ["Link"], + "linkURL": "https://c.animaapp.com/b3vf2M20/img/pp-header@2x.png", + "linkName": "EV Battery 300Ah Image" + }, + "description": "The EcoCharge EC-5000 Lithium-Ion Battery is a high-capacity, 5000mAh battery designed for performance and sustainability. Manufactured with responsibly sourced materials and a 95% recyclability rate, it reduces lifecycle emissions through eco-friendly production and verified recycling programs.", + "productCategory": [ + { + "type": ["Classification"], + "id": "https://unstats.un.org/unsd/classifications/Econ/cpc/46410", + "code": "46410", + "name": "Primary cells", + "schemeID": "https://unstats.un.org/unsd/classifications/Econ/cpc/", + "schemeName": "UN Central Product Classification (CPC)" + }, + { + "type": ["Classification"], + "id": "https://unstats.un.org/unsd/classifications/Econ/cpc/46410", + "code": "46410", + "name": "Primary batteries", + "schemeID": "https://unstats.un.org/unsd/classifications/Econ/cpc/", + "schemeName": "UN Central Product Classification (CPC)" + } + ], + "furtherInformation": [ + { + "type": ["Link"], + "linkURL": "https://example-company.com/product-information/1234567", + "linkName": "Name of document that is further information" + }, + { + "type": ["Link"], + "linkURL": "https://example-company.com/product-information/1234567", + "linkName": "Name of additional document that is further information" + } + ], + "producedByParty": { + "type": ["Identifier"], + "id": "https://id.example-company.com/party/6789", + "name": "Example Manufacturing Co." + }, + "producedAtFacility": { + "type": ["Identifier"], + "id": "https://id.example-company.com/facility/123", + "name": "Green Acres Battery Factory" + }, + "dimensions": { + "type": ["Dimension"], + "weight": { "value": 10, "unit": "kg" }, + "length": { "value": 90, "unit": "mm" }, + "width": { "value": 60, "unit": "mm" }, + "height": { "value": 10, "unit": "mm" }, + "volume": { "value": 7.5, "unit": "L" } + }, + "characteristic": { + "Battery status": "Recycled", + "Battery cell type": "Prismatic", + "Number of cells per battery": "180", + "Total energy": "100kwh" + }, + "productionDate": "15 August 2024", + "countryOfProduction": "Australia", + "granularityLevel": "item", + "dueDiligenceDeclaration": { + "type": ["Link"], + "linkURL": "https://example-company.com/due-diligence/1234567", + "linkName": "Due Diligence Declaration" + }, + "materialsProvenance": [ + { + "type": ["Material"], + "name": "Material", + "originCountry": "AU", + "materialType": { + "type": ["Classification"], + "id": "https://unfc.org/material-type/Lithium", + "name": "Lithium" + }, + "massFraction": 20, + "massAmount": { "value": 1.0, "unit": "kg" }, + "recycledAmount": 0, + "hazardous": false + }, + { + "type": ["Material"], + "name": "Material", + "originCountry": "AU", + "materialType": { + "type": ["Classification"], + "id": "https://unfc.org/material-type/Lithium", + "name": "Lithium" + }, + "massFraction": 20, + "massAmount": { "value": 1.0, "unit": "kg" }, + "recycledAmount": 10, + "hazardous": true, + "materialSafetyInformation": { + "type": ["Link"], + "linkURL": "https://example.com/safety-info/lithium-spodumene.pdf", + "linkName": "Material Safety Data Sheet", + "linkType": "https://test.uncefact.org/vocabulary/linkTypes/safetyData" + } + }, + { + "type": ["Material"], + "name": "Material", + "originCountry": "AU", + "materialType": { + "type": ["Classification"], + "id": "https://unfc.org/material-type/Lithium", + "name": "Lithium" + }, + "massFraction": 20, + "massAmount": { "value": 1.0, "unit": "kg" }, + "recycledAmount": 0, + "hazardous": false + }, + { + "type": ["Material"], + "name": "Material", + "originCountry": "AU", + "materialType": { + "type": ["Classification"], + "id": "https://unfc.org/material-type/Lithium", + "name": "Lithium" + }, + "massFraction": 20, + "massAmount": { "value": 1.0, "unit": "kg" }, + "recycledAmount": 0, + "hazardous": false + } + ], + "conformityClaim": [ + { + "type": ["Claim", "Declaration"], + "assessmentDate": "2024-04-25", + "declaredValue": [ + { + "type": ["Metric"], + "metricName": "GHG emissions intensity", + "metricValue": { "value": 1.5, "unit": "kg" }, + "score": "1.2", + "accuracy": 0.8 + }, + { + "type": ["Metric"], + "metricName": "GHG emissions intensity", + "metricValue": { "value": 1.5, "unit": "kg" }, + "score": "1.2", + "accuracy": 0.8 + } + ], + "id": "https://products.example-company.com/09520123456788/declarations/12345", + "referenceStandard": { + "type": ["Standard"], + "id": "https://www.iso.org/standard/60857.html", + "name": "Standard", + "issuingParty": { + "type": ["Identifier"], + "id": "https://iso.org/issuing-party/123", + "name": "International Organization" + }, + "issueDate": "2023-12-05" + }, + "referenceRegulation": { + "type": ["Regulation"], + "id": "https://www.legislation.gov.au/F2008L02309/latest/versions", + "name": "National Greenhouse", + "jurisdictionCountry": "Australia", + "administeredBy": { + "type": ["Identifier"], + "id": "https://gov.au/admin-body/12345", + "name": "Australian Government" + }, + "effectiveDate": "2024-03-20" + }, + "assessmentCriteria": [ + { + "type": ["Criterion"], + "id": "https://www.globalbattery.org/media/publications/gba-rulebook-v2.0-master.pdf#BatteryAssembly", + "name": "Battery Assembly Guidelines", + "thresholdValues": [ + { + "type": ["Metric"], + "metricName": "Minimum compressive strength", + "metricValue": { "value": 500, "unit": "MPA" } + } + ] + } + ], + "conformance": true, + "conformityTopic": "environment.energy", + "conformityEvidence": { + "type": ["SecureLink", "Link"], + "linkURL": "https://example-certifier.com/evidence/1234567.json", + "hashDigest": "6239119dda5bd4c8a6ffb832fe16feaa5c27b7dba154d24c53d4470a2c69adc2", + "hashMethod": "SHA-256", + "linkName": "Declaration link name", + "linkType": "https://test.uncefact.org/vocabulary/linkTypes/dcc", + "encryptionMethod": "AES" + } + }, + { + "type": ["Claim", "Declaration"], + "assessmentDate": "2024-04-25", + "declaredValue": [ + { + "type": ["Metric"], + "metricName": "GHG emissions intensity", + "metricValue": { "value": 1.5, "unit": "kg" }, + "score": "1.2", + "accuracy": 0.8 + }, + { + "type": ["Metric"], + "metricName": "GHG emissions intensity", + "metricValue": { "value": 1.5, "unit": "kg" }, + "score": "1.2", + "accuracy": 0.8 + } + ], + "id": "https://products.example-company.com/09520123456788/declarations/12345", + "referenceStandard": { + "type": ["Standard"], + "id": "https://www.iso.org/standard/60857.html", + "name": "Standard", + "issuingParty": { + "type": ["Identifier"], + "id": "https://iso.org/issuing-party/123", + "name": "International Organization" + }, + "issueDate": "2023-12-05" + }, + "referenceRegulation": { + "type": ["Regulation"], + "id": "https://www.legislation.gov.au/F2008L02309/latest/versions", + "name": "National Greenhouse", + "jurisdictionCountry": "Australia", + "administeredBy": { + "type": ["Identifier"], + "id": "https://gov.au/admin-body/12345", + "name": "Australian Government" + }, + "effectiveDate": "2024-03-20" + }, + "assessmentCriteria": [ + { + "type": ["Criterion"], + "id": "https://www.globalbattery.org/media/publications/gba-rulebook-v2.0-master.pdf#BatteryAssembly", + "name": "Battery Assembly Guidelines", + "thresholdValues": [ + { + "type": ["Metric"], + "metricName": "Minimum compressive strength", + "metricValue": { "value": 500, "unit": "MPA" } + } + ] + } + ], + "conformance": false, + "conformityTopic": "environment.energy", + "conformityEvidence": { + "type": ["SecureLink", "Link"], + "linkURL": "https://example-certifier.com/evidence/1234567.json", + "hashDigest": "6239119dda5bd4c8a6ffb832fe16feaa5c27b7dba154d24c53d4470a2c69adc2", + "hashMethod": "SHA-256", + "linkName": "Declaration link name", + "linkType": "https://test.uncefact.org/vocabulary/linkTypes/dcc", + "encryptionMethod": "AES" + } + }, + { + "type": ["Claim", "Declaration"], + "assessmentDate": "2024-04-25", + "declaredValue": [ + { + "type": ["Metric"], + "metricName": "GHG emissions intensity", + "metricValue": { "value": 1.5, "unit": "kg" }, + "score": "1.2", + "accuracy": 0.8 + }, + { + "type": ["Metric"], + "metricName": "GHG emissions intensity", + "metricValue": { "value": 1.5, "unit": "kg" }, + "score": "1.2", + "accuracy": 0.8 + } + ], + "id": "https://products.example-company.com/09520123456788/declarations/12345", + "referenceStandard": { + "type": ["Standard"], + "id": "https://www.iso.org/standard/60857.html", + "name": "Standard", + "issuingParty": { + "type": ["Identifier"], + "id": "https://iso.org/issuing-party/123", + "name": "International Organization" + }, + "issueDate": "2023-12-05" + }, + "referenceRegulation": { + "type": ["Regulation"], + "id": "https://www.legislation.gov.au/F2008L02309/latest/versions", + "name": "National Greenhouse", + "jurisdictionCountry": "Australia", + "administeredBy": { + "type": ["Identifier"], + "id": "https://gov.au/admin-body/12345", + "name": "Australian Government" + }, + "effectiveDate": "2024-03-20" + }, + "assessmentCriteria": [ + { + "type": ["Criterion"], + "id": "https://www.globalbattery.org/media/publications/gba-rulebook-v2.0-master.pdf#BatteryAssembly", + "name": "Battery Assembly Guidelines", + "thresholdValues": [ + { + "type": ["Metric"], + "metricName": "Minimum compressive strength", + "metricValue": { "value": 500, "unit": "MPA" } + } + ] + } + ], + "conformance": false, + "conformityTopic": "environment.energy", + "conformityEvidence": { + "type": ["SecureLink", "Link"], + "linkURL": "https://example-certifier.com/evidence/1234567.json", + "hashDigest": "6239119dda5bd4c8a6ffb832fe16feaa5c27b7dba154d24c53d4470a2c69adc2", + "hashMethod": "SHA-256", + "linkName": "Declaration link name", + "linkType": "https://test.uncefact.org/vocabulary/linkTypes/dcc", + "encryptionMethod": "AES" + } + }, + { + "type": ["Claim", "Declaration"], + "assessmentDate": "2024-04-25", + "declaredValue": [ + { + "type": ["Metric"], + "metricName": "GHG emissions intensity", + "metricValue": { "value": 1.5, "unit": "kg" }, + "score": "1.2", + "accuracy": 0.8 + }, + { + "type": ["Metric"], + "metricName": "GHG emissions intensity", + "metricValue": { "value": 1.5, "unit": "kg" }, + "score": "1.2", + "accuracy": 0.8 + } + ], + "id": "https://products.example-company.com/09520123456788/declarations/12345", + "referenceStandard": { + "type": ["Standard"], + "id": "https://www.iso.org/standard/60857.html", + "name": "Standard", + "issuingParty": { + "type": ["Identifier"], + "id": "https://iso.org/issuing-party/123", + "name": "International Organization" + }, + "issueDate": "2023-12-05" + }, + "referenceRegulation": { + "type": ["Regulation"], + "id": "https://www.legislation.gov.au/F2008L02309/latest/versions", + "name": "National Greenhouse", + "jurisdictionCountry": "Australia", + "administeredBy": { + "type": ["Identifier"], + "id": "https://gov.au/admin-body/12345", + "name": "Australian Government" + }, + "effectiveDate": "2024-03-20" + }, + "assessmentCriteria": [ + { + "type": ["Criterion"], + "id": "https://www.globalbattery.org/media/publications/gba-rulebook-v2.0-master.pdf#BatteryAssembly", + "name": "Battery Assembly Guidelines", + "thresholdValues": [ + { + "type": ["Metric"], + "metricName": "Minimum compressive strength", + "metricValue": { "value": 500, "unit": "MPA" } + } + ] + } + ], + "conformance": false, + "conformityTopic": "environment.energy", + "conformityEvidence": { + "type": ["SecureLink", "Link"], + "linkURL": "https://example-certifier.com/evidence/1234567.json", + "hashDigest": "6239119dda5bd4c8a6ffb832fe16feaa5c27b7dba154d24c53d4470a2c69adc2", + "hashMethod": "SHA-256", + "linkName": "Declaration link name", + "linkType": "https://test.uncefact.org/vocabulary/linkTypes/dcc", + "encryptionMethod": "AES" + } + }, + { + "type": ["Claim", "Declaration"], + "assessmentDate": "2024-04-25", + "declaredValue": [ + { + "type": ["Metric"], + "metricName": "GHG emissions intensity", + "metricValue": { "value": 1.5, "unit": "kg" }, + "score": "1.2", + "accuracy": 0.8 + }, + { + "type": ["Metric"], + "metricName": "GHG emissions intensity", + "metricValue": { "value": 1.5, "unit": "kg" }, + "score": "1.2", + "accuracy": 0.8 + } + ], + "id": "https://products.example-company.com/09520123456788/declarations/12345", + "referenceStandard": { + "type": ["Standard"], + "id": "https://www.iso.org/standard/60857.html", + "name": "Standard", + "issuingParty": { + "type": ["Identifier"], + "id": "https://iso.org/issuing-party/123", + "name": "International Organization" + }, + "issueDate": "2023-12-05" + }, + "referenceRegulation": { + "type": ["Regulation"], + "id": "https://www.legislation.gov.au/F2008L02309/latest/versions", + "name": "National Greenhouse", + "jurisdictionCountry": "Australia", + "administeredBy": { + "type": ["Identifier"], + "id": "https://gov.au/admin-body/12345", + "name": "Australian Government" + }, + "effectiveDate": "2024-03-20" + }, + "assessmentCriteria": [ + { + "type": ["Criterion"], + "id": "https://www.globalbattery.org/media/publications/gba-rulebook-v2.0-master.pdf#BatteryAssembly", + "name": "Battery Assembly Guidelines", + "thresholdValues": [ + { + "type": ["Metric"], + "metricName": "Minimum compressive strength", + "metricValue": { "value": 500, "unit": "MPA" } + } + ] + } + ], + "conformance": false, + "conformityTopic": "environment.energy", + "conformityEvidence": { + "type": ["SecureLink", "Link"], + "linkURL": "https://example-certifier.com/evidence/1234567.json", + "hashDigest": "6239119dda5bd4c8a6ffb832fe16feaa5c27b7dba154d24c53d4470a2c69adc2", + "hashMethod": "SHA-256", + "linkName": "Declaration link name", + "linkType": "https://test.uncefact.org/vocabulary/linkTypes/dcc", + "encryptionMethod": "AES" + } + } + ], + "circularityScorecard": { + "type": ["CircularityPerformance"], + "recyclingInformation": { + "type": ["Link"], + "linkURL": "https://example-company.com/recycling/1234567", + "linkName": "Recycling Information" + }, + "repairInformation": { + "type": ["Link"], + "linkURL": "https://example-company.com/repair/1234567", + "linkName": "Repair Instructions" + }, + "recyclableContent": 67, + "recycledContent": 86, + "utilityFactor": 1.2, + "materialCircularityIndicator": 0.67 + }, + "emissionsScorecard": { + "type": ["EmissionsPerformance"], + "carbonFootprint": 12.5, + "declaredUnit": "kg", + "operationalScope": "CradleToGate", + "primarySourcedRatio": 75, + "reportingStandard": { + "type": ["Standard"], + "id": "https://www.ifrs.org/standards/issb/s2", + "name": "WBSCD Pathfinder framework - V.2.0", + "issuingParty": { + "type": ["Identifier"], + "id": "https://id.ifrs.org/issuing-party/123", + "name": "International Financial Reporting Standards Foundation", + "registeredId": "90664869327", + "idScheme": { + "type": ["IdentifierScheme"], + "id": "https://id.ifrs.org/issuing-party/", + "name": "IFRS Issuing Party" + } + }, + "issueDate": "2024-04-25" + } + }, + "traceabilityInformation": { + "valueChainProcess": "Spinning", + "verifiedRatio": 0.5, + "traceabilityEvent": [ + { + "linkURL": "https://files.example-certifier.com/1234567.json", + "linkName": "Transaction Event", + "linkType": "https://test.uncefact.org/vocabulary/linkTypes/dcc", + "hashDigest": "6239119", + "hashMethod": "SHA-256", + "encryptionMethod": "AES" + } + ] + } + }, + "className": "json-form", + "style": { + "margin": "40px auto", + "paddingTop": "40px", + "width": "80%" + } + }, + "constructData": { + "mappingFields": [ + { + "sourcePath": "/linkResolver", + "destinationPath": "/traceabilityInformation/traceabilityEvent/0/linkURL" + } + ], + "dummyFields": [ + { + "path": "/traceabilityInformation/0/eventType", + "data": "transaction" + } + ], + "generationFields": [] + } + } + ] + } + }, + { + "name": "CustomButton", + "type": "Submit", + "props": {} + } + ], + "services": [ + { + "name": "processDPP", + "parameters": [ + { + "vckit": { + "vckitAPIUrl": "http://localhost:3332/v2", + "issuer": { + "id": "did:web:6028-115-79-212-164.ngrok-free.app", + "name": "Packhouse Facility" + }, + "headers": { + "Authorization": "Bearer test123" + } + }, + "dpp": { + "context": ["https://vocabulary.uncefact.org/untp/dpp/0.5.0/"], + "renderTemplate": [ + { + "template": " Digital Product Passport

PRODUCT PASSPORT

{{credentialSubject.name}}

{{credentialSubject.description}}
{{#each credentialSubject.furtherInformation}} {{linkName}} {{/each}}
{{#if credentialSubject.characteristic}}
Characteristics
{{#each credentialSubject.characteristic}}
{{@key}}

{{this}}

{{/each}}
{{/if}}

Circularity Scorecard

The circularity Scorecard provides a simple high level summary of circularity performance of the product.

{{credentialSubject.circularityScorecard.recyclableContent}}%

Recyclable content

{{credentialSubject.circularityScorecard.recycledContent}}%

Recycled content

{{credentialSubject.circularityScorecard.utilityFactor}}

Utility factor

{{credentialSubject.circularityScorecard.materialCircularityIndicator}}

Material circularity*

*The Material Circularity Indicator provides an overall circularity score which is a function of all three of the earlier measures.

Emissions Scorecard

The Emissions Scorecard gives a clear snapshot of the product's greenhouse gas (GHG) emissions performance, providing a single indicator to assess its overall environmental impact.

{{credentialSubject.emissionsScorecard.carbonFootprint}}{{credentialSubject.emissionsScorecard.declaredUnit}}

Co2Eq

Scope includes

{{credentialSubject.emissionsScorecard.operationalScope}}

Primary sourced ratio*

{{credentialSubject.emissionsScorecard.primarySourcedRatio}}% primary sources

Issue date

{{credentialSubject.emissionsScorecard.reportingStandard.issueDate}}

*

The Primary Sourced Ratio shows the percentage of scope 3 emissions data that is directly collected from actual sources, rather than being based on estimates.

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}}
Production
Product category

{{#each credentialSubject.productCategory}}{{name}}{{#unless @last}},{{/unless}} {{/each}}

Date produced

{{credentialSubject.productionDate}}

Country

{{credentialSubject.countryOfProduction}}

Dimensions

Weight: {{credentialSubject.dimensions.weight.value}}{{credentialSubject.dimensions.weight.unit}} Length: {{credentialSubject.dimensions.length.value}}{{credentialSubject.dimensions.length.unit}} Width: {{credentialSubject.dimensions.width.value}}{{credentialSubject.dimensions.width.unit}} Height: {{credentialSubject.dimensions.height.value}}{{credentialSubject.dimensions.height.unit}} Volume: {{credentialSubject.dimensions.volume.value}}{{credentialSubject.dimensions.volume.unit}}

Product composition

A complete list of materials that make up the composition of this product.

{{#each credentialSubject.materialsProvenance}}

{{massFraction}}%

{{massAmount.value}}{{massAmount.unit}} {{name}}

Recycled {{recycledAmount}}%

Hazard {{#if hazardous}}Yes{{else}}No{{/if}}

{{materialSafetyInformation.linkName}}
{{originCountry}}
{{/each}}

History

{{!-- start: Supply chain due diligence report --}}
Supply chain due diligence report
{{!-- end: Supply chain due diligence report --}}

{{credentialSubject.traceabilityInformation.valueChainProcess}}

Verified ratio {{credentialSubject.traceabilityInformation.verifiedRatio}}

{{#each credentialSubject.traceabilityInformation.traceabilityEvent}}
{{linkName}} View
{{/each}}

Passport issued by

Organisation

{{issuer.name}}

Registered ID {{issuer.id}}
Valid from

{{validFrom}}

Valid to

{{validUntil}}

This Digital Product Passport (DPP) is a digital record of the product's sustainability and environmental performance, ensuring transparency and accountability in line with UNTP standards. The DPP can be verified at any time using the QR code or visiting www.untp-certification.org with the passport ID.

PRODUCT PASSPORT
{{credentialSubject.name}}
Batch: {{credentialSubject.batchNumber}}
Serial: {{credentialSubject.serialNumber}}

{{credentialSubject.description}}

{{#each credentialSubject.furtherInformation}}
{{linkName}}
{{/each}}
{{#if credentialSubject.characteristic}}
Characteristics
{{#each credentialSubject.characteristic}}
{{@key}}
{{this}}
{{/each}}
{{/if}}
Circularity Scorecard

The circularity Scorecard provides a simple high level summary of circularity performance of the product.

{{credentialSubject.circularityScorecard.recyclableContent}}%
Recyclable content
{{credentialSubject.circularityScorecard.recycledContent}}%
Recycled content
{{credentialSubject.circularityScorecard.utilityFactor}}
Utility factor
{{credentialSubject.circularityScorecard.materialCircularityIndicator}}
Material circularity*

*The Material Circularity Indicator provides an overall circularity score which is a function of all three of the earlier measures.

Emissions Scorecard

The Emissions Scorecard gives a clear snapshot of the product's greenhouse gas (GHG) emissions performance, providing a single indicator to assess its overall environmental impact.

{{credentialSubject.emissionsScorecard.carbonFootprint}}{{credentialSubject.emissionsScorecard.declaredUnit}}

Co2Eq

Scope includes
{{credentialSubject.emissionsScorecard.operationalScope}}
Primary sourced ratio*
{{credentialSubject.emissionsScorecard.primarySourcedRatio}}% primary sources

The Primary Sourced Ratio shows the percentage of scope 3 emissions data that is directly collected from actual sources, rather than being based on estimates.

Issue date
{{credentialSubject.emissionsScorecard.reportingStandard.issueDate}}
*
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}}
Production
Product category
{{#each credentialSubject.productCategory}}{{name}}{{#unless @last}},{{/unless}} {{/each}}
Date produced
{{credentialSubject.productionDate}}
Country
{{credentialSubject.countryOfProduction}}
Dimensions
Weight: {{credentialSubject.dimensions.weight.value}}{{credentialSubject.dimensions.weight.unit}} Length: {{credentialSubject.dimensions.length.value}}{{credentialSubject.dimensions.length.unit}} Width: {{credentialSubject.dimensions.width.value}}{{credentialSubject.dimensions.width.unit}} Height: {{credentialSubject.dimensions.height.value}}{{credentialSubject.dimensions.height.unit}} Volume: {{credentialSubject.dimensions.volume.value}}{{credentialSubject.dimensions.volume.unit}}
Composition

The Product Composition List details the materials and components used in the product, providing transparency on the origin and nature of each element.

{{#each credentialSubject.materialsProvenance}}
{{massFraction}}%
{{massAmount.value}}{{massAmount.unit}} {{name}}
Recycled {{#if recycledAmount}}{{recycledAmount}}{{else}}0{{/if}}%
Hazard {{#if hazardous}}Yes{{else}}No{{/if}}
{{originCountry}}
{{/each}}
History
{{!-- start: Supply chain due diligence report --}}
Supply chain due diligence report
{{!-- end: Supply chain due diligence report --}}

{{credentialSubject.traceabilityInformation.valueChainProcess}}

Verified ratio {{credentialSubject.traceabilityInformation.verifiedRatio}}

{{#each credentialSubject.traceabilityInformation.traceabilityEvent}}
{{linkName}} View
{{/each}}
Passport issued by
Organisation
{{issuer.name}}
Registered ID
Valid from
{{validFrom}}
Valid to
{{validUntil}}

This Digital Product Passport (DPP) is a digital record of the product’s sustainability and environmental performance, ensuring transparency and accountability in line with UNTP standards. The DPP can be verified at any time using the QR code or visiting www.untp-certification.org with the passport ID.

", + "@type": "WebRenderingTemplate2022" + } + ], + "type": ["DigitalProductPassport"], + "dlrLinkTitle": "Cherries Product Passport", + "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": { + "resultPath": "/uri", + "bucket": "verifiable-credentials" + }, + "options": { + "method": "POST", + "headers": { + "Content-Type": "application/json" + } + } + }, + "identifierKeyPath": "/id" + } + ] + }, + { + "name": "mergeToLocalStorage", + "parameters": [ + { + "storageKey": "CherriesFarm_dpps", + "objectKeyPath": "/decodedEnvelopedVC/credentialSubject/id" + } + ] + } + ] + }, + { + "name": "Move to Next Facility", + "id": "transaction_product", + "components": [ + { + "name": "LocalStorageLoader", + "type": "EntryData", + "props": { + "storageKey": "CherriesFarm_dpps", + "nestedComponents": [ + { + "name": "JsonForm", + "type": "EntryData", + "props": { + "schema": { + "url": "https://jargon.sh/user/unece/traceabilityEvents/v/working/artefacts/jsonSchemas/TransactionEvent.json?class=TransactionEvent" + } + }, + "constructData": { + "mappingFields": [ + { + "sourcePath": "/decodedEnvelopedVC/credentialSubject/id", + "destinationPath": "/epcList/index/name" + }, + { + "sourcePath": "/linkResolver", + "destinationPath": "/epcList/index/id" + }, + { + "sourcePath": "/decodedEnvelopedVC/credentialSubject/name", + "destinationPath": "/quantityList/0/productName" + }, + { + "sourcePath": "/linkResolver", + "destinationPath": "/quantityList/0/productId" + } + ], + "dummyFields": [ + { + "path": "/type", + "data": ["TransactionEvent", "Event"] + }, + { + "path": "/id", + "data": "https://events.sample.com/01/09359502000034/21/123456" + }, + { + "path": "/processType", + "data": "Weaving" + }, + { + "path": "/eventTime", + "data": "2024-09-01T12:00:00" + }, + { + "path": "/action", + "data": "add" + }, + { + "path": "/disposition", + "data": "https://ref.gs1.org/cbv/Disp-active" + }, + { + "path": "/bizStep", + "data": "https://ref.gs1.org/cbv/BizStep-commissioning" + }, + { + "path": "/bizLocation", + "data": "https://id.gs1.org/414/9520123456788" + }, + { + "path": "/sensorElementList/0/sensorMetadata/device/type", + "data": ["Item"] + }, + { + "path": "/sensorElementList/0/sensorMetadata/device/id", + "data": "https://id.gs1.org/01/09520123456788/21/12345" + }, + { + "path": "/sensorElementList/0/sensorMetadata/device/name", + "data": "EV battery 300Ah." + }, + { + "path": "/sensorElementList/0/sensorMetadata/dataProcessingMethod", + "data": "https://standards.org/sensorMethod#1234" + }, + { + "path": "/sensorElementList/0/sensorReport/0/time", + "data": "2024-07-24T12:00:00" + }, + { + "path": "/sensorElementList/0/sensorReport/0/sensorType", + "data": "https://samplesensors.com/model1234" + }, + { + "path": "/sensorElementList/0/sensorReport/0/value", + "data": 25 + }, + { + "path": "/sensorElementList/0/sensorReport/0/uom", + "data": "KGM" + }, + { + "path": "/sensorElementList/0/sensorIntegrityProof", + "data": "https://jargon.sh" + }, + { + "path": "/sourcePartyId", + "data": "https://abr.business.gov.au/ABN/View?abn=90664869327" + }, + { + "path": "/destinationPartyId", + "data": "https://abr.business.gov.au/ABN/View?abn=90664869327" + }, + { + "path": "/bizTransaction", + "data": "https://ref.gs1.org/cbv/BTT-prodorder" + }, + { + "path": "/epcList/0/type", + "data": ["Item"] + }, + { + "path": "/quantityList/0/quantity", + "data": 20 + }, + { + "path": "/quantityList/0/uom", + "data": "KGM" + } + ], + "generationFields": [ + { + "path": "/eventTime", + "handler": "generateCurrentDatetime" + } + ] + } + } + ] + } + }, + { + "name": "CustomButton", + "type": "Submit", + "props": { + "includeDownload": true, + "downloadFileName": "transaction" + } + } + ], + "services": [ + { "name": "convertObjectToArray1Item", "parameters": [{ "path": "/data" }] }, + { + "name": "processTransactionEvent", + "parameters": [ + { + "vckit": { + "vckitAPIUrl": "http://localhost:3332/v2", + "issuer": { + "id": "did:web:6028-115-79-212-164.ngrok-free.app", + "name": "Packhouse Facility" + }, + "headers": { + "Authorization": "Bearer test123" + } + }, + "traceabilityEvent": { + "context": ["https://vocabulary.uncefact.org/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": "Transaction 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": { + "resultPath": "/uri", + "bucket": "verifiable-credentials" + }, + "options": { + "method": "POST", + "headers": { + "Content-Type": "application/json" + } + } + }, + "identifierKeyPath": "/0/id", + "localStorageParams": { "storageKey": "CherriesFarm_dpps", "keyPath": "/0/epcList/index/name" } + } + ] + }, + { + "name": "mergeToLocalStorage", + "parameters": [ + { + "storageKey": "orchard_facility_transaction_event", + "objectKeyPath": "/decodedEnvelopedVC/credentialSubject/0/id" + } + ] + } + ] + } + ] + }, + { + "name": "Fumigation and Freight Forwarding Facility", + "type": "producer", + "assets": { + "logo": "Cherries-farm-logo.webp", + "brandTitle": "Fumigation and Freight Forwarding Facility" + }, + "styles": { + "primaryColor": "#b5651d", + "secondaryColor": "#391561", + "tertiaryColor": "#ffffff" + }, + "features": [ + { + "name": "Issue DPP", + "id": "produce_product", + "components": [ + { + "name": "LocalStorageLoader", + "type": "EntryData", + "props": { + "storageKey": "orchard_facility_transaction_event", + "nestedComponents": [ + { + "name": "JsonForm", + "type": "EntryData", + "props": { + "schema": { + "url": "https://jargon.sh/user/unece/DigitalProductPassport/v/working/artefacts/jsonSchemas/Product.json?class=Product" + }, + "data": { + "type": ["Product"], + "id": "https://example.com/01/09359502000034", + "name": "EcoCharge Lithium-Ion Battery", + "registeredId": "095201234", + "idScheme": { + "type": ["IdentifierScheme"], + "id": "https://id.gs1.org/01/", + "name": "Global Trade Identification Number (GTIN)" + }, + "serialNumber": "12345678", + "batchNumber": "6789", + "productImage": { + "type": ["Link"], + "linkURL": "https://c.animaapp.com/b3vf2M20/img/pp-header@2x.png", + "linkName": "EV Battery 300Ah Image" + }, + "description": "The EcoCharge EC-5000 Lithium-Ion Battery is a high-capacity, 5000mAh battery designed for performance and sustainability. Manufactured with responsibly sourced materials and a 95% recyclability rate, it reduces lifecycle emissions through eco-friendly production and verified recycling programs.", + "productCategory": [ + { + "type": ["Classification"], + "id": "https://unstats.un.org/unsd/classifications/Econ/cpc/46410", + "code": "46410", + "name": "Primary cells", + "schemeID": "https://unstats.un.org/unsd/classifications/Econ/cpc/", + "schemeName": "UN Central Product Classification (CPC)" + }, + { + "type": ["Classification"], + "id": "https://unstats.un.org/unsd/classifications/Econ/cpc/46410", + "code": "46410", + "name": "Primary batteries", + "schemeID": "https://unstats.un.org/unsd/classifications/Econ/cpc/", + "schemeName": "UN Central Product Classification (CPC)" + } + ], + "furtherInformation": [ + { + "type": ["Link"], + "linkURL": "https://example-company.com/product-information/1234567", + "linkName": "Name of document that is further information" + }, + { + "type": ["Link"], + "linkURL": "https://example-company.com/product-information/1234567", + "linkName": "Name of additional document that is further information" + } + ], + "producedByParty": { + "type": ["Identifier"], + "id": "https://id.example-company.com/party/6789", + "name": "Example Manufacturing Co." + }, + "producedAtFacility": { + "type": ["Identifier"], + "id": "https://id.example-company.com/facility/123", + "name": "Green Acres Battery Factory" + }, + "dimensions": { + "type": ["Dimension"], + "weight": { "value": 10, "unit": "kg" }, + "length": { "value": 90, "unit": "mm" }, + "width": { "value": 60, "unit": "mm" }, + "height": { "value": 10, "unit": "mm" }, + "volume": { "value": 7.5, "unit": "L" } + }, + "characteristic": { + "Battery status": "Recycled", + "Battery cell type": "Prismatic", + "Number of cells per battery": "180", + "Total energy": "100kwh" + }, + "productionDate": "15 August 2024", + "countryOfProduction": "Australia", + "granularityLevel": "item", + "dueDiligenceDeclaration": { + "type": ["Link"], + "linkURL": "https://example-company.com/due-diligence/1234567", + "linkName": "Due Diligence Declaration" + }, + "materialsProvenance": [ + { + "type": ["Material"], + "name": "Material", + "originCountry": "AU", + "materialType": { + "type": ["Classification"], + "id": "https://unfc.org/material-type/Lithium", + "name": "Lithium" + }, + "massFraction": 20, + "massAmount": { "value": 1.0, "unit": "kg" }, + "recycledAmount": 0, + "hazardous": false + }, + { + "type": ["Material"], + "name": "Material", + "originCountry": "AU", + "materialType": { + "type": ["Classification"], + "id": "https://unfc.org/material-type/Lithium", + "name": "Lithium" + }, + "massFraction": 20, + "massAmount": { "value": 1.0, "unit": "kg" }, + "recycledAmount": 10, + "hazardous": true, + "materialSafetyInformation": { + "type": ["Link"], + "linkURL": "https://example.com/safety-info/lithium-spodumene.pdf", + "linkName": "Material Safety Data Sheet", + "linkType": "https://test.uncefact.org/vocabulary/linkTypes/safetyData" + } + }, + { + "type": ["Material"], + "name": "Material", + "originCountry": "AU", + "materialType": { + "type": ["Classification"], + "id": "https://unfc.org/material-type/Lithium", + "name": "Lithium" + }, + "massFraction": 20, + "massAmount": { "value": 1.0, "unit": "kg" }, + "recycledAmount": 0, + "hazardous": false + }, + { + "type": ["Material"], + "name": "Material", + "originCountry": "AU", + "materialType": { + "type": ["Classification"], + "id": "https://unfc.org/material-type/Lithium", + "name": "Lithium" + }, + "massFraction": 20, + "massAmount": { "value": 1.0, "unit": "kg" }, + "recycledAmount": 0, + "hazardous": false + } + ], + "conformityClaim": [ + { + "type": ["Claim", "Declaration"], + "assessmentDate": "2024-04-25", + "declaredValue": [ + { + "type": ["Metric"], + "metricName": "GHG emissions intensity", + "metricValue": { "value": 1.5, "unit": "kg" }, + "score": "1.2", + "accuracy": 0.8 + }, + { + "type": ["Metric"], + "metricName": "GHG emissions intensity", + "metricValue": { "value": 1.5, "unit": "kg" }, + "score": "1.2", + "accuracy": 0.8 + } + ], + "id": "https://products.example-company.com/09520123456788/declarations/12345", + "referenceStandard": { + "type": ["Standard"], + "id": "https://www.iso.org/standard/60857.html", + "name": "Standard", + "issuingParty": { + "type": ["Identifier"], + "id": "https://iso.org/issuing-party/123", + "name": "International Organization" + }, + "issueDate": "2023-12-05" + }, + "referenceRegulation": { + "type": ["Regulation"], + "id": "https://www.legislation.gov.au/F2008L02309/latest/versions", + "name": "National Greenhouse", + "jurisdictionCountry": "Australia", + "administeredBy": { + "type": ["Identifier"], + "id": "https://gov.au/admin-body/12345", + "name": "Australian Government" + }, + "effectiveDate": "2024-03-20" + }, + "assessmentCriteria": [ + { + "type": ["Criterion"], + "id": "https://www.globalbattery.org/media/publications/gba-rulebook-v2.0-master.pdf#BatteryAssembly", + "name": "Battery Assembly Guidelines", + "thresholdValues": [ + { + "type": ["Metric"], + "metricName": "Minimum compressive strength", + "metricValue": { "value": 500, "unit": "MPA" } + } + ] + } + ], + "conformance": true, + "conformityTopic": "environment.energy", + "conformityEvidence": { + "type": ["SecureLink", "Link"], + "linkURL": "https://example-certifier.com/evidence/1234567.json", + "hashDigest": "6239119dda5bd4c8a6ffb832fe16feaa5c27b7dba154d24c53d4470a2c69adc2", + "hashMethod": "SHA-256", + "linkName": "Declaration link name", + "linkType": "https://test.uncefact.org/vocabulary/linkTypes/dcc", + "encryptionMethod": "AES" + } + }, + { + "type": ["Claim", "Declaration"], + "assessmentDate": "2024-04-25", + "declaredValue": [ + { + "type": ["Metric"], + "metricName": "GHG emissions intensity", + "metricValue": { "value": 1.5, "unit": "kg" }, + "score": "1.2", + "accuracy": 0.8 + }, + { + "type": ["Metric"], + "metricName": "GHG emissions intensity", + "metricValue": { "value": 1.5, "unit": "kg" }, + "score": "1.2", + "accuracy": 0.8 + } + ], + "id": "https://products.example-company.com/09520123456788/declarations/12345", + "referenceStandard": { + "type": ["Standard"], + "id": "https://www.iso.org/standard/60857.html", + "name": "Standard", + "issuingParty": { + "type": ["Identifier"], + "id": "https://iso.org/issuing-party/123", + "name": "International Organization" + }, + "issueDate": "2023-12-05" + }, + "referenceRegulation": { + "type": ["Regulation"], + "id": "https://www.legislation.gov.au/F2008L02309/latest/versions", + "name": "National Greenhouse", + "jurisdictionCountry": "Australia", + "administeredBy": { + "type": ["Identifier"], + "id": "https://gov.au/admin-body/12345", + "name": "Australian Government" + }, + "effectiveDate": "2024-03-20" + }, + "assessmentCriteria": [ + { + "type": ["Criterion"], + "id": "https://www.globalbattery.org/media/publications/gba-rulebook-v2.0-master.pdf#BatteryAssembly", + "name": "Battery Assembly Guidelines", + "thresholdValues": [ + { + "type": ["Metric"], + "metricName": "Minimum compressive strength", + "metricValue": { "value": 500, "unit": "MPA" } + } + ] + } + ], + "conformance": false, + "conformityTopic": "environment.energy", + "conformityEvidence": { + "type": ["SecureLink", "Link"], + "linkURL": "https://example-certifier.com/evidence/1234567.json", + "hashDigest": "6239119dda5bd4c8a6ffb832fe16feaa5c27b7dba154d24c53d4470a2c69adc2", + "hashMethod": "SHA-256", + "linkName": "Declaration link name", + "linkType": "https://test.uncefact.org/vocabulary/linkTypes/dcc", + "encryptionMethod": "AES" + } + }, + { + "type": ["Claim", "Declaration"], + "assessmentDate": "2024-04-25", + "declaredValue": [ + { + "type": ["Metric"], + "metricName": "GHG emissions intensity", + "metricValue": { "value": 1.5, "unit": "kg" }, + "score": "1.2", + "accuracy": 0.8 + }, + { + "type": ["Metric"], + "metricName": "GHG emissions intensity", + "metricValue": { "value": 1.5, "unit": "kg" }, + "score": "1.2", + "accuracy": 0.8 + } + ], + "id": "https://products.example-company.com/09520123456788/declarations/12345", + "referenceStandard": { + "type": ["Standard"], + "id": "https://www.iso.org/standard/60857.html", + "name": "Standard", + "issuingParty": { + "type": ["Identifier"], + "id": "https://iso.org/issuing-party/123", + "name": "International Organization" + }, + "issueDate": "2023-12-05" + }, + "referenceRegulation": { + "type": ["Regulation"], + "id": "https://www.legislation.gov.au/F2008L02309/latest/versions", + "name": "National Greenhouse", + "jurisdictionCountry": "Australia", + "administeredBy": { + "type": ["Identifier"], + "id": "https://gov.au/admin-body/12345", + "name": "Australian Government" + }, + "effectiveDate": "2024-03-20" + }, + "assessmentCriteria": [ + { + "type": ["Criterion"], + "id": "https://www.globalbattery.org/media/publications/gba-rulebook-v2.0-master.pdf#BatteryAssembly", + "name": "Battery Assembly Guidelines", + "thresholdValues": [ + { + "type": ["Metric"], + "metricName": "Minimum compressive strength", + "metricValue": { "value": 500, "unit": "MPA" } + } + ] + } + ], + "conformance": false, + "conformityTopic": "environment.energy", + "conformityEvidence": { + "type": ["SecureLink", "Link"], + "linkURL": "https://example-certifier.com/evidence/1234567.json", + "hashDigest": "6239119dda5bd4c8a6ffb832fe16feaa5c27b7dba154d24c53d4470a2c69adc2", + "hashMethod": "SHA-256", + "linkName": "Declaration link name", + "linkType": "https://test.uncefact.org/vocabulary/linkTypes/dcc", + "encryptionMethod": "AES" + } + }, + { + "type": ["Claim", "Declaration"], + "assessmentDate": "2024-04-25", + "declaredValue": [ + { + "type": ["Metric"], + "metricName": "GHG emissions intensity", + "metricValue": { "value": 1.5, "unit": "kg" }, + "score": "1.2", + "accuracy": 0.8 + }, + { + "type": ["Metric"], + "metricName": "GHG emissions intensity", + "metricValue": { "value": 1.5, "unit": "kg" }, + "score": "1.2", + "accuracy": 0.8 + } + ], + "id": "https://products.example-company.com/09520123456788/declarations/12345", + "referenceStandard": { + "type": ["Standard"], + "id": "https://www.iso.org/standard/60857.html", + "name": "Standard", + "issuingParty": { + "type": ["Identifier"], + "id": "https://iso.org/issuing-party/123", + "name": "International Organization" + }, + "issueDate": "2023-12-05" + }, + "referenceRegulation": { + "type": ["Regulation"], + "id": "https://www.legislation.gov.au/F2008L02309/latest/versions", + "name": "National Greenhouse", + "jurisdictionCountry": "Australia", + "administeredBy": { + "type": ["Identifier"], + "id": "https://gov.au/admin-body/12345", + "name": "Australian Government" + }, + "effectiveDate": "2024-03-20" + }, + "assessmentCriteria": [ + { + "type": ["Criterion"], + "id": "https://www.globalbattery.org/media/publications/gba-rulebook-v2.0-master.pdf#BatteryAssembly", + "name": "Battery Assembly Guidelines", + "thresholdValues": [ + { + "type": ["Metric"], + "metricName": "Minimum compressive strength", + "metricValue": { "value": 500, "unit": "MPA" } + } + ] + } + ], + "conformance": false, + "conformityTopic": "environment.energy", + "conformityEvidence": { + "type": ["SecureLink", "Link"], + "linkURL": "https://example-certifier.com/evidence/1234567.json", + "hashDigest": "6239119dda5bd4c8a6ffb832fe16feaa5c27b7dba154d24c53d4470a2c69adc2", + "hashMethod": "SHA-256", + "linkName": "Declaration link name", + "linkType": "https://test.uncefact.org/vocabulary/linkTypes/dcc", + "encryptionMethod": "AES" + } + }, + { + "type": ["Claim", "Declaration"], + "assessmentDate": "2024-04-25", + "declaredValue": [ + { + "type": ["Metric"], + "metricName": "GHG emissions intensity", + "metricValue": { "value": 1.5, "unit": "kg" }, + "score": "1.2", + "accuracy": 0.8 + }, + { + "type": ["Metric"], + "metricName": "GHG emissions intensity", + "metricValue": { "value": 1.5, "unit": "kg" }, + "score": "1.2", + "accuracy": 0.8 + } + ], + "id": "https://products.example-company.com/09520123456788/declarations/12345", + "referenceStandard": { + "type": ["Standard"], + "id": "https://www.iso.org/standard/60857.html", + "name": "Standard", + "issuingParty": { + "type": ["Identifier"], + "id": "https://iso.org/issuing-party/123", + "name": "International Organization" + }, + "issueDate": "2023-12-05" + }, + "referenceRegulation": { + "type": ["Regulation"], + "id": "https://www.legislation.gov.au/F2008L02309/latest/versions", + "name": "National Greenhouse", + "jurisdictionCountry": "Australia", + "administeredBy": { + "type": ["Identifier"], + "id": "https://gov.au/admin-body/12345", + "name": "Australian Government" + }, + "effectiveDate": "2024-03-20" + }, + "assessmentCriteria": [ + { + "type": ["Criterion"], + "id": "https://www.globalbattery.org/media/publications/gba-rulebook-v2.0-master.pdf#BatteryAssembly", + "name": "Battery Assembly Guidelines", + "thresholdValues": [ + { + "type": ["Metric"], + "metricName": "Minimum compressive strength", + "metricValue": { "value": 500, "unit": "MPA" } + } + ] + } + ], + "conformance": false, + "conformityTopic": "environment.energy", + "conformityEvidence": { + "type": ["SecureLink", "Link"], + "linkURL": "https://example-certifier.com/evidence/1234567.json", + "hashDigest": "6239119dda5bd4c8a6ffb832fe16feaa5c27b7dba154d24c53d4470a2c69adc2", + "hashMethod": "SHA-256", + "linkName": "Declaration link name", + "linkType": "https://test.uncefact.org/vocabulary/linkTypes/dcc", + "encryptionMethod": "AES" + } + } + ], + "circularityScorecard": { + "type": ["CircularityPerformance"], + "recyclingInformation": { + "type": ["Link"], + "linkURL": "https://example-company.com/recycling/1234567", + "linkName": "Recycling Information" + }, + "repairInformation": { + "type": ["Link"], + "linkURL": "https://example-company.com/repair/1234567", + "linkName": "Repair Instructions" + }, + "recyclableContent": 67, + "recycledContent": 86, + "utilityFactor": 1.2, + "materialCircularityIndicator": 0.67 + }, + "emissionsScorecard": { + "type": ["EmissionsPerformance"], + "carbonFootprint": 12.5, + "declaredUnit": "kg", + "operationalScope": "CradleToGate", + "primarySourcedRatio": 75, + "reportingStandard": { + "type": ["Standard"], + "id": "https://www.ifrs.org/standards/issb/s2", + "name": "WBSCD Pathfinder framework - V.2.0", + "issuingParty": { + "type": ["Identifier"], + "id": "https://id.ifrs.org/issuing-party/123", + "name": "International Financial Reporting Standards Foundation", + "registeredId": "90664869327", + "idScheme": { + "type": ["IdentifierScheme"], + "id": "https://id.ifrs.org/issuing-party/", + "name": "IFRS Issuing Party" + } + }, + "issueDate": "2024-04-25" + } + }, + "traceabilityInformation": { + "valueChainProcess": "Spinning", + "verifiedRatio": 0.5, + "traceabilityEvent": [ + { + "linkURL": "https://files.example-certifier.com/1234567.json", + "linkName": "Transaction Event", + "linkType": "https://test.uncefact.org/vocabulary/linkTypes/dcc", + "hashDigest": "6239119", + "hashMethod": "SHA-256", + "encryptionMethod": "AES" + } + ] + } + }, + "className": "json-form", + "style": { + "margin": "40px auto", + "paddingTop": "40px", + "width": "80%" + } + }, + "constructData": { + "mappingFields": [ + { + "sourcePath": "/linkResolver", + "destinationPath": "/traceabilityInformation/traceabilityEvent/0/linkURL" + } + ], + "dummyFields": [ + { + "path": "/traceabilityInformation/0/eventType", + "data": "transaction" + } + ], + "generationFields": [] + } + } + ] + } + }, + { + "name": "CustomButton", + "type": "Submit", + "props": {} + } + ], + "services": [ + { + "name": "processDPP", + "parameters": [ + { + "vckit": { + "vckitAPIUrl": "http://localhost:3332/v2", + "issuer": { + "id": "did:web:6028-115-79-212-164.ngrok-free.app", + "name": "Fumigation and Freight Forwarding Facility" + }, + "headers": { + "Authorization": "Bearer test123" + } + }, + "dpp": { + "context": ["https://vocabulary.uncefact.org/untp/dpp/0.5.0/"], + "renderTemplate": [ + { + "template": " Digital Product Passport

PRODUCT PASSPORT

{{credentialSubject.name}}

{{credentialSubject.description}}
{{#each credentialSubject.furtherInformation}} {{linkName}} {{/each}}
{{#if credentialSubject.characteristic}}
Characteristics
{{#each credentialSubject.characteristic}}
{{@key}}

{{this}}

{{/each}}
{{/if}}

Circularity Scorecard

The circularity Scorecard provides a simple high level summary of circularity performance of the product.

{{credentialSubject.circularityScorecard.recyclableContent}}%

Recyclable content

{{credentialSubject.circularityScorecard.recycledContent}}%

Recycled content

{{credentialSubject.circularityScorecard.utilityFactor}}

Utility factor

{{credentialSubject.circularityScorecard.materialCircularityIndicator}}

Material circularity*

*The Material Circularity Indicator provides an overall circularity score which is a function of all three of the earlier measures.

Emissions Scorecard

The Emissions Scorecard gives a clear snapshot of the product's greenhouse gas (GHG) emissions performance, providing a single indicator to assess its overall environmental impact.

{{credentialSubject.emissionsScorecard.carbonFootprint}}{{credentialSubject.emissionsScorecard.declaredUnit}}

Co2Eq

Scope includes

{{credentialSubject.emissionsScorecard.operationalScope}}

Primary sourced ratio*

{{credentialSubject.emissionsScorecard.primarySourcedRatio}}% primary sources

Issue date

{{credentialSubject.emissionsScorecard.reportingStandard.issueDate}}

*

The Primary Sourced Ratio shows the percentage of scope 3 emissions data that is directly collected from actual sources, rather than being based on estimates.

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}}
Production
Product category

{{#each credentialSubject.productCategory}}{{name}}{{#unless @last}},{{/unless}} {{/each}}

Date produced

{{credentialSubject.productionDate}}

Country

{{credentialSubject.countryOfProduction}}

Dimensions

Weight: {{credentialSubject.dimensions.weight.value}}{{credentialSubject.dimensions.weight.unit}} Length: {{credentialSubject.dimensions.length.value}}{{credentialSubject.dimensions.length.unit}} Width: {{credentialSubject.dimensions.width.value}}{{credentialSubject.dimensions.width.unit}} Height: {{credentialSubject.dimensions.height.value}}{{credentialSubject.dimensions.height.unit}} Volume: {{credentialSubject.dimensions.volume.value}}{{credentialSubject.dimensions.volume.unit}}

Product composition

A complete list of materials that make up the composition of this product.

{{#each credentialSubject.materialsProvenance}}

{{massFraction}}%

{{massAmount.value}}{{massAmount.unit}} {{name}}

Recycled {{recycledAmount}}%

Hazard {{#if hazardous}}Yes{{else}}No{{/if}}

{{materialSafetyInformation.linkName}}
{{originCountry}}
{{/each}}

History

{{!-- start: Supply chain due diligence report --}}
Supply chain due diligence report
{{!-- end: Supply chain due diligence report --}}

{{credentialSubject.traceabilityInformation.valueChainProcess}}

Verified ratio {{credentialSubject.traceabilityInformation.verifiedRatio}}

{{#each credentialSubject.traceabilityInformation.traceabilityEvent}}
{{linkName}} View
{{/each}}

Passport issued by

Organisation

{{issuer.name}}

Registered ID {{issuer.id}}
Valid from

{{validFrom}}

Valid to

{{validUntil}}

This Digital Product Passport (DPP) is a digital record of the product's sustainability and environmental performance, ensuring transparency and accountability in line with UNTP standards. The DPP can be verified at any time using the QR code or visiting www.untp-certification.org with the passport ID.

PRODUCT PASSPORT
{{credentialSubject.name}}
Batch: {{credentialSubject.batchNumber}}
Serial: {{credentialSubject.serialNumber}}

{{credentialSubject.description}}

{{#each credentialSubject.furtherInformation}}
{{linkName}}
{{/each}}
{{#if credentialSubject.characteristic}}
Characteristics
{{#each credentialSubject.characteristic}}
{{@key}}
{{this}}
{{/each}}
{{/if}}
Circularity Scorecard

The circularity Scorecard provides a simple high level summary of circularity performance of the product.

{{credentialSubject.circularityScorecard.recyclableContent}}%
Recyclable content
{{credentialSubject.circularityScorecard.recycledContent}}%
Recycled content
{{credentialSubject.circularityScorecard.utilityFactor}}
Utility factor
{{credentialSubject.circularityScorecard.materialCircularityIndicator}}
Material circularity*

*The Material Circularity Indicator provides an overall circularity score which is a function of all three of the earlier measures.

Emissions Scorecard

The Emissions Scorecard gives a clear snapshot of the product's greenhouse gas (GHG) emissions performance, providing a single indicator to assess its overall environmental impact.

{{credentialSubject.emissionsScorecard.carbonFootprint}}{{credentialSubject.emissionsScorecard.declaredUnit}}

Co2Eq

Scope includes
{{credentialSubject.emissionsScorecard.operationalScope}}
Primary sourced ratio*
{{credentialSubject.emissionsScorecard.primarySourcedRatio}}% primary sources

The Primary Sourced Ratio shows the percentage of scope 3 emissions data that is directly collected from actual sources, rather than being based on estimates.

Issue date
{{credentialSubject.emissionsScorecard.reportingStandard.issueDate}}
*
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}}
Production
Product category
{{#each credentialSubject.productCategory}}{{name}}{{#unless @last}},{{/unless}} {{/each}}
Date produced
{{credentialSubject.productionDate}}
Country
{{credentialSubject.countryOfProduction}}
Dimensions
Weight: {{credentialSubject.dimensions.weight.value}}{{credentialSubject.dimensions.weight.unit}} Length: {{credentialSubject.dimensions.length.value}}{{credentialSubject.dimensions.length.unit}} Width: {{credentialSubject.dimensions.width.value}}{{credentialSubject.dimensions.width.unit}} Height: {{credentialSubject.dimensions.height.value}}{{credentialSubject.dimensions.height.unit}} Volume: {{credentialSubject.dimensions.volume.value}}{{credentialSubject.dimensions.volume.unit}}
Composition

The Product Composition List details the materials and components used in the product, providing transparency on the origin and nature of each element.

{{#each credentialSubject.materialsProvenance}}
{{massFraction}}%
{{massAmount.value}}{{massAmount.unit}} {{name}}
Recycled {{#if recycledAmount}}{{recycledAmount}}{{else}}0{{/if}}%
Hazard {{#if hazardous}}Yes{{else}}No{{/if}}
{{originCountry}}
{{/each}}
History
{{!-- start: Supply chain due diligence report --}}
Supply chain due diligence report
{{!-- end: Supply chain due diligence report --}}

{{credentialSubject.traceabilityInformation.valueChainProcess}}

Verified ratio {{credentialSubject.traceabilityInformation.verifiedRatio}}

{{#each credentialSubject.traceabilityInformation.traceabilityEvent}}
{{linkName}} View
{{/each}}
Passport issued by
Organisation
{{issuer.name}}
Registered ID
Valid from
{{validFrom}}
Valid to
{{validUntil}}

This Digital Product Passport (DPP) is a digital record of the product’s sustainability and environmental performance, ensuring transparency and accountability in line with UNTP standards. The DPP can be verified at any time using the QR code or visiting www.untp-certification.org with the passport ID.

", + "@type": "WebRenderingTemplate2022" + } + ], + "type": ["DigitalProductPassport"], + "dlrLinkTitle": "Cherries Product Passport", + "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": { + "resultPath": "/uri", + "bucket": "verifiable-credentials" + }, + "options": { + "method": "POST", + "headers": { + "Content-Type": "application/json" + } + } + }, + "identifierKeyPath": "/id" + } + ] + }, + { + "name": "mergeToLocalStorage", + "parameters": [ + { + "storageKey": "CherriesFarm_dpps", + "objectKeyPath": "/decodedEnvelopedVC/credentialSubject/id" + } + ] + } + ] + }, + { + "name": "Move to Next Facility", + "id": "transaction_product", + "components": [ + { + "name": "LocalStorageLoader", + "type": "EntryData", + "props": { + "storageKey": "CherriesFarm_dpps", + "nestedComponents": [ + { + "name": "JsonForm", + "type": "EntryData", + "props": { + "schema": { + "url": "https://jargon.sh/user/unece/traceabilityEvents/v/working/artefacts/jsonSchemas/TransactionEvent.json?class=TransactionEvent" + } + }, + "constructData": { + "mappingFields": [ + { + "sourcePath": "/decodedEnvelopedVC/credentialSubject/id", + "destinationPath": "/epcList/index/name" + }, + { + "sourcePath": "/linkResolver", + "destinationPath": "/epcList/index/id" + }, + { + "sourcePath": "/decodedEnvelopedVC/credentialSubject/name", + "destinationPath": "/quantityList/0/productName" + }, + { + "sourcePath": "/linkResolver", + "destinationPath": "/quantityList/0/productId" + } + ], + "dummyFields": [ + { + "path": "/type", + "data": ["TransactionEvent", "Event"] + }, + { + "path": "/id", + "data": "https://events.sample.com/01/09359502000034/21/123456" + }, + { + "path": "/processType", + "data": "Weaving" + }, + { + "path": "/eventTime", + "data": "2024-09-01T12:00:00" + }, + { + "path": "/action", + "data": "add" + }, + { + "path": "/disposition", + "data": "https://ref.gs1.org/cbv/Disp-active" + }, + { + "path": "/bizStep", + "data": "https://ref.gs1.org/cbv/BizStep-commissioning" + }, + { + "path": "/bizLocation", + "data": "https://id.gs1.org/414/9520123456788" + }, + { + "path": "/sensorElementList/0/sensorMetadata/device/type", + "data": ["Item"] + }, + { + "path": "/sensorElementList/0/sensorMetadata/device/id", + "data": "https://id.gs1.org/01/09520123456788/21/12345" + }, + { + "path": "/sensorElementList/0/sensorMetadata/device/name", + "data": "EV battery 300Ah." + }, + { + "path": "/sensorElementList/0/sensorMetadata/dataProcessingMethod", + "data": "https://standards.org/sensorMethod#1234" + }, + { + "path": "/sensorElementList/0/sensorReport/0/time", + "data": "2024-07-24T12:00:00" + }, + { + "path": "/sensorElementList/0/sensorReport/0/sensorType", + "data": "https://samplesensors.com/model1234" + }, + { + "path": "/sensorElementList/0/sensorReport/0/value", + "data": 25 + }, + { + "path": "/sensorElementList/0/sensorReport/0/uom", + "data": "KGM" + }, + { + "path": "/sensorElementList/0/sensorIntegrityProof", + "data": "https://jargon.sh" + }, + { + "path": "/sourcePartyId", + "data": "https://abr.business.gov.au/ABN/View?abn=90664869327" + }, + { + "path": "/destinationPartyId", + "data": "https://abr.business.gov.au/ABN/View?abn=90664869327" + }, + { + "path": "/bizTransaction", + "data": "https://ref.gs1.org/cbv/BTT-prodorder" + }, + { + "path": "/epcList/0/type", + "data": ["Item"] + }, + { + "path": "/quantityList/0/quantity", + "data": 20 + }, + { + "path": "/quantityList/0/uom", + "data": "KGM" + } + ], + "generationFields": [ + { + "path": "/eventTime", + "handler": "generateCurrentDatetime" + } + ] + } + } + ] + } + }, + { + "name": "CustomButton", + "type": "Submit", + "props": { + "includeDownload": true, + "downloadFileName": "transaction" + } + } + ], + "services": [ + { "name": "convertObjectToArray1Item", "parameters": [{ "path": "/data" }] }, + { + "name": "processTransactionEvent", + "parameters": [ + { + "vckit": { + "vckitAPIUrl": "http://localhost:3332/v2", + "issuer": { + "id": "did:web:6028-115-79-212-164.ngrok-free.app", + "name": "Fumigation and Freight Forwarding Facility" + }, + "headers": { + "Authorization": "Bearer test123" + } + }, + "traceabilityEvent": { + "context": ["https://vocabulary.uncefact.org/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": "Transaction 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": { + "resultPath": "/uri", + "bucket": "verifiable-credentials" + }, + "options": { + "method": "POST", + "headers": { + "Content-Type": "application/json" + } + } + }, + "identifierKeyPath": "/0/id", + "localStorageParams": { "storageKey": "CherriesFarm_dpps", "keyPath": "/0/epcList/index/name" } + } + ] + }, + { + "name": "mergeToLocalStorage", + "parameters": [ + { + "storageKey": "orchard_facility_transaction_event", + "objectKeyPath": "/decodedEnvelopedVC/credentialSubject/0/id" + } + ] + } + ] + } + ] + }, + { + "name": "Airport Terminal Facility", + "type": "producer", + "assets": { + "logo": "Cherries-farm-logo.webp", + "brandTitle": "Airport Terminal" + }, + "styles": { + "primaryColor": "#b5651d", + "secondaryColor": "#391561", + "tertiaryColor": "#ffffff" + }, + "features": [ + { + "name": "Issue DPP", + "id": "produce_product", + "components": [ + { + "name": "LocalStorageLoader", + "type": "EntryData", + "props": { + "storageKey": "orchard_facility_transaction_event", + "nestedComponents": [ + { + "name": "JsonForm", + "type": "EntryData", + "props": { + "schema": { + "url": "https://jargon.sh/user/unece/DigitalProductPassport/v/working/artefacts/jsonSchemas/Product.json?class=Product" + }, + "data": { + "type": ["Product"], + "id": "https://example.com/01/09359502000034", + "name": "EcoCharge Lithium-Ion Battery", + "registeredId": "095201234", + "idScheme": { + "type": ["IdentifierScheme"], + "id": "https://id.gs1.org/01/", + "name": "Global Trade Identification Number (GTIN)" + }, + "serialNumber": "12345678", + "batchNumber": "6789", + "productImage": { + "type": ["Link"], + "linkURL": "https://c.animaapp.com/b3vf2M20/img/pp-header@2x.png", + "linkName": "EV Battery 300Ah Image" + }, + "description": "The EcoCharge EC-5000 Lithium-Ion Battery is a high-capacity, 5000mAh battery designed for performance and sustainability. Manufactured with responsibly sourced materials and a 95% recyclability rate, it reduces lifecycle emissions through eco-friendly production and verified recycling programs.", + "productCategory": [ + { + "type": ["Classification"], + "id": "https://unstats.un.org/unsd/classifications/Econ/cpc/46410", + "code": "46410", + "name": "Primary cells", + "schemeID": "https://unstats.un.org/unsd/classifications/Econ/cpc/", + "schemeName": "UN Central Product Classification (CPC)" + }, + { + "type": ["Classification"], + "id": "https://unstats.un.org/unsd/classifications/Econ/cpc/46410", + "code": "46410", + "name": "Primary batteries", + "schemeID": "https://unstats.un.org/unsd/classifications/Econ/cpc/", + "schemeName": "UN Central Product Classification (CPC)" + } + ], + "furtherInformation": [ + { + "type": ["Link"], + "linkURL": "https://example-company.com/product-information/1234567", + "linkName": "Name of document that is further information" + }, + { + "type": ["Link"], + "linkURL": "https://example-company.com/product-information/1234567", + "linkName": "Name of additional document that is further information" + } + ], + "producedByParty": { + "type": ["Identifier"], + "id": "https://id.example-company.com/party/6789", + "name": "Example Manufacturing Co." + }, + "producedAtFacility": { + "type": ["Identifier"], + "id": "https://id.example-company.com/facility/123", + "name": "Green Acres Battery Factory" + }, + "dimensions": { + "type": ["Dimension"], + "weight": { "value": 10, "unit": "kg" }, + "length": { "value": 90, "unit": "mm" }, + "width": { "value": 60, "unit": "mm" }, + "height": { "value": 10, "unit": "mm" }, + "volume": { "value": 7.5, "unit": "L" } + }, + "characteristic": { + "Battery status": "Recycled", + "Battery cell type": "Prismatic", + "Number of cells per battery": "180", + "Total energy": "100kwh" + }, + "productionDate": "15 August 2024", + "countryOfProduction": "Australia", + "granularityLevel": "item", + "dueDiligenceDeclaration": { + "type": ["Link"], + "linkURL": "https://example-company.com/due-diligence/1234567", + "linkName": "Due Diligence Declaration" + }, + "materialsProvenance": [ + { + "type": ["Material"], + "name": "Material", + "originCountry": "AU", + "materialType": { + "type": ["Classification"], + "id": "https://unfc.org/material-type/Lithium", + "name": "Lithium" + }, + "massFraction": 20, + "massAmount": { "value": 1.0, "unit": "kg" }, + "recycledAmount": 0, + "hazardous": false + }, + { + "type": ["Material"], + "name": "Material", + "originCountry": "AU", + "materialType": { + "type": ["Classification"], + "id": "https://unfc.org/material-type/Lithium", + "name": "Lithium" + }, + "massFraction": 20, + "massAmount": { "value": 1.0, "unit": "kg" }, + "recycledAmount": 10, + "hazardous": true, + "materialSafetyInformation": { + "type": ["Link"], + "linkURL": "https://example.com/safety-info/lithium-spodumene.pdf", + "linkName": "Material Safety Data Sheet", + "linkType": "https://test.uncefact.org/vocabulary/linkTypes/safetyData" + } + }, + { + "type": ["Material"], + "name": "Material", + "originCountry": "AU", + "materialType": { + "type": ["Classification"], + "id": "https://unfc.org/material-type/Lithium", + "name": "Lithium" + }, + "massFraction": 20, + "massAmount": { "value": 1.0, "unit": "kg" }, + "recycledAmount": 0, + "hazardous": false + }, + { + "type": ["Material"], + "name": "Material", + "originCountry": "AU", + "materialType": { + "type": ["Classification"], + "id": "https://unfc.org/material-type/Lithium", + "name": "Lithium" + }, + "massFraction": 20, + "massAmount": { "value": 1.0, "unit": "kg" }, + "recycledAmount": 0, + "hazardous": false + } + ], + "conformityClaim": [ + { + "type": ["Claim", "Declaration"], + "assessmentDate": "2024-04-25", + "declaredValue": [ + { + "type": ["Metric"], + "metricName": "GHG emissions intensity", + "metricValue": { "value": 1.5, "unit": "kg" }, + "score": "1.2", + "accuracy": 0.8 + }, + { + "type": ["Metric"], + "metricName": "GHG emissions intensity", + "metricValue": { "value": 1.5, "unit": "kg" }, + "score": "1.2", + "accuracy": 0.8 + } + ], + "id": "https://products.example-company.com/09520123456788/declarations/12345", + "referenceStandard": { + "type": ["Standard"], + "id": "https://www.iso.org/standard/60857.html", + "name": "Standard", + "issuingParty": { + "type": ["Identifier"], + "id": "https://iso.org/issuing-party/123", + "name": "International Organization" + }, + "issueDate": "2023-12-05" + }, + "referenceRegulation": { + "type": ["Regulation"], + "id": "https://www.legislation.gov.au/F2008L02309/latest/versions", + "name": "National Greenhouse", + "jurisdictionCountry": "Australia", + "administeredBy": { + "type": ["Identifier"], + "id": "https://gov.au/admin-body/12345", + "name": "Australian Government" + }, + "effectiveDate": "2024-03-20" + }, + "assessmentCriteria": [ + { + "type": ["Criterion"], + "id": "https://www.globalbattery.org/media/publications/gba-rulebook-v2.0-master.pdf#BatteryAssembly", + "name": "Battery Assembly Guidelines", + "thresholdValues": [ + { + "type": ["Metric"], + "metricName": "Minimum compressive strength", + "metricValue": { "value": 500, "unit": "MPA" } + } + ] + } + ], + "conformance": true, + "conformityTopic": "environment.energy", + "conformityEvidence": { + "type": ["SecureLink", "Link"], + "linkURL": "https://example-certifier.com/evidence/1234567.json", + "hashDigest": "6239119dda5bd4c8a6ffb832fe16feaa5c27b7dba154d24c53d4470a2c69adc2", + "hashMethod": "SHA-256", + "linkName": "Declaration link name", + "linkType": "https://test.uncefact.org/vocabulary/linkTypes/dcc", + "encryptionMethod": "AES" + } + }, + { + "type": ["Claim", "Declaration"], + "assessmentDate": "2024-04-25", + "declaredValue": [ + { + "type": ["Metric"], + "metricName": "GHG emissions intensity", + "metricValue": { "value": 1.5, "unit": "kg" }, + "score": "1.2", + "accuracy": 0.8 + }, + { + "type": ["Metric"], + "metricName": "GHG emissions intensity", + "metricValue": { "value": 1.5, "unit": "kg" }, + "score": "1.2", + "accuracy": 0.8 + } + ], + "id": "https://products.example-company.com/09520123456788/declarations/12345", + "referenceStandard": { + "type": ["Standard"], + "id": "https://www.iso.org/standard/60857.html", + "name": "Standard", + "issuingParty": { + "type": ["Identifier"], + "id": "https://iso.org/issuing-party/123", + "name": "International Organization" + }, + "issueDate": "2023-12-05" + }, + "referenceRegulation": { + "type": ["Regulation"], + "id": "https://www.legislation.gov.au/F2008L02309/latest/versions", + "name": "National Greenhouse", + "jurisdictionCountry": "Australia", + "administeredBy": { + "type": ["Identifier"], + "id": "https://gov.au/admin-body/12345", + "name": "Australian Government" + }, + "effectiveDate": "2024-03-20" + }, + "assessmentCriteria": [ + { + "type": ["Criterion"], + "id": "https://www.globalbattery.org/media/publications/gba-rulebook-v2.0-master.pdf#BatteryAssembly", + "name": "Battery Assembly Guidelines", + "thresholdValues": [ + { + "type": ["Metric"], + "metricName": "Minimum compressive strength", + "metricValue": { "value": 500, "unit": "MPA" } + } + ] + } + ], + "conformance": false, + "conformityTopic": "environment.energy", + "conformityEvidence": { + "type": ["SecureLink", "Link"], + "linkURL": "https://example-certifier.com/evidence/1234567.json", + "hashDigest": "6239119dda5bd4c8a6ffb832fe16feaa5c27b7dba154d24c53d4470a2c69adc2", + "hashMethod": "SHA-256", + "linkName": "Declaration link name", + "linkType": "https://test.uncefact.org/vocabulary/linkTypes/dcc", + "encryptionMethod": "AES" + } + }, + { + "type": ["Claim", "Declaration"], + "assessmentDate": "2024-04-25", + "declaredValue": [ + { + "type": ["Metric"], + "metricName": "GHG emissions intensity", + "metricValue": { "value": 1.5, "unit": "kg" }, + "score": "1.2", + "accuracy": 0.8 + }, + { + "type": ["Metric"], + "metricName": "GHG emissions intensity", + "metricValue": { "value": 1.5, "unit": "kg" }, + "score": "1.2", + "accuracy": 0.8 + } + ], + "id": "https://products.example-company.com/09520123456788/declarations/12345", + "referenceStandard": { + "type": ["Standard"], + "id": "https://www.iso.org/standard/60857.html", + "name": "Standard", + "issuingParty": { + "type": ["Identifier"], + "id": "https://iso.org/issuing-party/123", + "name": "International Organization" + }, + "issueDate": "2023-12-05" + }, + "referenceRegulation": { + "type": ["Regulation"], + "id": "https://www.legislation.gov.au/F2008L02309/latest/versions", + "name": "National Greenhouse", + "jurisdictionCountry": "Australia", + "administeredBy": { + "type": ["Identifier"], + "id": "https://gov.au/admin-body/12345", + "name": "Australian Government" + }, + "effectiveDate": "2024-03-20" + }, + "assessmentCriteria": [ + { + "type": ["Criterion"], + "id": "https://www.globalbattery.org/media/publications/gba-rulebook-v2.0-master.pdf#BatteryAssembly", + "name": "Battery Assembly Guidelines", + "thresholdValues": [ + { + "type": ["Metric"], + "metricName": "Minimum compressive strength", + "metricValue": { "value": 500, "unit": "MPA" } + } + ] + } + ], + "conformance": false, + "conformityTopic": "environment.energy", + "conformityEvidence": { + "type": ["SecureLink", "Link"], + "linkURL": "https://example-certifier.com/evidence/1234567.json", + "hashDigest": "6239119dda5bd4c8a6ffb832fe16feaa5c27b7dba154d24c53d4470a2c69adc2", + "hashMethod": "SHA-256", + "linkName": "Declaration link name", + "linkType": "https://test.uncefact.org/vocabulary/linkTypes/dcc", + "encryptionMethod": "AES" + } + }, + { + "type": ["Claim", "Declaration"], + "assessmentDate": "2024-04-25", + "declaredValue": [ + { + "type": ["Metric"], + "metricName": "GHG emissions intensity", + "metricValue": { "value": 1.5, "unit": "kg" }, + "score": "1.2", + "accuracy": 0.8 + }, + { + "type": ["Metric"], + "metricName": "GHG emissions intensity", + "metricValue": { "value": 1.5, "unit": "kg" }, + "score": "1.2", + "accuracy": 0.8 + } + ], + "id": "https://products.example-company.com/09520123456788/declarations/12345", + "referenceStandard": { + "type": ["Standard"], + "id": "https://www.iso.org/standard/60857.html", + "name": "Standard", + "issuingParty": { + "type": ["Identifier"], + "id": "https://iso.org/issuing-party/123", + "name": "International Organization" + }, + "issueDate": "2023-12-05" + }, + "referenceRegulation": { + "type": ["Regulation"], + "id": "https://www.legislation.gov.au/F2008L02309/latest/versions", + "name": "National Greenhouse", + "jurisdictionCountry": "Australia", + "administeredBy": { + "type": ["Identifier"], + "id": "https://gov.au/admin-body/12345", + "name": "Australian Government" + }, + "effectiveDate": "2024-03-20" + }, + "assessmentCriteria": [ + { + "type": ["Criterion"], + "id": "https://www.globalbattery.org/media/publications/gba-rulebook-v2.0-master.pdf#BatteryAssembly", + "name": "Battery Assembly Guidelines", + "thresholdValues": [ + { + "type": ["Metric"], + "metricName": "Minimum compressive strength", + "metricValue": { "value": 500, "unit": "MPA" } + } + ] + } + ], + "conformance": false, + "conformityTopic": "environment.energy", + "conformityEvidence": { + "type": ["SecureLink", "Link"], + "linkURL": "https://example-certifier.com/evidence/1234567.json", + "hashDigest": "6239119dda5bd4c8a6ffb832fe16feaa5c27b7dba154d24c53d4470a2c69adc2", + "hashMethod": "SHA-256", + "linkName": "Declaration link name", + "linkType": "https://test.uncefact.org/vocabulary/linkTypes/dcc", + "encryptionMethod": "AES" + } + }, + { + "type": ["Claim", "Declaration"], + "assessmentDate": "2024-04-25", + "declaredValue": [ + { + "type": ["Metric"], + "metricName": "GHG emissions intensity", + "metricValue": { "value": 1.5, "unit": "kg" }, + "score": "1.2", + "accuracy": 0.8 + }, + { + "type": ["Metric"], + "metricName": "GHG emissions intensity", + "metricValue": { "value": 1.5, "unit": "kg" }, + "score": "1.2", + "accuracy": 0.8 + } + ], + "id": "https://products.example-company.com/09520123456788/declarations/12345", + "referenceStandard": { + "type": ["Standard"], + "id": "https://www.iso.org/standard/60857.html", + "name": "Standard", + "issuingParty": { + "type": ["Identifier"], + "id": "https://iso.org/issuing-party/123", + "name": "International Organization" + }, + "issueDate": "2023-12-05" + }, + "referenceRegulation": { + "type": ["Regulation"], + "id": "https://www.legislation.gov.au/F2008L02309/latest/versions", + "name": "National Greenhouse", + "jurisdictionCountry": "Australia", + "administeredBy": { + "type": ["Identifier"], + "id": "https://gov.au/admin-body/12345", + "name": "Australian Government" + }, + "effectiveDate": "2024-03-20" + }, + "assessmentCriteria": [ + { + "type": ["Criterion"], + "id": "https://www.globalbattery.org/media/publications/gba-rulebook-v2.0-master.pdf#BatteryAssembly", + "name": "Battery Assembly Guidelines", + "thresholdValues": [ + { + "type": ["Metric"], + "metricName": "Minimum compressive strength", + "metricValue": { "value": 500, "unit": "MPA" } + } + ] + } + ], + "conformance": false, + "conformityTopic": "environment.energy", + "conformityEvidence": { + "type": ["SecureLink", "Link"], + "linkURL": "https://example-certifier.com/evidence/1234567.json", + "hashDigest": "6239119dda5bd4c8a6ffb832fe16feaa5c27b7dba154d24c53d4470a2c69adc2", + "hashMethod": "SHA-256", + "linkName": "Declaration link name", + "linkType": "https://test.uncefact.org/vocabulary/linkTypes/dcc", + "encryptionMethod": "AES" + } + } + ], + "circularityScorecard": { + "type": ["CircularityPerformance"], + "recyclingInformation": { + "type": ["Link"], + "linkURL": "https://example-company.com/recycling/1234567", + "linkName": "Recycling Information" + }, + "repairInformation": { + "type": ["Link"], + "linkURL": "https://example-company.com/repair/1234567", + "linkName": "Repair Instructions" + }, + "recyclableContent": 67, + "recycledContent": 86, + "utilityFactor": 1.2, + "materialCircularityIndicator": 0.67 + }, + "emissionsScorecard": { + "type": ["EmissionsPerformance"], + "carbonFootprint": 12.5, + "declaredUnit": "kg", + "operationalScope": "CradleToGate", + "primarySourcedRatio": 75, + "reportingStandard": { + "type": ["Standard"], + "id": "https://www.ifrs.org/standards/issb/s2", + "name": "WBSCD Pathfinder framework - V.2.0", + "issuingParty": { + "type": ["Identifier"], + "id": "https://id.ifrs.org/issuing-party/123", + "name": "International Financial Reporting Standards Foundation", + "registeredId": "90664869327", + "idScheme": { + "type": ["IdentifierScheme"], + "id": "https://id.ifrs.org/issuing-party/", + "name": "IFRS Issuing Party" + } + }, + "issueDate": "2024-04-25" + } + }, + "traceabilityInformation": { + "valueChainProcess": "Spinning", + "verifiedRatio": 0.5, + "traceabilityEvent": [ + { + "linkURL": "https://files.example-certifier.com/1234567.json", + "linkName": "Transaction Event", + "linkType": "https://test.uncefact.org/vocabulary/linkTypes/dcc", + "hashDigest": "6239119", + "hashMethod": "SHA-256", + "encryptionMethod": "AES" + } + ] + } + }, + "className": "json-form", + "style": { + "margin": "40px auto", + "paddingTop": "40px", + "width": "80%" + } + }, + "constructData": { + "mappingFields": [ + { + "sourcePath": "/linkResolver", + "destinationPath": "/traceabilityInformation/traceabilityEvent/0/linkURL" + } + ], + "dummyFields": [ + { + "path": "/traceabilityInformation/0/eventType", + "data": "transaction" + } + ], + "generationFields": [] + } + } + ] + } + }, + { + "name": "CustomButton", + "type": "Submit", + "props": {} + } + ], + "services": [ + { + "name": "processDPP", + "parameters": [ + { + "vckit": { + "vckitAPIUrl": "http://localhost:3332/v2", + "issuer": { + "id": "did:web:6028-115-79-212-164.ngrok-free.app", + "name": "Airport Terminal Facility" + }, + "headers": { + "Authorization": "Bearer test123" + } + }, + "dpp": { + "context": ["https://vocabulary.uncefact.org/untp/dpp/0.5.0/"], + "renderTemplate": [ + { + "template": " Digital Product Passport

PRODUCT PASSPORT

{{credentialSubject.name}}

{{credentialSubject.description}}
{{#each credentialSubject.furtherInformation}} {{linkName}} {{/each}}
{{#if credentialSubject.characteristic}}
Characteristics
{{#each credentialSubject.characteristic}}
{{@key}}

{{this}}

{{/each}}
{{/if}}

Circularity Scorecard

The circularity Scorecard provides a simple high level summary of circularity performance of the product.

{{credentialSubject.circularityScorecard.recyclableContent}}%

Recyclable content

{{credentialSubject.circularityScorecard.recycledContent}}%

Recycled content

{{credentialSubject.circularityScorecard.utilityFactor}}

Utility factor

{{credentialSubject.circularityScorecard.materialCircularityIndicator}}

Material circularity*

*The Material Circularity Indicator provides an overall circularity score which is a function of all three of the earlier measures.

Emissions Scorecard

The Emissions Scorecard gives a clear snapshot of the product's greenhouse gas (GHG) emissions performance, providing a single indicator to assess its overall environmental impact.

{{credentialSubject.emissionsScorecard.carbonFootprint}}{{credentialSubject.emissionsScorecard.declaredUnit}}

Co2Eq

Scope includes

{{credentialSubject.emissionsScorecard.operationalScope}}

Primary sourced ratio*

{{credentialSubject.emissionsScorecard.primarySourcedRatio}}% primary sources

Issue date

{{credentialSubject.emissionsScorecard.reportingStandard.issueDate}}

*

The Primary Sourced Ratio shows the percentage of scope 3 emissions data that is directly collected from actual sources, rather than being based on estimates.

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}}
Production
Product category

{{#each credentialSubject.productCategory}}{{name}}{{#unless @last}},{{/unless}} {{/each}}

Date produced

{{credentialSubject.productionDate}}

Country

{{credentialSubject.countryOfProduction}}

Dimensions

Weight: {{credentialSubject.dimensions.weight.value}}{{credentialSubject.dimensions.weight.unit}} Length: {{credentialSubject.dimensions.length.value}}{{credentialSubject.dimensions.length.unit}} Width: {{credentialSubject.dimensions.width.value}}{{credentialSubject.dimensions.width.unit}} Height: {{credentialSubject.dimensions.height.value}}{{credentialSubject.dimensions.height.unit}} Volume: {{credentialSubject.dimensions.volume.value}}{{credentialSubject.dimensions.volume.unit}}

Product composition

A complete list of materials that make up the composition of this product.

{{#each credentialSubject.materialsProvenance}}

{{massFraction}}%

{{massAmount.value}}{{massAmount.unit}} {{name}}

Recycled {{recycledAmount}}%

Hazard {{#if hazardous}}Yes{{else}}No{{/if}}

{{materialSafetyInformation.linkName}}
{{originCountry}}
{{/each}}

History

{{!-- start: Supply chain due diligence report --}}
Supply chain due diligence report
{{!-- end: Supply chain due diligence report --}}

{{credentialSubject.traceabilityInformation.valueChainProcess}}

Verified ratio {{credentialSubject.traceabilityInformation.verifiedRatio}}

{{#each credentialSubject.traceabilityInformation.traceabilityEvent}}
{{linkName}} View
{{/each}}

Passport issued by

Organisation

{{issuer.name}}

Registered ID {{issuer.id}}
Valid from

{{validFrom}}

Valid to

{{validUntil}}

This Digital Product Passport (DPP) is a digital record of the product's sustainability and environmental performance, ensuring transparency and accountability in line with UNTP standards. The DPP can be verified at any time using the QR code or visiting www.untp-certification.org with the passport ID.

PRODUCT PASSPORT
{{credentialSubject.name}}
Batch: {{credentialSubject.batchNumber}}
Serial: {{credentialSubject.serialNumber}}

{{credentialSubject.description}}

{{#each credentialSubject.furtherInformation}}
{{linkName}}
{{/each}}
{{#if credentialSubject.characteristic}}
Characteristics
{{#each credentialSubject.characteristic}}
{{@key}}
{{this}}
{{/each}}
{{/if}}
Circularity Scorecard

The circularity Scorecard provides a simple high level summary of circularity performance of the product.

{{credentialSubject.circularityScorecard.recyclableContent}}%
Recyclable content
{{credentialSubject.circularityScorecard.recycledContent}}%
Recycled content
{{credentialSubject.circularityScorecard.utilityFactor}}
Utility factor
{{credentialSubject.circularityScorecard.materialCircularityIndicator}}
Material circularity*

*The Material Circularity Indicator provides an overall circularity score which is a function of all three of the earlier measures.

Emissions Scorecard

The Emissions Scorecard gives a clear snapshot of the product's greenhouse gas (GHG) emissions performance, providing a single indicator to assess its overall environmental impact.

{{credentialSubject.emissionsScorecard.carbonFootprint}}{{credentialSubject.emissionsScorecard.declaredUnit}}

Co2Eq

Scope includes
{{credentialSubject.emissionsScorecard.operationalScope}}
Primary sourced ratio*
{{credentialSubject.emissionsScorecard.primarySourcedRatio}}% primary sources

The Primary Sourced Ratio shows the percentage of scope 3 emissions data that is directly collected from actual sources, rather than being based on estimates.

Issue date
{{credentialSubject.emissionsScorecard.reportingStandard.issueDate}}
*
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}}
Production
Product category
{{#each credentialSubject.productCategory}}{{name}}{{#unless @last}},{{/unless}} {{/each}}
Date produced
{{credentialSubject.productionDate}}
Country
{{credentialSubject.countryOfProduction}}
Dimensions
Weight: {{credentialSubject.dimensions.weight.value}}{{credentialSubject.dimensions.weight.unit}} Length: {{credentialSubject.dimensions.length.value}}{{credentialSubject.dimensions.length.unit}} Width: {{credentialSubject.dimensions.width.value}}{{credentialSubject.dimensions.width.unit}} Height: {{credentialSubject.dimensions.height.value}}{{credentialSubject.dimensions.height.unit}} Volume: {{credentialSubject.dimensions.volume.value}}{{credentialSubject.dimensions.volume.unit}}
Composition

The Product Composition List details the materials and components used in the product, providing transparency on the origin and nature of each element.

{{#each credentialSubject.materialsProvenance}}
{{massFraction}}%
{{massAmount.value}}{{massAmount.unit}} {{name}}
Recycled {{#if recycledAmount}}{{recycledAmount}}{{else}}0{{/if}}%
Hazard {{#if hazardous}}Yes{{else}}No{{/if}}
{{originCountry}}
{{/each}}
History
{{!-- start: Supply chain due diligence report --}}
Supply chain due diligence report
{{!-- end: Supply chain due diligence report --}}

{{credentialSubject.traceabilityInformation.valueChainProcess}}

Verified ratio {{credentialSubject.traceabilityInformation.verifiedRatio}}

{{#each credentialSubject.traceabilityInformation.traceabilityEvent}}
{{linkName}} View
{{/each}}
Passport issued by
Organisation
{{issuer.name}}
Registered ID
Valid from
{{validFrom}}
Valid to
{{validUntil}}

This Digital Product Passport (DPP) is a digital record of the product’s sustainability and environmental performance, ensuring transparency and accountability in line with UNTP standards. The DPP can be verified at any time using the QR code or visiting www.untp-certification.org with the passport ID.

", + "@type": "WebRenderingTemplate2022" + } + ], + "type": ["DigitalProductPassport"], + "dlrLinkTitle": "Cherries Product Passport", + "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": { + "resultPath": "/uri", + "bucket": "verifiable-credentials" + }, + "options": { + "method": "POST", + "headers": { + "Content-Type": "application/json" + } + } + }, + "identifierKeyPath": "/id" + } + ] + }, + { + "name": "mergeToLocalStorage", + "parameters": [ + { + "storageKey": "CherriesFarm_dpps", + "objectKeyPath": "/decodedEnvelopedVC/credentialSubject/id" + } + ] + } + ] + }, + { + "name": "Move to Next Facility", + "id": "transaction_product", + "components": [ + { + "name": "LocalStorageLoader", + "type": "EntryData", + "props": { + "storageKey": "CherriesFarm_dpps", + "nestedComponents": [ + { + "name": "JsonForm", + "type": "EntryData", + "props": { + "schema": { + "url": "https://jargon.sh/user/unece/traceabilityEvents/v/working/artefacts/jsonSchemas/TransactionEvent.json?class=TransactionEvent" + } + }, + "constructData": { + "mappingFields": [ + { + "sourcePath": "/decodedEnvelopedVC/credentialSubject/id", + "destinationPath": "/epcList/index/name" + }, + { + "sourcePath": "/linkResolver", + "destinationPath": "/epcList/index/id" + }, + { + "sourcePath": "/decodedEnvelopedVC/credentialSubject/name", + "destinationPath": "/quantityList/0/productName" + }, + { + "sourcePath": "/linkResolver", + "destinationPath": "/quantityList/0/productId" + } + ], + "dummyFields": [ + { + "path": "/type", + "data": ["TransactionEvent", "Event"] + }, + { + "path": "/id", + "data": "https://events.sample.com/01/09359502000034/21/123456" + }, + { + "path": "/processType", + "data": "Weaving" + }, + { + "path": "/eventTime", + "data": "2024-09-01T12:00:00" + }, + { + "path": "/action", + "data": "add" + }, + { + "path": "/disposition", + "data": "https://ref.gs1.org/cbv/Disp-active" + }, + { + "path": "/bizStep", + "data": "https://ref.gs1.org/cbv/BizStep-commissioning" + }, + { + "path": "/bizLocation", + "data": "https://id.gs1.org/414/9520123456788" + }, + { + "path": "/sensorElementList/0/sensorMetadata/device/type", + "data": ["Item"] + }, + { + "path": "/sensorElementList/0/sensorMetadata/device/id", + "data": "https://id.gs1.org/01/09520123456788/21/12345" + }, + { + "path": "/sensorElementList/0/sensorMetadata/device/name", + "data": "EV battery 300Ah." + }, + { + "path": "/sensorElementList/0/sensorMetadata/dataProcessingMethod", + "data": "https://standards.org/sensorMethod#1234" + }, + { + "path": "/sensorElementList/0/sensorReport/0/time", + "data": "2024-07-24T12:00:00" + }, + { + "path": "/sensorElementList/0/sensorReport/0/sensorType", + "data": "https://samplesensors.com/model1234" + }, + { + "path": "/sensorElementList/0/sensorReport/0/value", + "data": 25 + }, + { + "path": "/sensorElementList/0/sensorReport/0/uom", + "data": "KGM" + }, + { + "path": "/sensorElementList/0/sensorIntegrityProof", + "data": "https://jargon.sh" + }, + { + "path": "/sourcePartyId", + "data": "https://abr.business.gov.au/ABN/View?abn=90664869327" + }, + { + "path": "/destinationPartyId", + "data": "https://abr.business.gov.au/ABN/View?abn=90664869327" + }, + { + "path": "/bizTransaction", + "data": "https://ref.gs1.org/cbv/BTT-prodorder" + }, + { + "path": "/epcList/0/type", + "data": ["Item"] + }, + { + "path": "/quantityList/0/quantity", + "data": 20 + }, + { + "path": "/quantityList/0/uom", + "data": "KGM" + } + ], + "generationFields": [ + { + "path": "/eventTime", + "handler": "generateCurrentDatetime" + } + ] + } + } + ] + } + }, + { + "name": "CustomButton", + "type": "Submit", + "props": { + "includeDownload": true, + "downloadFileName": "transaction" + } + } + ], + "services": [ + { "name": "convertObjectToArray1Item", "parameters": [{ "path": "/data" }] }, + { + "name": "processTransactionEvent", + "parameters": [ + { + "vckit": { + "vckitAPIUrl": "http://localhost:3332/v2", + "issuer": { + "id": "did:web:6028-115-79-212-164.ngrok-free.app", + "name": "Airport Terminal Facility" + }, + "headers": { + "Authorization": "Bearer test123" + } + }, + "traceabilityEvent": { + "context": ["https://vocabulary.uncefact.org/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": "Transaction 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": { + "resultPath": "/uri", + "bucket": "verifiable-credentials" + }, + "options": { + "method": "POST", + "headers": { + "Content-Type": "application/json" + } + } + }, + "identifierKeyPath": "/0/id", + "localStorageParams": { "storageKey": "CherriesFarm_dpps", "keyPath": "/0/epcList/index/name" } + } + ] + }, + { + "name": "mergeToLocalStorage", + "parameters": [ + { + "storageKey": "orchard_facility_transaction_event", + "objectKeyPath": "/decodedEnvelopedVC/credentialSubject/0/id" + } + ] + } + ] + } + ] + } + ], + "identifyProvider": { + "type": "gs1", + "url": "http://localhost:3001", + "namespace": "gs1" + }, + "identifierSchemes": [ + { + "type": "gtin", + "format": "(\\d{12,14}|\\d{8})", + "carriers": ["barcode"] + }, + { + "type": "nlis", + "format": "^3ABCD123[a-zA-Z0-9]{8}$", + "carriers": ["manual_entry"] + } + ], + "defaultVerificationServiceLink": { + "title": "Default Verification Service", + "context": "Default Verification Service", + "type": "application/json", + "href": "http://localhost:3332/agent/routeVerificationCredential", + "hreflang": ["en"], + "headers": { + "Authorization": "Bearer test123", + "Content-Type": "application/json" + } + } +} diff --git a/packages/components/src/types/common.types.ts b/packages/components/src/types/common.types.ts index 92a23796..624f6279 100644 --- a/packages/components/src/types/common.types.ts +++ b/packages/components/src/types/common.types.ts @@ -11,3 +11,9 @@ export interface IVCContext { vckitAPIUrl?: string; headers?: Record; } + +export enum DataCarrierType { + QRCode = 'qrcode', + Barcode = 'barcode', + ManualEntry = 'manual_entry', +} diff --git a/packages/mock-app/documents/configure-document.md b/packages/mock-app/documents/configure-document.md index 1cf70b97..a9dca30d 100644 --- a/packages/mock-app/documents/configure-document.md +++ b/packages/mock-app/documents/configure-document.md @@ -158,7 +158,6 @@ Based on the example, you can define the features of the apps in the configurati ], "type": ["DigitalProductPassport"], "dlrLinkTitle": "Livestock Passport", - "dlrIdentificationKeyType": "nlisid", "dlrVerificationPage": "http://localhost:3001/verify" }, @@ -218,7 +217,6 @@ Based on the example, you can define the features of the apps in the configurati ], "type": ["DigitalTraceabilityEvent"], "dlrLinkTitle": "Transaction Event", - "dlrIdentificationKeyType": "nlisid", "dlrVerificationPage": "http://dlr.example.com/verify" }, "dlr": { diff --git a/packages/mock-app/src/__tests__/mocks/app-config.mock.json b/packages/mock-app/src/__tests__/mocks/app-config.mock.json index 765de3b7..cec12e70 100644 --- a/packages/mock-app/src/__tests__/mocks/app-config.mock.json +++ b/packages/mock-app/src/__tests__/mocks/app-config.mock.json @@ -716,7 +716,6 @@ ], "type": ["VerifiableCredential", "DigitalProductPassport"], "dlrLinkTitle": "Cherries Product Passport", - "dlrIdentificationKeyType": "gtin", "dlrVerificationPage": "http://localhost:3003/verify" }, "dlr": { @@ -905,7 +904,6 @@ ], "type": ["VerifiableCredential", "DigitalTraceabilityEvent"], "dlrLinkTitle": "Object Event", - "dlrIdentificationKeyType": "gtin", "dlrVerificationPage": "http://localhost:3003/verify" }, "dlr": { @@ -1122,7 +1120,6 @@ ], "type": ["VerifiableCredential", "DigitalIdentityAnchor"], "dlrLinkTitle": "DigitalIdentityAnchor", - "dlrIdentificationKeyType": "gtin", "dlrVerificationPage": "http://localhost:3003/verify" }, "dlr": { @@ -2789,7 +2786,6 @@ ], "type": ["TransactionEventCredential"], "dlrLinkTitle": "Transaction Event", - "dlrIdentificationKeyType": "gtin", "dlrVerificationPage": "http://localhost:3003/verify" }, "dlr": { @@ -3541,7 +3537,6 @@ ], "type": ["VerifiableCredential", "DigitalProductPassport"], "dlrLinkTitle": "Cherries Product Passport", - "dlrIdentificationKeyType": "gtin", "dlrVerificationPage": "http://localhost:3003/verify" }, "dlr": { @@ -4024,7 +4019,6 @@ ], "type": ["TransactionEventCredential"], "dlrLinkTitle": "Transaction Event", - "dlrIdentificationKeyType": "gtin", "dlrVerificationPage": "http://localhost:3003/verify" }, "dlr": { @@ -4776,7 +4770,6 @@ ], "type": ["VerifiableCredential", "DigitalProductPassport"], "dlrLinkTitle": "Cherries Product Passport", - "dlrIdentificationKeyType": "gtin", "dlrVerificationPage": "http://localhost:3003/verify" }, "dlr": { @@ -5259,7 +5252,6 @@ ], "type": ["TransactionEventCredential"], "dlrLinkTitle": "Transaction Event", - "dlrIdentificationKeyType": "gtin", "dlrVerificationPage": "http://localhost:3003/verify" }, "dlr": { diff --git a/packages/mock-app/src/constants/app-config.dev.example.json b/packages/mock-app/src/constants/app-config.dev.example.json index e6994ad8..3c2e6e26 100644 --- a/packages/mock-app/src/constants/app-config.dev.example.json +++ b/packages/mock-app/src/constants/app-config.dev.example.json @@ -725,7 +725,6 @@ ], "type": ["VerifiableCredential", " DigitalProductPassport"], "dlrLinkTitle": "Steel Passport", - "dlrIdentificationKeyType": "gtin", "dlrVerificationPage": "http://localhost:3000/verify" }, "dlr": { @@ -1205,7 +1204,6 @@ ], "type": ["TransactionEventCredential"], "dlrLinkTitle": "Transaction Event", - "dlrIdentificationKeyType": "gtin", "dlrVerificationPage": "http://localhost:3000/verify" }, "dlr": { @@ -1940,7 +1938,6 @@ ], "type": ["VerifiableCredential", " DigitalProductPassport"], "dlrLinkTitle": "Steel Passport", - "dlrIdentificationKeyType": "gtin", "dlrVerificationPage": "http://localhost:3000/verify" }, @@ -2421,7 +2418,6 @@ ], "type": ["TransactionEventCredential"], "dlrLinkTitle": "Transaction Event", - "dlrIdentificationKeyType": "gtin", "dlrVerificationPage": "http://localhost:3000/verify" }, "dlr": { diff --git a/packages/mock-app/src/constants/app-config.example.json b/packages/mock-app/src/constants/app-config.example.json index 31b0c812..a9c95712 100644 --- a/packages/mock-app/src/constants/app-config.example.json +++ b/packages/mock-app/src/constants/app-config.example.json @@ -706,7 +706,6 @@ ], "type": ["VerifiableCredential", "DigitalProductPassport"], "dlrLinkTitle": "Truffle Product Passport", - "dlrIdentificationKeyType": "gtin", "dlrVerificationPage": "http://localhost:3001/verify" }, "dlr": { @@ -1187,7 +1186,6 @@ ], "type": ["TransactionEventCredential"], "dlrLinkTitle": "Transaction Event", - "dlrIdentificationKeyType": "gtin", "dlrVerificationPage": "http://localhost:3001/verify" }, "dlr": { diff --git a/packages/mock-app/src/constants/app-config.json b/packages/mock-app/src/constants/app-config.json index 0a43e4e3..fa3c61d4 100644 --- a/packages/mock-app/src/constants/app-config.json +++ b/packages/mock-app/src/constants/app-config.json @@ -46,7 +46,7 @@ "type": ["Product"], "id": "https://example.com/01/09359502000034", "name": "EcoCharge Lithium-Ion Battery", - "registeredId": "095201234", + "registeredId": "09359502000034", "idScheme": { "type": ["IdentifierScheme"], "id": "https://id.gs1.org/01/", @@ -651,6 +651,721 @@ "name": "CustomButton", "type": "Submit", "props": {} + }, + { + "name": "BarcodeGenerator", + "type": "Result", + "props": { + "dataPath": { + "primary": { + "ai": "01", + "path": "/decodedEnvelopedVC/credentialSubject/registeredId" + }, + "qualifiers": [ + { + "ai": "10", + "path": "/decodedEnvelopedVC/credentialSubject/batchNumber" + } + ] + } + } + } + ], + "services": [ + { + "name": "processDPP", + "parameters": [ + { + "vckit": { + "vckitAPIUrl": "http://localhost:3332/v2", + "issuer": { + "id": "did:web:6028-115-79-212-164.ngrok-free.app", + "name": "Orchard Facility" + }, + "headers": { + "Authorization": "Bearer test123" + } + }, + "dpp": { + "context": ["https://vocabulary.uncefact.org/untp/dpp/0.5.0/"], + "renderTemplate": [ + { + "template": " Digital Product Passport

PRODUCT PASSPORT

{{credentialSubject.name}}

{{credentialSubject.description}}
{{#each credentialSubject.furtherInformation}} {{linkName}} {{/each}}
{{#if credentialSubject.characteristic}}
Characteristics
{{#each credentialSubject.characteristic}}
{{@key}}

{{this}}

{{/each}}
{{/if}}

Circularity Scorecard

The circularity Scorecard provides a simple high level summary of circularity performance of the product.

{{credentialSubject.circularityScorecard.recyclableContent}}%

Recyclable content

{{credentialSubject.circularityScorecard.recycledContent}}%

Recycled content

{{credentialSubject.circularityScorecard.utilityFactor}}

Utility factor

{{credentialSubject.circularityScorecard.materialCircularityIndicator}}

Material circularity*

*The Material Circularity Indicator provides an overall circularity score which is a function of all three of the earlier measures.

Emissions Scorecard

The Emissions Scorecard gives a clear snapshot of the product's greenhouse gas (GHG) emissions performance, providing a single indicator to assess its overall environmental impact.

{{credentialSubject.emissionsScorecard.carbonFootprint}}{{credentialSubject.emissionsScorecard.declaredUnit}}

Co2Eq

Scope includes

{{credentialSubject.emissionsScorecard.operationalScope}}

Primary sourced ratio*

{{credentialSubject.emissionsScorecard.primarySourcedRatio}}% primary sources

Issue date

{{credentialSubject.emissionsScorecard.reportingStandard.issueDate}}

*

The Primary Sourced Ratio shows the percentage of scope 3 emissions data that is directly collected from actual sources, rather than being based on estimates.

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}}
Production
Product category

{{#each credentialSubject.productCategory}}{{name}}{{#unless @last}},{{/unless}} {{/each}}

Date produced

{{credentialSubject.productionDate}}

Country

{{credentialSubject.countryOfProduction}}

Dimensions

Weight: {{credentialSubject.dimensions.weight.value}}{{credentialSubject.dimensions.weight.unit}} Length: {{credentialSubject.dimensions.length.value}}{{credentialSubject.dimensions.length.unit}} Width: {{credentialSubject.dimensions.width.value}}{{credentialSubject.dimensions.width.unit}} Height: {{credentialSubject.dimensions.height.value}}{{credentialSubject.dimensions.height.unit}} Volume: {{credentialSubject.dimensions.volume.value}}{{credentialSubject.dimensions.volume.unit}}

Product composition

A complete list of materials that make up the composition of this product.

{{#each credentialSubject.materialsProvenance}}

{{massFraction}}%

{{massAmount.value}}{{massAmount.unit}} {{name}}

Recycled {{recycledAmount}}%

Hazard {{#if hazardous}}Yes{{else}}No{{/if}}

{{materialSafetyInformation.linkName}}
{{originCountry}}
{{/each}}

History

{{!-- start: Supply chain due diligence report --}}
Supply chain due diligence report
{{!-- end: Supply chain due diligence report --}}

{{credentialSubject.traceabilityInformation.valueChainProcess}}

Verified ratio {{credentialSubject.traceabilityInformation.verifiedRatio}}

{{#each credentialSubject.traceabilityInformation.traceabilityEvent}}
{{linkName}} View
{{/each}}

Passport issued by

Organisation

{{issuer.name}}

Registered ID {{issuer.id}}
Valid from

{{validFrom}}

Valid to

{{validUntil}}

This Digital Product Passport (DPP) is a digital record of the product's sustainability and environmental performance, ensuring transparency and accountability in line with UNTP standards. The DPP can be verified at any time using the QR code or visiting www.untp-certification.org with the passport ID.

PRODUCT PASSPORT
{{credentialSubject.name}}
Batch: {{credentialSubject.batchNumber}}
Serial: {{credentialSubject.serialNumber}}

{{credentialSubject.description}}

{{#each credentialSubject.furtherInformation}}
{{linkName}}
{{/each}}
{{#if credentialSubject.characteristic}}
Characteristics
{{#each credentialSubject.characteristic}}
{{@key}}
{{this}}
{{/each}}
{{/if}}
Circularity Scorecard

The circularity Scorecard provides a simple high level summary of circularity performance of the product.

{{credentialSubject.circularityScorecard.recyclableContent}}%
Recyclable content
{{credentialSubject.circularityScorecard.recycledContent}}%
Recycled content
{{credentialSubject.circularityScorecard.utilityFactor}}
Utility factor
{{credentialSubject.circularityScorecard.materialCircularityIndicator}}
Material circularity*

*The Material Circularity Indicator provides an overall circularity score which is a function of all three of the earlier measures.

Emissions Scorecard

The Emissions Scorecard gives a clear snapshot of the product's greenhouse gas (GHG) emissions performance, providing a single indicator to assess its overall environmental impact.

{{credentialSubject.emissionsScorecard.carbonFootprint}}{{credentialSubject.emissionsScorecard.declaredUnit}}

Co2Eq

Scope includes
{{credentialSubject.emissionsScorecard.operationalScope}}
Primary sourced ratio*
{{credentialSubject.emissionsScorecard.primarySourcedRatio}}% primary sources

The Primary Sourced Ratio shows the percentage of scope 3 emissions data that is directly collected from actual sources, rather than being based on estimates.

Issue date
{{credentialSubject.emissionsScorecard.reportingStandard.issueDate}}
*
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}}
Production
Product category
{{#each credentialSubject.productCategory}}{{name}}{{#unless @last}},{{/unless}} {{/each}}
Date produced
{{credentialSubject.productionDate}}
Country
{{credentialSubject.countryOfProduction}}
Dimensions
Weight: {{credentialSubject.dimensions.weight.value}}{{credentialSubject.dimensions.weight.unit}} Length: {{credentialSubject.dimensions.length.value}}{{credentialSubject.dimensions.length.unit}} Width: {{credentialSubject.dimensions.width.value}}{{credentialSubject.dimensions.width.unit}} Height: {{credentialSubject.dimensions.height.value}}{{credentialSubject.dimensions.height.unit}} Volume: {{credentialSubject.dimensions.volume.value}}{{credentialSubject.dimensions.volume.unit}}
Composition

The Product Composition List details the materials and components used in the product, providing transparency on the origin and nature of each element.

{{#each credentialSubject.materialsProvenance}}
{{massFraction}}%
{{massAmount.value}}{{massAmount.unit}} {{name}}
Recycled {{#if recycledAmount}}{{recycledAmount}}{{else}}0{{/if}}%
Hazard {{#if hazardous}}Yes{{else}}No{{/if}}
{{originCountry}}
{{/each}}
History
{{!-- start: Supply chain due diligence report --}}
Supply chain due diligence report
{{!-- end: Supply chain due diligence report --}}

{{credentialSubject.traceabilityInformation.valueChainProcess}}

Verified ratio {{credentialSubject.traceabilityInformation.verifiedRatio}}

{{#each credentialSubject.traceabilityInformation.traceabilityEvent}}
{{linkName}} View
{{/each}}
Passport issued by
Organisation
{{issuer.name}}
Registered ID
Valid from
{{validFrom}}
Valid to
{{validUntil}}

This Digital Product Passport (DPP) is a digital record of the product’s sustainability and environmental performance, ensuring transparency and accountability in line with UNTP standards. The DPP can be verified at any time using the QR code or visiting www.untp-certification.org with the passport ID.

", + "@type": "WebRenderingTemplate2022" + } + ], + "type": ["DigitalProductPassport"], + "dlrLinkTitle": "Cherries Product Passport", + "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": { + "resultPath": "/uri", + "bucket": "verifiable-credentials" + }, + "options": { + "method": "POST", + "headers": { + "Content-Type": "application/json" + } + } + }, + "identifierKeyPath": { + "primary": { + "ai": "01", + "path": "/registeredId" + }, + "qualifiers": [ + { + "ai": "10", + "path": "/batchNumber" + } + ] + } + } + ] + } + ] + }, + { + "name": "Issue DLP", + "id": "produce_product", + "components": [ + { + "name": "JsonForm", + "type": "EntryData", + "props": { + "schema": { + "url": "https://jargon.sh/user/unece/DigitalProductPassport/v/working/artefacts/jsonSchemas/Product.json?class=Product" + }, + "data": { + "type": ["Product"], + "id": "https://example.com/01/3ABCD123XBDC0447", + "name": "EcoCharge Lithium-Ion Battery", + "registeredId": "3ABCD123XBDC0447", + "idScheme": { + "type": ["IdentifierScheme"], + "id": "https://id.gs1.org/01/", + "name": "Global Trade Identification Number (GTIN)" + }, + "serialNumber": "12345678", + "batchNumber": "6789", + "productImage": { + "type": ["Link"], + "linkURL": "https://c.animaapp.com/b3vf2M20/img/pp-header@2x.png", + "linkName": "EV Battery 300Ah Image" + }, + "description": "The EcoCharge EC-5000 Lithium-Ion Battery is a high-capacity, 5000mAh battery designed for performance and sustainability. Manufactured with responsibly sourced materials and a 95% recyclability rate, it reduces lifecycle emissions through eco-friendly production and verified recycling programs.", + "productCategory": [ + { + "type": ["Classification"], + "id": "https://unstats.un.org/unsd/classifications/Econ/cpc/46410", + "code": "46410", + "name": "Primary cells", + "schemeID": "https://unstats.un.org/unsd/classifications/Econ/cpc/", + "schemeName": "UN Central Product Classification (CPC)" + }, + { + "type": ["Classification"], + "id": "https://unstats.un.org/unsd/classifications/Econ/cpc/46410", + "code": "46410", + "name": "Primary batteries", + "schemeID": "https://unstats.un.org/unsd/classifications/Econ/cpc/", + "schemeName": "UN Central Product Classification (CPC)" + } + ], + "furtherInformation": [ + { + "type": ["Link"], + "linkURL": "https://example-company.com/product-information/1234567", + "linkName": "Name of document that is further information" + }, + { + "type": ["Link"], + "linkURL": "https://example-company.com/product-information/1234567", + "linkName": "Name of additional document that is further information" + } + ], + "producedByParty": { + "type": ["Identifier"], + "id": "https://id.example-company.com/party/6789", + "name": "Example Manufacturing Co." + }, + "producedAtFacility": { + "type": ["Identifier"], + "id": "https://id.example-company.com/facility/123", + "name": "Green Acres Battery Factory" + }, + "dimensions": { + "type": ["Dimension"], + "weight": { "value": 10, "unit": "kg" }, + "length": { "value": 90, "unit": "mm" }, + "width": { "value": 60, "unit": "mm" }, + "height": { "value": 10, "unit": "mm" }, + "volume": { "value": 7.5, "unit": "L" } + }, + "characteristic": { + "Battery status": "Recycled", + "Battery cell type": "Prismatic", + "Number of cells per battery": "180", + "Total energy": "100kwh" + }, + "productionDate": "2024-04-24", + "countryOfProduction": "Australia", + "granularityLevel": "item", + "dueDiligenceDeclaration": { + "type": ["Link"], + "linkURL": "https://example-company.com/due-diligence/1234567", + "linkName": "Due Diligence Declaration" + }, + "materialsProvenance": [ + { + "type": ["Material"], + "name": "Material", + "originCountry": "AU", + "materialType": { + "type": ["Classification"], + "id": "https://unfc.org/material-type/Lithium", + "name": "Lithium" + }, + "massFraction": 20, + "massAmount": { "value": 1.0, "unit": "kg" }, + "recycledAmount": 0, + "hazardous": false + }, + { + "type": ["Material"], + "name": "Material", + "originCountry": "AU", + "materialType": { + "type": ["Classification"], + "id": "https://unfc.org/material-type/Lithium", + "name": "Lithium" + }, + "massFraction": 20, + "massAmount": { "value": 1.0, "unit": "kg" }, + "recycledAmount": 10, + "hazardous": true, + "materialSafetyInformation": { + "type": ["Link"], + "linkURL": "https://example.com/safety-info/lithium-spodumene.pdf", + "linkName": "Material Safety Data Sheet", + "linkType": "https://test.uncefact.org/vocabulary/linkTypes/safetyData" + } + }, + { + "type": ["Material"], + "name": "Material", + "originCountry": "AU", + "materialType": { + "type": ["Classification"], + "id": "https://unfc.org/material-type/Lithium", + "name": "Lithium" + }, + "massFraction": 20, + "massAmount": { "value": 1.0, "unit": "kg" }, + "recycledAmount": 0, + "hazardous": false + }, + { + "type": ["Material"], + "name": "Material", + "originCountry": "AU", + "materialType": { + "type": ["Classification"], + "id": "https://unfc.org/material-type/Lithium", + "name": "Lithium" + }, + "massFraction": 20, + "massAmount": { "value": 1.0, "unit": "kg" }, + "recycledAmount": 0, + "hazardous": false + } + ], + "conformityClaim": [ + { + "type": ["Claim", "Declaration"], + "assessmentDate": "2024-04-25", + "declaredValue": [ + { + "type": ["Metric"], + "metricName": "GHG emissions intensity", + "metricValue": { "value": 1.5, "unit": "kg" }, + "score": "1.2", + "accuracy": 0.8 + }, + { + "type": ["Metric"], + "metricName": "GHG emissions intensity", + "metricValue": { "value": 1.5, "unit": "kg" }, + "score": "1.2", + "accuracy": 0.8 + } + ], + "id": "https://products.example-company.com/09520123456788/declarations/12345", + "referenceStandard": { + "type": ["Standard"], + "id": "https://www.iso.org/standard/60857.html", + "name": "Standard", + "issuingParty": { + "type": ["Identifier"], + "id": "https://iso.org/issuing-party/123", + "name": "International Organization" + }, + "issueDate": "2024-04-25" + }, + "referenceRegulation": { + "type": ["Regulation"], + "id": "https://www.legislation.gov.au/F2008L02309/latest/versions", + "name": "National Greenhouse", + "jurisdictionCountry": "Australia", + "administeredBy": { + "type": ["Identifier"], + "id": "https://gov.au/admin-body/12345", + "name": "Australian Government" + }, + "effectiveDate": "2024-03-20" + }, + "assessmentCriteria": [ + { + "type": ["Criterion"], + "id": "https://www.globalbattery.org/media/publications/gba-rulebook-v2.0-master.pdf#BatteryAssembly", + "name": "Battery Assembly Guidelines", + "thresholdValues": [ + { + "type": ["Metric"], + "metricName": "Minimum compressive strength", + "metricValue": { "value": 500, "unit": "MPA" } + } + ] + } + ], + "conformance": true, + "conformityTopic": "environment.energy", + "conformityEvidence": { + "type": ["SecureLink", "Link"], + "linkURL": "https://example-certifier.com/evidence/1234567.json", + "hashDigest": "6239119dda5bd4c8a6ffb832fe16feaa5c27b7dba154d24c53d4470a2c69adc2", + "hashMethod": "SHA-256", + "linkName": "Declaration link name", + "linkType": "https://test.uncefact.org/vocabulary/linkTypes/dcc", + "encryptionMethod": "AES" + } + }, + { + "type": ["Claim", "Declaration"], + "assessmentDate": "2024-04-25", + "declaredValue": [ + { + "type": ["Metric"], + "metricName": "GHG emissions intensity", + "metricValue": { "value": 1.5, "unit": "kg" }, + "score": "1.2", + "accuracy": 0.8 + }, + { + "type": ["Metric"], + "metricName": "GHG emissions intensity", + "metricValue": { "value": 1.5, "unit": "kg" }, + "score": "1.2", + "accuracy": 0.8 + } + ], + "id": "https://products.example-company.com/09520123456788/declarations/12345", + "referenceStandard": { + "type": ["Standard"], + "id": "https://www.iso.org/standard/60857.html", + "name": "Standard", + "issuingParty": { + "type": ["Identifier"], + "id": "https://iso.org/issuing-party/123", + "name": "International Organization" + }, + "issueDate": "2023-12-05" + }, + "referenceRegulation": { + "type": ["Regulation"], + "id": "https://www.legislation.gov.au/F2008L02309/latest/versions", + "name": "National Greenhouse", + "jurisdictionCountry": "Australia", + "administeredBy": { + "type": ["Identifier"], + "id": "https://gov.au/admin-body/12345", + "name": "Australian Government" + }, + "effectiveDate": "2024-03-20" + }, + "assessmentCriteria": [ + { + "type": ["Criterion"], + "id": "https://www.globalbattery.org/media/publications/gba-rulebook-v2.0-master.pdf#BatteryAssembly", + "name": "Battery Assembly Guidelines", + "thresholdValues": [ + { + "type": ["Metric"], + "metricName": "Minimum compressive strength", + "metricValue": { "value": 500, "unit": "MPA" } + } + ] + } + ], + "conformance": false, + "conformityTopic": "environment.energy", + "conformityEvidence": { + "type": ["SecureLink", "Link"], + "linkURL": "https://example-certifier.com/evidence/1234567.json", + "hashDigest": "6239119dda5bd4c8a6ffb832fe16feaa5c27b7dba154d24c53d4470a2c69adc2", + "hashMethod": "SHA-256", + "linkName": "Declaration link name", + "linkType": "https://test.uncefact.org/vocabulary/linkTypes/dcc", + "encryptionMethod": "AES" + } + }, + { + "type": ["Claim", "Declaration"], + "assessmentDate": "2024-04-25", + "declaredValue": [ + { + "type": ["Metric"], + "metricName": "GHG emissions intensity", + "metricValue": { "value": 1.5, "unit": "kg" }, + "score": "1.2", + "accuracy": 0.8 + }, + { + "type": ["Metric"], + "metricName": "GHG emissions intensity", + "metricValue": { "value": 1.5, "unit": "kg" }, + "score": "1.2", + "accuracy": 0.8 + } + ], + "id": "https://products.example-company.com/09520123456788/declarations/12345", + "referenceStandard": { + "type": ["Standard"], + "id": "https://www.iso.org/standard/60857.html", + "name": "Standard", + "issuingParty": { + "type": ["Identifier"], + "id": "https://iso.org/issuing-party/123", + "name": "International Organization" + }, + "issueDate": "2023-12-05" + }, + "referenceRegulation": { + "type": ["Regulation"], + "id": "https://www.legislation.gov.au/F2008L02309/latest/versions", + "name": "National Greenhouse", + "jurisdictionCountry": "Australia", + "administeredBy": { + "type": ["Identifier"], + "id": "https://gov.au/admin-body/12345", + "name": "Australian Government" + }, + "effectiveDate": "2024-03-20" + }, + "assessmentCriteria": [ + { + "type": ["Criterion"], + "id": "https://www.globalbattery.org/media/publications/gba-rulebook-v2.0-master.pdf#BatteryAssembly", + "name": "Battery Assembly Guidelines", + "thresholdValues": [ + { + "type": ["Metric"], + "metricName": "Minimum compressive strength", + "metricValue": { "value": 500, "unit": "MPA" } + } + ] + } + ], + "conformance": false, + "conformityTopic": "environment.energy", + "conformityEvidence": { + "type": ["SecureLink", "Link"], + "linkURL": "https://example-certifier.com/evidence/1234567.json", + "hashDigest": "6239119dda5bd4c8a6ffb832fe16feaa5c27b7dba154d24c53d4470a2c69adc2", + "hashMethod": "SHA-256", + "linkName": "Declaration link name", + "linkType": "https://test.uncefact.org/vocabulary/linkTypes/dcc", + "encryptionMethod": "AES" + } + }, + { + "type": ["Claim", "Declaration"], + "assessmentDate": "2024-04-25", + "declaredValue": [ + { + "type": ["Metric"], + "metricName": "GHG emissions intensity", + "metricValue": { "value": 1.5, "unit": "kg" }, + "score": "1.2", + "accuracy": 0.8 + }, + { + "type": ["Metric"], + "metricName": "GHG emissions intensity", + "metricValue": { "value": 1.5, "unit": "kg" }, + "score": "1.2", + "accuracy": 0.8 + } + ], + "id": "https://products.example-company.com/09520123456788/declarations/12345", + "referenceStandard": { + "type": ["Standard"], + "id": "https://www.iso.org/standard/60857.html", + "name": "Standard", + "issuingParty": { + "type": ["Identifier"], + "id": "https://iso.org/issuing-party/123", + "name": "International Organization" + }, + "issueDate": "2023-12-05" + }, + "referenceRegulation": { + "type": ["Regulation"], + "id": "https://www.legislation.gov.au/F2008L02309/latest/versions", + "name": "National Greenhouse", + "jurisdictionCountry": "Australia", + "administeredBy": { + "type": ["Identifier"], + "id": "https://gov.au/admin-body/12345", + "name": "Australian Government" + }, + "effectiveDate": "2024-03-20" + }, + "assessmentCriteria": [ + { + "type": ["Criterion"], + "id": "https://www.globalbattery.org/media/publications/gba-rulebook-v2.0-master.pdf#BatteryAssembly", + "name": "Battery Assembly Guidelines", + "thresholdValues": [ + { + "type": ["Metric"], + "metricName": "Minimum compressive strength", + "metricValue": { "value": 500, "unit": "MPA" } + } + ] + } + ], + "conformance": false, + "conformityTopic": "environment.energy", + "conformityEvidence": { + "type": ["SecureLink", "Link"], + "linkURL": "https://example-certifier.com/evidence/1234567.json", + "hashDigest": "6239119dda5bd4c8a6ffb832fe16feaa5c27b7dba154d24c53d4470a2c69adc2", + "hashMethod": "SHA-256", + "linkName": "Declaration link name", + "linkType": "https://test.uncefact.org/vocabulary/linkTypes/dcc", + "encryptionMethod": "AES" + } + }, + { + "type": ["Claim", "Declaration"], + "assessmentDate": "2024-04-25", + "declaredValue": [ + { + "type": ["Metric"], + "metricName": "GHG emissions intensity", + "metricValue": { "value": 1.5, "unit": "kg" }, + "score": "1.2", + "accuracy": 0.8 + }, + { + "type": ["Metric"], + "metricName": "GHG emissions intensity", + "metricValue": { "value": 1.5, "unit": "kg" }, + "score": "1.2", + "accuracy": 0.8 + } + ], + "id": "https://products.example-company.com/09520123456788/declarations/12345", + "referenceStandard": { + "type": ["Standard"], + "id": "https://www.iso.org/standard/60857.html", + "name": "Standard", + "issuingParty": { + "type": ["Identifier"], + "id": "https://iso.org/issuing-party/123", + "name": "International Organization" + }, + "issueDate": "2023-12-05" + }, + "referenceRegulation": { + "type": ["Regulation"], + "id": "https://www.legislation.gov.au/F2008L02309/latest/versions", + "name": "National Greenhouse", + "jurisdictionCountry": "Australia", + "administeredBy": { + "type": ["Identifier"], + "id": "https://gov.au/admin-body/12345", + "name": "Australian Government" + }, + "effectiveDate": "2024-03-20" + }, + "assessmentCriteria": [ + { + "type": ["Criterion"], + "id": "https://www.globalbattery.org/media/publications/gba-rulebook-v2.0-master.pdf#BatteryAssembly", + "name": "Battery Assembly Guidelines", + "thresholdValues": [ + { + "type": ["Metric"], + "metricName": "Minimum compressive strength", + "metricValue": { "value": 500, "unit": "MPA" } + } + ] + } + ], + "conformance": false, + "conformityTopic": "environment.energy", + "conformityEvidence": { + "type": ["SecureLink", "Link"], + "linkURL": "https://example-certifier.com/evidence/1234567.json", + "hashDigest": "6239119dda5bd4c8a6ffb832fe16feaa5c27b7dba154d24c53d4470a2c69adc2", + "hashMethod": "SHA-256", + "linkName": "Declaration link name", + "linkType": "https://test.uncefact.org/vocabulary/linkTypes/dcc", + "encryptionMethod": "AES" + } + } + ], + "circularityScorecard": { + "type": ["CircularityPerformance"], + "recyclingInformation": { + "type": ["Link"], + "linkURL": "https://example-company.com/recycling/1234567", + "linkName": "Recycling Information" + }, + "repairInformation": { + "type": ["Link"], + "linkURL": "https://example-company.com/repair/1234567", + "linkName": "Repair Instructions" + }, + "recyclableContent": 67, + "recycledContent": 86, + "utilityFactor": 1.2, + "materialCircularityIndicator": 0.67 + }, + "emissionsScorecard": { + "type": ["EmissionsPerformance"], + "carbonFootprint": 12.5, + "declaredUnit": "kg", + "operationalScope": "CradleToGate", + "primarySourcedRatio": 75, + "reportingStandard": { + "type": ["Standard"], + "id": "https://www.ifrs.org/standards/issb/s2", + "name": "WBSCD Pathfinder framework - V.2.0", + "issuingParty": { + "type": ["Identifier"], + "id": "https://id.ifrs.org/issuing-party/123", + "name": "International Financial Reporting Standards Foundation", + "registeredId": "90664869327", + "idScheme": { + "type": ["IdentifierScheme"], + "id": "https://id.ifrs.org/issuing-party/", + "name": "IFRS Issuing Party" + } + }, + "issueDate": "2024-04-25" + } + }, + "traceabilityInformation": { + "valueChainProcess": "Spinning", + "verifiedRatio": 0.5, + "traceabilityEvent": [ + { + "linkURL": "https://files.example-certifier.com/1234567.json", + "linkName": "Object Event", + "linkType": "https://test.uncefact.org/vocabulary/linkTypes/dcc", + "hashDigest": "6239119", + "hashMethod": "SHA-256", + "encryptionMethod": "AES" + }, + { + "linkURL": "https://files.example-certifier.com/1234567.json", + "linkName": "Transformation Event", + "linkType": "https://test.uncefact.org/vocabulary/linkTypes/dcc", + "hashDigest": "6239119", + "hashMethod": "SHA-256", + "encryptionMethod": "AES" + }, + { + "linkURL": "https://files.example-certifier.com/1234567.json", + "linkName": "Transaction Event", + "linkType": "https://test.uncefact.org/vocabulary/linkTypes/dcc", + "hashDigest": "6239119", + "hashMethod": "SHA-256", + "encryptionMethod": "AES" + }, + { + "linkURL": "https://files.example-certifier.com/1234567.json", + "linkName": "Aggregation Event", + "linkType": "https://test.uncefact.org/vocabulary/linkTypes/dcc", + "hashDigest": "6239119", + "hashMethod": "SHA-256", + "encryptionMethod": "AES" + }, + { + "linkURL": "https://files.example-certifier.com/1234567.json", + "linkName": "Association Event", + "linkType": "https://test.uncefact.org/vocabulary/linkTypes/dcc", + "hashDigest": "6239119", + "hashMethod": "SHA-256", + "encryptionMethod": "AES" + }, + { + "linkURL": "https://files.example-certifier.com/1234567.json", + "linkName": "Object Event", + "linkType": "https://test.uncefact.org/vocabulary/linkTypes/dcc", + "hashDigest": "6239119", + "hashMethod": "SHA-256", + "encryptionMethod": "AES" + } + ] + } + }, + "constructData": { + "mappingFields": [], + "dummyFields": [], + "generationFields": [ + { + "path": "/eventID", + "handler": "generateIdWithSerialNumber" + } + ] + }, + "className": "json-form", + "style": { + "margin": "40px auto", + "paddingTop": "40px", + "width": "80%" + } + } + }, + { + "name": "CustomButton", + "type": "Submit", + "props": {} + }, + { + "name": "BarcodeGenerator", + "type": "Result", + "props": { + "dataPath": { + "primary": { + "ai": "01", + "path": "/decodedEnvelopedVC/credentialSubject/registeredId" + } + } + } } ], "services": [ @@ -661,7 +1376,7 @@ "vckit": { "vckitAPIUrl": "http://localhost:3332/v2", "issuer": { - "id": "did:web:uncefact.github.io:project-vckit:test-and-development", + "id": "did:web:6028-115-79-212-164.ngrok-free.app", "name": "Orchard Facility" }, "headers": { @@ -678,13 +1393,12 @@ ], "type": ["DigitalProductPassport"], "dlrLinkTitle": "Cherries Product Passport", - "dlrIdentificationKeyType": "gtin", "dlrVerificationPage": "http://localhost:3003/verify" }, "dlr": { "dlrAPIUrl": "http://localhost:3000", "dlrAPIKey": "test123", - "namespace": "gs1", + "namespace": "nlis", "linkRegisterPath": "/api/resolver" }, "storage": { @@ -700,16 +1414,12 @@ } } }, - "identifierKeyPath": "/id" - } - ] - }, - { - "name": "mergeToLocalStorage", - "parameters": [ - { - "storageKey": "CherriesFarm_dpps", - "objectKeyPath": "/decodedEnvelopedVC/credentialSubject/id" + "identifierKeyPath": { + "primary": { + "ai": "01", + "path": "/registeredId" + } + } } ] } @@ -875,7 +1585,7 @@ "vckit": { "vckitAPIUrl": "http://localhost:3332/v2", "issuer": { - "id": "did:web:uncefact.github.io:project-vckit:test-and-development", + "id": "did:web:6028-115-79-212-164.ngrok-free.app", "name": "Orchard Facility" }, "headers": { @@ -892,7 +1602,6 @@ ], "type": ["DigitalTraceabilityEvent"], "dlrLinkTitle": "Transaction Event", - "dlrIdentificationKeyType": "gtin", "dlrVerificationPage": "http://localhost:3003/verify" }, "dlr": { @@ -1815,7 +2524,7 @@ "vckit": { "vckitAPIUrl": "http://localhost:3332/v2", "issuer": { - "id": "did:web:uncefact.github.io:project-vckit:test-and-development", + "id": "did:web:6028-115-79-212-164.ngrok-free.app", "name": "Orchard Facility" }, "headers": { @@ -1832,7 +2541,6 @@ ], "type": ["DigitalTraceabilityEvent"], "dlrLinkTitle": "Traceability Event", - "dlrIdentificationKeyType": "gtin", "dlrVerificationPage": "http://localhost:3003/verify" }, "dlr": { @@ -1993,7 +2701,7 @@ "vckit": { "vckitAPIUrl": "http://localhost:3332/v2", "issuer": { - "id": "did:web:uncefact.github.io:project-vckit:test-and-development", + "id": "did:web:6028-115-79-212-164.ngrok-free.app", "name": "Orchard Facility" }, "headers": { @@ -2010,7 +2718,6 @@ ], "type": ["DigitalTraceabilityEvent"], "dlrLinkTitle": "Object Event", - "dlrIdentificationKeyType": "gtin", "dlrVerificationPage": "http://localhost:3003/verify" }, "dlr": { @@ -2175,7 +2882,7 @@ "vckit": { "vckitAPIUrl": "http://localhost:3332/v2", "issuer": { - "id": "did:web:uncefact.github.io:project-vckit:test-and-development", + "id": "did:web:6028-115-79-212-164.ngrok-free.app", "name": "Orchard Facility" }, "headers": { @@ -2192,7 +2899,6 @@ ], "type": ["DigitalTraceabilityEvent"], "dlrLinkTitle": "Association Event", - "dlrIdentificationKeyType": "gtin", "dlrVerificationPage": "http://localhost:3003/verify" }, "dlr": { @@ -2357,7 +3063,7 @@ "vckit": { "vckitAPIUrl": "http://localhost:3332/v2", "issuer": { - "id": "did:web:uncefact.github.io:project-vckit:test-and-development", + "id": "did:web:6028-115-79-212-164.ngrok-free.app", "name": "Orchard Facility" }, "headers": { @@ -2374,7 +3080,6 @@ ], "type": ["DigitalTraceabilityEvent"], "dlrLinkTitle": "Aggregation Event", - "dlrIdentificationKeyType": "gtin", "dlrVerificationPage": "http://localhost:3003/verify" }, "dlr": { @@ -2560,7 +3265,7 @@ "vckit": { "vckitAPIUrl": "http://localhost:3332/v2", "issuer": { - "id": "did:web:uncefact.github.io:project-vckit:test-and-development", + "id": "did:web:6028-115-79-212-164.ngrok-free.app", "name": "Orchard Facility" }, "headers": { @@ -2577,7 +3282,6 @@ ], "type": ["DigitalTraceabilityEvent"], "dlrLinkTitle": "Transformation Event", - "dlrIdentificationKeyType": "gtin", "dlrVerificationPage": "http://localhost:3003/verify" }, "dlr": { @@ -3062,7 +3766,7 @@ "vckit": { "vckitAPIUrl": "http://localhost:3332/v2", "issuer": { - "id": "did:web:uncefact.github.io:project-vckit:test-and-development", + "id": "did:web:6028-115-79-212-164.ngrok-free.app", "name": "Orchard Facility" }, "headers": { @@ -3079,7 +3783,6 @@ ], "type": ["DigitalConformityCredential"], "dlrLinkTitle": "DigitalConformityCredential", - "dlrIdentificationKeyType": "gtin", "dlrVerificationPage": "http://localhost:3003/verify" }, "dlr": { @@ -3480,7 +4183,7 @@ "vckit": { "vckitAPIUrl": "http://localhost:3332/v2", "issuer": { - "id": "did:web:uncefact.github.io:project-vckit:test-and-development", + "id": "did:web:6028-115-79-212-164.ngrok-free.app", "name": "Orchard Facility" }, "headers": { @@ -3497,7 +4200,6 @@ ], "type": ["DigitalFacilityRecord"], "dlrLinkTitle": "DigitalFacilityRecord", - "dlrIdentificationKeyType": "gln", "dlrVerificationPage": "http://localhost:3003/verify" }, "dlr": { @@ -4144,7 +4846,7 @@ "vckit": { "vckitAPIUrl": "http://localhost:3332/v2", "issuer": { - "id": "did:web:uncefact.github.io:project-vckit:test-and-development", + "id": "did:web:6028-115-79-212-164.ngrok-free.app", "name": "Packhouse Facility" }, "headers": { @@ -4161,7 +4863,6 @@ ], "type": ["DigitalProductPassport"], "dlrLinkTitle": "Cherries Product Passport", - "dlrIdentificationKeyType": "gtin", "dlrVerificationPage": "http://localhost:3003/verify" }, "dlr": { @@ -4358,7 +5059,7 @@ "vckit": { "vckitAPIUrl": "http://localhost:3332/v2", "issuer": { - "id": "did:web:uncefact.github.io:project-vckit:test-and-development", + "id": "did:web:6028-115-79-212-164.ngrok-free.app", "name": "Packhouse Facility" }, "headers": { @@ -4375,7 +5076,6 @@ ], "type": ["DigitalTraceabilityEvent"], "dlrLinkTitle": "Transaction Event", - "dlrIdentificationKeyType": "gtin", "dlrVerificationPage": "http://localhost:3003/verify" }, "dlr": { @@ -5032,7 +5732,7 @@ "vckit": { "vckitAPIUrl": "http://localhost:3332/v2", "issuer": { - "id": "did:web:uncefact.github.io:project-vckit:test-and-development", + "id": "did:web:6028-115-79-212-164.ngrok-free.app", "name": "Fumigation and Freight Forwarding Facility" }, "headers": { @@ -5049,7 +5749,6 @@ ], "type": ["DigitalProductPassport"], "dlrLinkTitle": "Cherries Product Passport", - "dlrIdentificationKeyType": "gtin", "dlrVerificationPage": "http://localhost:3003/verify" }, "dlr": { @@ -5246,7 +5945,7 @@ "vckit": { "vckitAPIUrl": "http://localhost:3332/v2", "issuer": { - "id": "did:web:uncefact.github.io:project-vckit:test-and-development", + "id": "did:web:6028-115-79-212-164.ngrok-free.app", "name": "Fumigation and Freight Forwarding Facility" }, "headers": { @@ -5263,7 +5962,6 @@ ], "type": ["DigitalTraceabilityEvent"], "dlrLinkTitle": "Transaction Event", - "dlrIdentificationKeyType": "gtin", "dlrVerificationPage": "http://localhost:3003/verify" }, "dlr": { @@ -5920,7 +6618,7 @@ "vckit": { "vckitAPIUrl": "http://localhost:3332/v2", "issuer": { - "id": "did:web:uncefact.github.io:project-vckit:test-and-development", + "id": "did:web:6028-115-79-212-164.ngrok-free.app", "name": "Airport Terminal Facility" }, "headers": { @@ -5937,7 +6635,6 @@ ], "type": ["DigitalProductPassport"], "dlrLinkTitle": "Cherries Product Passport", - "dlrIdentificationKeyType": "gtin", "dlrVerificationPage": "http://localhost:3003/verify" }, "dlr": { @@ -6134,7 +6831,7 @@ "vckit": { "vckitAPIUrl": "http://localhost:3332/v2", "issuer": { - "id": "did:web:uncefact.github.io:project-vckit:test-and-development", + "id": "did:web:6028-115-79-212-164.ngrok-free.app", "name": "Airport Terminal Facility" }, "headers": { @@ -6151,7 +6848,6 @@ ], "type": ["DigitalTraceabilityEvent"], "dlrLinkTitle": "Transaction Event", - "dlrIdentificationKeyType": "gtin", "dlrVerificationPage": "http://localhost:3003/verify" }, "dlr": { @@ -6197,6 +6893,18 @@ "url": "http://localhost:3001", "namespace": "gs1" }, + "identifierSchemes": [ + { + "type": "gtin", + "format": "(\\d{12,14}|\\d{8})", + "carriers": ["barcode"] + }, + { + "type": "nlis", + "format": "^3ABCD123[a-zA-Z0-9]{8}$", + "carriers": ["manual_entry"] + } + ], "defaultVerificationServiceLink": { "title": "Default Verification Service", "context": "Default Verification Service", diff --git a/packages/services/src/__tests__/aggregationEvent.test.ts b/packages/services/src/__tests__/aggregationEvent.test.ts index 42d7720c..855d03d5 100644 --- a/packages/services/src/__tests__/aggregationEvent.test.ts +++ b/packages/services/src/__tests__/aggregationEvent.test.ts @@ -1,6 +1,7 @@ import * as vckitService from '../vckit.service'; import { uploadData } from '../storage.service'; import * as linkResolverService from '../linkResolver.service'; +import * as identifierSchemeServices from '../identifierSchemes/identifierSchemeServices'; import { ITraceabilityEventContext } from '../types/types'; import { Result } from '../types/validateContext'; import * as validateContext from '../validateContext'; @@ -18,9 +19,6 @@ jest.mock('../storage.service', () => ({ jest.mock('../linkResolver.service', () => ({ registerLinkResolver: jest.fn(), createLinkResolver: jest.fn(), - IdentificationKeyType: jest.fn(), - getLinkResolverIdentifier: jest.fn(), - getLinkResolverIdentifierFromURI: jest.fn(), LinkType: { verificationLinkType: 'gs1:verificationService', certificationLinkType: 'gs1:certificationInfo', @@ -47,7 +45,6 @@ describe('processAggregationEvent', () => { type: ['AggregationEventCredential'], renderTemplate: [{ template: '

Render dpp template

', '@type': 'WebRenderingTemplate2022' }], dlrLinkTitle: 'Aggregation Event', - dlrIdentificationKeyType: linkResolverService.IdentificationKeyType.gtin, dlrVerificationPage: 'http://exampleUI.com/verify', dlrQualifierPath: '', }, @@ -64,14 +61,14 @@ describe('processAggregationEvent', () => { jest .spyOn(validateContext, 'validateTraceabilityEventContext') .mockReturnValueOnce({ ok: true, value: context } as unknown as Result); - jest - .spyOn(linkResolverService, 'getLinkResolverIdentifier') - .mockReturnValueOnce({ identifier: '0123456789', qualifierPath: '/10/ABC123' }); - jest.spyOn(linkResolverService, 'getLinkResolverIdentifierFromURI').mockReturnValueOnce({ - identifier: '0123456789', - qualifierPath: '/10/ABC123', - elementString: '01012345678910ABC123', + jest.spyOn(identifierSchemeServices, 'constructIdentifierData').mockReturnValue({ + primary: { ai: '01', value: '0123456789' }, + qualifiers: [ + { ai: '21', value: '951350380' }, + { ai: '10', value: 'ABC123' }, + ], }); + jest.spyOn(identifierSchemeServices, 'constructQualifierPath').mockReturnValue('/21/951350380/10/ABC123'); jest.spyOn(linkResolverService, 'registerLinkResolver').mockResolvedValueOnce(aggregationEventDLRMock); const aggregationVC = await processAggregationEvent(aggregationEvent, context); @@ -130,14 +127,14 @@ describe('processAggregationEvent', () => { jest .spyOn(validateContext, 'validateTraceabilityEventContext') .mockReturnValueOnce({ ok: true, value: context } as unknown as Result); - jest - .spyOn(linkResolverService, 'getLinkResolverIdentifier') - .mockReturnValueOnce({ identifier: '0123456789', qualifierPath: '/10/ABC123' }); - jest.spyOn(linkResolverService, 'getLinkResolverIdentifierFromURI').mockReturnValueOnce({ - identifier: '0123456789', - qualifierPath: '/10/ABC123', - elementString: '01012345678910ABC123', + jest.spyOn(identifierSchemeServices, 'constructIdentifierData').mockReturnValue({ + primary: { ai: '01', value: '0123456789' }, + qualifiers: [ + { ai: '21', value: '951350380' }, + { ai: '10', value: 'ABC123' }, + ], }); + jest.spyOn(identifierSchemeServices, 'constructQualifierPath').mockReturnValue('/21/951350380/10/ABC123'); jest.spyOn(publicAPI, 'post').mockRejectedValueOnce("Can't issue VC"); await processAggregationEvent(aggregationEvent, invalidIssuerContext); @@ -160,14 +157,14 @@ describe('processAggregationEvent', () => { jest .spyOn(validateContext, 'validateTraceabilityEventContext') .mockReturnValueOnce({ ok: true, value: context } as unknown as Result); - jest - .spyOn(linkResolverService, 'getLinkResolverIdentifier') - .mockReturnValueOnce({ identifier: '0123456789', qualifierPath: '/10/ABC123' }); - jest.spyOn(linkResolverService, 'getLinkResolverIdentifierFromURI').mockReturnValueOnce({ - identifier: '0123456789', - qualifierPath: '/10/ABC123', - elementString: '01012345678910ABC123', + jest.spyOn(identifierSchemeServices, 'constructIdentifierData').mockReturnValue({ + primary: { ai: '01', value: '0123456789' }, + qualifiers: [ + { ai: '21', value: '951350380' }, + { ai: '10', value: 'ABC123' }, + ], }); + jest.spyOn(identifierSchemeServices, 'constructQualifierPath').mockReturnValue('/21/951350380/10/ABC123'); jest.spyOn(publicAPI, 'put').mockRejectedValueOnce('Invalid storage provider'); await processAggregationEvent(aggregationEvent, invalidStorageContext); @@ -195,14 +192,14 @@ describe('processAggregationEvent', () => { jest .spyOn(validateContext, 'validateTraceabilityEventContext') .mockReturnValueOnce({ ok: true, value: context } as unknown as Result); - jest - .spyOn(linkResolverService, 'getLinkResolverIdentifier') - .mockReturnValueOnce({ identifier: '0123456789', qualifierPath: '/10/ABC123' }); - jest.spyOn(linkResolverService, 'getLinkResolverIdentifierFromURI').mockReturnValueOnce({ - identifier: '0123456789', - qualifierPath: '/10/ABC123', - elementString: '01012345678910ABC123', + jest.spyOn(identifierSchemeServices, 'constructIdentifierData').mockReturnValue({ + primary: { ai: '01', value: '0123456789' }, + qualifiers: [ + { ai: '21', value: '951350380' }, + { ai: '10', value: 'ABC123' }, + ], }); + jest.spyOn(identifierSchemeServices, 'constructQualifierPath').mockReturnValue('/21/951350380/10/ABC123'); jest.spyOn(linkResolverService, 'createLinkResolver').mockRejectedValueOnce('Invalid DLR API link resolver url'); await processAggregationEvent(aggregationEvent, invalidDLRContext); @@ -228,15 +225,16 @@ describe('processAggregationEvent', () => { jest .spyOn(validateContext, 'validateTraceabilityEventContext') .mockReturnValueOnce({ ok: true, value: contextWithHeaders } as unknown as Result); - jest - .spyOn(linkResolverService, 'getLinkResolverIdentifier') - .mockReturnValueOnce({ identifier: '0123456789', qualifierPath: '/10/ABC123' }); jest.spyOn(linkResolverService, 'registerLinkResolver').mockResolvedValueOnce(aggregationEventDLRMock); - jest.spyOn(linkResolverService, 'getLinkResolverIdentifierFromURI').mockReturnValueOnce({ - identifier: '0123456789', - qualifierPath: '/10/ABC123', - elementString: '01012345678910ABC123', + + jest.spyOn(identifierSchemeServices, 'constructIdentifierData').mockReturnValue({ + primary: { ai: '01', value: '0123456789' }, + qualifiers: [ + { ai: '21', value: '951350380' }, + { ai: '10', value: 'ABC123' }, + ], }); + jest.spyOn(identifierSchemeServices, 'constructQualifierPath').mockReturnValue('/21/951350380/10/ABC123'); const aggregationVC = await processAggregationEvent(aggregationEvent, contextWithHeaders); diff --git a/packages/services/src/__tests__/epcisEvents/associationEvent.test.ts b/packages/services/src/__tests__/epcisEvents/associationEvent.test.ts index fb26a72a..e42c108f 100644 --- a/packages/services/src/__tests__/epcisEvents/associationEvent.test.ts +++ b/packages/services/src/__tests__/epcisEvents/associationEvent.test.ts @@ -3,6 +3,7 @@ import { processAssociationEvent } from '../../epcisEvents/associationEvent'; import * as vckitService from '../../vckit.service'; import { uploadData } from '../../storage.service'; import * as linkResolverService from '../../linkResolver.service'; +import * as identifierSchemeServices from '../../identifierSchemes/identifierSchemeServices'; import { ITraceabilityEventContext } from '../../types'; import { Result } from '../../types/validateContext'; import * as validateContext from '../../validateContext'; @@ -18,9 +19,6 @@ jest.mock('../../storage.service', () => ({ jest.mock('../../linkResolver.service', () => ({ registerLinkResolver: jest.fn(), createLinkResolver: jest.fn(), - IdentificationKeyType: jest.fn(), - getLinkResolverIdentifier: jest.fn(), - getLinkResolverIdentifierFromURI: jest.fn(), LinkType: { verificationLinkType: 'verificationService', certificationLinkType: 'certificationInfo', @@ -136,14 +134,15 @@ describe('processAssociationEvent', () => { jest .spyOn(validateContext, 'validateTraceabilityEventContext') .mockReturnValueOnce({ ok: true, value: context } as unknown as Result); - jest - .spyOn(linkResolverService, 'getLinkResolverIdentifier') - .mockReturnValue({ identifier: '0123456789', qualifierPath: '/10/ABC123' }); - jest.spyOn(linkResolverService, 'getLinkResolverIdentifierFromURI').mockReturnValueOnce({ - identifier: '0105012345678900', - qualifierPath: '/21/951350380', - elementString: '010501234567890021951350380', + + jest.spyOn(identifierSchemeServices, 'constructIdentifierData').mockReturnValue({ + primary: { ai: '01', value: '0123456789' }, + qualifiers: [ + { ai: '21', value: '951350380' }, + { ai: '10', value: 'ABC123' }, + ], }); + jest.spyOn(identifierSchemeServices, 'constructQualifierPath').mockReturnValue('/21/951350380/10/ABC123'); jest.spyOn(linkResolverService, 'registerLinkResolver').mockResolvedValue('https://example.com/link-resolver'); const result = await processAssociationEvent(associationEvent, context); @@ -171,6 +170,14 @@ describe('processAssociationEvent', () => { identifierKeyPath: '/invalid', }; + jest.spyOn(identifierSchemeServices, 'constructIdentifierData').mockReturnValue({ + primary: { ai: '', value: '' }, + qualifiers: [ + { ai: '21', value: '951350380' }, + { ai: '10', value: 'ABC123' }, + ], + }); + jest .spyOn(validateContext, 'validateTraceabilityEventContext') .mockReturnValueOnce({ ok: true, value: context } as unknown as Result); @@ -213,14 +220,14 @@ describe('processAssociationEvent', () => { jest .spyOn(validateContext, 'validateTraceabilityEventContext') .mockReturnValueOnce({ ok: true, value: context } as unknown as Result); - jest - .spyOn(linkResolverService, 'getLinkResolverIdentifier') - .mockReturnValue({ identifier: '0123456789', qualifierPath: '/10/ABC123' }); - jest.spyOn(linkResolverService, 'getLinkResolverIdentifierFromURI').mockReturnValueOnce({ - identifier: '0105012345678900', - qualifierPath: '/21/951350380', - elementString: '010501234567890021951350380', + jest.spyOn(identifierSchemeServices, 'constructIdentifierData').mockReturnValue({ + primary: { ai: '01', value: '0123456789' }, + qualifiers: [ + { ai: '21', value: '951350380' }, + { ai: '10', value: 'ABC123' }, + ], }); + jest.spyOn(identifierSchemeServices, 'constructQualifierPath').mockReturnValue('/21/951350380/10/ABC123'); jest.spyOn(linkResolverService, 'registerLinkResolver').mockResolvedValue('https://example.com/link-resolver'); await processAssociationEvent(associationEvent, contextWithHeaders); diff --git a/packages/services/src/__tests__/epcisEvents/objectEvent.test.ts b/packages/services/src/__tests__/epcisEvents/objectEvent.test.ts index db953b63..9554e195 100644 --- a/packages/services/src/__tests__/epcisEvents/objectEvent.test.ts +++ b/packages/services/src/__tests__/epcisEvents/objectEvent.test.ts @@ -3,6 +3,7 @@ import { processObjectEvent } from '../../epcisEvents/objectEvent'; import * as vckitService from '../../vckit.service'; import { uploadData } from '../../storage.service'; import * as linkResolverService from '../../linkResolver.service'; +import * as identifierSchemeServices from '../../identifierSchemes/identifierSchemeServices'; import { ITraceabilityEventContext } from '../../types'; import { Result } from '../../types/validateContext'; import * as validateContext from '../../validateContext'; @@ -18,9 +19,6 @@ jest.mock('../../storage.service', () => ({ jest.mock('../../linkResolver.service', () => ({ registerLinkResolver: jest.fn(), createLinkResolver: jest.fn(), - IdentificationKeyType: jest.fn(), - getLinkResolverIdentifier: jest.fn(), - getLinkResolverIdentifierFromURI: jest.fn(), LinkType: { verificationLinkType: 'verificationService', certificationLinkType: 'certificationInfo', @@ -71,14 +69,14 @@ describe('processObjectEvent', () => { jest .spyOn(validateContext, 'validateTraceabilityEventContext') .mockReturnValueOnce({ ok: true, value: context } as unknown as Result); - jest - .spyOn(linkResolverService, 'getLinkResolverIdentifier') - .mockReturnValue({ identifier: '0123456789', qualifierPath: '/10/ABC123' }); - jest.spyOn(linkResolverService, 'getLinkResolverIdentifierFromURI').mockReturnValueOnce({ - identifier: '0123456789', - qualifierPath: '/10/ABC123', - elementString: '01012345678910ABC123', + jest.spyOn(identifierSchemeServices, 'constructIdentifierData').mockReturnValue({ + primary: { ai: '01', value: '0105012345678900' }, + qualifiers: [ + { ai: '21', value: '951350380' }, + { ai: '10', value: 'ABC123' }, + ], }); + jest.spyOn(identifierSchemeServices, 'constructQualifierPath').mockReturnValue('/21/951350380/10/ABC123'); jest.spyOn(linkResolverService, 'registerLinkResolver').mockResolvedValue('https://example.com/link-resolver'); const result = await processObjectEvent(objectEvent, context); @@ -103,6 +101,13 @@ describe('processObjectEvent', () => { ...context, identifierKeyPath: '/invalid', }; + jest.spyOn(identifierSchemeServices, 'constructIdentifierData').mockReturnValue({ + primary: { ai: '', value: '' }, + qualifiers: [ + { ai: '21', value: '951350380' }, + { ai: '10', value: 'ABC123' }, + ], + }); jest .spyOn(validateContext, 'validateTraceabilityEventContext') @@ -146,14 +151,14 @@ describe('processObjectEvent', () => { jest .spyOn(validateContext, 'validateTraceabilityEventContext') .mockReturnValueOnce({ ok: true, value: context } as unknown as Result); - jest - .spyOn(linkResolverService, 'getLinkResolverIdentifier') - .mockReturnValue({ identifier: '0123456789', qualifierPath: '/10/ABC123' }); - jest.spyOn(linkResolverService, 'getLinkResolverIdentifierFromURI').mockReturnValueOnce({ - identifier: '0123456789', - qualifierPath: '/10/ABC123', - elementString: '01012345678910ABC123', + jest.spyOn(identifierSchemeServices, 'constructIdentifierData').mockReturnValue({ + primary: { ai: '01', value: '0105012345678900' }, + qualifiers: [ + { ai: '21', value: '951350380' }, + { ai: '10', value: 'ABC123' }, + ], }); + jest.spyOn(identifierSchemeServices, 'constructQualifierPath').mockReturnValue('/21/951350380/10/ABC123'); jest.spyOn(linkResolverService, 'registerLinkResolver').mockResolvedValue('https://example.com/link-resolver'); await processObjectEvent(objectEvent, contextWithHeaders); diff --git a/packages/services/src/__tests__/epcisEvents/transformationEventOnly.test.ts b/packages/services/src/__tests__/epcisEvents/transformationEventOnly.test.ts index 72d16b70..37fc76b7 100644 --- a/packages/services/src/__tests__/epcisEvents/transformationEventOnly.test.ts +++ b/packages/services/src/__tests__/epcisEvents/transformationEventOnly.test.ts @@ -3,6 +3,7 @@ import { processTransformationEventOnly } from '../../epcisEvents/transformation import * as vckitService from '../../vckit.service'; import { uploadData } from '../../storage.service'; import * as linkResolverService from '../../linkResolver.service'; +import * as identifierSchemeServices from '../../identifierSchemes/identifierSchemeServices'; import { ITraceabilityEventContext } from '../../types'; import { Result } from '../../types/validateContext'; import * as validateContext from '../../validateContext'; @@ -18,9 +19,6 @@ jest.mock('../../storage.service', () => ({ jest.mock('../../linkResolver.service', () => ({ registerLinkResolver: jest.fn(), createLinkResolver: jest.fn(), - IdentificationKeyType: jest.fn(), - getLinkResolverIdentifier: jest.fn(), - getLinkResolverIdentifierFromURI: jest.fn(), LinkType: { verificationLinkType: 'verificationService', certificationLinkType: 'certificationInfo', @@ -160,14 +158,14 @@ describe('processTransformationEventOnly', () => { jest .spyOn(validateContext, 'validateTraceabilityEventContext') .mockReturnValueOnce({ ok: true, value: context } as unknown as Result); - jest - .spyOn(linkResolverService, 'getLinkResolverIdentifier') - .mockReturnValue({ identifier: '0123456789', qualifierPath: '/10/ABC123' }); - jest.spyOn(linkResolverService, 'getLinkResolverIdentifierFromURI').mockReturnValueOnce({ - identifier: '0123456789', - qualifierPath: '/10/ABC123', - elementString: '01012345678910ABC123', + jest.spyOn(identifierSchemeServices, 'constructIdentifierData').mockReturnValue({ + primary: { ai: '01', value: '0105012345678900' }, + qualifiers: [ + { ai: '21', value: '951350380' }, + { ai: '10', value: 'ABC123' }, + ], }); + jest.spyOn(identifierSchemeServices, 'constructQualifierPath').mockReturnValue('/21/951350380/10/ABC123'); jest.spyOn(linkResolverService, 'registerLinkResolver').mockResolvedValue('https://example.com/link-resolver'); const result = await processTransformationEventOnly(transformationEvent, context); @@ -195,6 +193,14 @@ describe('processTransformationEventOnly', () => { identifierKeyPath: '/invalid', }; + jest.spyOn(identifierSchemeServices, 'constructIdentifierData').mockReturnValue({ + primary: { ai: '', value: '' }, + qualifiers: [ + { ai: '21', value: '951350380' }, + { ai: '10', value: 'ABC123' }, + ], + }); + jest .spyOn(validateContext, 'validateTraceabilityEventContext') .mockReturnValueOnce({ ok: true, value: context } as unknown as Result); @@ -237,14 +243,14 @@ describe('processTransformationEventOnly', () => { jest .spyOn(validateContext, 'validateTraceabilityEventContext') .mockReturnValueOnce({ ok: true, value: context } as unknown as Result); - jest - .spyOn(linkResolverService, 'getLinkResolverIdentifier') - .mockReturnValue({ identifier: '0123456789', qualifierPath: '/10/ABC123' }); - jest.spyOn(linkResolverService, 'getLinkResolverIdentifierFromURI').mockReturnValueOnce({ - identifier: '0123456789', - qualifierPath: '/10/ABC123', - elementString: '01012345678910ABC123', + jest.spyOn(identifierSchemeServices, 'constructIdentifierData').mockReturnValue({ + primary: { ai: '01', value: '0105012345678900' }, + qualifiers: [ + { ai: '21', value: '951350380' }, + { ai: '10', value: 'ABC123' }, + ], }); + jest.spyOn(identifierSchemeServices, 'constructQualifierPath').mockReturnValue('/21/951350380/10/ABC123'); jest.spyOn(linkResolverService, 'registerLinkResolver').mockResolvedValue('https://example.com/link-resolver'); await processTransformationEventOnly(transformationEvent, contextWithHeaders); diff --git a/packages/services/src/__tests__/identifierSchemes/identifierSchemeServices.test.ts b/packages/services/src/__tests__/identifierSchemes/identifierSchemeServices.test.ts new file mode 100644 index 00000000..f0151ef8 --- /dev/null +++ b/packages/services/src/__tests__/identifierSchemes/identifierSchemeServices.test.ts @@ -0,0 +1,109 @@ +import { + constructElementString, + constructIdentifierData, + constructQualifierPath, +} from '../../identifierSchemes/identifierSchemeServices'; + +describe('IdentifierSchemeServices', () => { + describe('constructIdentifierData', () => { + it('should parse link resolver URL to AIs when identifierKeyPath is a string', () => { + const identifierKeyPath = '/path/to/identifier'; + const data = { path: { to: { identifier: 'https://example.com/abc/01/12345/02/67890' } } }; + const result = constructIdentifierData(identifierKeyPath, data); + expect(result).toEqual({ + primary: { ai: '01', value: '12345' }, + qualifiers: [{ ai: '02', value: '67890' }], + }); + }); + + it('should construct AI data when identifierKeyPath is an object', () => { + const identifierKeyPath = { + primary: { ai: '01', path: '/primary/path' }, + qualifiers: [{ ai: '02', path: '/qualifier/path' }], + }; + const data = { primary: { path: '12345' }, qualifier: { path: '67890' } }; + const result = constructIdentifierData(identifierKeyPath, data); + expect(result).toEqual({ + primary: { ai: '01', value: '12345' }, + qualifiers: [{ ai: '02', value: '67890' }], + }); + }); + + it('should construct AI data when identifierKeyPath is an object with undefined qualifiers', () => { + const identifierKeyPath = { + primary: { ai: '01', path: '/primary/path' }, + qualifiers: [], + }; + const data = { primary: { path: '12345' } }; + const result = constructIdentifierData(identifierKeyPath, data); + expect(result).toEqual({ + primary: { ai: '01', value: '12345' }, + qualifiers: [], + }); + }); + + it('should throw an error for invalid identifierKeyPath', () => { + expect(() => constructIdentifierData(123 as any, {})).toThrow('Invalid identifierKeyPath'); + }); + }); + + describe('constructElementString', () => { + it('should construct element string correctly', () => { + const aiData = { + primary: { ai: '01', value: '12345' }, + qualifiers: [ + { ai: '02', value: '67890' }, + { ai: '03', value: '54321' }, + ], + }; + const result = constructElementString(aiData); + expect(result).toBe('(01)12345(02)67890(03)54321'); + }); + + it('should construct element string correctly for no qualifiers', () => { + const aiData = { + primary: { ai: '01', value: '12345' }, + qualifiers: [], + }; + const result = constructElementString(aiData); + expect(result).toBe('(01)12345'); + }); + + it('should construct element string correctly for undefined qualifiers', () => { + const aiData: any = { + primary: { ai: '01', value: '12345' }, + }; + const result = constructElementString(aiData); + expect(result).toBe('(01)12345'); + }); + + it('should throw an error for missing primary AI or value', () => { + const aiData: any = { + primary: { ai: '01' }, + qualifiers: [{ ai: '02', value: '67890' }], + }; + expect(() => constructElementString(aiData)).toThrow('Primary AI or value not found'); + }); + }); + + describe('constructQualifierPath', () => { + it('should return "/" for empty qualifiers', () => { + const result = constructQualifierPath([]); + expect(result).toBe('/'); + }); + + it('should construct qualifier path correctly', () => { + const qualifiers = [ + { ai: '02', value: '67890' }, + { ai: '03', value: '54321' }, + ]; + const result = constructQualifierPath(qualifiers); + expect(result).toBe('/02/67890/03/54321'); + }); + + it('should return "/" for undefined qualifiers', () => { + const result = constructQualifierPath(undefined as any); + expect(result).toBe('/'); + }); + }); +}); diff --git a/packages/services/src/__tests__/linkResolver.test.ts b/packages/services/src/__tests__/linkResolver.test.ts index 9c7f639e..a9bc4c3d 100644 --- a/packages/services/src/__tests__/linkResolver.test.ts +++ b/packages/services/src/__tests__/linkResolver.test.ts @@ -1,10 +1,4 @@ -import { - IdentificationKeyType, - LinkType, - createLinkResolver, - getLinkResolverIdentifier, - registerLinkResolver, -} from '../linkResolver.service'; +import { LinkType, createLinkResolver, getLinkResolverIdentifier, registerLinkResolver } from '../linkResolver.service'; import { privateAPI } from '../utils/httpService'; jest.mock('../utils/httpService', () => ({ @@ -30,7 +24,7 @@ describe('create link resolve service', () => { const mockValue = { eventLink: 'https://localhost/epcis-transformation-event/1234', - identificationKeyType: IdentificationKeyType.nlisid, + identificationKeyType: '01', identificationKey: 'gtin-key', itemDescription: 'EPCIS transformation event VC', verificationPage: 'https://verify.com/dev/verifyCredential', @@ -73,7 +67,7 @@ describe('create link resolve service', () => { const mockValue = { eventLink: 'https://localhost/epcis-transformation-event/1234', - identificationKeyType: IdentificationKeyType.nlisid, + identificationKeyType: '01', identificationKey: 'gtin-key', itemDescription: 'EPCIS transformation event VC', verificationPage: 'https://verify.com/dev/verifyCredential', @@ -117,7 +111,7 @@ describe('create link resolve service', () => { const mockValue = { eventLink: 'https://localhost/epcis-transformation-event/1234', - identificationKeyType: IdentificationKeyType.nlisid, + identificationKeyType: '01', identificationKey: 'gtin-key', itemDescription: 'EPCIS transformation event VC', verificationPage: 'https://verify.com/dev/verifyCredential', @@ -153,7 +147,7 @@ describe('create link resolve service', () => { privateAPI.post = jest.fn().mockRejectedValueOnce(new Error(errorMessage)); await createLinkResolver({ linkResolver: { - identificationKeyType: IdentificationKeyType.nlisid, + identificationKeyType: '01', identificationKey: 'gtin-key', itemDescription: 'EPCIS transformation event VC', }, diff --git a/packages/services/src/__tests__/mocks/constants.ts b/packages/services/src/__tests__/mocks/constants.ts index 078a3361..3359a2a6 100644 --- a/packages/services/src/__tests__/mocks/constants.ts +++ b/packages/services/src/__tests__/mocks/constants.ts @@ -137,7 +137,6 @@ export const contextDPP = { renderTemplate: [{ template: '

Render dpp template

', '@type': 'WebRenderingTemplate2022' }], type: ['DigitalProductPassport'], dlrLinkTitle: 'Livestock Passport', - dlrIdentificationKeyType: 'nlis', dlrVerificationPage: 'https://web.example.com/verify', }, dlr: { @@ -223,7 +222,6 @@ export const traceabilityEventContext = { '@type': 'WebRenderingTemplate2022', }, ], - dlrIdentificationKeyType: 'gtin', dlrLinkTitle: 'Object Event', dlrVerificationPage: 'https://verify.example.com', }, @@ -252,7 +250,6 @@ export const digitalIdentityAnchorContext = { renderTemplate: [{ template: '

Render dpp template

', '@type': 'WebRenderingTemplate2022' }], type: ['DigitalIdentityAnchor'], dlrLinkTitle: 'DigitalIdentityAnchor', - dlrIdentificationKeyType: 'gtin', dlrVerificationPage: 'https://web.example.com/verify', }, dlr: { @@ -280,7 +277,6 @@ export const digitalFacilityRecordContext = { renderTemplate: [{ template: '

Render dpp template

', '@type': 'WebRenderingTemplate2022' }], type: ['DigitalFacilityRecord'], dlrLinkTitle: 'DigitalFacilityRecord', - dlrIdentificationKeyType: 'gln', dlrVerificationPage: 'https://web.example.com/verify', }, dlr: { @@ -308,7 +304,6 @@ export const digitalConformityCredentialContext = { renderTemplate: [{ template: '

Render dcc template

', '@type': 'WebRenderingTemplate2022' }], type: ['DigitalConformityCredential'], dlrLinkTitle: 'DigitalConformityCredential', - dlrIdentificationKeyType: 'gtin', dlrVerificationPage: 'https://web.example.com/verify', }, dlr: { diff --git a/packages/services/src/__tests__/processDPP.test.ts b/packages/services/src/__tests__/processDPP.test.ts index 517010ed..0f07a5b6 100644 --- a/packages/services/src/__tests__/processDPP.test.ts +++ b/packages/services/src/__tests__/processDPP.test.ts @@ -1,7 +1,8 @@ import { processDPP } from '../processDPP.service'; import { issueVC, contextDefault, decodeEnvelopedVC } from '../vckit.service'; import { uploadData } from '../storage.service'; -import { registerLinkResolver, IdentificationKeyType, LinkType } from '../linkResolver.service'; +import { registerLinkResolver, LinkType } from '../linkResolver.service'; +import * as identifierSchemeServices from '../identifierSchemes/identifierSchemeServices'; import { contextDPP, dataDPP } from './mocks/constants'; jest.mock('../vckit.service', () => ({ @@ -16,11 +17,6 @@ jest.mock('../storage.service', () => ({ jest.mock('../linkResolver.service', () => ({ registerLinkResolver: jest.fn(), - IdentificationKeyType: { - gtin: 'gtin', - nlisid: 'nlisid', - }, - getLinkResolverIdentifier: jest.fn(() => ({ identifier: '9359502000010', qualifierPath: '/10/ABC123' })), LinkType: { verificationLinkType: 'gs1:verificationService', certificationLinkType: 'gs1:certificationInfo', @@ -64,10 +60,21 @@ describe('processDPP', () => { return `${url}/${dataDPP.data.herd.identifier}`; }); + jest.spyOn(identifierSchemeServices, 'constructIdentifierData').mockReturnValue({ + primary: { ai: '01', value: '9359502000010' }, + qualifiers: [ + { + ai: '10', + value: 'ABC123', + }, + ], + }); + jest.spyOn(identifierSchemeServices, 'constructQualifierPath').mockReturnValue('/10/ABC123'); + (registerLinkResolver as jest.Mock).mockImplementation( ( url, - identificationKeyType: IdentificationKeyType, + identificationKeyType: string, identificationKey: string, linkTitle, verificationPage, @@ -84,13 +91,7 @@ describe('processDPP', () => { decodedEnvelopedVC: { credentialSubject: { id: 'https://example.com/123' }, }, - linkResolver: - contextDPP.dpp.dlrVerificationPage + - '/' + - contextDPP.dpp.dlrIdentificationKeyType + - '/' + - dataDPP.data.herd.identifier + - '?linkType=all', + linkResolver: 'https://web.example.com/verify/01/9359502000010?linkType=all', }); expect(uploadData).toHaveBeenCalled(); expect(registerLinkResolver).toHaveBeenCalled(); @@ -99,7 +100,7 @@ describe('processDPP', () => { const dlrContext = contextDPP.dlr; expect(registerLinkResolver).toHaveBeenCalledWith( expect.any(String), - dppContext.dlrIdentificationKeyType, + '01', dataDPP.data.herd.identifier, dppContext.dlrLinkTitle, LinkType.certificationLinkType, @@ -126,10 +127,16 @@ describe('processDPP', () => { return `${url}/${dataDPP.data.herd.identifier}`; }); + jest.spyOn(identifierSchemeServices, 'constructIdentifierData').mockReturnValue({ + primary: { ai: '01', value: '0123456789' }, + qualifiers: [], + }); + jest.spyOn(identifierSchemeServices, 'constructQualifierPath').mockReturnValue('/'); + (registerLinkResolver as jest.Mock).mockImplementation( ( url, - identificationKeyType: IdentificationKeyType, + identificationKeyType: string, identificationKey: string, linkTitle, verificationPage, @@ -169,6 +176,11 @@ describe('processDPP', () => { it('should throw error when data is empty', async () => { try { + jest.spyOn(identifierSchemeServices, 'constructIdentifierData').mockReturnValue({ + primary: { ai: '', value: '' }, + qualifiers: [], + }); + await processDPP({ data: { herd: '' } }, contextDPP); } catch (error: any) { expect(error.message).toEqual('Identifier not found'); diff --git a/packages/services/src/__tests__/processDigitalConformityCredential.test.ts b/packages/services/src/__tests__/processDigitalConformityCredential.test.ts index a4a5a304..e5c10bd8 100644 --- a/packages/services/src/__tests__/processDigitalConformityCredential.test.ts +++ b/packages/services/src/__tests__/processDigitalConformityCredential.test.ts @@ -1,6 +1,7 @@ import * as vckitService from '../vckit.service'; import { uploadData } from '../storage.service'; import * as linkResolverService from '../linkResolver.service'; +import * as identifierSchemeServices from '../identifierSchemes/identifierSchemeServices'; import { Result } from '../types/validateContext'; import * as validateContext from '../validateContext'; import { IDigitalConformityCredentialContext } from '../types'; @@ -17,7 +18,6 @@ jest.mock('../storage.service', () => ({ jest.mock('../linkResolver.service', () => ({ registerLinkResolver: jest.fn(), createLinkResolver: jest.fn(), - IdentificationKeyType: jest.fn(), getLinkResolverIdentifier: jest.fn(), getLinkResolverIdentifierFromURI: jest.fn(), LinkType: { @@ -46,9 +46,11 @@ describe('processDigitalConformityCredential', () => { jest .spyOn(validateContext, 'validateDigitalConformityCredentialContext') .mockReturnValueOnce({ ok: true, value: context } as unknown as Result); - jest - .spyOn(linkResolverService, 'getLinkResolverIdentifier') - .mockReturnValue({ identifier: '0123456789', qualifierPath: '/' }); + jest.spyOn(identifierSchemeServices, 'constructIdentifierData').mockReturnValue({ + primary: { ai: '01', value: '0123456789' }, + qualifiers: [], + }); + jest.spyOn(identifierSchemeServices, 'constructQualifierPath').mockReturnValue('/'); jest.spyOn(linkResolverService, 'registerLinkResolver').mockResolvedValue('https://example.com/link-resolver'); const result = await processDigitalConformityCredential(digitalConformityCredentialData, context); @@ -76,6 +78,11 @@ describe('processDigitalConformityCredential', () => { identifierKeyPath: '/invalid', }; + jest.spyOn(identifierSchemeServices, 'constructIdentifierData').mockReturnValue({ + primary: { ai: '', value: '' }, + qualifiers: [], + }); + jest .spyOn(validateContext, 'validateDigitalConformityCredentialContext') .mockReturnValueOnce({ ok: true, value: context } as unknown as Result); @@ -119,9 +126,11 @@ describe('processDigitalConformityCredential', () => { ok: true, value: contextWithHeaders, } as unknown as Result); - jest - .spyOn(linkResolverService, 'getLinkResolverIdentifier') - .mockReturnValue({ identifier: '0123456789', qualifierPath: '/' }); + jest.spyOn(identifierSchemeServices, 'constructIdentifierData').mockReturnValue({ + primary: { ai: '01', value: '0123456789' }, + qualifiers: [], + }); + jest.spyOn(identifierSchemeServices, 'constructQualifierPath').mockReturnValue('/'); jest.spyOn(linkResolverService, 'registerLinkResolver').mockResolvedValue('https://example.com/link-resolver'); await processDigitalConformityCredential(digitalConformityCredentialData, contextWithHeaders); diff --git a/packages/services/src/__tests__/processDigitalFacilityRecord.test.ts b/packages/services/src/__tests__/processDigitalFacilityRecord.test.ts index a8a2e732..f29cb93d 100644 --- a/packages/services/src/__tests__/processDigitalFacilityRecord.test.ts +++ b/packages/services/src/__tests__/processDigitalFacilityRecord.test.ts @@ -1,6 +1,7 @@ import * as vckitService from '../vckit.service'; import { uploadData } from '../storage.service'; import * as linkResolverService from '../linkResolver.service'; +import * as identifierSchemeServices from '../identifierSchemes/identifierSchemeServices'; import { Result } from '../types/validateContext'; import * as validateContext from '../validateContext'; import { IDigitalFacilityRecordContext } from '../types'; @@ -17,7 +18,6 @@ jest.mock('../storage.service', () => ({ jest.mock('../linkResolver.service', () => ({ registerLinkResolver: jest.fn(), createLinkResolver: jest.fn(), - IdentificationKeyType: jest.fn(), getLinkResolverIdentifier: jest.fn(), getLinkResolverIdentifierFromURI: jest.fn(), LinkType: { @@ -46,9 +46,11 @@ describe('processDigitalFacilityRecord', () => { jest .spyOn(validateContext, 'validateDigitalFacilityRecordContext') .mockReturnValueOnce({ ok: true, value: context } as unknown as Result); - jest - .spyOn(linkResolverService, 'getLinkResolverIdentifier') - .mockReturnValue({ identifier: '0123456789', qualifierPath: '/' }); + jest.spyOn(identifierSchemeServices, 'constructIdentifierData').mockReturnValue({ + primary: { ai: '01', value: '0123456789' }, + qualifiers: [], + }); + jest.spyOn(identifierSchemeServices, 'constructQualifierPath').mockReturnValue('/'); jest.spyOn(linkResolverService, 'registerLinkResolver').mockResolvedValue('https://example.com/link-resolver'); const result = await processDigitalFacilityRecord(digitalFacilityRecordData, context); @@ -76,6 +78,11 @@ describe('processDigitalFacilityRecord', () => { identifierKeyPath: '/invalid', }; + jest.spyOn(identifierSchemeServices, 'constructIdentifierData').mockReturnValue({ + primary: { ai: '', value: '' }, + qualifiers: [], + }); + jest .spyOn(validateContext, 'validateDigitalFacilityRecordContext') .mockReturnValueOnce({ ok: true, value: context } as unknown as Result); @@ -118,9 +125,11 @@ describe('processDigitalFacilityRecord', () => { jest .spyOn(validateContext, 'validateDigitalFacilityRecordContext') .mockReturnValueOnce({ ok: true, value: contextWithHeaders } as unknown as Result); - jest - .spyOn(linkResolverService, 'getLinkResolverIdentifier') - .mockReturnValue({ identifier: '0123456789', qualifierPath: '/' }); + jest.spyOn(identifierSchemeServices, 'constructIdentifierData').mockReturnValue({ + primary: { ai: '01', value: '0123456789' }, + qualifiers: [], + }); + jest.spyOn(identifierSchemeServices, 'constructQualifierPath').mockReturnValue('/'); jest.spyOn(linkResolverService, 'registerLinkResolver').mockResolvedValue('https://example.com/link-resolver'); await processDigitalFacilityRecord(digitalFacilityRecordData, contextWithHeaders); diff --git a/packages/services/src/__tests__/processDigitalIdentityAnchor.test.ts b/packages/services/src/__tests__/processDigitalIdentityAnchor.test.ts index 92f9e22b..57c45ad3 100644 --- a/packages/services/src/__tests__/processDigitalIdentityAnchor.test.ts +++ b/packages/services/src/__tests__/processDigitalIdentityAnchor.test.ts @@ -1,6 +1,7 @@ import * as vckitService from '../vckit.service'; import { uploadData } from '../storage.service'; import * as linkResolverService from '../linkResolver.service'; +import * as identifierSchemeServices from '../identifierSchemes/identifierSchemeServices'; import { Result } from '../types/validateContext'; import * as validateContext from '../validateContext'; import { IDigitalIdentityAnchorContext } from '../types'; @@ -17,7 +18,6 @@ jest.mock('../storage.service', () => ({ jest.mock('../linkResolver.service', () => ({ registerLinkResolver: jest.fn(), createLinkResolver: jest.fn(), - IdentificationKeyType: jest.fn(), getLinkResolverIdentifier: jest.fn(), getLinkResolverIdentifierFromURI: jest.fn(), LinkType: { @@ -49,9 +49,11 @@ describe('processDigitalIdentityAnchor', () => { jest .spyOn(validateContext, 'validateDigitalIdentityAnchorContext') .mockReturnValueOnce({ ok: true, value: context } as unknown as Result); - jest - .spyOn(linkResolverService, 'getLinkResolverIdentifier') - .mockReturnValue({ identifier: '0123456789', qualifierPath: '/' }); + jest.spyOn(identifierSchemeServices, 'constructIdentifierData').mockReturnValue({ + primary: { ai: '01', value: '0123456789' }, + qualifiers: [], + }); + jest.spyOn(identifierSchemeServices, 'constructQualifierPath').mockReturnValue('/'); jest.spyOn(linkResolverService, 'registerLinkResolver').mockResolvedValue('https://example.com/link-resolver'); const result = await processDigitalIdentityAnchor(digitalIdentityAnchorData, context); @@ -79,6 +81,11 @@ describe('processDigitalIdentityAnchor', () => { identifierKeyPath: '/invalid', }; + jest.spyOn(identifierSchemeServices, 'constructIdentifierData').mockReturnValue({ + primary: { ai: '', value: '' }, + qualifiers: [], + }); + jest .spyOn(validateContext, 'validateDigitalIdentityAnchorContext') .mockReturnValueOnce({ ok: true, value: context } as unknown as Result); @@ -121,9 +128,11 @@ describe('processDigitalIdentityAnchor', () => { jest .spyOn(validateContext, 'validateDigitalIdentityAnchorContext') .mockReturnValueOnce({ ok: true, value: contextWithHeaders } as unknown as Result); - jest - .spyOn(linkResolverService, 'getLinkResolverIdentifier') - .mockReturnValue({ identifier: '0123456789', qualifierPath: '/' }); + jest.spyOn(identifierSchemeServices, 'constructIdentifierData').mockReturnValue({ + primary: { ai: '01', value: '0123456789' }, + qualifiers: [], + }); + jest.spyOn(identifierSchemeServices, 'constructQualifierPath').mockReturnValue('/'); jest.spyOn(linkResolverService, 'registerLinkResolver').mockResolvedValue('https://example.com/link-resolver'); await processDigitalIdentityAnchor(digitalIdentityAnchorData, contextWithHeaders); diff --git a/packages/services/src/__tests__/transactionEvent.test.ts b/packages/services/src/__tests__/transactionEvent.test.ts index 5735646f..d9bd6e7d 100644 --- a/packages/services/src/__tests__/transactionEvent.test.ts +++ b/packages/services/src/__tests__/transactionEvent.test.ts @@ -2,6 +2,7 @@ import * as vckitService from '../vckit.service'; import * as linkResolverService from '../linkResolver.service'; import * as validateContext from '../validateContext'; import { processTransactionEvent } from '../epcisEvents/transactionEvent'; +import * as identifierSchemeServices from '../identifierSchemes/identifierSchemeServices'; import { uploadData } from '../storage.service'; import { Result } from '../types/validateContext'; import { ITraceabilityEventContext } from '../types/types'; @@ -18,8 +19,6 @@ jest.mock('../storage.service', () => ({ jest.mock('../linkResolver.service', () => ({ registerLinkResolver: jest.fn(), createLinkResolver: jest.fn(), - IdentificationKeyType: jest.fn(), - getLinkResolverIdentifier: jest.fn(() => ({ identifier: '9359502000010', qualifierPath: '/10/ABC123' })), LinkType: { verificationLinkType: 'gs1:verificationService', certificationLinkType: 'gs1:certificationInfo', @@ -54,7 +53,6 @@ describe('processTransactionEvent', () => { context: ['https://example.sh/TransactionEvent.jsonld'], type: ['DigitalTraceabilityEvent'], dlrLinkTitle: 'Transaction Event', - dlrIdentificationKeyType: linkResolverService.IdentificationKeyType.nlisid, dlrVerificationPage: 'http://exampleUI.com/verify', }, dlr: { dlrAPIUrl: 'http://exampleDLR.com', dlrAPIKey: 'test-key' }, @@ -78,6 +76,16 @@ describe('processTransactionEvent', () => { jest .spyOn(validateContext, 'validateTraceabilityEventContext') .mockReturnValueOnce({ ok: true, value: context } as unknown as Result); + jest.spyOn(identifierSchemeServices, 'constructIdentifierData').mockReturnValue({ + primary: { ai: '01', value: '9359502000010' }, + qualifiers: [ + { + ai: '10', + value: 'ABC123', + }, + ], + }); + jest.spyOn(identifierSchemeServices, 'constructQualifierPath').mockReturnValue('/10/ABC123'); jest.spyOn(linkResolverService, 'registerLinkResolver').mockResolvedValueOnce(transactionEventDLRMock); const transactionVC = await processTransactionEvent(transactionEvent, context); @@ -115,6 +123,17 @@ describe('processTransactionEvent', () => { ...context, identifierKeyPath: '/invalid-key', }; + + jest.spyOn(identifierSchemeServices, 'constructIdentifierData').mockReturnValue({ + primary: { ai: '', value: '' }, + qualifiers: [ + { + ai: '10', + value: 'ABC123', + }, + ], + }); + jest.spyOn(identifierSchemeServices, 'constructQualifierPath').mockReturnValue('/10/ABC123'); jest .spyOn(validateContext, 'validateTraceabilityEventContext') .mockReturnValueOnce({ ok: true, value: context } as unknown as Result); @@ -133,6 +152,16 @@ describe('processTransactionEvent', () => { ...context, vckit: { ...context.vckit, issuer: 'invalid-issuer' }, }; + jest.spyOn(identifierSchemeServices, 'constructIdentifierData').mockReturnValue({ + primary: { ai: '01', value: '9359502000010' }, + qualifiers: [ + { + ai: '10', + value: 'ABC123', + }, + ], + }); + jest.spyOn(identifierSchemeServices, 'constructQualifierPath').mockReturnValue('/10/ABC123'); jest .spyOn(validateContext, 'validateTraceabilityEventContext') .mockReturnValueOnce({ ok: true, value: context } as unknown as Result); @@ -154,6 +183,16 @@ describe('processTransactionEvent', () => { }; (vckitService.issueVC as jest.Mock).mockImplementationOnce(() => transactionVCMock); (vckitService.decodeEnvelopedVC as jest.Mock).mockReturnValue(transactionVCMock); + jest.spyOn(identifierSchemeServices, 'constructIdentifierData').mockReturnValue({ + primary: { ai: '01', value: '9359502000010' }, + qualifiers: [ + { + ai: '10', + value: 'ABC123', + }, + ], + }); + jest.spyOn(identifierSchemeServices, 'constructQualifierPath').mockReturnValue('/10/ABC123'); jest .spyOn(validateContext, 'validateTraceabilityEventContext') @@ -177,6 +216,17 @@ describe('processTransactionEvent', () => { }; (vckitService.issueVC as jest.Mock).mockImplementationOnce(() => transactionVCMock); (uploadData as jest.Mock).mockResolvedValueOnce('https://storage.com/vc.json'); + + jest.spyOn(identifierSchemeServices, 'constructIdentifierData').mockReturnValue({ + primary: { ai: '01', value: '9359502000010' }, + qualifiers: [ + { + ai: '10', + value: 'ABC123', + }, + ], + }); + jest.spyOn(identifierSchemeServices, 'constructQualifierPath').mockReturnValue('/10/ABC123'); jest .spyOn(validateContext, 'validateTraceabilityEventContext') .mockReturnValueOnce({ ok: true, value: context } as unknown as Result); diff --git a/packages/services/src/__tests__/transformationEvent.test.ts b/packages/services/src/__tests__/transformationEvent.test.ts index 97cbec40..2a8d0adf 100644 --- a/packages/services/src/__tests__/transformationEvent.test.ts +++ b/packages/services/src/__tests__/transformationEvent.test.ts @@ -5,7 +5,7 @@ import { } from '../epcisEvents/transformationEvent'; import { issueVC, contextDefault } from '../vckit.service'; import { uploadData } from '../storage.service'; -import { registerLinkResolver, IdentificationKeyType } from '../linkResolver.service'; +import { registerLinkResolver } from '../linkResolver.service'; import { IEntityIssue } from '../types'; import { contextTransformationEvent, dataTransformationEvent } from './mocks/constants'; import { generateUUID } from '../utils'; @@ -22,10 +22,6 @@ jest.mock('../storage.service', () => ({ jest.mock('../linkResolver.service', () => ({ registerLinkResolver: jest.fn(), - IdentificationKeyType: { - gtin: 'gtin', - nlisid: 'nlisid', - }, getLinkResolverIdentifier: jest.fn(() => ({ identifier: '9359502000010', qualifierPath: '/10/ABC123' })), LinkType: { verificationLinkType: 'gs1:verificationService', @@ -202,7 +198,7 @@ describe('Transformation event', () => { (registerLinkResolver as jest.Mock).mockImplementation( ( url, - identificationKeyType: IdentificationKeyType, + identificationKeyType: string, identificationKey: string, linkTitle, verificationPage, diff --git a/packages/services/src/__tests__/validateContext.test.ts b/packages/services/src/__tests__/validateContext.test.ts index 6a17d95b..d18f2a00 100644 --- a/packages/services/src/__tests__/validateContext.test.ts +++ b/packages/services/src/__tests__/validateContext.test.ts @@ -143,19 +143,6 @@ describe('validateContext', () => { expect(result.value).toEqual('Invalid dlrVerificationPage'); }); - it('should return error when dlrIdentificationKeyType in dpp context is invalid', () => { - const newContext = { - ...contextDPP, - dpp: { - ...contextDPP.dpp, - dlrIdentificationKeyType: '', - }, - }; - const result = validateContextDPP(newContext as any); - expect(result.ok).toBe(false); - expect(result.value).toEqual('Invalid dlrIdentificationKeyType'); - }); - it('should return error when storageAPIUrl in storage context is invalid', () => { const newContext = { ...contextDPP, @@ -345,19 +332,6 @@ describe('validateTraceabilityEventContext', () => { expect(result.value).toEqual('Invalid traceabilityEvent dlrVerificationPage'); }); - it('should return error when dlrIdentificationKeyType in traceabilityEvent is invalid', () => { - const newContext = { - ...traceabilityEventContext, - traceabilityEvent: { - ...traceabilityEventContext.traceabilityEvent, - dlrIdentificationKeyType: '', - }, - }; - const result = validateTraceabilityEventContext(newContext as any); - expect(result.ok).toBe(false); - expect(result.value).toEqual('Invalid traceabilityEvent dlrIdentificationKeyType'); - }); - it('should return error when storageAPIUrl in storage context is invalid', () => { const newContext = { ...traceabilityEventContext, diff --git a/packages/services/src/epcisEvents/aggregationEvent.ts b/packages/services/src/epcisEvents/aggregationEvent.ts index 902818fa..9b5539b9 100644 --- a/packages/services/src/epcisEvents/aggregationEvent.ts +++ b/packages/services/src/epcisEvents/aggregationEvent.ts @@ -1,11 +1,11 @@ import { decodeEnvelopedVC, issueVC } from '../vckit.service.js'; import { uploadData } from '../storage.service.js'; -import { LinkType, getLinkResolverIdentifier, registerLinkResolver } from '../linkResolver.service.js'; +import { LinkType, registerLinkResolver } from '../linkResolver.service.js'; import { IService } from '../types/IService.js'; import { ITraceabilityEvent, ITraceabilityEventContext } from '../types'; -import { constructIdentifierString, generateUUID } from '../utils/helpers.js'; +import { generateUUID } from '../utils/helpers.js'; import { validateTraceabilityEventContext } from '../validateContext.js'; -import { EPCISBusinessStepCode, EPCISEventAction, EPCISEventDisposition, EPCISEventType } from '../types/epcis.js'; +import { constructIdentifierData, constructQualifierPath } from '../identifierSchemes/identifierSchemeServices.js'; export const processAggregationEvent: IService = async ( aggregationEvent: ITraceabilityEvent, @@ -18,12 +18,10 @@ export const processAggregationEvent: IService = async ( const { vckit, traceabilityEvent, dlr, storage, identifierKeyPath } = context; - const parentIdentifier = constructIdentifierString(aggregationEvent.data, identifierKeyPath); - if (!parentIdentifier) { - throw new Error('Identifier not found'); - } - - const { identifier, qualifierPath } = getLinkResolverIdentifier(parentIdentifier); + const aiData = constructIdentifierData(identifierKeyPath, aggregationEvent.data); + if (!aiData.primary.ai || !aiData.primary.value) throw new Error('Identifier not found'); + const qualifierPath = constructQualifierPath(aiData.qualifiers); + const identifier = aiData.primary.value; const credentialId = generateUUID(); @@ -45,7 +43,7 @@ export const processAggregationEvent: IService = async ( const aggregationLinkResolver = await registerLinkResolver( aggregationVCLink, - traceabilityEvent.dlrIdentificationKeyType, + aiData.primary.ai, identifier, traceabilityEvent.dlrLinkTitle, LinkType.epcisLinkType, diff --git a/packages/services/src/epcisEvents/associationEvent.ts b/packages/services/src/epcisEvents/associationEvent.ts index 1061c53b..63f5a737 100644 --- a/packages/services/src/epcisEvents/associationEvent.ts +++ b/packages/services/src/epcisEvents/associationEvent.ts @@ -1,11 +1,12 @@ import { VerifiableCredential } from '@vckit/core-types'; -import { registerLinkResolver, LinkType, getLinkResolverIdentifier } from '../linkResolver.service.js'; +import { registerLinkResolver, LinkType } from '../linkResolver.service.js'; import { uploadData } from '../storage.service.js'; import { IService } from '../types/IService.js'; -import { constructIdentifierString, generateUUID } from '../utils/helpers.js'; +import { generateUUID } from '../utils/helpers.js'; import { decodeEnvelopedVC, issueVC } from '../vckit.service.js'; import { ITraceabilityEvent, ITraceabilityEventContext } from '../types/index.js'; import { validateTraceabilityEventContext } from '../validateContext.js'; +import { constructIdentifierData, constructQualifierPath } from '../identifierSchemes/identifierSchemeServices.js'; /** * Processes an association event by issuing a verifiable credential, storing it in a storage service and registering a link resolver. @@ -26,13 +27,10 @@ export const processAssociationEvent: IService = async ( const { vckit, traceabilityEvent, dlr, storage, identifierKeyPath } = context; - const associationIdentifier = constructIdentifierString(associationEvent.data, identifierKeyPath); - if (!associationIdentifier) { - throw new Error('Identifier not found'); - } - - const { identifier: associationEventIdentifier, qualifierPath: associationEventQualifierPath } = - getLinkResolverIdentifier(associationIdentifier); + const aiData = constructIdentifierData(identifierKeyPath, associationEvent.data); + if (!aiData.primary.ai || !aiData.primary.value) throw new Error('Identifier not found'); + const qualifierPath = constructQualifierPath(aiData.qualifiers); + const identifier = aiData.primary.value; const credentialId = generateUUID(); @@ -54,15 +52,15 @@ export const processAssociationEvent: IService = async ( const associationEventLinkResolver = await registerLinkResolver( associationEventVcUrl, - traceabilityEvent.dlrIdentificationKeyType, - associationEventIdentifier, + aiData.primary.ai, + identifier, traceabilityEvent.dlrLinkTitle, LinkType.epcisLinkType, traceabilityEvent.dlrVerificationPage, dlr.dlrAPIUrl, dlr.dlrAPIKey, dlr.namespace, - associationEventQualifierPath, + qualifierPath, LinkType.epcisLinkType, ); diff --git a/packages/services/src/epcisEvents/objectEvent.ts b/packages/services/src/epcisEvents/objectEvent.ts index 8459c3b1..bc114cfd 100644 --- a/packages/services/src/epcisEvents/objectEvent.ts +++ b/packages/services/src/epcisEvents/objectEvent.ts @@ -1,11 +1,12 @@ import { VerifiableCredential } from '@vckit/core-types'; -import { registerLinkResolver, LinkType, getLinkResolverIdentifier } from '../linkResolver.service.js'; +import { registerLinkResolver, LinkType } from '../linkResolver.service.js'; import { uploadData } from '../storage.service.js'; import { IService } from '../types/IService.js'; -import { constructIdentifierString, generateUUID } from '../utils/helpers.js'; +import { generateUUID } from '../utils/helpers.js'; import { decodeEnvelopedVC, issueVC } from '../vckit.service.js'; import { ITraceabilityEvent, ITraceabilityEventContext } from '../types/index.js'; import { validateTraceabilityEventContext } from '../validateContext.js'; +import { constructIdentifierData, constructQualifierPath } from '../identifierSchemes/identifierSchemeServices.js'; /** * Processes an object event by issuing a verifiable credential, storing it in a storage service and registering a link resolver. @@ -26,13 +27,10 @@ export const processObjectEvent: IService = async ( const { vckit, traceabilityEvent, dlr, storage, identifierKeyPath } = context; - const objectIdentifier = constructIdentifierString(objectEvent.data, identifierKeyPath); - if (!objectIdentifier) { - throw new Error('Identifier not found'); - } - - const { identifier: objectEventIdentifier, qualifierPath: objectEventQualifierPath } = - getLinkResolverIdentifier(objectIdentifier); + const aiData = constructIdentifierData(identifierKeyPath, objectEvent.data); + if (!aiData.primary.ai || !aiData.primary.value) throw new Error('Identifier not found'); + const qualifierPath = constructQualifierPath(aiData.qualifiers); + const identifier = aiData.primary.value; const credentialId = generateUUID(); @@ -54,15 +52,15 @@ export const processObjectEvent: IService = async ( const objectEventLinkResolver = await registerLinkResolver( objectEventVcUrl, - traceabilityEvent.dlrIdentificationKeyType, - objectEventIdentifier, + aiData.primary.ai, + identifier, traceabilityEvent.dlrLinkTitle, LinkType.epcisLinkType, traceabilityEvent.dlrVerificationPage, dlr.dlrAPIUrl, dlr.dlrAPIKey, dlr.namespace, - objectEventQualifierPath, + qualifierPath, LinkType.epcisLinkType, ); diff --git a/packages/services/src/epcisEvents/transactionEvent.ts b/packages/services/src/epcisEvents/transactionEvent.ts index a3438519..8770a9c8 100644 --- a/packages/services/src/epcisEvents/transactionEvent.ts +++ b/packages/services/src/epcisEvents/transactionEvent.ts @@ -2,10 +2,11 @@ import { VerifiableCredential } from '@vckit/core-types'; import { IService, ITraceabilityEvent, ITraceabilityEventContext } from '../types/index.js'; import { decodeEnvelopedVC, issueVC } from '../vckit.service.js'; import { uploadData } from '../storage.service.js'; -import { constructIdentifierString, generateUUID } from '../utils/helpers.js'; -import { LinkType, getLinkResolverIdentifier, registerLinkResolver } from '../linkResolver.service.js'; +import { generateUUID } from '../utils/helpers.js'; +import { LinkType, registerLinkResolver } from '../linkResolver.service.js'; import { validateTraceabilityEventContext } from '../validateContext.js'; import { deleteValuesFromLocalStorageByKeyPath } from './helpers.js'; +import { constructIdentifierData, constructQualifierPath } from '../identifierSchemes/identifierSchemeServices.js'; export const processTransactionEvent: IService = async ( transactionEvent: ITraceabilityEvent, @@ -17,12 +18,11 @@ export const processTransactionEvent: IService = async ( } const { vckit, traceabilityEvent, dlr, storage, identifierKeyPath, localStorageParams } = context; - const transactionIdentifier = constructIdentifierString(transactionEvent.data, identifierKeyPath); - if (!transactionIdentifier) { - throw new Error('Identifier not found'); - } - const { identifier, qualifierPath } = getLinkResolverIdentifier(transactionIdentifier); + const aiData = constructIdentifierData(identifierKeyPath, transactionEvent.data); + if (!aiData.primary.ai || !aiData.primary.value) throw new Error('Identifier not found'); + const qualifierPath = constructQualifierPath(aiData.qualifiers); + const identifier = aiData.primary.value; const credentialId = generateUUID(); @@ -44,7 +44,7 @@ export const processTransactionEvent: IService = async ( const linkResolver = await registerLinkResolver( vcUrl, - traceabilityEvent.dlrIdentificationKeyType, + aiData.primary.ai, identifier, traceabilityEvent.dlrLinkTitle, LinkType.epcisLinkType, diff --git a/packages/services/src/epcisEvents/transformationEvent.ts b/packages/services/src/epcisEvents/transformationEvent.ts index b0d06d8b..18902b40 100644 --- a/packages/services/src/epcisEvents/transformationEvent.ts +++ b/packages/services/src/epcisEvents/transformationEvent.ts @@ -3,12 +3,7 @@ import _ from 'lodash'; import { decodeEnvelopedVC, issueVC } from '../vckit.service.js'; import { uploadData } from '../storage.service.js'; -import { - IdentificationKeyType, - LinkType, - getLinkResolverIdentifier, - registerLinkResolver, -} from '../linkResolver.service.js'; +import { LinkType, getLinkResolverIdentifier, registerLinkResolver } from '../linkResolver.service.js'; import { IService } from '../types/IService.js'; import { IConfigDLR, ICredential, IEntityIssue, ITransformationEventContext, IVCKitContext } from '../types'; @@ -153,7 +148,7 @@ export const issueEpcisTransformationEvent = async ( generateLinkResolver: generateLinkResolver( dlrContext.dlrAPIUrl, dlrContext.namespace, - IdentificationKeyType.gtin, + '01', `linkType=${dlrContext.namespace}:${LinkType.certificationLinkType}`, ), generateIdWithBatchLot, diff --git a/packages/services/src/epcisEvents/transformationEventOnly.ts b/packages/services/src/epcisEvents/transformationEventOnly.ts index 55013c1a..f7aaa965 100644 --- a/packages/services/src/epcisEvents/transformationEventOnly.ts +++ b/packages/services/src/epcisEvents/transformationEventOnly.ts @@ -1,11 +1,12 @@ import { VerifiableCredential } from '@vckit/core-types'; -import { registerLinkResolver, LinkType, getLinkResolverIdentifier } from '../linkResolver.service.js'; +import { registerLinkResolver, LinkType } from '../linkResolver.service.js'; import { uploadData } from '../storage.service.js'; import { IService } from '../types/IService.js'; -import { constructIdentifierString, generateUUID } from '../utils/helpers.js'; +import { generateUUID } from '../utils/helpers.js'; import { decodeEnvelopedVC, issueVC } from '../vckit.service.js'; import { ITraceabilityEvent, ITraceabilityEventContext } from '../types/index.js'; import { validateTraceabilityEventContext } from '../validateContext.js'; +import { constructIdentifierData, constructQualifierPath } from '../identifierSchemes/identifierSchemeServices.js'; /** * Processes an transformation event by issuing a verifiable credential, storing it in a storage service and registering a link resolver. @@ -26,13 +27,10 @@ export const processTransformationEventOnly: IService = async ( const { vckit, traceabilityEvent, dlr, storage, identifierKeyPath } = context; - const transformationIdentifier = constructIdentifierString(transformationEvent.data, identifierKeyPath); - if (!transformationIdentifier) { - throw new Error('Identifier not found'); - } - - const { identifier: transformationEventIdentifier, qualifierPath: transformationEventQualifierPath } = - getLinkResolverIdentifier(transformationIdentifier); + const aiData = constructIdentifierData(identifierKeyPath, transformationEvent.data); + if (!aiData.primary.ai || !aiData.primary.value) throw new Error('Identifier not found'); + const qualifierPath = constructQualifierPath(aiData.qualifiers); + const identifier = aiData.primary.value; const credentialId = generateUUID(); @@ -54,15 +52,15 @@ export const processTransformationEventOnly: IService = async ( const transformationEventLinkResolver = await registerLinkResolver( transformationEventVcUrl, - traceabilityEvent.dlrIdentificationKeyType, - transformationEventIdentifier, + aiData.primary.ai, + identifier, traceabilityEvent.dlrLinkTitle, LinkType.epcisLinkType, traceabilityEvent.dlrVerificationPage, dlr.dlrAPIUrl, dlr.dlrAPIKey, dlr.namespace, - transformationEventQualifierPath, + qualifierPath, LinkType.epcisLinkType, ); diff --git a/packages/services/src/identifierSchemes/identifierSchemeServices.ts b/packages/services/src/identifierSchemes/identifierSchemeServices.ts new file mode 100644 index 00000000..6d73ce15 --- /dev/null +++ b/packages/services/src/identifierSchemes/identifierSchemeServices.ts @@ -0,0 +1,82 @@ +import JSONPointer from 'jsonpointer'; +import _ from 'lodash'; +export type Identifier = { + applicationIdentifiers: { + shortcode: string; + ai: string; + type: string; + regex: string; + qualifiers: string[]; + }; +}; + +type AIData = { + primary: { + ai: string; + value: string; + }; + qualifiers: { ai: string; value: string }[]; +}; + +type AIPathConfigures = { + primary: { + ai: string; + path: string; + }; + qualifiers: { + ai: string; + path: string; + }[]; +}; + +export const constructIdentifierData = (identifierKeyPath: string | AIPathConfigures, data: any): AIData => { + if (_.isString(identifierKeyPath)) { + const identifyData = JSONPointer.get(data, identifierKeyPath); + return parseLinkResolverURLToAIs(identifyData); + } + if (_.isObject(identifierKeyPath)) { + return constructAIData(data, identifierKeyPath); + } + + throw new Error('Invalid identifierKeyPath'); +}; + +export const constructElementString = (aiData: AIData): string => { + if (!aiData.primary.ai || !aiData.primary.value) { + throw new Error('Primary AI or value not found'); + } + const qualifiersString = aiData.qualifiers + ? aiData.qualifiers.map((qualifier) => `(${qualifier.ai})${qualifier.value}`).join('') + : ''; + return `(${aiData.primary.ai})${aiData.primary.value}${qualifiersString}`; +}; + +export const constructQualifierPath = (qualifiers: { ai: string; value: string }[]): string => { + if (!qualifiers) return '/'; + return qualifiers.map((qualifier) => `/${qualifier.ai}/${qualifier.value}`).join('') || '/'; +}; + +const parseLinkResolverURLToAIs = (url: string): AIData => { + const regex = /\/(\d{2}|\d{3})\/([^/]+)/g; + const matches = [...url.matchAll(regex)]; + + if (!matches.length) { + throw new Error('No AI-value pairs found in the URL.'); + } + + const primary = { ai: matches[0][1], value: matches[0][2] }; + const qualifiers = matches.slice(1).map((match) => ({ ai: match[1], value: match[2] })); + + return { primary, qualifiers }; +}; + +const constructAIData = (data: any, keyPath: AIPathConfigures) => { + const primary = { ai: keyPath.primary.ai, value: JSONPointer.get(data, keyPath.primary.path) }; + const qualifiers = keyPath.qualifiers + ? keyPath.qualifiers.map((qualifier) => ({ + ai: qualifier.ai, + value: JSONPointer.get(data, qualifier.path), + })) + : []; + return { primary, qualifiers }; +}; diff --git a/packages/services/src/identifierSchemes/index.ts b/packages/services/src/identifierSchemes/index.ts new file mode 100644 index 00000000..80bd6afc --- /dev/null +++ b/packages/services/src/identifierSchemes/index.ts @@ -0,0 +1 @@ +export * from './identifierSchemeServices.js'; diff --git a/packages/services/src/index.ts b/packages/services/src/index.ts index b5d9133e..037ad8fe 100644 --- a/packages/services/src/index.ts +++ b/packages/services/src/index.ts @@ -11,3 +11,4 @@ export * from './utils/index.js'; export * from './identityProviders/index.js'; export * from './features/index.js'; export * from './api.service.js'; +export * from './identifierSchemes/index.js'; diff --git a/packages/services/src/linkResolver.service.ts b/packages/services/src/linkResolver.service.ts index a60d8fe0..1718b8f6 100644 --- a/packages/services/src/linkResolver.service.ts +++ b/packages/services/src/linkResolver.service.ts @@ -13,7 +13,7 @@ import { extractDomain } from './utils/helpers.js'; * @example * const arg: ICreateLinkResolver = { * linkResolver: { - * identificationKeyType: IdentificationKeyType.nlisid, + * identificationKeyType: '01', * identificationKey: '1234', * itemDescription: 'item', * }, @@ -45,14 +45,8 @@ export enum MimeType { applicationJson = 'application/json', } -export enum IdentificationKeyType { - gtin = 'gtin', - nlisid = 'nlisid', - consignment_id = 'consignment_id', -} - export interface ILinkResolver { - identificationKeyType: IdentificationKeyType; + identificationKeyType: string; identificationKey: string; itemDescription: string; } @@ -175,7 +169,7 @@ export const constructLinkResolver = ( export const registerLinkResolver = async ( url: string, - identificationKeyType: IdentificationKeyType, + identificationKeyType: string, identificationKey: string, linkTitle: string, linkType: LinkType, @@ -272,11 +266,11 @@ export const getDlrPassport = async (dlrUrl: string): Promise => { * This method will convert either a bracketed element string or an unbracketed element string into an associative array. * Input could be "(01)05412345000013(3103)000189(3923)2172(10)ABC123"; * or input could be "3103000189010541234500001339232172"+groupSeparator+"10ABC123"; - * + * * @param {string} elementString - The GS1 element string. * @returns {{ identifier: string, qualifierPath: string }} - An object containing the identifier and qualifier path. * @throws {Error} Throws an error if the element string contains more or less than one primary identification key. - * + * * How to use: try { const elementString = '(01)09359502000010(10)ABC123'; @@ -360,10 +354,10 @@ export const getLinkResolverIdentifier = (elementString: string): { identifier: /** * Retrieves the identifier and qualifier path from a URI. - * + * * @param {string} uri - The URI. * @returns {{ identifier: string, qualifierPath: string }} - An object containing the identifier and qualifier path. - * + * * How to use: try { const uri = 'https://idr.com/gs1/01/09359502000010/10/ABC123'; diff --git a/packages/services/src/processDPP.service.ts b/packages/services/src/processDPP.service.ts index 62ab14a9..1e7aeb8c 100644 --- a/packages/services/src/processDPP.service.ts +++ b/packages/services/src/processDPP.service.ts @@ -1,12 +1,13 @@ import { W3CVerifiableCredential } from '@vckit/core-types'; import { IDppContext, IService } from './types/index.js'; -import { constructIdentifierString, generateUUID } from './utils/helpers.js'; +import { generateUUID } from './utils/helpers.js'; import { uploadData } from './storage.service.js'; import { decodeEnvelopedVC, issueVC } from './vckit.service.js'; import { validateContextDPP } from './validateContext.js'; import { deleteItemFromLocalStorage } from './features/localStorage.service.js'; -import { LinkType, getLinkResolverIdentifier, registerLinkResolver } from './linkResolver.service.js'; +import { LinkType, registerLinkResolver } from './linkResolver.service.js'; +import { constructIdentifierData, constructQualifierPath } from './identifierSchemes/identifierSchemeServices.js'; /** * Process DPP, issue VC, upload to storage and register link resolver @@ -20,10 +21,10 @@ export const processDPP: IService = async (data: any, context: IDppContext): Pro const validationResult = validateContextDPP(context); if (!validationResult.ok) throw new Error(validationResult.value); - const objectIdentifier = constructIdentifierString(credentialSubject, context.identifierKeyPath); - if (!objectIdentifier) throw new Error('Identifier not found'); - - const { identifier, qualifierPath } = getLinkResolverIdentifier(objectIdentifier); + const aiData = constructIdentifierData(context.identifierKeyPath, credentialSubject); + if (!aiData.primary.ai || !aiData.primary.value) throw new Error('Identifier not found'); + const qualifierPath = constructQualifierPath(aiData.qualifiers); + const identifier = aiData.primary.value; const credentialId = generateUUID(); const vckitContext = context.vckit; @@ -49,7 +50,7 @@ export const processDPP: IService = async (data: any, context: IDppContext): Pro const linkResolverContext = context.dlr; const linkResolver = await registerLinkResolver( vcUrl, - dppContext.dlrIdentificationKeyType, + aiData.primary.ai, identifier, dppContext.dlrLinkTitle, LinkType.certificationLinkType, diff --git a/packages/services/src/processDigitalConformityCredential.service.ts b/packages/services/src/processDigitalConformityCredential.service.ts index ba8395c0..aae01eee 100644 --- a/packages/services/src/processDigitalConformityCredential.service.ts +++ b/packages/services/src/processDigitalConformityCredential.service.ts @@ -1,11 +1,12 @@ import { VerifiableCredential } from '@vckit/core-types'; -import { registerLinkResolver, LinkType, getLinkResolverIdentifier } from './linkResolver.service.js'; +import { registerLinkResolver, LinkType } from './linkResolver.service.js'; import { uploadData } from './storage.service.js'; import { IService } from './types/IService.js'; -import { constructIdentifierString, generateUUID } from './utils/helpers.js'; +import { generateUUID } from './utils/helpers.js'; import { decodeEnvelopedVC, issueVC } from './vckit.service.js'; import { ITraceabilityEvent, IDigitalConformityCredentialContext } from './types/index.js'; import { validateDigitalConformityCredentialContext } from './validateContext.js'; +import { constructIdentifierData, constructQualifierPath } from './identifierSchemes/identifierSchemeServices.js'; /** * Processes a digital conformity credential by issuing a verifiable credential, storing it in a storage service and registering a link resolver. @@ -26,12 +27,10 @@ export const processDigitalConformityCredential: IService = async ( const { vckit, digitalConformityCredential, dlr, storage, identifierKeyPath } = context; - const identifierString = constructIdentifierString(digitalConformityCredentialData.data, identifierKeyPath); - if (!identifierString) { - throw new Error('Identifier not found'); - } - - const { identifier, qualifierPath } = getLinkResolverIdentifier(identifierString); + const aiData = constructIdentifierData(identifierKeyPath, digitalConformityCredentialData.data); + if (!aiData.primary.ai || !aiData.primary.value) throw new Error('Identifier not found'); + const qualifierPath = constructQualifierPath(aiData.qualifiers); + const identifier = aiData.primary.value; const credentialId = generateUUID(); @@ -54,7 +53,7 @@ export const processDigitalConformityCredential: IService = async ( const linkResolver = await registerLinkResolver( vcUrl, - digitalConformityCredential.dlrIdentificationKeyType, + aiData.primary.ai, identifier, digitalConformityCredential.dlrLinkTitle, LinkType.certificationLinkType, diff --git a/packages/services/src/processDigitalFacilityRecord.service.ts b/packages/services/src/processDigitalFacilityRecord.service.ts index 994558f8..bf63fec8 100644 --- a/packages/services/src/processDigitalFacilityRecord.service.ts +++ b/packages/services/src/processDigitalFacilityRecord.service.ts @@ -1,11 +1,12 @@ import { VerifiableCredential } from '@vckit/core-types'; -import { registerLinkResolver, LinkType, getLinkResolverIdentifier } from './linkResolver.service.js'; +import { registerLinkResolver, LinkType } from './linkResolver.service.js'; import { uploadData } from './storage.service.js'; import { IService } from './types/IService.js'; -import { constructIdentifierString, generateUUID } from './utils/helpers.js'; +import { generateUUID } from './utils/helpers.js'; import { decodeEnvelopedVC, issueVC } from './vckit.service.js'; import { ITraceabilityEvent, IDigitalFacilityRecordContext } from './types/index.js'; import { validateDigitalFacilityRecordContext } from './validateContext.js'; +import { constructIdentifierData, constructQualifierPath } from './identifierSchemes/identifierSchemeServices.js'; /** * Processes a digital facility record by issuing a verifiable credential, storing it in a storage service and registering a link resolver. @@ -26,12 +27,10 @@ export const processDigitalFacilityRecord: IService = async ( const { vckit, digitalFacilityRecord, dlr, storage, identifierKeyPath } = context; - const identifierString = constructIdentifierString(digitalFacilityRecordData.data, identifierKeyPath); - if (!identifierString) { - throw new Error('Identifier not found'); - } - - const { identifier, qualifierPath } = getLinkResolverIdentifier(identifierString); + const aiData = constructIdentifierData(identifierKeyPath, digitalFacilityRecordData.data); + if (!aiData.primary.ai || !aiData.primary.value) throw new Error('Identifier not found'); + const qualifierPath = constructQualifierPath(aiData.qualifiers); + const identifier = aiData.primary.value; const credentialId = generateUUID(); @@ -54,7 +53,7 @@ export const processDigitalFacilityRecord: IService = async ( const linkResolver = await registerLinkResolver( vcUrl, - digitalFacilityRecord.dlrIdentificationKeyType, + aiData.primary.ai, identifier, digitalFacilityRecord.dlrLinkTitle, LinkType.certificationLinkType, diff --git a/packages/services/src/processDigitalIdentityAnchor.service.ts b/packages/services/src/processDigitalIdentityAnchor.service.ts index c9e4336e..87adc120 100644 --- a/packages/services/src/processDigitalIdentityAnchor.service.ts +++ b/packages/services/src/processDigitalIdentityAnchor.service.ts @@ -1,11 +1,12 @@ import { VerifiableCredential } from '@vckit/core-types'; -import { registerLinkResolver, LinkType, getLinkResolverIdentifier } from './linkResolver.service.js'; +import { registerLinkResolver, LinkType } from './linkResolver.service.js'; import { uploadData } from './storage.service.js'; import { IService } from './types/IService.js'; -import { constructIdentifierString, generateUUID } from './utils/helpers.js'; +import { generateUUID } from './utils/helpers.js'; import { decodeEnvelopedVC, issueVC } from './vckit.service.js'; import { ITraceabilityEvent, IDigitalIdentityAnchorContext } from './types/index.js'; import { validateDigitalIdentityAnchorContext } from './validateContext.js'; +import { constructIdentifierData, constructQualifierPath } from './identifierSchemes/identifierSchemeServices.js'; /** * Processes a digital identity anchor by issuing a verifiable credential, storing it in a storage service and registering a link resolver. @@ -26,12 +27,10 @@ export const processDigitalIdentityAnchor: IService = async ( const { vckit, digitalIdentityAnchor, dlr, storage, identifierKeyPath } = context; - const identifierString = constructIdentifierString(digitalIdentityAnchorData.data, identifierKeyPath); - if (!identifierString) { - throw new Error('Identifier not found'); - } - - const { identifier, qualifierPath } = getLinkResolverIdentifier(identifierString); + const aiData = constructIdentifierData(identifierKeyPath, digitalIdentityAnchorData.data); + if (!aiData.primary.ai || !aiData.primary.value) throw new Error('Identifier not found'); + const qualifierPath = constructQualifierPath(aiData.qualifiers); + const identifier = aiData.primary.value; const credentialId = generateUUID(); @@ -53,7 +52,7 @@ export const processDigitalIdentityAnchor: IService = async ( const linkResolver = await registerLinkResolver( vcUrl, - digitalIdentityAnchor.dlrIdentificationKeyType, + aiData.primary.ai, identifier, digitalIdentityAnchor.dlrLinkTitle, LinkType.certificationLinkType, diff --git a/packages/services/src/types/types.ts b/packages/services/src/types/types.ts index db576c92..e4836677 100644 --- a/packages/services/src/types/types.ts +++ b/packages/services/src/types/types.ts @@ -1,5 +1,4 @@ import { CredentialPayload } from '@vckit/core-types'; -import { IdentificationKeyType } from '../linkResolver.service'; import { StorageServiceConfig } from '../types'; import { IConstructObjectParameters } from '../utils/helpers'; @@ -43,7 +42,7 @@ export interface ICredential { } export interface ILinkResolverContext { - dlrIdentificationKeyType: IdentificationKeyType; + dlrIdentificationKeyType: string; dlrLinkTitle: string; dlrVerificationPage: string; dlrQualifierPath: ''; diff --git a/packages/services/src/validateContext.ts b/packages/services/src/validateContext.ts index 8214c7e8..6bd6e6e7 100644 --- a/packages/services/src/validateContext.ts +++ b/packages/services/src/validateContext.ts @@ -41,7 +41,6 @@ export const validateContextDPP = (context: IDppContext): Result => { if (_.isEmpty(context.dpp.type)) return error('Invalid type'); if (_.isEmpty(context.dpp.dlrLinkTitle)) return error('Invalid dlrLinkTitle'); if (_.isEmpty(context.dpp.dlrVerificationPage)) return error('Invalid dlrVerificationPage'); - if (_.isEmpty(context.dpp.dlrIdentificationKeyType)) return error('Invalid dlrIdentificationKeyType'); if (_.isEmpty(context.storage)) return error('Invalid storage context'); if (_.isEmpty(context.storage.url)) return error('Invalid storage url'); @@ -68,7 +67,6 @@ export const validateContextTransformationEvent = ( if (_.isEmpty(context.dpp.type)) return error('Invalid dpp type'); if (_.isEmpty(context.dpp.dlrLinkTitle)) return error('Invalid dpp dlrLinkTitle'); if (_.isEmpty(context.dpp.dlrVerificationPage)) return error('Invalid dpp dlrVerificationPage'); - if (_.isEmpty(context.dpp.dlrIdentificationKeyType)) return error('Invalid dpp dlrIdentificationKeyType'); if (_.isEmpty(context.storage)) return error('Invalid storage context'); if (_.isEmpty(context.storage.url)) return error('Invalid storage url'); @@ -107,8 +105,6 @@ export const validateDigitalIdentityAnchorContext = ( if (_.isEmpty(context.digitalIdentityAnchor.type)) return error('Invalid type'); if (_.isEmpty(context.digitalIdentityAnchor.dlrLinkTitle)) return error('Invalid dlrLinkTitle'); if (_.isEmpty(context.digitalIdentityAnchor.dlrVerificationPage)) return error('Invalid dlrVerificationPage'); - if (_.isEmpty(context.digitalIdentityAnchor.dlrIdentificationKeyType)) - return error('Invalid dlrIdentificationKeyType'); if (_.isEmpty(context.storage)) return error('Invalid storage context'); if (_.isEmpty(context.storage.url)) return error('Invalid storage url'); @@ -135,8 +131,6 @@ export const validateDigitalFacilityRecordContext = ( if (_.isEmpty(context.digitalFacilityRecord.type)) return error('Invalid type'); if (_.isEmpty(context.digitalFacilityRecord.dlrLinkTitle)) return error('Invalid dlrLinkTitle'); if (_.isEmpty(context.digitalFacilityRecord.dlrVerificationPage)) return error('Invalid dlrVerificationPage'); - if (_.isEmpty(context.digitalFacilityRecord.dlrIdentificationKeyType)) - return error('Invalid dlrIdentificationKeyType'); if (_.isEmpty(context.storage)) return error('Invalid storage context'); if (_.isEmpty(context.storage.url)) return error('Invalid storage url'); @@ -164,8 +158,6 @@ export const validateDigitalConformityCredentialContext = ( if (_.isEmpty(context.digitalConformityCredential.type)) return error('Invalid type'); if (_.isEmpty(context.digitalConformityCredential.dlrLinkTitle)) return error('Invalid dlrLinkTitle'); if (_.isEmpty(context.digitalConformityCredential.dlrVerificationPage)) return error('Invalid dlrVerificationPage'); - if (_.isEmpty(context.digitalConformityCredential.dlrIdentificationKeyType)) - return error('Invalid dlrIdentificationKeyType'); if (_.isEmpty(context.storage)) return error('Invalid storage context'); if (_.isEmpty(context.storage.url)) return error('Invalid storage url'); @@ -195,8 +187,6 @@ export const validateTraceabilityEventContext = ( if (_.isEmpty(context.traceabilityEvent.dlrLinkTitle)) return error('Invalid traceabilityEvent dlrLinkTitle'); if (_.isEmpty(context.traceabilityEvent.dlrVerificationPage)) return error('Invalid traceabilityEvent dlrVerificationPage'); - if (_.isEmpty(context.traceabilityEvent.dlrIdentificationKeyType)) - return error('Invalid traceabilityEvent dlrIdentificationKeyType'); if (_.isEmpty(context.storage)) return error('Invalid storage context'); if (_.isEmpty(context.storage.url)) return error('Invalid storage url'); diff --git a/seeding/idr-data.sh b/seeding/idr-data.sh index 2eaca696..17d356b4 100755 --- a/seeding/idr-data.sh +++ b/seeding/idr-data.sh @@ -7,8 +7,11 @@ SERVICE_NAME="Identity Resolver" MAX_RETRIES=3 RETRY_COUNT=0 -# Path to the IDR identifier JSON file -IDENTIFIER_FILE="./seeding/idr-identifier.json" +# Path to the IDR identifier JSON file for gs1 namespace +GS1_IDENTIFIER_FILE="./seeding/idr-identifier.gs1.json" + +# Path to the IDR identifier JSON file for nlis namespace +NLIS_IDENTIFIER_FILE="./seeding/idr-identifier.nlis.json" # Wait for the service to be available echo "Waiting for ${SERVICE_NAME} service to be ready..." @@ -41,6 +44,13 @@ curl -X POST \ -H 'accept: application/json' \ -H "Authorization: Bearer ${IDR_SERVICE_API_KEY}" \ -H 'Content-Type: application/json' \ - -d @"$IDENTIFIER_FILE" + -d @"$GS1_IDENTIFIER_FILE" + +curl -X POST \ + http://${IDR_SERVICE_HOST}:${IDR_SERVICE_PORT}/api/identifiers \ + -H 'accept: application/json' \ + -H "Authorization: Bearer ${IDR_SERVICE_API_KEY}" \ + -H 'Content-Type: application/json' \ + -d @"$NLIS_IDENTIFIER_FILE" printf "\nSeeding ${SERVICE_NAME} service data complete!\n\n" \ No newline at end of file diff --git a/seeding/idr-identifier.json b/seeding/idr-identifier.gs1.json similarity index 100% rename from seeding/idr-identifier.json rename to seeding/idr-identifier.gs1.json diff --git a/seeding/idr-identifier.nlis.json b/seeding/idr-identifier.nlis.json new file mode 100644 index 00000000..2180515d --- /dev/null +++ b/seeding/idr-identifier.nlis.json @@ -0,0 +1,14 @@ +{ + "namespace": "nlis", + "applicationIdentifiers": [ + { + "title": "NLIS", + "label": "NLIS", + "shortcode": "nlis", + "ai": "01", + "type": "I", + "regex": "(3ABCD123[a-zA-Z0-9]{8})", + "qualifiers": [] + } + ] +}