{
  "$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"
    },
    "year": {
      "type": "number"
    },
    "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_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
    },
    "money_returned_usd": {
      "anyOf": [
        {
          "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
        },
        {
          "type": "null"
        }
      ]
    },
    "method": {
      "type": "string",
      "const": "income_group_medians"
    }
  },
  "required": [
    "version",
    "generated",
    "licence",
    "licence_url",
    "cite_as",
    "page_url",
    "year",
    "people_scammed",
    "share_of_adults",
    "money_lost_usd",
    "money_returned_usd",
    "method"
  ],
  "additionalProperties": false
}
