{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/roboparts-cc/json-schema/roboparts-cc-funnel-response-schema.json",
  "title": "FunnelResponse",
  "x-generated": "2026-11-23",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/_original/roboparts-cc-api-openapi.yml#/components/schemas/FunnelResponse",
  "type": "object",
  "required": [
    "date",
    "counts",
    "rates",
    "pipeline_usage",
    "history_7d"
  ],
  "properties": {
    "date": {
      "type": "string",
      "pattern": "^\\\\d{4}-\\\\d{2}-\\\\d{2}$",
      "description": "今日日期（UTC）"
    },
    "counts": {
      "type": "object",
      "required": [
        "visits",
        "signups",
        "trials_started",
        "trials_completed",
        "payments_started",
        "payments_success",
        "conversions"
      ],
      "properties": {
        "visits": {
          "type": "integer",
          "minimum": 0
        },
        "signups": {
          "type": "integer",
          "minimum": 0
        },
        "trials_started": {
          "type": "integer",
          "minimum": 0
        },
        "trials_completed": {
          "type": "integer",
          "minimum": 0
        },
        "payments_started": {
          "type": "integer",
          "minimum": 0
        },
        "payments_success": {
          "type": "integer",
          "minimum": 0
        },
        "conversions": {
          "type": "integer",
          "minimum": 0
        }
      }
    },
    "rates": {
      "type": "object",
      "properties": {
        "signup_rate": {
          "type": "number",
          "minimum": 0,
          "maximum": 1
        },
        "trial_start_rate": {
          "type": "number",
          "minimum": 0,
          "maximum": 1
        },
        "trial_complete_rate": {
          "type": "number",
          "minimum": 0,
          "maximum": 1
        },
        "payment_start_rate": {
          "type": "number",
          "minimum": 0,
          "maximum": 1
        },
        "payment_success_rate": {
          "type": "number",
          "minimum": 0,
          "maximum": 1
        },
        "conversion_rate": {
          "type": "number",
          "minimum": 0,
          "maximum": 1
        }
      }
    },
    "pipeline_usage": {
      "type": "object",
      "required": [
        "selection",
        "build_planner",
        "designer",
        "bom_checker",
        "adapter_generator"
      ],
      "properties": {
        "selection": {
          "type": "integer",
          "minimum": 0
        },
        "build_planner": {
          "type": "integer",
          "minimum": 0
        },
        "designer": {
          "type": "integer",
          "minimum": 0
        },
        "bom_checker": {
          "type": "integer",
          "minimum": 0
        },
        "adapter_generator": {
          "type": "integer",
          "minimum": 0
        }
      }
    },
    "history_7d": {
      "type": "array",
      "maxItems": 7,
      "items": {
        "type": "object",
        "required": [
          "date",
          "visits",
          "signups",
          "conversions"
        ],
        "properties": {
          "date": {
            "type": "string",
            "pattern": "^\\\\d{4}-\\\\d{2}-\\\\d{2}$"
          },
          "visits": {
            "type": "integer",
            "minimum": 0
          },
          "signups": {
            "type": "integer",
            "minimum": 0
          },
          "conversions": {
            "type": "integer",
            "minimum": 0
          }
        }
      }
    },
    "meta": {
      "type": "object",
      "description": "埋点契约元信息（含 data_version）",
      "additionalProperties": true
    }
  }
}