{
  "openapi": "3.1.1",
  "info": {
    "title": "Pecclin API",
    "description": "Agenda, prontuário e financeiro para clínicas multidisciplinares. Autenticação por sessão: cookie (painel web) ou `Authorization: Bearer pcl_…` (obtido em POST /api/v1/sessoes com modo \"token\").",
    "version": "v1"
  },
  "servers": [
    {
      "url": "https://api.pecclin.com.br/"
    }
  ],
  "paths": {
    "/api/v1/saude": {
      "get": {
        "tags": [
          "Operação"
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Saude"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/sessoes": {
      "post": {
        "tags": [
          "Sessões"
        ],
        "summary": "Entrar. Modo \"navegador\" grava cookie; modo \"token\" devolve o token no corpo. Com o autenticador ligado, a sessão volta aguardando o código (POST /sessoes/atual/segundo-fator).",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PedidoDeEntrada"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/v1/sessoes/atual/segundo-fator": {
      "post": {
        "tags": [
          "Sessões"
        ],
        "summary": "O código de seis dígitos do autenticador. Cinco erros encerram a sessão.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PedidoDeSegundoFator"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/v1/sessoes/atual": {
      "get": {
        "tags": [
          "Sessões"
        ],
        "summary": "Quem está na sessão. Responde 200 com usuario nulo quando não há sessão.",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SessaoAtual"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "Sessões"
        ],
        "summary": "Sair: encerra a sessão no servidor (vale para cookie e token).",
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/v1/sessoes/atual/clinicas": {
      "get": {
        "tags": [
          "Sessões"
        ],
        "summary": "As clínicas em que esta pessoa pode trabalhar.",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/ClinicaResumo"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/sessoes/atual/clinica": {
      "put": {
        "tags": [
          "Sessões"
        ],
        "summary": "Troca a clínica ativa da sessão (só quem não pertence a uma clínica).",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PedidoDeTrocaDeClinica"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SessaoAtual"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/modulos": {
      "get": {
        "tags": [
          "Módulos"
        ],
        "summary": "O catálogo: os módulos que uma clínica pode contratar.",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/ModuloDoCatalogo"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/clinicas": {
      "get": {
        "tags": [
          "Clínicas"
        ],
        "summary": "As clínicas ao alcance: todas para a equipe Pecclin, a própria para os demais.",
        "parameters": [
          {
            "name": "busca",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "pagina",
            "in": "query",
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ],
              "format": "int32"
            }
          },
          {
            "name": "tamanho",
            "in": "query",
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ],
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PaginaOfClinicaResumo"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/clinicas/{codigo}": {
      "get": {
        "tags": [
          "Clínicas"
        ],
        "parameters": [
          {
            "name": "codigo",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ClinicaDetalhe"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/clinicas/{codigo}/situacao": {
      "put": {
        "tags": [
          "Clínicas"
        ],
        "summary": "Ativa ou desativa a clínica. Desativada, ninguém dela entra — e nada é apagado.",
        "parameters": [
          {
            "name": "codigo",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PedidoDeSituacao"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ClinicaDetalhe"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/clinicas/{codigo}/modulos": {
      "get": {
        "tags": [
          "Clínicas"
        ],
        "summary": "O catálogo, marcando o que esta clínica contratou.",
        "parameters": [
          {
            "name": "codigo",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/ModuloDaClinica"
                  }
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "Clínicas"
        ],
        "summary": "Liga e desliga módulos (a lista inteira). Desligar não apaga dado.",
        "parameters": [
          {
            "name": "codigo",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PedidoDeModulos"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/ModuloDaClinica"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/equipe": {
      "get": {
        "tags": [
          "Equipe"
        ],
        "summary": "As pessoas da clínica ativa. Só a gestão administra a equipe.",
        "parameters": [
          {
            "name": "busca",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "pagina",
            "in": "query",
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ],
              "format": "int32"
            }
          },
          {
            "name": "tamanho",
            "in": "query",
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ],
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PaginaOfUsuarioResumo"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/pacientes": {
      "get": {
        "tags": [
          "Pacientes"
        ],
        "summary": "Os pacientes da clínica ativa. A busca ignora acento e casa nome, nome social, nome da mãe, CPF e celular.",
        "parameters": [
          {
            "name": "busca",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "inativos",
            "in": "query",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "pagina",
            "in": "query",
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ],
              "format": "int32"
            }
          },
          {
            "name": "tamanho",
            "in": "query",
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ],
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PaginaOfPacienteResumo"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/pacientes/{codigo}": {
      "get": {
        "tags": [
          "Pacientes"
        ],
        "summary": "A ficha cadastral. Conteúdo clínico não vem aqui: é do prontuário.",
        "parameters": [
          {
            "name": "codigo",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PacienteDetalhe"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/paineis": {
      "get": {
        "tags": [
          "Painéis"
        ],
        "summary": "Todos os painéis clientes da API, com o que cada um põe no menu.",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/PainelCliente"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/paineis/{codigo}": {
      "get": {
        "tags": [
          "Painéis"
        ],
        "summary": "Os módulos que este painel põe no menu (o catálogo inteiro, marcando os que aparecem).",
        "parameters": [
          {
            "name": "codigo",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PainelCliente"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "Painéis"
        ],
        "summary": "Só a equipe Pecclin: a lista INTEIRA de módulos do menu.",
        "parameters": [
          {
            "name": "codigo",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PedidoDeMenuDoPainel"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PainelCliente"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/agenda/grade": {
      "get": {
        "tags": [
          "Agenda"
        ],
        "summary": "A grade: profissionais, expediente, bloqueios e agendamentos do período, no relógio da clínica. Sem datas, o dia de hoje (no fuso da clínica). Até 7 dias.",
        "parameters": [
          {
            "name": "de",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "ate",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GradeDaAgenda"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "AgendamentoDaGrade": {
        "required": [
          "codigo",
          "profissional",
          "paciente",
          "nomeDoPaciente",
          "servico",
          "inicio",
          "fim",
          "duracaoMinutos",
          "situacao",
          "origem",
          "telemedicina",
          "sala",
          "observacoes",
          "emSerie"
        ],
        "type": "object",
        "properties": {
          "codigo": {
            "type": "string",
            "format": "uuid"
          },
          "profissional": {
            "type": "string",
            "format": "uuid"
          },
          "paciente": {
            "type": "string",
            "format": "uuid"
          },
          "nomeDoPaciente": {
            "type": "string"
          },
          "servico": {
            "type": "string"
          },
          "inicio": {
            "type": "string"
          },
          "fim": {
            "type": "string"
          },
          "duracaoMinutos": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "situacao": {
            "type": "string"
          },
          "origem": {
            "type": "string"
          },
          "telemedicina": {
            "type": "boolean"
          },
          "sala": {
            "type": [
              "null",
              "string"
            ]
          },
          "observacoes": {
            "type": [
              "null",
              "string"
            ]
          },
          "emSerie": {
            "type": "boolean"
          }
        }
      },
      "BloqueioDaGrade": {
        "required": [
          "codigo",
          "profissional",
          "inicio",
          "fim",
          "motivo"
        ],
        "type": "object",
        "properties": {
          "codigo": {
            "type": "string",
            "format": "uuid"
          },
          "profissional": {
            "type": "string",
            "format": "uuid"
          },
          "inicio": {
            "type": "string"
          },
          "fim": {
            "type": "string"
          },
          "motivo": {
            "type": "string"
          }
        }
      },
      "ClinicaDetalhe": {
        "required": [
          "codigo",
          "nomeFantasia",
          "razaoSocial",
          "cnpj",
          "cnes",
          "email",
          "telefone",
          "cidade",
          "uf",
          "plano",
          "planoRotulo",
          "tema",
          "fuso",
          "ativa",
          "criadoEm",
          "pessoas",
          "pacientes"
        ],
        "type": "object",
        "properties": {
          "codigo": {
            "type": "string",
            "format": "uuid"
          },
          "nomeFantasia": {
            "type": "string"
          },
          "razaoSocial": {
            "type": [
              "null",
              "string"
            ]
          },
          "cnpj": {
            "type": [
              "null",
              "string"
            ]
          },
          "cnes": {
            "type": [
              "null",
              "string"
            ]
          },
          "email": {
            "type": [
              "null",
              "string"
            ]
          },
          "telefone": {
            "type": [
              "null",
              "string"
            ]
          },
          "cidade": {
            "type": [
              "null",
              "string"
            ]
          },
          "uf": {
            "type": [
              "null",
              "string"
            ]
          },
          "plano": {
            "type": "string"
          },
          "planoRotulo": {
            "type": "string"
          },
          "tema": {
            "type": "string"
          },
          "fuso": {
            "type": "string"
          },
          "ativa": {
            "type": "boolean"
          },
          "criadoEm": {
            "type": "string",
            "format": "date-time"
          },
          "pessoas": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "pacientes": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          }
        }
      },
      "ClinicaResumo": {
        "required": [
          "codigo",
          "nome",
          "plano",
          "planoRotulo",
          "individual",
          "tema",
          "ativa",
          "cidade",
          "uf",
          "modulos"
        ],
        "type": "object",
        "properties": {
          "codigo": {
            "type": "string",
            "format": "uuid"
          },
          "nome": {
            "type": "string"
          },
          "plano": {
            "type": "string"
          },
          "planoRotulo": {
            "type": "string"
          },
          "individual": {
            "type": "boolean"
          },
          "tema": {
            "type": "string"
          },
          "ativa": {
            "type": "boolean"
          },
          "cidade": {
            "type": [
              "null",
              "string"
            ]
          },
          "uf": {
            "type": [
              "null",
              "string"
            ]
          },
          "modulos": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        }
      },
      "Endereco": {
        "required": [
          "cep",
          "logradouro",
          "numero",
          "complemento",
          "bairro",
          "cidade",
          "uf"
        ],
        "type": "object",
        "properties": {
          "cep": {
            "type": [
              "null",
              "string"
            ]
          },
          "logradouro": {
            "type": [
              "null",
              "string"
            ]
          },
          "numero": {
            "type": [
              "null",
              "string"
            ]
          },
          "complemento": {
            "type": [
              "null",
              "string"
            ]
          },
          "bairro": {
            "type": [
              "null",
              "string"
            ]
          },
          "cidade": {
            "type": [
              "null",
              "string"
            ]
          },
          "uf": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "ExpedienteDaGrade": {
        "required": [
          "profissional",
          "diaDaSemana",
          "inicio",
          "fim"
        ],
        "type": "object",
        "properties": {
          "profissional": {
            "type": "string",
            "format": "uuid"
          },
          "diaDaSemana": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "inicio": {
            "type": "string"
          },
          "fim": {
            "type": "string"
          }
        }
      },
      "GradeDaAgenda": {
        "required": [
          "de",
          "ate",
          "hoje",
          "agora",
          "fuso",
          "soAPropria",
          "profissionais",
          "expedientes",
          "bloqueios",
          "agendamentos"
        ],
        "type": "object",
        "properties": {
          "de": {
            "type": "string",
            "format": "date"
          },
          "ate": {
            "type": "string",
            "format": "date"
          },
          "hoje": {
            "type": "string",
            "format": "date"
          },
          "agora": {
            "type": "string"
          },
          "fuso": {
            "type": "string"
          },
          "soAPropria": {
            "type": "boolean"
          },
          "profissionais": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ProfissionalDaGrade"
            }
          },
          "expedientes": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ExpedienteDaGrade"
            }
          },
          "bloqueios": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/BloqueioDaGrade"
            }
          },
          "agendamentos": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AgendamentoDaGrade"
            }
          }
        }
      },
      "ModuloDaClinica": {
        "required": [
          "codigo",
          "nome",
          "resumo",
          "telas",
          "contratado",
          "contratadoEm"
        ],
        "type": "object",
        "properties": {
          "codigo": {
            "type": "string"
          },
          "nome": {
            "type": "string"
          },
          "resumo": {
            "type": "string"
          },
          "telas": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "contratado": {
            "type": "boolean"
          },
          "contratadoEm": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          }
        }
      },
      "ModuloDoCatalogo": {
        "required": [
          "codigo",
          "nome",
          "resumo",
          "telas"
        ],
        "type": "object",
        "properties": {
          "codigo": {
            "type": "string"
          },
          "nome": {
            "type": "string"
          },
          "resumo": {
            "type": "string"
          },
          "telas": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        }
      },
      "ModuloDoPainel": {
        "required": [
          "codigo",
          "nome",
          "resumo",
          "noMenu"
        ],
        "type": "object",
        "properties": {
          "codigo": {
            "type": "string"
          },
          "nome": {
            "type": "string"
          },
          "resumo": {
            "type": "string"
          },
          "noMenu": {
            "type": "boolean"
          }
        }
      },
      "PacienteDetalhe": {
        "required": [
          "codigo",
          "nomeCompleto",
          "nomeSocial",
          "nascimento",
          "idade",
          "sexo",
          "genero",
          "cpf",
          "cns",
          "nomeDaMae",
          "nomeDoPai",
          "racaCor",
          "escolaridade",
          "ocupacao",
          "email",
          "celular",
          "telefoneFixo",
          "instagram",
          "endereco",
          "alergias",
          "alertas",
          "medicamentosEmUso",
          "tipoSanguineo",
          "etiquetas",
          "observacoesDaRecepcao",
          "ativo",
          "aceiteDeDadosEm",
          "criadoEm",
          "responsaveis"
        ],
        "type": "object",
        "properties": {
          "codigo": {
            "type": "string",
            "format": "uuid"
          },
          "nomeCompleto": {
            "type": "string"
          },
          "nomeSocial": {
            "type": [
              "null",
              "string"
            ]
          },
          "nascimento": {
            "type": "string",
            "format": "date"
          },
          "idade": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "sexo": {
            "type": [
              "null",
              "string"
            ]
          },
          "genero": {
            "type": [
              "null",
              "string"
            ]
          },
          "cpf": {
            "type": [
              "null",
              "string"
            ]
          },
          "cns": {
            "type": [
              "null",
              "string"
            ]
          },
          "nomeDaMae": {
            "type": [
              "null",
              "string"
            ]
          },
          "nomeDoPai": {
            "type": [
              "null",
              "string"
            ]
          },
          "racaCor": {
            "type": [
              "null",
              "string"
            ]
          },
          "escolaridade": {
            "type": [
              "null",
              "string"
            ]
          },
          "ocupacao": {
            "type": [
              "null",
              "string"
            ]
          },
          "email": {
            "type": [
              "null",
              "string"
            ]
          },
          "celular": {
            "type": [
              "null",
              "string"
            ]
          },
          "telefoneFixo": {
            "type": [
              "null",
              "string"
            ]
          },
          "instagram": {
            "type": [
              "null",
              "string"
            ]
          },
          "endereco": {
            "$ref": "#/components/schemas/Endereco"
          },
          "alergias": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "alertas": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "medicamentosEmUso": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "tipoSanguineo": {
            "type": [
              "null",
              "string"
            ]
          },
          "etiquetas": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "observacoesDaRecepcao": {
            "type": [
              "null",
              "string"
            ]
          },
          "ativo": {
            "type": "boolean"
          },
          "aceiteDeDadosEm": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "criadoEm": {
            "type": "string",
            "format": "date-time"
          },
          "responsaveis": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Responsavel"
            }
          }
        }
      },
      "PacienteResumo": {
        "required": [
          "codigo",
          "nome",
          "nomeSocial",
          "nascimento",
          "idade",
          "cpf",
          "celular",
          "nomeDaMae",
          "ativo",
          "etiquetas"
        ],
        "type": "object",
        "properties": {
          "codigo": {
            "type": "string",
            "format": "uuid"
          },
          "nome": {
            "type": "string"
          },
          "nomeSocial": {
            "type": [
              "null",
              "string"
            ]
          },
          "nascimento": {
            "type": "string",
            "format": "date"
          },
          "idade": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "cpf": {
            "type": [
              "null",
              "string"
            ]
          },
          "celular": {
            "type": [
              "null",
              "string"
            ]
          },
          "nomeDaMae": {
            "type": [
              "null",
              "string"
            ]
          },
          "ativo": {
            "type": "boolean"
          },
          "etiquetas": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        }
      },
      "PaginaOfClinicaResumo": {
        "required": [
          "itens",
          "total",
          "numero",
          "tamanho"
        ],
        "type": "object",
        "properties": {
          "itens": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ClinicaResumo"
            }
          },
          "total": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "numero": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "tamanho": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          }
        }
      },
      "PaginaOfPacienteResumo": {
        "required": [
          "itens",
          "total",
          "numero",
          "tamanho"
        ],
        "type": "object",
        "properties": {
          "itens": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PacienteResumo"
            }
          },
          "total": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "numero": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "tamanho": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          }
        }
      },
      "PaginaOfUsuarioResumo": {
        "required": [
          "itens",
          "total",
          "numero",
          "tamanho"
        ],
        "type": "object",
        "properties": {
          "itens": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/UsuarioResumo"
            }
          },
          "total": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "numero": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "tamanho": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          }
        }
      },
      "PainelCliente": {
        "required": [
          "codigo",
          "nome",
          "modulos",
          "atualizadoEm"
        ],
        "type": "object",
        "properties": {
          "codigo": {
            "type": "string"
          },
          "nome": {
            "type": "string"
          },
          "modulos": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ModuloDoPainel"
            }
          },
          "atualizadoEm": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "PedidoDeEntrada": {
        "required": [
          "email",
          "senha",
          "modo",
          "cliente"
        ],
        "type": "object",
        "properties": {
          "email": {
            "type": [
              "null",
              "string"
            ]
          },
          "senha": {
            "type": [
              "null",
              "string"
            ]
          },
          "modo": {
            "type": [
              "null",
              "string"
            ]
          },
          "cliente": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "PedidoDeMenuDoPainel": {
        "required": [
          "modulos"
        ],
        "type": "object",
        "properties": {
          "modulos": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "type": "string"
            }
          }
        }
      },
      "PedidoDeModulos": {
        "required": [
          "modulos"
        ],
        "type": "object",
        "properties": {
          "modulos": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "type": "string"
            }
          }
        }
      },
      "PedidoDeSegundoFator": {
        "required": [
          "codigo"
        ],
        "type": "object",
        "properties": {
          "codigo": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "PedidoDeSituacao": {
        "required": [
          "ativa"
        ],
        "type": "object",
        "properties": {
          "ativa": {
            "type": "boolean"
          }
        }
      },
      "PedidoDeTrocaDeClinica": {
        "required": [
          "codigo"
        ],
        "type": "object",
        "properties": {
          "codigo": {
            "type": [
              "null",
              "string"
            ],
            "format": "uuid"
          }
        }
      },
      "ProfissionalDaGrade": {
        "required": [
          "codigo",
          "nome",
          "cor",
          "ativo",
          "agendamentos"
        ],
        "type": "object",
        "properties": {
          "codigo": {
            "type": "string",
            "format": "uuid"
          },
          "nome": {
            "type": "string"
          },
          "cor": {
            "type": [
              "null",
              "string"
            ]
          },
          "ativo": {
            "type": "boolean"
          },
          "agendamentos": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          }
        }
      },
      "Responsavel": {
        "required": [
          "nome",
          "parentesco",
          "cpf",
          "telefone",
          "email"
        ],
        "type": "object",
        "properties": {
          "nome": {
            "type": "string"
          },
          "parentesco": {
            "type": "string"
          },
          "cpf": {
            "type": [
              "null",
              "string"
            ]
          },
          "telefone": {
            "type": [
              "null",
              "string"
            ]
          },
          "email": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "Saude": {
        "required": [
          "situacao",
          "versao",
          "versaoDoEsquema"
        ],
        "type": "object",
        "properties": {
          "situacao": {
            "type": "string"
          },
          "versao": {
            "type": "string"
          },
          "versaoDoEsquema": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int32"
          }
        }
      },
      "SessaoAtual": {
        "required": [
          "usuario",
          "clinicaAtiva",
          "expiraEm",
          "token",
          "aguardandoSegundoFator"
        ],
        "type": "object",
        "properties": {
          "usuario": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/UsuarioDaSessao"
              }
            ]
          },
          "clinicaAtiva": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/ClinicaResumo"
              }
            ]
          },
          "expiraEm": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "token": {
            "type": [
              "null",
              "string"
            ]
          },
          "aguardandoSegundoFator": {
            "type": "boolean"
          }
        }
      },
      "UsuarioDaSessao": {
        "required": [
          "codigo",
          "nome",
          "email",
          "papel",
          "papelRotulo",
          "ehGestor",
          "atende",
          "ehBalcao",
          "podeAdministrarUsuarios",
          "podeAdministrarClinicas",
          "podeTrocarDeClinica",
          "temSegundoFator"
        ],
        "type": "object",
        "properties": {
          "codigo": {
            "type": "string",
            "format": "uuid"
          },
          "nome": {
            "type": "string"
          },
          "email": {
            "type": "string"
          },
          "papel": {
            "type": "string"
          },
          "papelRotulo": {
            "type": "string"
          },
          "ehGestor": {
            "type": "boolean"
          },
          "atende": {
            "type": "boolean"
          },
          "ehBalcao": {
            "type": "boolean"
          },
          "podeAdministrarUsuarios": {
            "type": "boolean"
          },
          "podeAdministrarClinicas": {
            "type": "boolean"
          },
          "podeTrocarDeClinica": {
            "type": "boolean"
          },
          "temSegundoFator": {
            "type": "boolean"
          }
        }
      },
      "UsuarioResumo": {
        "required": [
          "codigo",
          "nome",
          "email",
          "papel",
          "papelRotulo",
          "ativo",
          "atende",
          "temSegundoFator",
          "ultimoAcessoEm",
          "especialidades"
        ],
        "type": "object",
        "properties": {
          "codigo": {
            "type": "string",
            "format": "uuid"
          },
          "nome": {
            "type": "string"
          },
          "email": {
            "type": "string"
          },
          "papel": {
            "type": "string"
          },
          "papelRotulo": {
            "type": "string"
          },
          "ativo": {
            "type": "boolean"
          },
          "atende": {
            "type": "boolean"
          },
          "temSegundoFator": {
            "type": "boolean"
          },
          "ultimoAcessoEm": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "especialidades": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        }
      }
    }
  },
  "tags": [
    {
      "name": "Operação"
    },
    {
      "name": "Sessões"
    },
    {
      "name": "Módulos"
    },
    {
      "name": "Clínicas"
    },
    {
      "name": "Equipe"
    },
    {
      "name": "Pacientes"
    },
    {
      "name": "Painéis"
    },
    {
      "name": "Agenda"
    }
  ]
}