{
    "openapi": "3.0.0",
    "info": {
        "title": "HI API",
        "description": "Humanittare always efficient",
        "version": "1.0.0"
    },
    "paths": {
        "/nexus/v1/user": {
            "post": {
                "tags": [
                    "Autenticação"
                ],
                "summary": "Autentica o usuário e gera token Sanctum",
                "operationId": "e22716458ee15a5cad3c339e786140de",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "required": [
                                    "document"
                                ],
                                "properties": {
                                    "document": {
                                        "type": "string",
                                        "example": "12345678900"
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Usuário autenticado",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "active": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "user": {
                                            "type": "object"
                                        },
                                        "group": {
                                            "type": "object"
                                        },
                                        "token": {
                                            "type": "string"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Usuário não autorizado"
                    }
                }
            }
        },
        "/nexus/v1/certificate/{document}": {
            "get": {
                "tags": [
                    "Atestados"
                ],
                "summary": "Busca atestados por documento (CPF/CNPJ)",
                "operationId": "a58c04aa98e2f891e28c65bb674269af",
                "parameters": [
                    {
                        "name": "document",
                        "in": "path",
                        "description": "CPF ou CNPJ sem formatação",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "example": "12345678900"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Lista de atestados",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "array",
                                    "items": {
                                        "type": "object"
                                    }
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "sanctum": []
                    }
                ]
            }
        },
        "/nexus/v1/certificate": {
            "post": {
                "tags": [
                    "Atestados"
                ],
                "summary": "Envia novo atestado com arquivo",
                "operationId": "1860af62e6fb492b9690885d5ae53765",
                "requestBody": {
                    "required": true,
                    "content": {
                        "multipart/form-data": {
                            "schema": {
                                "required": [
                                    "document",
                                    "file"
                                ],
                                "properties": {
                                    "document": {
                                        "type": "string",
                                        "example": "12345678900"
                                    },
                                    "file": {
                                        "type": "string",
                                        "format": "binary"
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Atestado enviado com sucesso",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "string"
                                },
                                "example": "Atestado enviado com sucesso"
                            }
                        }
                    }
                },
                "security": [
                    {
                        "sanctum": []
                    }
                ]
            }
        },
        "/nexus/v1/cid": {
            "get": {
                "tags": [
                    "CIDs"
                ],
                "summary": "Retorna lista de CIDs",
                "operationId": "96a8dca85a6a0c254c886294e4e802cc",
                "responses": {
                    "200": {
                        "description": "Lista de CIDs",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "type": "object"
                                            }
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "sanctum": []
                    }
                ]
            }
        },
        "/nexus/v1/certificate/{uuid}": {
            "get": {
                "tags": [
                    "Atestados"
                ],
                "summary": "Exibe detalhes de um atestado",
                "operationId": "e435c1e8d212be9759a4d5007eb44f40",
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "description": "UUID do atestado",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Dados do atestado"
                    }
                },
                "security": [
                    {
                        "sanctum": []
                    }
                ]
            },
            "put": {
                "tags": [
                    "Atestados"
                ],
                "summary": "Atualiza um atestado",
                "operationId": "0111cbca4535a44b0afef2c4f1741ec2",
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "description": "UUID do atestado",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "requestBody": {
                    "required": false,
                    "content": {
                        "application/json": {
                            "schema": {
                                "properties": {
                                    "document": {
                                        "type": "string",
                                        "example": "12345678900"
                                    },
                                    "observations": {
                                        "type": "string",
                                        "example": "Atualização de observação"
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Atestado atualizado"
                    }
                },
                "security": [
                    {
                        "sanctum": []
                    }
                ]
            },
            "delete": {
                "tags": [
                    "Atestados"
                ],
                "summary": "Remove um atestado",
                "operationId": "ff858daaeb9bba3c6b448c823b30e599",
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "description": "UUID do atestado",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Atestado removido com sucesso"
                    }
                },
                "security": [
                    {
                        "sanctum": []
                    }
                ]
            }
        },
        "/api/services/localize/consults/document/{document}": {
            "get": {
                "tags": [
                    "Services"
                ],
                "summary": "Consulta informações de CPF ou CNPJ no Localize dados",
                "description": "Este endpoint permite consultar informações de um CPF ou CNPJ fornecido no Localize dados.",
                "operationId": "ee06c4897d6a6f78407f9be21b8a3d61",
                "parameters": [
                    {
                        "name": "document",
                        "in": "path",
                        "description": "Número do CPF ou CNPJ para consulta.",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "example": "42176327896"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Consulta realizada com sucesso.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "Consulta realizada com sucesso."
                                        },
                                        "data": {
                                            "properties": {
                                                "basic": {
                                                    "properties": {
                                                        "success": {
                                                            "type": "boolean",
                                                            "example": true
                                                        },
                                                        "type": {
                                                            "type": "integer",
                                                            "example": 1
                                                        },
                                                        "document": {
                                                            "type": "string",
                                                            "example": "42176327896"
                                                        },
                                                        "name": {
                                                            "type": "string",
                                                            "example": "MARCOS FELIPE DE ANDRADE SANTIAGO"
                                                        },
                                                        "gender": {
                                                            "type": "string",
                                                            "example": "MASCULINO"
                                                        },
                                                        "birth": {
                                                            "type": "string",
                                                            "example": "14/05/1995"
                                                        },
                                                        "dead_status": {
                                                            "type": "string",
                                                            "example": "VIVO(A)"
                                                        },
                                                        "rf_status": {
                                                            "type": "string",
                                                            "example": "REGULAR"
                                                        },
                                                        "mother": {
                                                            "type": "string",
                                                            "example": "FATIMA MARIA DE ANDRADE GRACIANO"
                                                        },
                                                        "sign": {
                                                            "type": "string",
                                                            "example": "TOURO"
                                                        },
                                                        "nit": {
                                                            "type": "string",
                                                            "example": "20744999809"
                                                        },
                                                        "age": {
                                                            "type": "string",
                                                            "example": "29"
                                                        },
                                                        "rg": {
                                                            "type": "string",
                                                            "example": "360602642"
                                                        },
                                                        "rg_issuing_state_code": {
                                                            "type": "string",
                                                            "example": "SP"
                                                        },
                                                        "rg_issuing_agency": {
                                                            "type": "string",
                                                            "example": "SSP"
                                                        }
                                                    },
                                                    "type": "object"
                                                },
                                                "company": {
                                                    "properties": {
                                                        "official_name": {
                                                            "type": "string",
                                                            "example": "HUMANITTARE CONSULTORIA E CORRETORA DE SEGUROS LTDA"
                                                        },
                                                        "founding_date": {
                                                            "type": "string",
                                                            "example": "12/05/2014"
                                                        },
                                                        "main_economic_activity": {
                                                            "type": "string",
                                                            "example": "Não Disponivel"
                                                        },
                                                        "secondary_economic_activity": {
                                                            "type": "string",
                                                            "example": "NÃO DISPONIVEL"
                                                        },
                                                        "company_type": {
                                                            "type": "string",
                                                            "example": "DEMAIS"
                                                        },
                                                        "cnae": {
                                                            "type": "string",
                                                            "example": "NÃO DISPONIVEL"
                                                        },
                                                        "tax_regime": {
                                                            "type": "string",
                                                            "example": "LUCRO PRESUMIDO"
                                                        },
                                                        "legal_nature": {
                                                            "type": "string",
                                                            "example": "SOCIEDADE EMPRESARIA LIMITADA"
                                                        },
                                                        "irs_status": {
                                                            "type": "string",
                                                            "example": "ATIVA"
                                                        },
                                                        "simples": {
                                                            "type": "string",
                                                            "example": "NÃO"
                                                        },
                                                        "activities": {
                                                            "type": "array",
                                                            "items": {
                                                                "properties": {
                                                                    "document": {
                                                                        "type": "string",
                                                                        "example": "20229525000100"
                                                                    },
                                                                    "is_main": {
                                                                        "type": "boolean",
                                                                        "example": true
                                                                    },
                                                                    "code": {
                                                                        "type": "string",
                                                                        "example": "6622300"
                                                                    },
                                                                    "activity": {
                                                                        "type": "string",
                                                                        "example": "CORRETORES E AGENTES DE SEGUROS, DE PLANOS DE PREVIDENCIA COMPLEMENTAR E DE SAUDE"
                                                                    }
                                                                },
                                                                "type": "object"
                                                            }
                                                        }
                                                    },
                                                    "type": "object"
                                                }
                                            },
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Nenhuma informação encontrada para o documento fornecido.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "error": {
                                            "type": "string",
                                            "example": "Nenhuma informação encontrada para este CPF."
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Erro ao se comunicar com o serviço externo.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "error": {
                                            "type": "string",
                                            "example": "Erro ao se comunicar com o serviço externo."
                                        },
                                        "details": {
                                            "type": "string",
                                            "example": "Detalhes do erro aqui"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Erro de validação no documento.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "error": {
                                            "type": "string",
                                            "example": "Erro de validação."
                                        },
                                        "details": {
                                            "type": "object",
                                            "example": {
                                                "document": "O documento fornecido não é um CPF ou CNPJ válido."
                                            }
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/services/via-cep/consult/{cep}": {
            "get": {
                "tags": [
                    "Services"
                ],
                "summary": "Consulta informações de um CEP",
                "description": "Este endpoint permite consultar informações detalhadas de um CEP fornecido.",
                "operationId": "e24f41d9859436642a6dbecfbc8b8d6b",
                "parameters": [
                    {
                        "name": "cep",
                        "in": "path",
                        "description": "Número do CEP para consulta.",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "example": "03365-000"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Consulta realizada com sucesso.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "Consulta realizada com sucesso."
                                        },
                                        "data": {
                                            "properties": {
                                                "cep": {
                                                    "type": "string",
                                                    "example": "03365-000"
                                                },
                                                "logradouro": {
                                                    "type": "string",
                                                    "example": "Rua Ouricuri"
                                                },
                                                "complemento": {
                                                    "type": "string",
                                                    "example": ""
                                                },
                                                "unidade": {
                                                    "type": "string",
                                                    "example": ""
                                                },
                                                "bairro": {
                                                    "type": "string",
                                                    "example": "Vila Formosa"
                                                },
                                                "localidade": {
                                                    "type": "string",
                                                    "example": "São Paulo"
                                                },
                                                "uf": {
                                                    "type": "string",
                                                    "example": "SP"
                                                },
                                                "estado": {
                                                    "type": "string",
                                                    "example": "São Paulo"
                                                },
                                                "regiao": {
                                                    "type": "string",
                                                    "example": "Sudeste"
                                                },
                                                "ibge": {
                                                    "type": "string",
                                                    "example": "3550308"
                                                },
                                                "gia": {
                                                    "type": "string",
                                                    "example": "1004"
                                                },
                                                "ddd": {
                                                    "type": "string",
                                                    "example": "11"
                                                },
                                                "siafi": {
                                                    "type": "string",
                                                    "example": "7107"
                                                }
                                            },
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "CEP não encontrado.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "error": {
                                            "type": "string",
                                            "example": "CEP não encontrado."
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Erro ao se comunicar com o serviço externo.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "error": {
                                            "type": "string",
                                            "example": "Erro ao se comunicar com o serviço externo."
                                        },
                                        "details": {
                                            "type": "string",
                                            "example": "Detalhes do erro aqui"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/services/ibge/states": {
            "get": {
                "tags": [
                    "Services",
                    "IBGE"
                ],
                "summary": "Consulta todos os estados do Brasil",
                "description": "Este endpoint permite consultar informações sobre todos os estados do Brasil, com a possibilidade\r\n * de ordenação e visualização personalizada.",
                "operationId": "7be687ed680fccc7f4eaef941aa4a53b",
                "parameters": [
                    {
                        "name": "orderBy",
                        "in": "query",
                        "description": "Parâmetro para ordenar os estados. Valores possíveis: 'id' ou 'nome'.",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "example": "nome"
                        }
                    },
                    {
                        "name": "view",
                        "in": "query",
                        "description": "Formato de visualização. Valores possíveis: 'default' ou 'nivelado'.",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "example": "default"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Consulta realizada com sucesso.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "Consulta realizada com sucesso."
                                        },
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "properties": {
                                                    "id": {
                                                        "type": "integer",
                                                        "example": 1
                                                    },
                                                    "nome": {
                                                        "type": "string",
                                                        "example": "Acre"
                                                    },
                                                    "sigla": {
                                                        "type": "string",
                                                        "example": "AC"
                                                    },
                                                    "regiao": {
                                                        "properties": {
                                                            "id": {
                                                                "type": "integer",
                                                                "example": 1
                                                            },
                                                            "nome": {
                                                                "type": "string",
                                                                "example": "Norte"
                                                            },
                                                            "sigla": {
                                                                "type": "string",
                                                                "example": "N"
                                                            }
                                                        },
                                                        "type": "object"
                                                    }
                                                },
                                                "type": "object"
                                            }
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Erro ao consultar dados.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "error": {
                                            "type": "string",
                                            "example": "Erro ao consultar dados."
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/services/ibge/regions": {
            "get": {
                "tags": [
                    "Services",
                    "IBGE"
                ],
                "summary": "Consulta todas as regiões do Brasil",
                "description": "Este endpoint permite consultar informações sobre todas as regiões do Brasil.",
                "operationId": "3453881372692a1dfdbbe2612d55d19f",
                "responses": {
                    "200": {
                        "description": "Consulta realizada com sucesso.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "array",
                                    "items": {
                                        "properties": {
                                            "id": {
                                                "type": "integer",
                                                "example": 1
                                            },
                                            "nome": {
                                                "type": "string",
                                                "example": "Norte"
                                            },
                                            "sigla": {
                                                "type": "string",
                                                "example": "N"
                                            }
                                        },
                                        "type": "object"
                                    }
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/services/ibge/countries": {
            "get": {
                "tags": [
                    "Services",
                    "IBGE"
                ],
                "summary": "Consulta todos os países",
                "description": "Este endpoint permite consultar informações sobre todos os países.",
                "operationId": "51b02eed966cae8870b536aa0ba809fa",
                "responses": {
                    "200": {
                        "description": "Consulta realizada com sucesso.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "array",
                                    "items": {
                                        "properties": {
                                            "id": {
                                                "type": "integer",
                                                "example": 1
                                            },
                                            "nome": {
                                                "type": "string",
                                                "example": "Brasil"
                                            },
                                            "sigla": {
                                                "type": "string",
                                                "example": "BR"
                                            }
                                        },
                                        "type": "object"
                                    }
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/services/ibge/municipalities/{state_id}": {
            "get": {
                "tags": [
                    "Services",
                    "IBGE"
                ],
                "summary": "Consulta municípios por estado",
                "description": "Este endpoint permite consultar os municípios de um estado específico.",
                "operationId": "1508d7b2df654d7b6feb98033ac2d421",
                "parameters": [
                    {
                        "name": "state_id",
                        "in": "path",
                        "description": "ID do estado para consultar seus municípios.",
                        "required": true,
                        "schema": {
                            "type": "integer",
                            "example": 1
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Consulta realizada com sucesso.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "array",
                                    "items": {
                                        "properties": {
                                            "id": {
                                                "type": "integer",
                                                "example": 1
                                            },
                                            "nome": {
                                                "type": "string",
                                                "example": "Rio Branco"
                                            }
                                        },
                                        "type": "object"
                                    }
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/services/ibge/districts/{state_id}": {
            "get": {
                "tags": [
                    "Services",
                    "IBGE"
                ],
                "summary": "Consulta distritos por estado",
                "description": "Este endpoint permite consultar os distritos de um estado específico.",
                "operationId": "7ca5f89caecbaf01cc82cf7fdcdf4a64",
                "parameters": [
                    {
                        "name": "state_id",
                        "in": "path",
                        "description": "ID do estado para consultar seus distritos.",
                        "required": true,
                        "schema": {
                            "type": "integer",
                            "example": 1
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Consulta realizada com sucesso.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "array",
                                    "items": {
                                        "properties": {
                                            "id": {
                                                "type": "integer",
                                                "example": 1
                                            },
                                            "nome": {
                                                "type": "string",
                                                "example": "Centro"
                                            }
                                        },
                                        "type": "object"
                                    }
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        }
    },
    "components": {
        "securitySchemes": {
            "sanctum": {
                "type": "http",
                "bearerFormat": "Token",
                "scheme": "bearer"
            },
            "bearerAuth": {
                "type": "http",
                "description": "Insira o token JWT no campo de autorização. Formato: 'Bearer {token}'",
                "bearerFormat": "JWT",
                "scheme": "bearer"
            }
        }
    },
    "tags": [
        {
            "name": "Autenticação",
            "description": "Autenticação"
        },
        {
            "name": "Atestados",
            "description": "Atestados"
        },
        {
            "name": "CIDs",
            "description": "CIDs"
        },
        {
            "name": "Services",
            "description": "Services"
        },
        {
            "name": "IBGE",
            "description": "IBGE"
        }
    ]
}