{
  "openapi": "3.1.0",
  "info": {
    "title": "Palais Unterkunft Hotel API",
    "description": "API for hotel information and booking inquiries. No authentication required for read endpoints. Use POST /api/inquiry to submit booking requests.",
    "version": "1.0.0",
    "contact": {
      "name": "Palais Unterkunft",
      "email": "info@palais-erfurt.de",
      "url": "https://palais-unterkunft.de/developers.html"
    }
  },
  "servers": [
    {
      "url": "https://palais-unterkunft.de/api",
      "description": "Production server"
    }
  ],
  "paths": {
    "/hotel": {
      "get": {
        "summary": "Get hotel information",
        "description": "Returns complete hotel information including address, contact details, amenities, check-in/out times and rating.",
        "operationId": "getHotel",
        "responses": {
          "200": {
            "description": "Hotel information",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/Hotel" }
              }
            }
          }
        }
      }
    },
    "/rooms": {
      "get": {
        "summary": "Get available room types",
        "description": "Returns all room types with descriptions, capacity and pricing guidance. Prices vary daily — use inquiry endpoint for current rates.",
        "operationId": "getRooms",
        "responses": {
          "200": {
            "description": "Room types",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/RoomList" }
              }
            }
          }
        }
      }
    },
    "/inquiry": {
      "post": {
        "summary": "Submit booking inquiry",
        "description": "Submit a booking inquiry. Hotel responds within 24 hours via email.",
        "operationId": "submitInquiry",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": { "$ref": "#/components/schemas/Inquiry" }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Inquiry submitted successfully",
            "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SuccessResponse" } } }
          },
          "400": {
            "description": "Invalid input",
            "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } }
          },
          "500": {
            "description": "Server error",
            "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "Hotel": {
        "type": "object",
        "properties": {
          "name": { "type": "string", "example": "Palais Unterkunft" },
          "type": { "type": "string", "example": "Hotel" },
          "description": { "type": "string" },
          "address": {
            "type": "object",
            "properties": {
              "street": { "type": "string", "example": "Futterstraße 13" },
              "city": { "type": "string", "example": "Erfurt" },
              "postalCode": { "type": "string", "example": "99084" },
              "country": { "type": "string", "example": "DE" }
            }
          },
          "contact": {
            "type": "object",
            "properties": {
              "phone": { "type": "string", "example": "+4936155060606" },
              "email": { "type": "string", "example": "info@palais-erfurt.de" }
            }
          },
          "checkin": { "type": "string", "example": "15:00" },
          "checkout": { "type": "string", "example": "10:00" },
          "rooms": { "type": "integer", "example": 13 },
          "rating": {
            "type": "object",
            "properties": {
              "value": { "type": "number", "example": 4.7 },
              "count": { "type": "integer", "example": 575 }
            }
          },
          "amenities": { "type": "array", "items": { "type": "string" } }
        }
      },
      "SuccessResponse": {
        "type": "object",
        "properties": {
          "success": { "type": "boolean", "example": true },
          "message": { "type": "string" }
        }
      },
      "ErrorResponse": {
        "type": "object",
        "properties": {
          "error": { "type": "string" },
          "code": { "type": "string" }
        }
      },
      "RoomList": {
        "type": "object",
        "properties": {
          "rooms": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "type": { "type": "string" },
                "persons": { "type": "integer" },
                "price_from": { "type": "number", "nullable": true },
                "beds": { "type": "string" },
                "amenities": { "type": "array", "items": { "type": "string" } }
              }
            }
          }
        }
      },
      "Inquiry": {
        "type": "object",
        "required": ["name", "email"],
        "properties": {
          "name": { "type": "string", "example": "Max Mustermann" },
          "email": { "type": "string", "format": "email" },
          "checkin": { "type": "string", "format": "date", "example": "2026-06-01" },
          "checkout": { "type": "string", "format": "date", "example": "2026-06-03" },
          "guests": { "type": "integer", "example": 2 },
          "message": { "type": "string" }
        }
      }
    }
  }
}
