{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "/studio/schemas/fan-export-manifest-1.0.0.json",
  "title": "Fan export manifest 1.0.0",
  "description": "Describes one open export: the three NDJSON files, their row counts and SHA-256 hashes, and the counts of fans left out. All data is synthetic.",
  "type": "object",
  "required": ["schema_version", "exported_at", "purpose", "row_counts", "sha256", "counts", "synthetic"],
  "additionalProperties": false,
  "properties": {
    "schema_version": { "const": "1.0.0" },
    "exported_at": { "type": "string", "format": "date-time" },
    "purpose": { "type": "string", "description": "The export purpose the consent check used." },
    "row_counts": { "$ref": "#/$defs/perFile", "description": "Rows in each file." },
    "sha256": { "type": "object", "required": ["fans.ndjson", "identity_links.ndjson", "consent_records.ndjson"], "additionalProperties": false,
      "properties": {
        "fans.ndjson": { "$ref": "#/$defs/hash" },
        "identity_links.ndjson": { "$ref": "#/$defs/hash" },
        "consent_records.ndjson": { "$ref": "#/$defs/hash" } } },
    "counts": { "type": "object", "required": ["candidates", "excluded_no_consent", "excluded_no_identifier", "exported", "capped"], "additionalProperties": false,
      "properties": {
        "candidates": { "type": "integer", "minimum": 0 },
        "excluded_no_consent": { "type": "integer", "minimum": 0 },
        "excluded_no_identifier": { "type": "integer", "minimum": 0 },
        "exported": { "type": "integer", "minimum": 0 },
        "capped": { "type": "boolean", "description": "True when more than 500 fans qualified and the list was cut at 500, ordered by fan_id." } } },
    "synthetic": { "const": true }
  },
  "$defs": {
    "hash": { "type": "string", "pattern": "^[0-9a-f]{64}$", "description": "SHA-256 of the file's UTF-8 bytes, lower-case hex." },
    "perFile": { "type": "object", "required": ["fans.ndjson", "identity_links.ndjson", "consent_records.ndjson"], "additionalProperties": false,
      "properties": {
        "fans.ndjson": { "type": "integer", "minimum": 0 },
        "identity_links.ndjson": { "type": "integer", "minimum": 0 },
        "consent_records.ndjson": { "type": "integer", "minimum": 0 } } }
  }
}
