Skip to content

Commit

Permalink
fix: add appleCovidCardUrl field to notarisationMetadata (#70)
Browse files Browse the repository at this point in the history
* fix: add appleCovidCardUrl field to notarisationMetadata

* test: update test
  • Loading branch information
HJunyuan authored Mar 18, 2022
1 parent a9d637e commit 230522a
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 6 deletions.
3 changes: 2 additions & 1 deletion src/sg/gov/tech/notarise/1.0/sample-document-pdt.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
{
"type": "PCR",
"expiryDateTime": "2022-12-09T20:20:50+08:00",
"qr": "HC1:ABCDE..."
"qr": "HC1:ABCDE...",
"appleCovidCardUrl": "https://redirect.health.apple.com/EU-DCC/#..."
}
]
}
Expand Down
6 changes: 4 additions & 2 deletions src/sg/gov/tech/notarise/1.0/sample-document-vac.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,16 @@
"expiryDateTime": "2022-12-09T20:20:50+08:00",
"vaccineCode": "3339641000133109",
"dose": 1,
"qr": "HC1:ABCDE..."
"qr": "HC1:ABCDE...",
"appleCovidCardUrl": "https://redirect.health.apple.com/EU-DCC/#..."
},
{
"type": "VAC",
"expiryDateTime": "2022-12-09T20:20:50+08:00",
"vaccineCode": "3339641000133109",
"dose": 2,
"qr": "HC1:FGHIJ..."
"qr": "HC1:FGHIJ...",
"appleCovidCardUrl": "https://redirect.health.apple.com/EU-DCC/#..."
}
]
}
Expand Down
14 changes: 12 additions & 2 deletions src/sg/gov/tech/notarise/1.0/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
{
"description": "Vaccination",
"type": "object",
"required": ["type", "expiryDateTime", "vaccineCode", "dose", "qr"],
"required": ["type", "expiryDateTime", "vaccineCode", "dose", "qr", "appleCovidCardUrl"],
"properties": {
"type": {
"const": "VAC"
Expand All @@ -57,13 +57,18 @@
"description": "Signed EU Digital COVID Certificate",
"type": "string",
"examples": ["HC1:ABCDE"]
},
"appleCovidCardUrl": {
"description": "URL to add to Apple Wallet and Health",
"type": "string",
"examples": ["https://redirect.health.apple.com/EU-DCC/#..."]
}
}
},
{
"description": "Test",
"type": "object",
"required": ["type", "expiryDateTime", "qr"],
"required": ["type", "expiryDateTime", "qr", "appleCovidCardUrl"],
"properties": {
"type": {
"enum": ["PCR", "ART", "SER"]
Expand All @@ -76,6 +81,11 @@
"description": "Signed EU Digital COVID Certificate",
"type": "string",
"examples": ["HC1:ABCDE"]
},
"appleCovidCardUrl": {
"description": "URL to add to Apple Wallet and Health",
"type": "string",
"examples": ["https://redirect.health.apple.com/EU-DCC/#..."]
}
}
}
Expand Down
21 changes: 20 additions & 1 deletion src/sg/gov/tech/notarise/1.0/schema.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,8 @@ describe("schema", () => {
"notarisationMetadata.signedEuHealthCerts[0].expiryDateTime",
"notarisationMetadata.signedEuHealthCerts[0].vaccineCode",
"notarisationMetadata.signedEuHealthCerts[0].dose",
"notarisationMetadata.signedEuHealthCerts[0].qr"
"notarisationMetadata.signedEuHealthCerts[0].qr",
"notarisationMetadata.signedEuHealthCerts[0].appleCovidCardUrl"
])
);
expect(isValid).toBe(false);
Expand Down Expand Up @@ -209,6 +210,15 @@ describe("schema", () => {
},
"schemaPath": "#/properties/notarisationMetadata/properties/signedEuHealthCerts/items/anyOf/0/required",
},
Object {
"dataPath": ".notarisationMetadata.signedEuHealthCerts[0]",
"keyword": "required",
"message": "should have required property 'appleCovidCardUrl'",
"params": Object {
"missingProperty": "appleCovidCardUrl",
},
"schemaPath": "#/properties/notarisationMetadata/properties/signedEuHealthCerts/items/anyOf/0/required",
},
Object {
"dataPath": ".notarisationMetadata.signedEuHealthCerts[0]",
"keyword": "required",
Expand Down Expand Up @@ -236,6 +246,15 @@ describe("schema", () => {
},
"schemaPath": "#/properties/notarisationMetadata/properties/signedEuHealthCerts/items/anyOf/1/required",
},
Object {
"dataPath": ".notarisationMetadata.signedEuHealthCerts[0]",
"keyword": "required",
"message": "should have required property 'appleCovidCardUrl'",
"params": Object {
"missingProperty": "appleCovidCardUrl",
},
"schemaPath": "#/properties/notarisationMetadata/properties/signedEuHealthCerts/items/anyOf/1/required",
},
Object {
"dataPath": ".notarisationMetadata.signedEuHealthCerts[0]",
"keyword": "anyOf",
Expand Down

0 comments on commit 230522a

Please sign in to comment.