{
  "openapi": "3.1.0",
  "info": {
    "title": "Frugal Hipster Dallas Agent API",
    "version": "1.0.0",
    "description": "Read source-checked Dallas deals and submit candidates, corrections, or end reports for editorial verification."
  },
  "servers": [
    { "url": "https://frugal-hipster-dallas.funkyfest.chatgpt.site", "description": "Current owner-only Sites deployment" },
    { "url": "https://frugalhipster.com", "description": "Planned canonical domain after public launch and DNS connection" }
  ],
  "paths": {
    "/api/v1/deals": {
      "get": {
        "summary": "List live source-checked deals",
        "parameters": [
          { "name": "day", "in": "query", "schema": { "type": "string" } },
          { "name": "neighborhood", "in": "query", "schema": { "type": "string" } },
          { "name": "category", "in": "query", "schema": { "type": "string" } },
          { "name": "collection", "in": "query", "schema": { "enum": ["All", "Date Night", "Half Price", "Live Music", "Speakeasy Energy", "Sneaky Good"] } },
          { "name": "q", "in": "query", "schema": { "type": "string" } }
        ],
        "responses": { "200": { "description": "Live deal feed" } }
      }
    },
    "/api/v1/submissions": {
      "post": {
        "summary": "Create a pending editorial submission",
        "parameters": [{ "name": "Idempotency-Key", "in": "header", "required": false, "schema": { "type": "string", "maxLength": 200 } }],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": ["intent", "venue", "neighborhood", "description", "source_url"],
                "properties": {
                  "intent": { "enum": ["submit", "correct", "end"] },
                  "deal_id": { "type": "integer" },
                  "venue": { "type": "string" },
                  "neighborhood": { "type": "string" },
                  "title": { "type": "string" },
                  "description": { "type": "string" },
                  "timing": { "type": "string" },
                  "price": { "type": "string" },
                  "restrictions": { "type": "string" },
                  "source_url": { "type": "string", "format": "uri" },
                  "contact_email": { "type": "string", "format": "email" },
                  "submitted_by": { "enum": ["agent", "venue", "reader"] },
                  "agent": { "type": "object", "properties": { "name": { "type": "string" }, "url": { "type": "string", "format": "uri" } } }
                }
              }
            }
          }
        },
        "responses": {
          "202": { "description": "Queued as pending_review" },
          "400": { "description": "Validation failure" },
          "429": { "description": "Rate limited" }
        }
      }
    },
    "/api/v1/submissions/{id}": {
      "get": {
        "summary": "Read public submission status",
        "parameters": [{ "name": "id", "in": "path", "required": true, "schema": { "type": "string" } }],
        "responses": { "200": { "description": "Submission status" }, "404": { "description": "Not found" } }
      }
    }
  }
}
