{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "version": {
      "type": "string",
      "const": "v1"
    },
    "generated": {
      "type": "string"
    },
    "licence": {
      "type": "string",
      "const": "CC BY 4.0"
    },
    "licence_url": {
      "type": "string",
      "const": "https://creativecommons.org/licenses/by/4.0/"
    },
    "cite_as": {
      "type": "string",
      "const": "Scamstats (Armidale), scamstats.org"
    },
    "page_url": {
      "type": "string"
    },
    "countries": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "iso2": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "page_url": {
            "type": "string"
          },
          "currency": {
            "type": "string"
          },
          "people_scammed": {
            "type": "object",
            "properties": {
              "value": {
                "type": "number"
              },
              "display": {
                "type": "string"
              },
              "basis": {
                "type": "string",
                "enum": [
                  "measured",
                  "estimated",
                  "borrowed"
                ]
              },
              "donors": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "donors_name": {
                "type": "string"
              },
              "period_start": {
                "type": "string"
              },
              "period_end": {
                "type": "string"
              }
            },
            "required": [
              "value",
              "display",
              "basis",
              "donors",
              "donors_name",
              "period_start",
              "period_end"
            ],
            "additionalProperties": false
          },
          "share_of_adults": {
            "type": "object",
            "properties": {
              "value": {
                "type": "number"
              },
              "display": {
                "type": "string"
              },
              "basis": {
                "type": "string",
                "enum": [
                  "measured",
                  "estimated",
                  "borrowed"
                ]
              },
              "donors": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "donors_name": {
                "type": "string"
              },
              "period_start": {
                "type": "string"
              },
              "period_end": {
                "type": "string"
              }
            },
            "required": [
              "value",
              "display",
              "basis",
              "donors",
              "donors_name",
              "period_start",
              "period_end"
            ],
            "additionalProperties": false
          },
          "money_lost": {
            "type": "object",
            "properties": {
              "value": {
                "type": "number"
              },
              "display": {
                "type": "string"
              },
              "basis": {
                "type": "string",
                "enum": [
                  "measured",
                  "estimated",
                  "borrowed"
                ]
              },
              "donors": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "donors_name": {
                "type": "string"
              },
              "period_start": {
                "type": "string"
              },
              "period_end": {
                "type": "string"
              }
            },
            "required": [
              "value",
              "display",
              "basis",
              "donors",
              "donors_name",
              "period_start",
              "period_end"
            ],
            "additionalProperties": false
          },
          "money_lost_usd": {
            "type": "object",
            "properties": {
              "value": {
                "type": "number"
              },
              "display": {
                "type": "string"
              },
              "basis": {
                "type": "string",
                "enum": [
                  "measured",
                  "estimated",
                  "borrowed"
                ]
              },
              "donors": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "donors_name": {
                "type": "string"
              },
              "period_start": {
                "type": "string"
              },
              "period_end": {
                "type": "string"
              }
            },
            "required": [
              "value",
              "display",
              "basis",
              "donors",
              "donors_name",
              "period_start",
              "period_end"
            ],
            "additionalProperties": false
          },
          "cases_recorded": {
            "type": "object",
            "properties": {
              "value": {
                "type": "number"
              },
              "display": {
                "type": "string"
              },
              "basis": {
                "type": "string",
                "enum": [
                  "measured",
                  "estimated",
                  "borrowed"
                ]
              },
              "donors": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "donors_name": {
                "type": "string"
              },
              "period_start": {
                "type": "string"
              },
              "period_end": {
                "type": "string"
              }
            },
            "required": [
              "value",
              "display",
              "basis",
              "donors",
              "donors_name",
              "period_start",
              "period_end"
            ],
            "additionalProperties": false
          },
          "top_types": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "rank": {
                  "type": "number"
                },
                "code": {
                  "type": "string"
                },
                "label": {
                  "type": "string"
                }
              },
              "required": [
                "rank",
                "code",
                "label"
              ],
              "additionalProperties": false
            }
          },
          "unranked_share": {
            "type": [
              "number",
              "null"
            ]
          },
          "police": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "series_id": {
                  "type": "string"
                },
                "description": {
                  "type": "string"
                },
                "reporting_bodies": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                },
                "counts": {
                  "type": "string",
                  "enum": [
                    "cases",
                    "people"
                  ]
                },
                "includes_attempted": {
                  "type": "string",
                  "enum": [
                    "yes",
                    "no",
                    "unknown"
                  ]
                },
                "authorisation": {
                  "type": "string",
                  "enum": [
                    "authorised",
                    "unauthorised",
                    "both",
                    "unknown"
                  ]
                },
                "period_start": {
                  "type": "string"
                },
                "period_end": {
                  "type": "string"
                },
                "value": {
                  "type": "number"
                }
              },
              "required": [
                "series_id",
                "description",
                "reporting_bodies",
                "counts",
                "includes_attempted",
                "authorisation",
                "period_start",
                "period_end",
                "value"
              ],
              "additionalProperties": false
            }
          }
        },
        "required": [
          "iso2",
          "name",
          "page_url",
          "currency",
          "people_scammed",
          "share_of_adults",
          "money_lost",
          "money_lost_usd",
          "cases_recorded",
          "top_types",
          "unranked_share",
          "police"
        ],
        "additionalProperties": false
      }
    }
  },
  "required": [
    "version",
    "generated",
    "licence",
    "licence_url",
    "cite_as",
    "page_url",
    "countries"
  ],
  "additionalProperties": false
}
