{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://cloudfacts.org/schemas/plan.schema.json",
  "title": "CloudFacts Plan",
  "type": "object",
  "properties": {
    "@id": { "type": "string", "pattern": "^plan:" },
    "name": { "type": "string" },
    "url": { "type": "string", "format": "uri" },
    "provider": {
      "type": "object",
      "properties": {
        "@id": { "type": "string" },
        "name": { "type": "string" },
        "url": { "type": "string" }
      }
    },
    "status": { "type": "string", "enum": ["active", "deprecated", "unavailable", "historical", "unknown"] },
    "compute": {
      "type": "object",
      "properties": {
        "vcpu": { "type": "integer", "minimum": 0 },
        "cpu_type": { "type": "string", "enum": ["shared", "dedicated", "burstable", "unknown"] },
        "architecture": { "type": "string", "enum": ["x86_64", "arm64", "mixed", "unknown"] }
      }
    },
    "memory": {
      "type": "object",
      "properties": {
        "ram_gb": { "type": "number", "minimum": 0 }
      }
    },
    "storage": {
      "type": "object",
      "properties": {
        "size_gb": { "type": "number", "minimum": 0 },
        "type": { "type": "string", "enum": ["nvme", "ssd", "hdd", "network_ssd", "network_nvme", "unknown"] }
      }
    },
    "pricing": {
      "type": "object",
      "properties": {
        "currency": { "type": "string", "pattern": "^[A-Z]{3}$" },
        "advertised_monthly": { "type": "number" },
        "effective_monthly_eur": { "type": "number" },
        "vat_included": { "type": "boolean" },
        "ipv4_monthly": { "type": ["number", "null"] },
        "backup_monthly": { "type": ["number", "null"] },
        "setup_fee": { "type": "number" }
      }
    },
    "coverage": {
      "type": "object",
      "additionalProperties": { "type": "string", "enum": ["complete", "partial", "unknown", "not_applicable", "unknown"] }
    }
  },
  "required": ["@id", "name", "url", "provider", "status"]
}