{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://shapes.penny.coop/participant/1.0.0/schema.json",
  "title": "Participant",
  "description": "A private research participant record with contact details, alias, address, consent records and blocked status.",
  "type": "object",
  "properties": {
    "name": {
      "title": "Name!",
      "type": "string",
      "x-penny": {
        "field": "text",
        "input": "text"
      }
    },
    "email": {
      "title": "Email",
      "type": "string",
      "format": "email",
      "x-penny": {
        "field": "text",
        "input": "email"
      }
    },
    "alias": {
      "title": "Alias",
      "type": "string",
      "x-penny": {
        "field": "text",
        "input": "alias"
      }
    },
    "address": {
      "title": "Address",
      "$ref": "https://shapes.penny.coop/address/1.0.0/schema.json",
      "x-penny": {
        "field": "address"
      }
    },
    "consentForms": {
      "title": "Consent Forms",
      "type": "array",
      "items": {
        "$ref": "https://shapes.penny.coop/consent-record/1.0.0/schema.json"
      },
      "x-penny": {
        "field": "consentRecord",
        "multiple": true
      }
    },
    "blocked": {
      "title": "Is blocked?",
      "type": "boolean",
      "x-penny": {
        "field": "boolean"
      }
    }
  },
  "required": [
    "name",
    "blocked"
  ],
  "x-penny": {
    "shape": "participant",
    "version": "1.0.0",
    "source": "app/types/participant.js",
    "sourceName": "participant",
    "kind": "record",
    "plural": "Participants",
    "icon": "User",
    "group": "Private",
    "defaultVisibility": "private",
    "publishable": false,
    "listSubtitle": "alias",
    "fieldOrder": [
      "name",
      "email",
      "alias",
      "address",
      "consentForms",
      "blocked"
    ],
    "sensitive": true,
    "encryption": {
      "required": true,
      "fields": [
        "name",
        "email",
        "alias",
        "address"
      ],
      "description": "Logical decrypted fields only. The main app encrypts participant identifying data; this shape is not permission to store or publish plaintext."
    }
  }
}
