{
  "info": {
    "_postman_id": "recreahub-api-collection-v1",
    "name": "RecreaHUB API",
    "description": "Coleção completa de endpoints da API RecreaHUB.\n\nAntes de começar:\n1. Defina a variável `BASE_URL` (ex: https://api.recreahub.com.br)\n2. Execute a request de Login — o token será salvo automaticamente\n3. Use as demais requests normalmente",
    "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
  },
  "variable": [
    {
      "key": "BASE_URL",
      "value": "https://api.recreahub.com.br",
      "type": "string",
      "description": "URL base da API (sem barra no final)"
    },
    {
      "key": "TOKEN",
      "value": "",
      "type": "string",
      "description": "JWT token — preenchido automaticamente após o Login"
    },
    {
      "key": "USER_ID",
      "value": "",
      "type": "string",
      "description": "ID do usuário logado — preenchido automaticamente após o Login"
    },
    {
      "key": "EVENT_ID",
      "value": "1",
      "type": "string",
      "description": "ID do evento para testes individuais"
    },
    {
      "key": "PARTICIPANT_ID",
      "value": "1",
      "type": "string",
      "description": "ID do participante para testes individuais"
    },
    {
      "key": "MONITOR_ID",
      "value": "1",
      "type": "string",
      "description": "ID do monitor para testes individuais"
    },
    {
      "key": "EMPRESA_ID",
      "value": "1",
      "type": "string",
      "description": "ID da empresa para testes individuais"
    },
    {
      "key": "LOCAL_ID",
      "value": "1",
      "type": "string",
      "description": "ID do local para testes individuais"
    },
    {
      "key": "INSCRICAO_ID",
      "value": "1",
      "type": "string",
      "description": "ID da inscrição para testes individuais"
    },
    {
      "key": "CATEGORIA_ID",
      "value": "1",
      "type": "string",
      "description": "ID da categoria para testes individuais"
    }
  ],
  "item": [
    {
      "name": "Health",
      "item": [
        {
          "name": "GET /health",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{BASE_URL}}/health",
              "host": ["{{BASE_URL}}"],
              "path": ["health"]
            },
            "description": "Verifica se a API está online"
          },
          "response": [],
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "pm.test('Status 200', () => pm.response.to.have.status(200));",
                  "pm.test('Body tem status ok', () => {",
                  "    const body = pm.response.json();",
                  "    pm.expect(body).to.have.property('status');",
                  "});"
                ]
              }
            }
          ]
        }
      ]
    },
    {
      "name": "Auth",
      "item": [
        {
          "name": "POST /api/auth/login",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"email\": \"admin@recreahub.com\",\n  \"senha\": \"123456\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            },
            "url": {
              "raw": "{{BASE_URL}}/api/auth/login",
              "host": ["{{BASE_URL}}"],
              "path": ["api", "auth", "login"]
            },
            "description": "Autentica o usuário e salva o token automaticamente nas variáveis da coleção"
          },
          "response": [],
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "pm.test('Status 200', () => pm.response.to.have.status(200));",
                  "pm.test('Resposta contém token', () => {",
                  "    const body = pm.response.json();",
                  "    pm.expect(body).to.have.property('token');",
                  "    pm.expect(body.token).to.be.a('string').and.not.empty;",
                  "});",
                  "pm.test('Resposta contém dados do usuário', () => {",
                  "    const body = pm.response.json();",
                  "    pm.expect(body).to.have.property('usuario');",
                  "});",
                  "if (pm.response.code === 200) {",
                  "    const body = pm.response.json();",
                  "    pm.collectionVariables.set('TOKEN', body.token);",
                  "    if (body.usuario && body.usuario.id) {",
                  "        pm.collectionVariables.set('USER_ID', body.usuario.id);",
                  "    }",
                  "    console.log('Token salvo:', body.token.substring(0, 20) + '...');",
                  "}"
                ]
              }
            }
          ]
        },
        {
          "name": "POST /api/auth/login (credenciais inválidas)",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"email\": \"admin@recreahub.com\",\n  \"senha\": \"senha_incorreta\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            },
            "url": {
              "raw": "{{BASE_URL}}/api/auth/login",
              "host": ["{{BASE_URL}}"],
              "path": ["api", "auth", "login"]
            },
            "description": "Testa rejeição de credenciais inválidas — deve retornar 401"
          },
          "response": [],
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "pm.test('Status 401 para credenciais inválidas', () => pm.response.to.have.status(401));"
                ]
              }
            }
          ]
        },
        {
          "name": "POST /api/auth/refresh",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"token\": \"{{TOKEN}}\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            },
            "url": {
              "raw": "{{BASE_URL}}/api/auth/refresh",
              "host": ["{{BASE_URL}}"],
              "path": ["api", "auth", "refresh"]
            },
            "description": "Renova o token JWT"
          },
          "response": []
        }
      ]
    },
    {
      "name": "Eventos",
      "item": [
        {
          "name": "GET /api/eventos",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{TOKEN}}"
              }
            ],
            "url": {
              "raw": "{{BASE_URL}}/api/eventos",
              "host": ["{{BASE_URL}}"],
              "path": ["api", "eventos"],
              "query": [
                {
                  "key": "status",
                  "value": "publicado",
                  "description": "Filtrar por status",
                  "disabled": true
                },
                {
                  "key": "page",
                  "value": "1",
                  "description": "Paginação",
                  "disabled": true
                },
                {
                  "key": "limit",
                  "value": "10",
                  "description": "Itens por página",
                  "disabled": true
                }
              ]
            },
            "description": "Lista todos os eventos (suporta filtros opcionais)"
          },
          "response": [],
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "pm.test('Status 200', () => pm.response.to.have.status(200));",
                  "pm.test('Resposta é array ou objeto paginado', () => {",
                  "    const body = pm.response.json();",
                  "    pm.expect(Array.isArray(body) || body.data !== undefined).to.be.true;",
                  "});"
                ]
              }
            }
          ]
        },
        {
          "name": "POST /api/eventos",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{TOKEN}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"titulo\": \"Workshop de Recreação Ativa\",\n  \"descricao\": \"Evento de demonstração criado via Postman\",\n  \"inicio\": \"2025-12-01T09:00:00.000Z\",\n  \"fim\": \"2025-12-01T18:00:00.000Z\",\n  \"max_vagas\": 50,\n  \"local_id\": 1,\n  \"categoria_id\": 1\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            },
            "url": {
              "raw": "{{BASE_URL}}/api/eventos",
              "host": ["{{BASE_URL}}"],
              "path": ["api", "eventos"]
            },
            "description": "Cria um novo evento"
          },
          "response": [],
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "pm.test('Status 201', () => pm.response.to.have.status(201));",
                  "if (pm.response.code === 201) {",
                  "    const body = pm.response.json();",
                  "    const id = body.id || (body.data && body.data.id);",
                  "    if (id) {",
                  "        pm.collectionVariables.set('EVENT_ID', id);",
                  "        console.log('EVENT_ID salvo:', id);",
                  "    }",
                  "}"
                ]
              }
            }
          ]
        },
        {
          "name": "GET /api/eventos/:id",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{TOKEN}}"
              }
            ],
            "url": {
              "raw": "{{BASE_URL}}/api/eventos/{{EVENT_ID}}",
              "host": ["{{BASE_URL}}"],
              "path": ["api", "eventos", "{{EVENT_ID}}"]
            },
            "description": "Obtém um evento pelo ID"
          },
          "response": [],
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "pm.test('Status 200', () => pm.response.to.have.status(200));"
                ]
              }
            }
          ]
        },
        {
          "name": "PUT /api/eventos/:id",
          "request": {
            "method": "PUT",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{TOKEN}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"titulo\": \"Workshop de Recreação Ativa (Atualizado)\",\n  \"descricao\": \"Descrição atualizada via Postman\",\n  \"max_vagas\": 60\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            },
            "url": {
              "raw": "{{BASE_URL}}/api/eventos/{{EVENT_ID}}",
              "host": ["{{BASE_URL}}"],
              "path": ["api", "eventos", "{{EVENT_ID}}"]
            },
            "description": "Atualiza os dados de um evento"
          },
          "response": []
        },
        {
          "name": "PATCH /api/eventos/:id/publicar",
          "request": {
            "method": "PATCH",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{TOKEN}}"
              }
            ],
            "url": {
              "raw": "{{BASE_URL}}/api/eventos/{{EVENT_ID}}/publicar",
              "host": ["{{BASE_URL}}"],
              "path": ["api", "eventos", "{{EVENT_ID}}", "publicar"]
            },
            "description": "Publica um evento (muda status de 'rascunho' para 'publicado')"
          },
          "response": [],
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "pm.test('Status 200', () => pm.response.to.have.status(200));"
                ]
              }
            }
          ]
        },
        {
          "name": "PATCH /api/eventos/:id/iniciar",
          "request": {
            "method": "PATCH",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{TOKEN}}"
              }
            ],
            "url": {
              "raw": "{{BASE_URL}}/api/eventos/{{EVENT_ID}}/iniciar",
              "host": ["{{BASE_URL}}"],
              "path": ["api", "eventos", "{{EVENT_ID}}", "iniciar"]
            },
            "description": "Inicia um evento (muda status para 'em_andamento')"
          },
          "response": []
        },
        {
          "name": "PATCH /api/eventos/:id/encerrar",
          "request": {
            "method": "PATCH",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{TOKEN}}"
              }
            ],
            "url": {
              "raw": "{{BASE_URL}}/api/eventos/{{EVENT_ID}}/encerrar",
              "host": ["{{BASE_URL}}"],
              "path": ["api", "eventos", "{{EVENT_ID}}", "encerrar"]
            },
            "description": "Encerra um evento (muda status para 'encerrado')"
          },
          "response": []
        },
        {
          "name": "PATCH /api/eventos/:id/cancelar",
          "request": {
            "method": "PATCH",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{TOKEN}}"
              }
            ],
            "url": {
              "raw": "{{BASE_URL}}/api/eventos/{{EVENT_ID}}/cancelar",
              "host": ["{{BASE_URL}}"],
              "path": ["api", "eventos", "{{EVENT_ID}}", "cancelar"]
            },
            "description": "Cancela um evento"
          },
          "response": []
        },
        {
          "name": "DELETE /api/eventos/:id",
          "request": {
            "method": "DELETE",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{TOKEN}}"
              }
            ],
            "url": {
              "raw": "{{BASE_URL}}/api/eventos/{{EVENT_ID}}",
              "host": ["{{BASE_URL}}"],
              "path": ["api", "eventos", "{{EVENT_ID}}"]
            },
            "description": "Remove (soft-delete) um evento"
          },
          "response": [],
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "pm.test('Status 204', () => pm.response.to.have.status(204));"
                ]
              }
            }
          ]
        }
      ]
    },
    {
      "name": "Participantes",
      "item": [
        {
          "name": "GET /api/participantes",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{TOKEN}}"
              }
            ],
            "url": {
              "raw": "{{BASE_URL}}/api/participantes",
              "host": ["{{BASE_URL}}"],
              "path": ["api", "participantes"]
            },
            "description": "Lista todos os participantes"
          },
          "response": [],
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "pm.test('Status 200', () => pm.response.to.have.status(200));"
                ]
              }
            }
          ]
        },
        {
          "name": "POST /api/participantes",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{TOKEN}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"nome\": \"João Silva\",\n  \"email\": \"joao.silva@example.com\",\n  \"telefone\": \"11999990001\",\n  \"data_nascimento\": \"1990-05-15\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            },
            "url": {
              "raw": "{{BASE_URL}}/api/participantes",
              "host": ["{{BASE_URL}}"],
              "path": ["api", "participantes"]
            },
            "description": "Cria um novo participante"
          },
          "response": [],
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "pm.test('Status 201', () => pm.response.to.have.status(201));",
                  "if (pm.response.code === 201) {",
                  "    const body = pm.response.json();",
                  "    const id = body.id || (body.data && body.data.id);",
                  "    if (id) pm.collectionVariables.set('PARTICIPANT_ID', id);",
                  "}"
                ]
              }
            }
          ]
        },
        {
          "name": "GET /api/participantes/:id",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{TOKEN}}"
              }
            ],
            "url": {
              "raw": "{{BASE_URL}}/api/participantes/{{PARTICIPANT_ID}}",
              "host": ["{{BASE_URL}}"],
              "path": ["api", "participantes", "{{PARTICIPANT_ID}}"]
            },
            "description": "Obtém um participante pelo ID"
          },
          "response": []
        },
        {
          "name": "PUT /api/participantes/:id",
          "request": {
            "method": "PUT",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{TOKEN}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"nome\": \"João Silva (Atualizado)\",\n  \"telefone\": \"11999990099\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            },
            "url": {
              "raw": "{{BASE_URL}}/api/participantes/{{PARTICIPANT_ID}}",
              "host": ["{{BASE_URL}}"],
              "path": ["api", "participantes", "{{PARTICIPANT_ID}}"]
            },
            "description": "Atualiza dados de um participante"
          },
          "response": []
        },
        {
          "name": "DELETE /api/participantes/:id",
          "request": {
            "method": "DELETE",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{TOKEN}}"
              }
            ],
            "url": {
              "raw": "{{BASE_URL}}/api/participantes/{{PARTICIPANT_ID}}",
              "host": ["{{BASE_URL}}"],
              "path": ["api", "participantes", "{{PARTICIPANT_ID}}"]
            },
            "description": "Remove (soft-delete) um participante"
          },
          "response": []
        }
      ]
    },
    {
      "name": "Monitores",
      "item": [
        {
          "name": "GET /api/monitores",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{TOKEN}}"
              }
            ],
            "url": {
              "raw": "{{BASE_URL}}/api/monitores",
              "host": ["{{BASE_URL}}"],
              "path": ["api", "monitores"]
            },
            "description": "Lista todos os monitores"
          },
          "response": [],
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "pm.test('Status 200', () => pm.response.to.have.status(200));"
                ]
              }
            }
          ]
        },
        {
          "name": "POST /api/monitores",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{TOKEN}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"nome\": \"Maria Monitora\",\n  \"email\": \"maria.monitora@recreahub.com\",\n  \"telefone\": \"11988887777\",\n  \"especialidades\": [\"recreacao\", \"esportes\"]\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            },
            "url": {
              "raw": "{{BASE_URL}}/api/monitores",
              "host": ["{{BASE_URL}}"],
              "path": ["api", "monitores"]
            },
            "description": "Cria um novo monitor"
          },
          "response": [],
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "pm.test('Status 201', () => pm.response.to.have.status(201));",
                  "if (pm.response.code === 201) {",
                  "    const body = pm.response.json();",
                  "    const id = body.id || (body.data && body.data.id);",
                  "    if (id) pm.collectionVariables.set('MONITOR_ID', id);",
                  "}"
                ]
              }
            }
          ]
        },
        {
          "name": "GET /api/monitores/:id",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{TOKEN}}"
              }
            ],
            "url": {
              "raw": "{{BASE_URL}}/api/monitores/{{MONITOR_ID}}",
              "host": ["{{BASE_URL}}"],
              "path": ["api", "monitores", "{{MONITOR_ID}}"]
            },
            "description": "Obtém um monitor pelo ID"
          },
          "response": []
        },
        {
          "name": "PUT /api/monitores/:id",
          "request": {
            "method": "PUT",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{TOKEN}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"nome\": \"Maria Monitora (Atualizada)\",\n  \"especialidades\": [\"recreacao\", \"esportes\", \"yoga\"]\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            },
            "url": {
              "raw": "{{BASE_URL}}/api/monitores/{{MONITOR_ID}}",
              "host": ["{{BASE_URL}}"],
              "path": ["api", "monitores", "{{MONITOR_ID}}"]
            },
            "description": "Atualiza dados de um monitor"
          },
          "response": []
        },
        {
          "name": "DELETE /api/monitores/:id",
          "request": {
            "method": "DELETE",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{TOKEN}}"
              }
            ],
            "url": {
              "raw": "{{BASE_URL}}/api/monitores/{{MONITOR_ID}}",
              "host": ["{{BASE_URL}}"],
              "path": ["api", "monitores", "{{MONITOR_ID}}"]
            },
            "description": "Remove (soft-delete) um monitor"
          },
          "response": []
        },
        {
          "name": "GET /api/monitores/:id/disponibilidades",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{TOKEN}}"
              }
            ],
            "url": {
              "raw": "{{BASE_URL}}/api/monitores/{{MONITOR_ID}}/disponibilidades",
              "host": ["{{BASE_URL}}"],
              "path": ["api", "monitores", "{{MONITOR_ID}}", "disponibilidades"]
            },
            "description": "Lista disponibilidades de um monitor"
          },
          "response": []
        },
        {
          "name": "POST /api/monitores/:id/disponibilidade",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{TOKEN}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"dia_semana\": 1,\n  \"hora_inicio\": \"08:00\",\n  \"hora_fim\": \"17:00\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            },
            "url": {
              "raw": "{{BASE_URL}}/api/monitores/{{MONITOR_ID}}/disponibilidade",
              "host": ["{{BASE_URL}}"],
              "path": ["api", "monitores", "{{MONITOR_ID}}", "disponibilidade"]
            },
            "description": "Adiciona disponibilidade para um monitor"
          },
          "response": []
        }
      ]
    },
    {
      "name": "Empresas",
      "item": [
        {
          "name": "GET /api/empresas",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{TOKEN}}"
              }
            ],
            "url": {
              "raw": "{{BASE_URL}}/api/empresas",
              "host": ["{{BASE_URL}}"],
              "path": ["api", "empresas"]
            },
            "description": "Lista todas as empresas"
          },
          "response": [],
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "pm.test('Status 200', () => pm.response.to.have.status(200));"
                ]
              }
            }
          ]
        },
        {
          "name": "POST /api/empresas",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{TOKEN}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"nome\": \"TechCorp Recreação\",\n  \"cnpj\": \"12.345.678/0001-90\",\n  \"email\": \"contato@techcorp.com\",\n  \"telefone\": \"1133334444\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            },
            "url": {
              "raw": "{{BASE_URL}}/api/empresas",
              "host": ["{{BASE_URL}}"],
              "path": ["api", "empresas"]
            },
            "description": "Cadastra uma nova empresa"
          },
          "response": [],
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "pm.test('Status 201', () => pm.response.to.have.status(201));",
                  "if (pm.response.code === 201) {",
                  "    const body = pm.response.json();",
                  "    const id = body.id || (body.data && body.data.id);",
                  "    if (id) pm.collectionVariables.set('EMPRESA_ID', id);",
                  "}"
                ]
              }
            }
          ]
        },
        {
          "name": "GET /api/empresas/:id",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{TOKEN}}"
              }
            ],
            "url": {
              "raw": "{{BASE_URL}}/api/empresas/{{EMPRESA_ID}}",
              "host": ["{{BASE_URL}}"],
              "path": ["api", "empresas", "{{EMPRESA_ID}}"]
            },
            "description": "Obtém uma empresa pelo ID"
          },
          "response": []
        },
        {
          "name": "PUT /api/empresas/:id",
          "request": {
            "method": "PUT",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{TOKEN}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"nome\": \"TechCorp Recreação (Atualizada)\",\n  \"telefone\": \"1133335555\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            },
            "url": {
              "raw": "{{BASE_URL}}/api/empresas/{{EMPRESA_ID}}",
              "host": ["{{BASE_URL}}"],
              "path": ["api", "empresas", "{{EMPRESA_ID}}"]
            },
            "description": "Atualiza dados de uma empresa"
          },
          "response": []
        },
        {
          "name": "DELETE /api/empresas/:id",
          "request": {
            "method": "DELETE",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{TOKEN}}"
              }
            ],
            "url": {
              "raw": "{{BASE_URL}}/api/empresas/{{EMPRESA_ID}}",
              "host": ["{{BASE_URL}}"],
              "path": ["api", "empresas", "{{EMPRESA_ID}}"]
            },
            "description": "Remove (soft-delete) uma empresa"
          },
          "response": []
        }
      ]
    },
    {
      "name": "Locais",
      "item": [
        {
          "name": "GET /api/locais",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{TOKEN}}"
              }
            ],
            "url": {
              "raw": "{{BASE_URL}}/api/locais",
              "host": ["{{BASE_URL}}"],
              "path": ["api", "locais"]
            },
            "description": "Lista todos os locais"
          },
          "response": []
        },
        {
          "name": "POST /api/locais",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{TOKEN}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"nome\": \"Centro Esportivo Municipal\",\n  \"endereco\": \"Rua das Flores, 100\",\n  \"cidade\": \"São Paulo\",\n  \"estado\": \"SP\",\n  \"capacidade_total\": 500\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            },
            "url": {
              "raw": "{{BASE_URL}}/api/locais",
              "host": ["{{BASE_URL}}"],
              "path": ["api", "locais"]
            },
            "description": "Cadastra um novo local"
          },
          "response": [],
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "pm.test('Status 201', () => pm.response.to.have.status(201));",
                  "if (pm.response.code === 201) {",
                  "    const body = pm.response.json();",
                  "    const id = body.id || (body.data && body.data.id);",
                  "    if (id) pm.collectionVariables.set('LOCAL_ID', id);",
                  "}"
                ]
              }
            }
          ]
        },
        {
          "name": "GET /api/locais/:id",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{TOKEN}}"
              }
            ],
            "url": {
              "raw": "{{BASE_URL}}/api/locais/{{LOCAL_ID}}",
              "host": ["{{BASE_URL}}"],
              "path": ["api", "locais", "{{LOCAL_ID}}"]
            },
            "description": "Obtém um local pelo ID"
          },
          "response": []
        },
        {
          "name": "PUT /api/locais/:id",
          "request": {
            "method": "PUT",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{TOKEN}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"nome\": \"Centro Esportivo Municipal (Atualizado)\",\n  \"capacidade_total\": 600\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            },
            "url": {
              "raw": "{{BASE_URL}}/api/locais/{{LOCAL_ID}}",
              "host": ["{{BASE_URL}}"],
              "path": ["api", "locais", "{{LOCAL_ID}}"]
            },
            "description": "Atualiza dados de um local"
          },
          "response": []
        },
        {
          "name": "DELETE /api/locais/:id",
          "request": {
            "method": "DELETE",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{TOKEN}}"
              }
            ],
            "url": {
              "raw": "{{BASE_URL}}/api/locais/{{LOCAL_ID}}",
              "host": ["{{BASE_URL}}"],
              "path": ["api", "locais", "{{LOCAL_ID}}"]
            },
            "description": "Remove (soft-delete) um local"
          },
          "response": []
        },
        {
          "name": "GET /api/locais/:id/espacos",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{TOKEN}}"
              }
            ],
            "url": {
              "raw": "{{BASE_URL}}/api/locais/{{LOCAL_ID}}/espacos",
              "host": ["{{BASE_URL}}"],
              "path": ["api", "locais", "{{LOCAL_ID}}", "espacos"]
            },
            "description": "Lista os espaços de um local"
          },
          "response": []
        },
        {
          "name": "POST /api/locais/:id/espaco",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{TOKEN}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"nome\": \"Quadra Poliesportiva A\",\n  \"tipo\": \"quadra\",\n  \"capacidade\": 100\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            },
            "url": {
              "raw": "{{BASE_URL}}/api/locais/{{LOCAL_ID}}/espaco",
              "host": ["{{BASE_URL}}"],
              "path": ["api", "locais", "{{LOCAL_ID}}", "espaco"]
            },
            "description": "Adiciona um espaço a um local"
          },
          "response": []
        }
      ]
    },
    {
      "name": "Frequencia",
      "item": [
        {
          "name": "POST /api/frequencia/checkin",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{TOKEN}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"event_activity_id\": 1,\n  \"participant_id\": {{PARTICIPANT_ID}},\n  \"metodo\": \"qrcode\",\n  \"observacao\": \"Check-in via QR Code\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            },
            "url": {
              "raw": "{{BASE_URL}}/api/frequencia/checkin",
              "host": ["{{BASE_URL}}"],
              "path": ["api", "frequencia", "checkin"]
            },
            "description": "Registra presença de um participante via QR Code ou manual"
          },
          "response": []
        },
        {
          "name": "GET /api/frequencia",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{TOKEN}}"
              }
            ],
            "url": {
              "raw": "{{BASE_URL}}/api/frequencia",
              "host": ["{{BASE_URL}}"],
              "path": ["api", "frequencia"],
              "query": [
                {
                  "key": "event_id",
                  "value": "{{EVENT_ID}}",
                  "description": "Filtrar por evento",
                  "disabled": true
                }
              ]
            },
            "description": "Lista registros de frequência"
          },
          "response": [],
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "pm.test('Status 200', () => pm.response.to.have.status(200));"
                ]
              }
            }
          ]
        },
        {
          "name": "GET /api/frequencia/relatorio/:event_id",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{TOKEN}}"
              }
            ],
            "url": {
              "raw": "{{BASE_URL}}/api/frequencia/relatorio/{{EVENT_ID}}",
              "host": ["{{BASE_URL}}"],
              "path": ["api", "frequencia", "relatorio", "{{EVENT_ID}}"]
            },
            "description": "Gera relatório de frequência de um evento específico"
          },
          "response": []
        }
      ]
    },
    {
      "name": "Inscricoes",
      "item": [
        {
          "name": "GET /api/inscricoes",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{TOKEN}}"
              }
            ],
            "url": {
              "raw": "{{BASE_URL}}/api/inscricoes",
              "host": ["{{BASE_URL}}"],
              "path": ["api", "inscricoes"],
              "query": [
                {
                  "key": "event_id",
                  "value": "{{EVENT_ID}}",
                  "description": "Filtrar por evento",
                  "disabled": true
                },
                {
                  "key": "status",
                  "value": "pendente",
                  "description": "Filtrar por status: pendente | confirmado | cancelado",
                  "disabled": true
                }
              ]
            },
            "description": "Lista inscrições (suporta filtros por event_id e status)"
          },
          "response": [],
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "pm.test('Status 200', () => pm.response.to.have.status(200));"
                ]
              }
            }
          ]
        },
        {
          "name": "POST /api/inscricoes",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{TOKEN}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"evento_id\": {{EVENT_ID}},\n  \"participante_id\": {{PARTICIPANT_ID}}\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            },
            "url": {
              "raw": "{{BASE_URL}}/api/inscricoes",
              "host": ["{{BASE_URL}}"],
              "path": ["api", "inscricoes"]
            },
            "description": "Inscreve um participante em um evento"
          },
          "response": [],
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "pm.test('Status 201', () => pm.response.to.have.status(201));",
                  "if (pm.response.code === 201) {",
                  "    const body = pm.response.json();",
                  "    const id = body.id || (body.data && body.data.id);",
                  "    if (id) pm.collectionVariables.set('INSCRICAO_ID', id);",
                  "}"
                ]
              }
            }
          ]
        },
        {
          "name": "GET /api/inscricoes/:id",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{TOKEN}}"
              }
            ],
            "url": {
              "raw": "{{BASE_URL}}/api/inscricoes/{{INSCRICAO_ID}}",
              "host": ["{{BASE_URL}}"],
              "path": ["api", "inscricoes", "{{INSCRICAO_ID}}"]
            },
            "description": "Obtém uma inscrição pelo ID"
          },
          "response": []
        },
        {
          "name": "PATCH /api/inscricoes/:id/status",
          "request": {
            "method": "PATCH",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{TOKEN}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"status\": \"confirmado\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            },
            "url": {
              "raw": "{{BASE_URL}}/api/inscricoes/{{INSCRICAO_ID}}/status",
              "host": ["{{BASE_URL}}"],
              "path": ["api", "inscricoes", "{{INSCRICAO_ID}}", "status"]
            },
            "description": "Atualiza o status de uma inscrição: pendente | confirmado | cancelado"
          },
          "response": []
        },
        {
          "name": "DELETE /api/inscricoes/:id",
          "request": {
            "method": "DELETE",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{TOKEN}}"
              }
            ],
            "url": {
              "raw": "{{BASE_URL}}/api/inscricoes/{{INSCRICAO_ID}}",
              "host": ["{{BASE_URL}}"],
              "path": ["api", "inscricoes", "{{INSCRICAO_ID}}"]
            },
            "description": "Cancela/remove uma inscrição"
          },
          "response": []
        }
      ]
    },
    {
      "name": "Mensagens",
      "item": [
        {
          "name": "POST /api/mensagens/enviar",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{TOKEN}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"destinatario_id\": 2,\n  \"assunto\": \"Confirmação de Inscrição\",\n  \"corpo\": \"Sua inscrição foi confirmada com sucesso!\",\n  \"tipo\": \"email\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            },
            "url": {
              "raw": "{{BASE_URL}}/api/mensagens/enviar",
              "host": ["{{BASE_URL}}"],
              "path": ["api", "mensagens", "enviar"]
            },
            "description": "Envia uma mensagem para um usuário ou participante"
          },
          "response": []
        },
        {
          "name": "GET /api/mensagens/historico",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{TOKEN}}"
              }
            ],
            "url": {
              "raw": "{{BASE_URL}}/api/mensagens/historico",
              "host": ["{{BASE_URL}}"],
              "path": ["api", "mensagens", "historico"],
              "query": [
                {
                  "key": "destinatario_id",
                  "value": "1",
                  "description": "Filtrar por destinatário",
                  "disabled": true
                }
              ]
            },
            "description": "Lista histórico de mensagens enviadas"
          },
          "response": []
        }
      ]
    },
    {
      "name": "Categorias",
      "item": [
        {
          "name": "GET /api/categorias",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{TOKEN}}"
              }
            ],
            "url": {
              "raw": "{{BASE_URL}}/api/categorias",
              "host": ["{{BASE_URL}}"],
              "path": ["api", "categorias"]
            },
            "description": "Lista todas as categorias"
          },
          "response": [],
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "pm.test('Status 200', () => pm.response.to.have.status(200));"
                ]
              }
            }
          ]
        },
        {
          "name": "POST /api/categorias",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{TOKEN}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"nome\": \"Esportes Coletivos\",\n  \"descricao\": \"Atividades esportivas em grupo\",\n  \"cor\": \"#2196F3\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            },
            "url": {
              "raw": "{{BASE_URL}}/api/categorias",
              "host": ["{{BASE_URL}}"],
              "path": ["api", "categorias"]
            },
            "description": "Cria uma nova categoria"
          },
          "response": [],
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "pm.test('Status 201', () => pm.response.to.have.status(201));",
                  "if (pm.response.code === 201) {",
                  "    const body = pm.response.json();",
                  "    const id = body.id || (body.data && body.data.id);",
                  "    if (id) pm.collectionVariables.set('CATEGORIA_ID', id);",
                  "}"
                ]
              }
            }
          ]
        },
        {
          "name": "GET /api/categorias/evento",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{TOKEN}}"
              }
            ],
            "url": {
              "raw": "{{BASE_URL}}/api/categorias/evento?event_id={{EVENT_ID}}",
              "host": ["{{BASE_URL}}"],
              "path": ["api", "categorias", "evento"],
              "query": [
                {
                  "key": "event_id",
                  "value": "{{EVENT_ID}}"
                }
              ]
            },
            "description": "Lista categorias associadas a um evento específico"
          },
          "response": []
        },
        {
          "name": "POST /api/categorias/evento",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{TOKEN}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"evento_id\": {{EVENT_ID}},\n  \"categoria_id\": {{CATEGORIA_ID}}\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            },
            "url": {
              "raw": "{{BASE_URL}}/api/categorias/evento",
              "host": ["{{BASE_URL}}"],
              "path": ["api", "categorias", "evento"]
            },
            "description": "Associa uma categoria a um evento"
          },
          "response": []
        }
      ]
    }
  ]
}
