{
  "openapi": "3.1.0",
  "info": {
    "title": "GuestSuite Public API",
    "version": "1.0.0",
    "summary": "API pubblica read-only con informazioni su GuestSuite.",
    "description": "API pubblica e read-only di GuestSuite, software per la gestione di B&B e affitti brevi in Italia. Nessuna autenticazione. Nessun dato personale: espone solo informazioni sul prodotto, prezzi e pagine pubbliche. Rate limit: 60 richieste ogni 60 secondi per IP, comunicato con gli header IETF RateLimit e RateLimit-Policy. Gli errori usano application/problem+json (RFC 9457).",
    "contact": {
      "name": "GuestSuite",
      "email": "simone.ruggiero97@gmail.com",
      "url": "https://guestsuite.app/contact"
    }
  },
  "servers": [
    {
      "url": "https://guestsuite.app"
    }
  ],
  "externalDocs": {
    "description": "Documentazione per sviluppatori",
    "url": "https://guestsuite.app/docs"
  },
  "security": [],
  "tags": [
    {
      "name": "public",
      "description": "Informazioni pubbliche su GuestSuite"
    }
  ],
  "paths": {
    "/api/v1/info": {
      "get": {
        "operationId": "getInfo",
        "tags": [
          "public"
        ],
        "summary": "Informazioni su GuestSuite",
        "description": "Restituisce nome, descrizione, stato (waitlist o disponibile), funzionalita', pubblico di riferimento, contatti e link utili.",
        "responses": {
          "200": {
            "description": "Informazioni sul prodotto",
            "headers": {
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Info"
                }
              }
            }
          },
          "429": {
            "description": "Limite di richieste superato",
            "headers": {
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/pricing": {
      "get": {
        "operationId": "getPricing",
        "tags": [
          "public"
        ],
        "summary": "Prezzo mensile per numero di strutture",
        "description": "Calcola il costo mensile in euro: prima struttura piu' 3 EUR per ogni struttura aggiuntiva. Tutte le funzionalita' sono incluse.",
        "parameters": [
          {
            "name": "properties",
            "in": "query",
            "required": false,
            "description": "Numero di strutture gestite",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Prezzo calcolato",
            "headers": {
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pricing"
                }
              }
            }
          },
          "400": {
            "description": "Parametro non valido",
            "headers": {
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "429": {
            "description": "Limite di richieste superato",
            "headers": {
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/pages": {
      "get": {
        "operationId": "listPages",
        "tags": [
          "public"
        ],
        "summary": "Elenco delle pagine pubbliche",
        "description": "Elenca pagine principali, articoli del blog e pagine soluzione per tipo di struttura, con paginazione.",
        "parameters": [
          {
            "name": "type",
            "in": "query",
            "required": false,
            "description": "Filtra per tipo di pagina",
            "schema": {
              "type": "string",
              "enum": [
                "all",
                "static",
                "blog",
                "solution"
              ],
              "default": "all"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Numero massimo di risultati",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 50
            }
          },
          {
            "name": "offset",
            "in": "query",
            "required": false,
            "description": "Risultati da saltare",
            "schema": {
              "type": "integer",
              "minimum": 0,
              "default": 0
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Pagina di risultati",
            "headers": {
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PageList"
                }
              }
            }
          },
          "400": {
            "description": "Parametro non valido",
            "headers": {
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "429": {
            "description": "Limite di richieste superato",
            "headers": {
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "headers": {
      "RateLimit": {
        "description": "Quota residua e secondi al reset, es. \"default\";r=59;t=60",
        "schema": {
          "type": "string"
        }
      },
      "RateLimitPolicy": {
        "description": "Politica di rate limit, es. \"default\";q=60;w=60",
        "schema": {
          "type": "string"
        }
      }
    },
    "schemas": {
      "Info": {
        "type": "object",
        "required": [
          "name",
          "url",
          "description",
          "status",
          "features",
          "contact",
          "links"
        ],
        "properties": {
          "name": {
            "type": "string"
          },
          "url": {
            "type": "string",
            "format": "uri"
          },
          "description": {
            "type": "string"
          },
          "status": {
            "type": "string",
            "enum": [
              "waitlist",
              "available"
            ]
          },
          "market": {
            "type": "string"
          },
          "languages": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "features": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "audience": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "contact": {
            "type": "object",
            "properties": {
              "email": {
                "type": "string",
                "format": "email"
              },
              "contact_page": {
                "type": "string",
                "format": "uri"
              },
              "locality": {
                "type": "string"
              },
              "country": {
                "type": "string"
              }
            }
          },
          "links": {
            "type": "object",
            "additionalProperties": {
              "type": "string",
              "format": "uri"
            }
          }
        }
      },
      "Pricing": {
        "type": "object",
        "required": [
          "currency",
          "properties",
          "monthly_total_eur"
        ],
        "properties": {
          "currency": {
            "type": "string",
            "const": "EUR"
          },
          "billing_period": {
            "type": "string",
            "const": "month"
          },
          "properties": {
            "type": "integer"
          },
          "first_property_eur": {
            "type": "number"
          },
          "standard_first_property_eur": {
            "type": "number"
          },
          "additional_property_eur": {
            "type": "number"
          },
          "monthly_total_eur": {
            "type": "number"
          },
          "waitlist_discount_active": {
            "type": "boolean"
          },
          "all_features_included": {
            "type": "boolean"
          },
          "notes": {
            "type": "string"
          }
        }
      },
      "Page": {
        "type": "object",
        "required": [
          "type",
          "title",
          "url"
        ],
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "static",
              "blog",
              "solution"
            ]
          },
          "title": {
            "type": "string"
          },
          "url": {
            "type": "string",
            "format": "uri"
          },
          "date": {
            "type": "string"
          },
          "summary": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "PageList": {
        "type": "object",
        "required": [
          "total",
          "offset",
          "limit",
          "items"
        ],
        "properties": {
          "total": {
            "type": "integer"
          },
          "offset": {
            "type": "integer"
          },
          "limit": {
            "type": "integer"
          },
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Page"
            }
          }
        }
      },
      "Problem": {
        "type": "object",
        "description": "RFC 9457 Problem Details",
        "required": [
          "type",
          "title",
          "status",
          "detail",
          "code"
        ],
        "properties": {
          "type": {
            "type": "string",
            "format": "uri"
          },
          "title": {
            "type": "string"
          },
          "status": {
            "type": "integer"
          },
          "detail": {
            "type": "string"
          },
          "code": {
            "type": "string"
          },
          "resolution": {
            "type": "string"
          }
        }
      }
    }
  }
}