Step 3: Configure the certificate template
<tr>
<td><span class="d-flex pt-1 pb-1 font-bold">Beneficiary Name</span></td>
<td><span class="d-flex pt-1 pb-1 font-bold">Beneficiary Parent Name</span></td>
</tr>
<tr>
<td><span class="d-flex">{{name}}</span></td>
<td><span class="d-flex">{{parentName}}</span></td>
</tr>function prepareDataForVaccineCertificateTemplate(certificateRaw, dataURL) {
certificateRaw.certificate = JSON.parse(certificateRaw.certificate);
const {certificate: {credentialSubject, evidence}} = certificateRaw;
const certificateData = {
name: credentialSubject.name,
parentName: credentialSubject.parentName,
age: credentialSubject.age,
gender: credentialSubject.gender,
identity: formatId(credentialSubject.id),
beneficiaryId: credentialSubject.refId,
recipientAddress: formatRecipientAddress(credentialSubject.address),
vaccine: evidence[0].vaccine,
vaccinationDate: formatDate(evidence[0].date) + ` (Batch no. ${evidence[0].batch} )`,
vaccineValidDays: `after ${getVaccineValidDays(evidence[0].effectiveStart, evidence[0].effectiveUntil)} days`,
vaccinatedBy: evidence[0].verifier.name,
vaccinatedAt: formatFacilityAddress(evidence[0]),
qrCode: dataURL,
dose: evidence[0].dose,
totalDoses: evidence[0].totalDoses,
isFinalDose: evidence[0].dose === evidence[0].totalDoses,
currentDoseText: `(${getNumberWithOrdinal(evidence[0].dose)} Dose)`
};
return certificateData;
}PreviousStep 2: Configure the QR code contentNextHow to set up the verification portal for implementation
Last updated
Was this helpful?