{
  "openapi": "3.1.0",
  "info": {
    "title": "RCFácil Premium API",
    "version": "2.0.0",
    "description": "API pública da RCFácil Premium – maior rede de Franquia de Intermediação Cartorária do Brasil. Permite consultar informações sobre a franquia, segmentos de negócio, FAQ e enviar leads de interessados. CNPJ: 49.437.211/0001-85. Fundada em 2016.",
    "contact": {
      "name": "Suporte RCFácil",
      "email": "franquias@rcfacil.com.br",
      "url": "https://franquiasrcfacil.com.br/docs/api"
    },
    "license": {
      "name": "Proprietary",
      "url": "https://franquiasrcfacil.com.br/termos"
    },
    "x-logo": {
      "url": "https://franquiasrcfacil.com.br/images/logo-icon.png",
      "altText": "RCFácil Premium – Logo"
    }
  },
  "servers": [
    {
      "url": "https://franquiasrcfacil.com.br/api",
      "description": "Produção"
    }
  ],
  "tags": [
    { "name": "Leads",     "description": "Envio de leads de potenciais franqueados" },
    { "name": "Info",      "description": "Informações sobre a franquia" },
    { "name": "Segmentos", "description": "Os 8 segmentos de negócio da RCFácil" },
    { "name": "FAQ",       "description": "Perguntas frequentes sobre a franquia" }
  ],
  "paths": {
    "/leads": {
      "post": {
        "operationId": "createLead",
        "summary": "Enviar lead de interesse em franquia",
        "description": "Recebe dados de um potencial franqueado interessado na RCFácil Premium. Os dados são encaminhados ao time comercial para contato em até 24 horas.",
        "tags": ["Leads"],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": { "$ref": "#/components/schemas/LeadInput" }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Lead criado com sucesso",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/LeadResponse" }
              }
            }
          },
          "400": { "description": "Dados inválidos ou campos obrigatórios ausentes" },
          "429": { "description": "Muitas requisições – rate limit excedido" }
        }
      }
    },
    "/info": {
      "get": {
        "operationId": "getFranchiseInfo",
        "summary": "Retorna informações gerais sobre a franquia RCFácil",
        "description": "Retorna dados institucionais completos: nome, CNPJ, fundação, segmentos, prêmios, potencial de faturamento e contato.",
        "tags": ["Info"],
        "responses": {
          "200": {
            "description": "Informações da franquia",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/FranchiseInfo" }
              }
            }
          }
        }
      }
    },
    "/segmentos": {
      "get": {
        "operationId": "getSegmentos",
        "summary": "Lista os 8 segmentos de negócio da RCFácil",
        "description": "Retorna descrição detalhada de cada um dos 8 segmentos de receita disponíveis na franquia RCFácil.",
        "tags": ["Segmentos"],
        "parameters": [
          {
            "name": "id",
            "in": "query",
            "required": false,
            "schema": { "type": "integer", "minimum": 1, "maximum": 8 },
            "description": "ID do segmento (1-8). Omita para retornar todos."
          }
        ],
        "responses": {
          "200": {
            "description": "Lista de segmentos",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/SegmentosResponse" }
              }
            }
          }
        }
      }
    },
    "/faq": {
      "get": {
        "operationId": "getFAQ",
        "summary": "Retorna as perguntas frequentes sobre a franquia",
        "description": "Lista as perguntas e respostas mais comuns sobre investimento, modelo, abertura e diferenciais da franquia RCFácil.",
        "tags": ["FAQ"],
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "required": false,
            "schema": { "type": "string" },
            "description": "Palavra-chave para filtrar. Omita para retornar todas as perguntas."
          }
        ],
        "responses": {
          "200": {
            "description": "FAQ da franquia",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/FAQResponse" }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "LeadInput": {
        "type": "object",
        "required": ["nome", "email", "whatsapp"],
        "properties": {
          "nome":         { "type": "string", "minLength": 3, "description": "Nome completo do interessado" },
          "email":        { "type": "string", "format": "email", "description": "E-mail do interessado" },
          "whatsapp":     { "type": "string", "description": "WhatsApp com DDD, ex: (11) 99999-9999" },
          "cidade":       { "type": "string", "description": "Cidade do interessado" },
          "uf":           { "type": "string", "maxLength": 2, "description": "Estado (UF), ex: SP" },
          "profissao":    { "type": "string", "enum": ["advogado","contador","corretor","empresario","servidor_publico","outro"], "description": "Profissão atual" },
          "investimento": { "type": "string", "enum": ["ate-50k","50k-100k","100k-200k","200k-plus","indefinido"], "description": "Faixa de investimento disponível" },
          "adesao":       { "type": "string", "enum": ["imediato","1-3-meses","3-6-meses","mais-6-meses"], "description": "Prazo para adesão" },
          "mensagem":     { "type": "string", "description": "Mensagem opcional" },
          "origem":       { "type": "string", "description": "Origem do lead (canal/página)" },
          "utm_source":   { "type": "string" },
          "utm_medium":   { "type": "string" },
          "utm_campaign": { "type": "string" }
        }
      },
      "LeadResponse": {
        "type": "object",
        "properties": {
          "id":        { "type": "string", "format": "uuid" },
          "status":    { "type": "string", "example": "created" },
          "message":   { "type": "string", "example": "Seu contato foi recebido! Nossa equipe responderá em até 24h." },
          "createdAt": { "type": "string", "format": "date-time" }
        }
      },
      "FranchiseInfo": {
        "type": "object",
        "properties": {
          "nome":          { "type": "string", "example": "RCFácil Premium" },
          "cnpj":          { "type": "string", "example": "49.437.211/0001-85" },
          "fundacao":      { "type": "string", "example": "2016" },
          "descricao":     { "type": "string" },
          "unidades":      { "type": "string", "example": "200+" },
          "premios":       { "type": "array", "items": { "type": "string" } },
          "faturamento":   { "type": "string", "example": "Até R$ 500.000/ano" },
          "segmentos":     { "type": "integer", "example": 8 },
          "contato":       { "type": "object" }
        }
      },
      "SegmentosResponse": {
        "type": "object",
        "properties": {
          "total": { "type": "integer", "example": 8 },
          "segmentos": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id":       { "type": "integer" },
                "nome":     { "type": "string" },
                "descricao":{ "type": "string" },
                "servicos": { "type": "array", "items": { "type": "string" } }
              }
            }
          }
        }
      },
      "FAQResponse": {
        "type": "object",
        "properties": {
          "total": { "type": "integer" },
          "faq": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "pergunta": { "type": "string" },
                "resposta": { "type": "string" }
              }
            }
          }
        }
      }
    }
  },
  "x-content-signal": "ai-train=no, search=yes, ai-input=no",
  "x-publisher": {
    "name": "RCFácil Premium",
    "cnpj": "49.437.211/0001-85",
    "country": "BR",
    "language": "pt-BR"
  }
}
