added the italy only certificate

This commit is contained in:
Gianmarco Pettinato 2021-09-27 18:54:27 +02:00
parent 29f17f2380
commit f1a839c2b4
2 changed files with 5 additions and 1 deletions

View File

@ -36,7 +36,10 @@ export class VaccineVerifier {
if(vaccineDiff <= 0){ if(vaccineDiff <= 0){
return this.getLogicValidityDays(validRulesSet, this.vaccineStartDayComplete, this.vaccineEndDayComplete,inoculationDate); return this.getLogicValidityDays(validRulesSet, this.vaccineStartDayComplete, this.vaccineEndDayComplete,inoculationDate);
} else { } else {
return this.getLogicValidityDays(validRulesSet, this.vaccineStartDayNotComplete, this.vaccineEndDayNotComplete,inoculationDate); const result = this.getLogicValidityDays(validRulesSet, this.vaccineStartDayNotComplete, this.vaccineEndDayNotComplete,inoculationDate);
if(result.valid)
result.message = 'Certificate is valid only in italy';
return result;
} }
} }

View File

@ -46,6 +46,7 @@ export default class Verifier {
result = {signature:{valid: signatureValidity}, valid: vaccineVerifier.checkCertifcate(dcc.payload), info:{identity:dcc.payload.nam,dob:dcc.payload.dob}}; result = {signature:{valid: signatureValidity}, valid: vaccineVerifier.checkCertifcate(dcc.payload), info:{identity:dcc.payload.nam,dob:dcc.payload.dob}};
} catch (error) { } catch (error) {
console.log(error); console.log(error);
result = {signature:{valid: false}, valid:{valid:false, message:'nd'}, info:{identity:{fnt:'nd',fn:'nd',gnt:'nd',gn:'nd'},dob:'nd'}};
} }
return result; return result;
} }