{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "$id": "https://onelesstool.com/data/schema.json",
  "title": "OneLessTool prices",
  "description": "CC BY 4.0. Attribution: \"OneLessTool, onelesstool.com\". One row per catalog plan; null is unknown, never zero.",
  "type": "array",
  "items": {
    "$schema": "http://json-schema.org/draft-07/schema#",
    "type": "object",
    "properties": {
      "tool": {
        "type": "string",
        "minLength": 1,
        "description": "Catalog tool slug; profile is /tools/{tool}."
      },
      "vendor": {
        "type": "string",
        "minLength": 1
      },
      "planId": {
        "type": "string",
        "minLength": 1
      },
      "planName": {
        "type": "string",
        "minLength": 1
      },
      "amount": {
        "anyOf": [
          {
            "type": "number",
            "minimum": 0
          },
          {
            "type": "null"
          }
        ],
        "description": "Listed USD per unit per period; null unless verified."
      },
      "period": {
        "type": "string",
        "enum": [
          "month",
          "year",
          "one_time"
        ]
      },
      "unit": {
        "type": "string",
        "enum": [
          "seat",
          "account",
          "usage"
        ]
      },
      "billedAnnually": {
        "type": "boolean"
      },
      "monthlyUSD": {
        "anyOf": [
          {
            "type": "number",
            "minimum": 0
          },
          {
            "type": "null"
          }
        ],
        "description": "USD per unit per month; null unless verified and known."
      },
      "evidenceStatus": {
        "type": "string",
        "enum": [
          "verified",
          "editorial",
          "estimate",
          "illustrative",
          "ai_suggested",
          "unverified"
        ]
      },
      "verifiedAt": {
        "anyOf": [
          {
            "type": "string",
            "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
          },
          {
            "type": "null"
          }
        ]
      },
      "verifiedBy": {
        "type": [
          "string",
          "null"
        ]
      },
      "sourceUrl": {
        "anyOf": [
          {
            "type": "string",
            "format": "uri"
          },
          {
            "type": "null"
          }
        ],
        "description": "First plan evidence source, when recorded."
      },
      "dataVersion": {
        "type": "string",
        "minLength": 1
      }
    },
    "required": [
      "tool",
      "vendor",
      "planId",
      "planName",
      "amount",
      "period",
      "unit",
      "billedAnnually",
      "monthlyUSD",
      "evidenceStatus",
      "verifiedAt",
      "verifiedBy",
      "sourceUrl",
      "dataVersion"
    ],
    "additionalProperties": false,
    "allOf": [
      {
        "if": {
          "properties": {
            "evidenceStatus": {
              "not": {
                "const": "verified"
              }
            }
          }
        },
        "then": {
          "properties": {
            "amount": {
              "type": "null"
            },
            "monthlyUSD": {
              "type": "null"
            },
            "verifiedAt": {
              "type": "null"
            },
            "verifiedBy": {
              "type": "null"
            }
          }
        }
      }
    ]
  }
}
