{
  "openapi": "3.1.0",
  "info": {
    "title": "Tom Wood Honda Service API (demo)",
    "version": "0.1.0",
    "description": "Demo with sample data. Agents can read services and open times, check recalls, and request a booking. A booking request returns a confirm_url; nothing is booked until the customer confirms."
  },
  "servers": [{ "url": "/" }],
  "paths": {
    "/api/services": {
      "get": { "operationId": "listServices", "summary": "Service menu with sample prices",
        "responses": { "200": { "description": "Store facts and services" } } }
    },
    "/api/open-times": {
      "get": { "operationId": "getOpenTimes", "summary": "Open times for a service",
        "parameters": [
          { "name": "service_id", "in": "query", "required": true, "schema": { "type": "string" } },
          { "name": "date", "in": "query", "required": false, "schema": { "type": "string", "format": "date" } }
        ],
        "responses": { "200": { "description": "Days with open times" }, "400": { "description": "Unknown service" } } }
    },
    "/api/booking-requests": {
      "post": { "operationId": "requestBooking", "summary": "Request a booking. The customer must confirm.",
        "requestBody": { "required": true, "content": { "application/json": { "schema": {
          "type": "object", "required": ["service_id", "date", "time", "first_name", "phone"],
          "properties": {
            "service_id": { "type": "string" }, "date": { "type": "string", "format": "date" },
            "time": { "type": "string", "examples": ["9:00 AM"] }, "first_name": { "type": "string" },
            "phone": { "type": "string" }, "vehicle": { "type": "string" },
            "transport": { "type": "string", "enum": ["wait", "drop_off", "ride"] }, "notes": { "type": "string" }
          } } } } },
        "responses": { "201": { "description": "pending_customer_confirmation with confirm_url" }, "400": { "description": "Invalid request" } } }
    },
    "/api/recalls": {
      "get": { "operationId": "checkRecalls", "summary": "NHTSA recalls for the VIN's model and year",
        "parameters": [{ "name": "vin", "in": "query", "required": true, "schema": { "type": "string", "minLength": 17, "maxLength": 17 } }],
        "responses": { "200": { "description": "Vehicle and recalls" } } }
    }
  }
}
