{
  "$id": "https://schemata.openattestation.com/sg/gov/tech/notarise/1.0",
  "$schema": "http://json-schema.org/draft-07/schema#",
  "type": "object",
  "description": "Description of data expected for notarised documents",
  "properties": {
    "notarisationMetadata": {
      "type": "object",
      "properties": {
        "reference": {
          "description": "Unique reference of the notarisation",
          "type": "string"
        },
        "notarisedOn": {
          "description": "Date and time at which the notarisation happened",
          "type": "string",
          "format": "date-time",
          "examples": ["2020-09-27T06:15:00Z"]
        },
        "passportNumber": {
          "description": "Passport number of the recipient",
          "type": "string"
        },
        "url": {
          "description": "URI to the stored document",
          "type": "string",
          "format": "uri"
        },
        "signedEuHealthCerts": {
          "description": "A collection of signed EU Digital COVID Certificates",
          "type": "array",
          "minItems": 1,
          "items": {
            "anyOf": [
              {
                "description": "Vaccination",
                "type": "object",
                "required": ["type", "expiryDateTime", "vaccineCode", "dose", "qr", "appleCovidCardUrl"],
                "properties": {
                  "type": {
                    "const": "VAC"
                  },
                  "expiryDateTime": {
                    "format": "date-time",
                    "examples": ["2022-12-09T20:20:50+08:00"]
                  },
                  "vaccineCode": {
                    "type": "string",
                    "examples": ["3339641000133109", "3407851000133103"]
                  },
                  "dose": {
                    "description": "Dose number",
                    "type": "number",
                    "examples": [1, 2]
                  },
                  "qr": {
                    "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", "appleCovidCardUrl"],
                "properties": {
                  "type": {
                    "enum": ["PCR", "ART", "SER"]
                  },
                  "expiryDateTime": {
                    "format": "date-time",
                    "examples": ["2022-12-09T20:20:50+08:00"]
                  },
                  "qr": {
                    "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/#..."]
                  }
                }
              }
            ]
          }
        }
      },
      "required": ["reference", "notarisedOn", "passportNumber", "url"]
    }
  },
  "required": ["notarisationMetadata"]
}
