{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://jianbianlighting.com.cn/ai/catalog.schema.json",
  "title": "Jian Bian public quotation catalog",
  "type": "object",
  "required": ["schema_version", "generated_at", "record_count", "products"],
  "properties": {
    "schema_version": {"const": "1.0.0"},
    "generated_at": {"type": "string", "format": "date-time"},
    "record_count": {"type": "integer", "minimum": 0},
    "products": {"type": "array", "items": {"$ref": "#/$defs/product"}}
  },
  "$defs": {
    "measurement": {
      "type": "object", "required": ["value", "status", "unit"],
      "properties": {"value": {"type": ["number", "null"]}, "min_value": {"type": "number"}, "max_value": {"type": "number"}, "unit": {"enum": ["W", "K", "mAh", "h"]}, "status": {"enum": ["not_verified", "listed_on_public_page", "listed_not_lab_verified"]}, "source_label": {"type": "string"}, "source_text": {"type": "string"}}
    },
    "product": {
      "type": "object",
      "required": ["id", "record_type", "name", "url", "specifications", "normalized", "certification", "commercial", "source_checked_at"],
      "properties": {
        "id": {"type": "string", "pattern": "^[a-z0-9-]+$"},
        "record_type": {"enum": ["product", "collection_or_overview"]},
        "name": {"type": "string", "minLength": 1},
        "url": {"type": "string", "format": "uri"},
        "source_checked_at": {"type": "string", "format": "date-time"},
        "specifications": {"type": "array", "items": {"type": "object", "required": ["name", "value", "source_url", "status"], "properties": {"name": {"type": "string"}, "value": {"type": "string"}, "source_url": {"type": "string", "format": "uri"}, "status": {"const": "published_claim_not_independently_tested"}}}},
        "normalized": {"type": "object", "required": ["power_w", "cct_k", "battery_capacity_mah", "runtime_hours", "charging_hours"], "additionalProperties": {"$ref": "#/$defs/measurement"}},
        "certification": {"type": "object", "required": ["status", "verified_certifications"], "properties": {"status": {"const": "requires_model_specific_document_review"}, "verified_certifications": {"type": "array", "maxItems": 0}}},
        "commercial": {"type": "object", "required": ["sales_mode", "price", "currency", "stock", "moq", "lead_time"], "properties": {"sales_mode": {"const": "quotation"}, "price": {"type": "null"}, "currency": {"type": "null"}, "stock": {"type": "null"}, "moq": {"type": "null"}, "lead_time": {"type": "null"}}}
      }
    }
  }
}
