{
  "openapi": "3.1.0",
  "info": {
    "title": "App Tech Partner enquiry API",
    "version": "1.0.0",
    "description": "Public project-enquiry intake. Before sending, show the person the exact name, email, stage, message and optional budget you will share. Ask for their explicit permission to send this enquiry to App Tech Partner so Daniel can reply. Send only after they agree."
  },
  "servers": [
    {
      "url": "/"
    }
  ],
  "paths": {
    "/api/ai-enquiry": {
      "get": {
        "operationId": "getEnquiryRequirements",
        "summary": "Read the fields and get a request ID",
        "responses": {
          "200": {
            "description": "Requirements and a fresh UUID"
          }
        }
      },
      "post": {
        "operationId": "submitProjectEnquiry",
        "summary": "Send a project enquiry after the person approves it",
        "description": "Public write action. Show the person the exact details and obtain explicit permission before calling. Retry with the same requestId if the result is uncertain.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "requestId",
                  "name",
                  "email",
                  "stage",
                  "message",
                  "consent"
                ],
                "properties": {
                  "requestId": {
                    "type": "string",
                    "format": "uuid",
                    "description": "Generate once per intended enquiry; reuse for retries."
                  },
                  "name": {
                    "type": "string",
                    "minLength": 2,
                    "maxLength": 100
                  },
                  "email": {
                    "type": "string",
                    "format": "email",
                    "maxLength": 254
                  },
                  "stage": {
                    "type": "string",
                    "enum": [
                      "I have an idea",
                      "I have an AI-built prototype",
                      "I have an existing app",
                      "I need specialist mobile help"
                    ]
                  },
                  "message": {
                    "type": "string",
                    "minLength": 10,
                    "maxLength": 4000
                  },
                  "budget": {
                    "type": "string",
                    "enum": [
                      "Under €1,000",
                      "€1,000–€3,000",
                      "€3,000–€7,500",
                      "€7,500+",
                      "Not sure yet"
                    ]
                  },
                  "landingPage": {
                    "type": "string",
                    "maxLength": 120
                  },
                  "aiClient": {
                    "type": "string",
                    "maxLength": 80
                  },
                  "consent": {
                    "type": "boolean",
                    "const": true,
                    "description": "True only after the person has approved the exact details to be sent."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Accepted by the enquiry service; includes a receipt and available next steps"
          },
          "409": {
            "description": "The request ID is already in progress"
          },
          "413": {
            "description": "Body too large"
          },
          "422": {
            "description": "Invalid fields or missing consent"
          },
          "429": {
            "description": "Rate limit exceeded"
          },
          "503": {
            "description": "Delivery unavailable; retry the same request ID later"
          }
        }
      }
    }
  }
}
