From 634c17db13bb02151620afcf8f846c3d8938ea97 Mon Sep 17 00:00:00 2001 From: kkmanos Date: Wed, 9 Oct 2024 11:57:05 +0300 Subject: [PATCH] exposed additional data on the card --- .../EdiplomasBlueprintSdJwtVCDM.ts | 14 +++++++++----- .../EHICSupportedCredentialSdJwtVCDM.ts | 12 +++++++----- .../VIDSupportedCredentialSdJwtVCDM.ts | 12 +++++++----- 3 files changed, 23 insertions(+), 15 deletions(-) diff --git a/wallet-enterprise-configurations/diploma-issuer/src/configuration/SupportedCredentialsConfiguration/EdiplomasBlueprintSdJwtVCDM.ts b/wallet-enterprise-configurations/diploma-issuer/src/configuration/SupportedCredentialsConfiguration/EdiplomasBlueprintSdJwtVCDM.ts index cc162d1..b89b972 100644 --- a/wallet-enterprise-configurations/diploma-issuer/src/configuration/SupportedCredentialsConfiguration/EdiplomasBlueprintSdJwtVCDM.ts +++ b/wallet-enterprise-configurations/diploma-issuer/src/configuration/SupportedCredentialsConfiguration/EdiplomasBlueprintSdJwtVCDM.ts @@ -81,14 +81,16 @@ export class EdiplomasBlueprintSdJwtVCDM implements VCDMSupportedCredentialProto { name: "Grade", value: diplomaEntry.grade }, { name: "Graduation Date", value: formatDateDDMMYYYY(diplomaEntry.graduation_date) }, { name: "Blueprint ID", value: "#" + diplomaEntry.blueprint_id }, + { name: "Expiry Date", value: formatDateDDMMYYYY(diplomaEntry.expiry_date) }, ]; const rowsObject: CategorizedRawCredentialView = { rows }; const pathsWithValues = [ { path: "given_name", value: diplomaEntry.given_name }, { path: "family_name", value: diplomaEntry.family_name }, - { path: "Title", value: diplomaEntry.title }, - { path: "Grade", value: diplomaEntry.grade }, + { path: "title", value: diplomaEntry.title }, + { path: "graduation_date", value: formatDateDDMMYYYY(diplomaEntry.graduation_date) }, + { path: "expiry_date", value: formatDateDDMMYYYY(diplomaEntry.expiry_date) }, ]; const dataUri = generateDataUriFromSvg(svgText, pathsWithValues); @@ -176,9 +178,11 @@ export class EdiplomasBlueprintSdJwtVCDM implements VCDMSupportedCredentialProto "background_color": "#12107c", "text_color": "#FFFFFF" }, - "svg_templates": { - "uri": config.url + "/images/diplomaTemplate.svg", - }, + "svg_templates": [ + { + "uri": config.url + "/images/diplomaTemplate.svg", + } + ], } } } diff --git a/wallet-enterprise-configurations/ehic-issuer/src/configuration/SupportedCredentialsConfiguration/EHICSupportedCredentialSdJwtVCDM.ts b/wallet-enterprise-configurations/ehic-issuer/src/configuration/SupportedCredentialsConfiguration/EHICSupportedCredentialSdJwtVCDM.ts index 5abf53a..c63c151 100644 --- a/wallet-enterprise-configurations/ehic-issuer/src/configuration/SupportedCredentialsConfiguration/EHICSupportedCredentialSdJwtVCDM.ts +++ b/wallet-enterprise-configurations/ehic-issuer/src/configuration/SupportedCredentialsConfiguration/EHICSupportedCredentialSdJwtVCDM.ts @@ -63,7 +63,7 @@ export class EHICSupportedCredentialSdJwtVCDM implements VCDMSupportedCredential return null; } - const ehics = users.filter((ehic) => + const ehics = users.filter((ehic) => ehic.family_name == userSession.family_name && ehic.given_name == userSession.given_name && new Date(ehic.birth_date).toISOString() == new Date(userSession.birth_date as string).toISOString() @@ -120,7 +120,7 @@ export class EHICSupportedCredentialSdJwtVCDM implements VCDMSupportedCredential throw new Error("Not the correct credential"); } - const ehicEntry = users.filter((ehic) => + const ehicEntry = users.filter((ehic) => ehic.family_name == userSession.family_name && ehic.given_name == userSession.given_name && new Date(ehic.birth_date).toISOString() == new Date(userSession.birth_date as string).toISOString() @@ -187,9 +187,11 @@ export class EHICSupportedCredentialSdJwtVCDM implements VCDMSupportedCredential "background_color": "#12107c", "text_color": "#FFFFFF" }, - "svg_templates": { - "uri": config.url + "/images/ehicTemplate.svg", - }, + "svg_templates": [ + { + "uri": config.url + "/images/ehicTemplate.svg", + } + ], } } } diff --git a/wallet-enterprise-configurations/vid-issuer/src/configuration/SupportedCredentialsConfiguration/VIDSupportedCredentialSdJwtVCDM.ts b/wallet-enterprise-configurations/vid-issuer/src/configuration/SupportedCredentialsConfiguration/VIDSupportedCredentialSdJwtVCDM.ts index 78a67da..576b911 100644 --- a/wallet-enterprise-configurations/vid-issuer/src/configuration/SupportedCredentialsConfiguration/VIDSupportedCredentialSdJwtVCDM.ts +++ b/wallet-enterprise-configurations/vid-issuer/src/configuration/SupportedCredentialsConfiguration/VIDSupportedCredentialSdJwtVCDM.ts @@ -76,8 +76,8 @@ export class VIDSupportedCredentialSdJwtVCDM implements VCDMSupportedCredentialP const pathsWithValues = [ { path: "family_name", value: vid.family_name }, - { path: "given_name", value: vid.given_name}, - { path: "document_number", value: vid.document_number}, + { path: "given_name", value: vid.given_name }, + { path: "document_number", value: vid.document_number }, { path: "birth_date", value: formatDateDDMMYYYY(vid.birth_date) }, { path: "expiry_date", value: formatDateDDMMYYYY(vid.expiry_date) } ]; @@ -173,9 +173,11 @@ export class VIDSupportedCredentialSdJwtVCDM implements VCDMSupportedCredentialP "background_color": "#12107c", "text_color": "#FFFFFF" }, - "svg_templates": { - "uri": config.url + "/images/idTemplate.svg", - }, + "svg_templates": [ + { + "uri": config.url + "/images/idTemplate.svg", + } + ], } } }