{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://rulecalc.io/data/global-tax-rules-2026.schema.json",
  "title": "Global tax and compliance rules, 2026 (v2)",
  "type": "object",
  "required": ["datasetId", "title", "version", "asOf", "license", "maintainer", "rules"],
  "properties": {
    "datasetId": { "type": "string" },
    "title": { "type": "string" },
    "version": { "type": "string", "pattern": "^[0-9]+\\.[0-9]+\\.[0-9]+$" },
    "asOf": { "type": "string", "format": "date" },
    "license": { "type": "string" },
    "licenseNote": { "type": "string" },
    "maintainer": { "type": "string" },
    "homepage": { "type": "string", "format": "uri" },
    "description": { "type": "string" },
    "disclaimer": { "type": "string" },
    "coverage": {
      "type": "object",
      "properties": {
        "rules": { "type": "integer", "minimum": 1 },
        "jurisdictions": { "type": "integer", "minimum": 1 },
        "countries": { "type": "integer", "minimum": 0 },
        "platformWide": { "type": "integer", "minimum": 0 }
      }
    },
    "fields": { "type": "object", "additionalProperties": { "type": "string" } },
    "changesFromV1": { "type": "string" },
    "rules": {
      "type": "array",
      "minItems": 1,
      "items": { "$ref": "#/$defs/rule" }
    }
  },
  "$defs": {
    "rule": {
      "type": "object",
      "required": ["id", "country", "countryName", "jurisdiction", "topic", "title", "effectiveFrom", "keyFigure", "values", "authority", "sourceUrl", "calculator", "checkedOn"],
      "additionalProperties": false,
      "properties": {
        "id": {
          "type": "string",
          "pattern": "^[a-z0-9]+(-[a-z0-9]+)*$",
          "description": "Stable slug, unique within the dataset."
        },
        "country": {
          "type": "string",
          "description": "ISO 3166-1 alpha-2 code, or GLOBAL for platform-wide rules."
        },
        "countryName": { "type": "string", "description": "English country name." },
        "jurisdiction": { "type": "string" },
        "topic": {
          "type": "string",
          "enum": ["income-tax", "corporate-tax", "business-tax", "vat", "indirect-tax", "payroll", "social-contributions", "social-security", "pension", "savings", "filing", "e-invoicing", "capital-gains", "investment-tax", "securities", "marketplace-fees", "health-insurance", "labour", "energy"]
        },
        "title": { "type": "string" },
        "effectiveFrom": {
          "type": "string",
          "format": "date",
          "description": "First day the rule applies. May be in the future."
        },
        "keyFigure": {
          "type": "string",
          "description": "One-sentence, citation-ready summary of the rule with its units."
        },
        "values": {
          "type": "object",
          "description": "Flat key/value constants. Keys are self-describing and carry their unit suffix (Pct, Eur, Usd, Jpy, Czk, Sek, Dkk, Sgd, Rm, Twd, Idr, Inr, Cad, Gbp, Pln, Aed, Krw) so a consumer never has to guess a currency.",
          "additionalProperties": true
        },
        "authority": {
          "type": "string",
          "description": "Statute, agency publication or platform policy the values follow."
        },
        "sourceUrl": {
          "type": "string",
          "format": "uri",
          "description": "Official page of that authority, reachable on checkedOn."
        },
        "calculator": {
          "type": "string",
          "format": "uri",
          "description": "rulecalc.io page that implements and tests this rule."
        },
        "checkedOn": {
          "type": "string",
          "format": "date",
          "description": "Date the value was last checked against the authority."
        },
        "notes": { "type": "string" }
      }
    }
  }
}
