{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://citerlabs.com/resources/lead-intake-kit.schema.json",
  "title": "CiterLabs public lead intake kit",
  "type": "object",
  "required": [
    "id",
    "version",
    "status",
    "title",
    "url",
    "access",
    "dataBoundary",
    "licenseStatus",
    "protocol",
    "workflow",
    "estimator",
    "assets",
    "examples",
    "participation"
  ],
  "properties": {
    "id": {
      "const": "citerlabs-lead-intake-kit"
    },
    "version": {
      "type": "string"
    },
    "status": {
      "const": "published-resource"
    },
    "title": {
      "type": "string"
    },
    "description": {
      "type": "string"
    },
    "url": {
      "type": "string",
      "format": "uri"
    },
    "access": {
      "const": "no-signup"
    },
    "dataBoundary": {
      "type": "string"
    },
    "licenseStatus": {
      "type": "object",
      "required": [
        "status",
        "note"
      ],
      "properties": {
        "status": {
          "const": "limited-grant"
        },
        "note": {
          "type": "string"
        }
      }
    },
    "protocol": {
      "type": "object",
      "required": [
        "executable",
        "note"
      ],
      "properties": {
        "executable": {
          "const": false
        },
        "note": {
          "type": "string"
        }
      }
    },
    "workflow": {
      "type": "array",
      "minItems": 1,
      "items": {
        "type": "object",
        "required": [
          "step",
          "name",
          "action",
          "gate"
        ],
        "properties": {
          "step": {
            "type": "integer",
            "minimum": 1
          },
          "name": {
            "type": "string"
          },
          "action": {
            "type": "string"
          },
          "gate": {
            "type": "string"
          }
        }
      }
    },
    "estimator": {
      "type": "object",
      "required": [
        "inputs",
        "formulas",
        "limitations"
      ],
      "properties": {
        "inputs": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "formulas": {
          "type": "object",
          "additionalProperties": {
            "type": "string"
          }
        },
        "limitations": {
          "type": "array",
          "items": {
            "type": "string"
          }
        }
      }
    },
    "assets": {
      "type": "array",
      "items": {
        "type": "object",
        "required": [
          "name",
          "description",
          "url"
        ],
        "properties": {
          "name": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "url": {
            "type": "string",
            "format": "uri"
          }
        }
      }
    },
    "examples": {
      "type": "array",
      "items": {
        "type": "object",
        "required": [
          "case",
          "requestId",
          "expected"
        ],
        "properties": {
          "case": {
            "type": "string"
          },
          "requestId": {
            "type": "string"
          },
          "need": {
            "type": "string"
          },
          "expected": {
            "type": "string"
          }
        }
      }
    },
    "participation": {
      "type": "object",
      "required": [
        "email",
        "purpose",
        "status"
      ],
      "properties": {
        "email": {
          "type": "string",
          "format": "email"
        },
        "purpose": {
          "type": "string"
        },
        "status": {
          "type": "string"
        }
      }
    }
  }
}