{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "$id": "keyword-data.schema.json",
  "title": "KeywordData",
  "description": "InfoKeyword Worker가 Firestore에 저장하는 키워드 분석 문서 스키마",
  "type": "object",
  "properties": {
    "keyword": {
      "type": "string",
      "description": "분석 대상 키워드"
    },
    "keyword_count": {
      "type": "integer",
      "minimum": 0,
      "description": "키워드 출현 횟수"
    },
    "search_volume": {
      "type": "integer",
      "minimum": 0,
      "description": "월간 검색량 (예: Google Keyword Planner 기준)"
    },
    "difficulty_score": {
      "type": "number",
      "minimum": 0,
      "maximum": 1,
      "description": "키워드 경쟁 난이도 점수 (0.0 ~ 1.0)"
    },
    "source": {
      "type": "string",
      "description": "데이터 출처 (예: google_keyword_planner, semrush)"
    },
    "task_id": {
      "type": "string",
      "description": "이 문서를 생성한 task ID"
    },
    "created_at": {
      "type": "string",
      "description": "문서 최초 생성 시각 (ISO 8601)"
    },
    "updated_at": {
      "type": "string",
      "description": "문서 최종 수정 시각 (ISO 8601)"
    }
  },
  "required": [
    "keyword",
    "keyword_count",
    "search_volume",
    "difficulty_score",
    "source",
    "task_id",
    "created_at",
    "updated_at"
  ],
  "additionalProperties": false
}
