{
  "$id": "https://redlightindex.com/schema/reports_and_measurements.schema.json",
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "items": {
    "additionalProperties": false,
    "properties": {
      "band": {
        "type": "string"
      },
      "claim_id": {
        "type": "string"
      },
      "device_id": {
        "type": "string"
      },
      "distance_bucket": {
        "enum": [
          "contact",
          "le8_cm",
          "8_20_cm",
          "gt20_cm",
          "not_stated"
        ],
        "type": "string"
      },
      "distance_cm": {
        "pattern": "^$|^-?(?:0|[1-9][0-9]*)(?:\\.[0-9]+)?$",
        "type": "string"
      },
      "geometry": {
        "type": "string"
      },
      "instrument_type": {
        "type": "string"
      },
      "measured_by": {
        "type": "string"
      },
      "measurement_id": {
        "type": "string"
      },
      "notes": {
        "type": "string"
      },
      "provenance_class": {
        "enum": [
          "L",
          "I",
          "M"
        ],
        "type": "string"
      },
      "report_date": {
        "pattern": "^$|^[0-9]{4}-[0-9]{2}-[0-9]{2}$",
        "type": "string"
      },
      "report_number": {
        "type": "string"
      },
      "retrieved_at": {
        "pattern": "^$|^[0-9]{4}-[0-9]{2}-[0-9]{2}$",
        "type": "string"
      },
      "signed_report": {
        "enum": [
          "true",
          "false"
        ],
        "type": "string"
      },
      "source_archive_url": {
        "pattern": "^$|^https://.*$",
        "type": "string"
      },
      "source_url": {
        "pattern": "^$|^https://.*$",
        "type": "string"
      },
      "statistic": {
        "type": "string"
      },
      "unit": {
        "type": "string"
      },
      "value": {
        "pattern": "^$|^-?(?:0|[1-9][0-9]*)(?:\\.[0-9]+)?$",
        "type": "string"
      }
    },
    "required": [
      "measurement_id",
      "device_id",
      "claim_id",
      "provenance_class",
      "measured_by",
      "report_number",
      "report_date",
      "signed_report",
      "instrument_type",
      "geometry",
      "statistic",
      "band",
      "value",
      "unit",
      "distance_cm",
      "distance_bucket",
      "source_url",
      "source_archive_url",
      "retrieved_at",
      "notes"
    ],
    "type": "object"
  },
  "title": "Red Light Index reports_and_measurements rows",
  "type": "array"
}
