{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://the-internet-of-value-spec.netlify.app/schemas/wellbeing-identity-workshop",
  "title": "The Internet of Value Wellbeing Identity Workshop Completion",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "id",
    "subjectDid",
    "identityRecordRef",
    "sourceRefs",
    "protocolVersion",
    "status",
    "completionBasis",
    "completedAt",
    "credentialId",
    "nodeCoverage",
    "facetCoverage",
    "allNodesAddressed",
    "allFacetsAddressed"
  ],
  "properties": {
    "id": {
      "type": "string",
      "format": "uuid"
    },
    "subjectDid": {
      "type": "string",
      "pattern": "^did:iov:member:[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$"
    },
    "identityRecordRef": {
      "type": "string",
      "minLength": 1
    },
    "sourceRefs": {
      "type": "array",
      "minItems": 1,
      "uniqueItems": true,
      "items": {
        "type": "string"
      }
    },
    "protocolVersion": {
      "type": "string"
    },
    "status": {
      "type": "string",
      "enum": [
        "draft",
        "completed",
        "revoked"
      ]
    },
    "completionBasis": {
      "type": "string",
      "enum": [
        "facilitated-workshop",
        "founding-author-bootstrap"
      ]
    },
    "completedAt": {
      "type": "string",
      "format": "date-time"
    },
    "credentialId": {
      "type": "string",
      "format": "uuid"
    },
    "nodeCoverage": {
      "type": "array",
      "minItems": 8,
      "maxItems": 8,
      "uniqueItems": true,
      "items": {
        "type": "string",
        "pattern": "^~~[A-Za-z0-9_]+$"
      }
    },
    "facetCoverage": {
      "type": "array",
      "minItems": 1,
      "items": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "path",
          "state"
        ],
        "properties": {
          "path": {
            "type": "string",
            "pattern": "^~{3,4}[A-Za-z0-9_]+$"
          },
          "state": {
            "type": "string",
            "enum": [
              "provided",
              "verified",
              "self-attested",
              "pending-validation",
              "unknown",
              "not-applicable",
              "withheld"
            ]
          }
        }
      }
    },
    "allNodesAddressed": {
      "const": true
    },
    "allFacetsAddressed": {
      "const": true
    }
  }
}
