From 9baaa19aef5ab211761c0087494deff60a131033 Mon Sep 17 00:00:00 2001 From: Thanh Do Date: Mon, 23 Dec 2024 15:04:17 +0700 Subject: [PATCH] resolve readme --- README.md | 3 +++ cypress/e2e/issue_workflow_test/DPP/issueDPP.cy.ts | 2 +- .../DigitalProductPassport_instance-v0.5.0.json | 8 ++++---- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 9e33930a..44123f5b 100644 --- a/README.md +++ b/README.md @@ -97,6 +97,9 @@ export MOCK_GS1_SERVICE_API_KEY=test456 # Mock GS1 service API key ## End-to-end testing ```bash # Run end-to-end testing scripts +yarn build-clean # clean node_modules before setup +yarn install +yarn build SEEDING=true docker compose -f docker-compose.e2e.yml up -d chmod +x run-e2e-tests.sh ./run-e2e-tests.sh diff --git a/cypress/e2e/issue_workflow_test/DPP/issueDPP.cy.ts b/cypress/e2e/issue_workflow_test/DPP/issueDPP.cy.ts index 3a95ef5c..ab05b81a 100644 --- a/cypress/e2e/issue_workflow_test/DPP/issueDPP.cy.ts +++ b/cypress/e2e/issue_workflow_test/DPP/issueDPP.cy.ts @@ -1,4 +1,4 @@ -import { LinkType } from "@mock-app/services"; +import { LinkType } from "../../../../packages/services/src/linkResolver.service"; describe('Issue DPP end-to-end testing flow', () => { beforeEach(() => { diff --git a/cypress/fixtures/credentials-e2e/DigitalProductPassport_instance-v0.5.0.json b/cypress/fixtures/credentials-e2e/DigitalProductPassport_instance-v0.5.0.json index 48153255..7b23ba18 100644 --- a/cypress/fixtures/credentials-e2e/DigitalProductPassport_instance-v0.5.0.json +++ b/cypress/fixtures/credentials-e2e/DigitalProductPassport_instance-v0.5.0.json @@ -834,15 +834,15 @@ ] } }, - "validFrom": "2024-12-23T06:29:11.214Z", + "validFrom": "2024-12-23T06:43:35.245Z", "credentialStatus": { - "id": "http://localhost:3332/credentials/status/bitstring-status-list/1#188", + "id": "http://localhost:3332/credentials/status/bitstring-status-list/1#195", "type": "BitstringStatusListEntry", "statusPurpose": "revocation", - "statusListIndex": 188, + "statusListIndex": 195, "statusListCredential": "http://localhost:3332/credentials/status/bitstring-status-list/1" }, - "id": "urn:uuid:1cb3ab96-03b9-4cf2-b33d-83214d904656", + "id": "urn:uuid:99be634a-61dd-49ed-aa70-7cd8278c052f", "render": [ { "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.

",