{
  "openapi": "3.1.0",
  "info": {
    "title": "Yano Platform Public API",
    "description": "Zero-commission ticketing and event infrastructure API for independent organizers in India.",
    "version": "1.0.0"
  },
  "servers": [
    {
      "url": "https://yano.club",
      "description": "Production Server"
    }
  ],
  "paths": {
    "/api/public/events/search": {
      "get": {
        "summary": "Search Public Events by Human Intent",
        "description": "Finds upcoming community events and gatherings in India filtered by city, date/weekend, price, and social comfort intent (solo-friendly, quiet/chill, interactive, learning).",
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "description": "Natural language search keywords (e.g. 'acoustic', 'pottery', 'book club')",
            "required": false,
            "schema": { "type": "string" }
          },
          {
            "name": "city",
            "in": "query",
            "description": "Filter by Indian city (e.g. 'Bangalore', 'Mumbai', 'Delhi')",
            "required": false,
            "schema": { "type": "string" }
          },
          {
            "name": "when",
            "in": "query",
            "description": "Date constraint ('today', 'weekend', 'week', 'all')",
            "required": false,
            "schema": { "type": "string", "enum": ["all", "today", "weekend", "week"] }
          },
          {
            "name": "intent",
            "in": "query",
            "description": "Social energy intent ('solo', 'quiet', 'social', 'learning', 'party')",
            "required": false,
            "schema": { "type": "string", "enum": ["all", "solo", "quiet", "social", "learning", "party"] }
          },
          {
            "name": "free",
            "in": "query",
            "description": "Set to 1 or true for 100% free events only",
            "required": false,
            "schema": { "type": "boolean" }
          },
          {
            "name": "max_price",
            "in": "query",
            "description": "Maximum ticket price in INR",
            "required": false,
            "schema": { "type": "number" }
          }
        ],
        "responses": {
          "200": {
            "description": "List of matching public events with direct booking URLs"
          }
        }
      }
    },
    "/api/pricing": {
      "get": {
        "summary": "Get live ticket pricing slabs",
        "description": "Returns pricing slabs for prepaid ticket credits and signup bonus credits.",
        "responses": {
          "200": {
            "description": "Live pricing configuration"
          }
        }
      }
    },
    "/api/coupon/validate": {
      "post": {
        "summary": "Validate promo code",
        "description": "Validates a coupon code for an event and returns computed discount.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "slug": {
                    "type": "string"
                  },
                  "code": {
                    "type": "string"
                  },
                  "amountInr": {
                    "type": "number"
                  }
                },
                "required": [
                  "slug",
                  "code"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Validation result"
          }
        }
      }
    },
    "/api/health": {
      "get": {
        "summary": "Platform Health Probe",
        "description": "Returns real-time database latency, RPC health, and Cloudflare R2 storage operational status.",
        "responses": {
          "200": {
            "description": "Health status"
          }
        }
      }
    }
  }
}