{
    "openapi": "3.0.0",
    "info": {
        "title": "Documentação da api pública - Reentrada",
        "description": "API Public by Reentrada",
        "termsOfService": "",
        "contact": {
            "email": "nando.falou@gmail.com"
        },
        "version": "1.0.0"
    },
    "servers": [
        {
            "url": "https://reentrada.ticketeria.tk/api",
            "description": "Dev"
        },
        {
            "url": "http://localhost:{port}/api",
            "description": "Localhost Dev",
            "variables": {
                "port": {
                    "enum": [
                        "80",
                        "8080"
                    ],
                    "default": "80"
                }
            }
        }
    ],
    "tags": [
        {
            "name": "Auth"
        }
    ],
    "paths": {
        "/auth/login": {
            "post": {
                "tags": [
                    "Auth"
                ],
                "summary": "Obtenha uma autorização de token de usuário.",
                "description": "Obtém uma autorização de token. Digite o nome de usuário e a senha na guia 'Autorizar'. Em seguida, execute o endpoint /auth/login para obter um token de usuário.",
                "operationId": "login",
                "consumes": [
                    "application/json"
                ],
                "security": [
                    {
                        "basicAuth": []
                    }
                ],
                "responses": {
                    "201": {
                        "description": "Obtém uma autorização de token no parâmetro de resposta 'access_token'.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ResponseBasicAuth"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Dados do usuário inseridos incorretamente ou não inseridos. Entre com usuário e senha na aba 'Autorizar' e tente novamente!",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ResponseUnauthorized"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/auth": {
            "post": {
                "tags": [
                    "Auth"
                ],
                "summary": "Create Account",
                "description": "Nova Conta",
                "operationId": "/",
                "consumes": [
                    "application/json"
                ],
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "id": {
                                        "description": "Nome do usuário",
                                        "type": "string",
                                        "example": "useradmin@localhost"
                                    },
                                    "name": {
                                        "description": "Id do usuário",
                                        "type": "integer",
                                        "example": 157
                                    },
                                    "email": {
                                        "description": "e-mail do usuário",
                                        "type": "string",
                                        "example": "useradmin@localhost"
                                    },
                                    "password": {
                                        "description": "Senha",
                                        "type": "string",
                                        "example": "123456"
                                    }
                                },
                                "required": [
                                    "email",
                                    "name",
                                    "password"
                                ]
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Resposta da solicitação. Cliente receberá email para ativação da conta",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "status": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": null
                                        },
                                        "user": {
                                            "properties": {
                                                "email": {
                                                    "type": "string",
                                                    "example": "useradmin@localhost"
                                                },
                                                "name": {
                                                    "type": "string",
                                                    "example": "Nome do usuário"
                                                }
                                            },
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Dados do usuário inseridos incorretamente.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "description": "Part of the requisition model",
                                    "properties": {
                                        "status": {
                                            "type": "boolean",
                                            "example": false
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "e-mail já cadastrado"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/auth/activate/{hashlink}": {
            "get": {
                "tags": [
                    "Auth"
                ],
                "summary": "activate",
                "description": "Ativa usuário pelo hashlink enviado",
                "operationId": "activate",
                "consumes": [
                    "application/json"
                ],
                "parameters": [
                    {
                        "in": "path",
                        "name": "hashlink",
                        "type": "string",
                        "required": true,
                        "description": "Hash link enviado para o usuário",
                        "example": "0f7cb185ee9bb4e5e35eae127a157080"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Resposta da solicitação. Cliente receberá email ativar conta",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "status": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": null
                                        },
                                        "user": {
                                            "properties": {
                                                "email": {
                                                    "type": "string",
                                                    "example": "useradmin@localhost"
                                                },
                                                "name": {
                                                    "type": "string",
                                                    "example": "User Administrator"
                                                }
                                            },
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Dados do usuário inseridos incorretamente.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "status": {
                                            "type": "boolean",
                                            "example": false
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Link inválido"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                }
            }
        }
    },
    "components": {
        "schemas": {
            "ResponseBasicAuth": {
                "description": "Part of the requisition model",
                "allOf": [
                    {
                        "description": "Part of the requisition model",
                        "properties": {
                            "token_type": {
                                "type": "string",
                                "example": "Bearer"
                            },
                            "expires_in": {
                                "type": "integer",
                                "example": 1667701448
                            },
                            "access_token": {
                                "type": "string"
                            },
                            "user": {
                                "properties": {
                                    "id": {
                                        "type": "integer",
                                        "example": 121
                                    },
                                    "name": {
                                        "type": "string",
                                        "example": "User Administrator"
                                    },
                                    "login": {
                                        "type": "string",
                                        "example": "useradmin"
                                    }
                                },
                                "type": "object"
                            }
                        },
                        "type": "object"
                    }
                ]
            },
            "ResponseResetPassword": {
                "description": "Part of the requisition model",
                "properties": {
                    "status": {
                        "type": "boolean",
                        "example": true
                    },
                    "message": {
                        "type": "string",
                        "example": null
                    },
                    "user": {
                        "properties": {
                            "email": {
                                "type": "string",
                                "example": "useradmin@localhost"
                            }
                        },
                        "type": "object"
                    }
                },
                "type": "object"
            },
            "ResponseResetPasswordFail": {
                "description": "Part of the requisition model",
                "properties": {
                    "status": {
                        "type": "boolean",
                        "example": false
                    },
                    "message": {
                        "type": "string",
                        "example": "Usuário não encontrado ou não ativo"
                    }
                },
                "type": "object"
            },
            "ResponseUnauthorized": {
                "description": "Request model to update property data.",
                "allOf": [
                    {
                        "$ref": "#/components/schemas/successFalse"
                    },
                    {
                        "$ref": "#/components/schemas/Unauthorized"
                    },
                    {
                        "$ref": "#/components/schemas/messageUnauth"
                    }
                ]
            },
            "ResponseFobidden": {
                "description": "Part of the requisition model",
                "allOf": [
                    {
                        "$ref": "#/components/schemas/successFalse"
                    }
                ]
            },
            "ResponseNotAllowed": {
                "description": "Part of the requisition model",
                "allOf": [
                    {
                        "$ref": "#/components/schemas/successFalse"
                    }
                ]
            },
            "ResponseBadRequest": {
                "description": "Part of the requisition model",
                "allOf": [
                    {
                        "$ref": "#/components/schemas/successFalse"
                    }
                ]
            },
            "success": {
                "description": "Part of the requisition model",
                "properties": {
                    "status": {
                        "type": "boolean",
                        "example": true
                    }
                },
                "type": "object"
            },
            "successFalse": {
                "description": "Part of the requisition model",
                "properties": {
                    "status": {
                        "type": "integer",
                        "example": 401
                    }
                },
                "type": "object"
            },
            "messageOk": {
                "description": "Part of the requisition model",
                "properties": {
                    "message": {
                        "type": "string",
                        "example": "ok"
                    },
                    "uuid": {
                        "type": "string",
                        "example": "144dae74-ae92-4a12-a2fd-194cb6c1eea8"
                    },
                    "time": {
                        "type": "number",
                        "format": "double",
                        "example": 4.099783182144165
                    }
                },
                "type": "object"
            },
            "messageUnauth": {
                "description": "Part of the requisition model",
                "properties": {
                    "messages": {
                        "properties": {
                            "error": {
                                "type": "string",
                                "example": "Usuário/senha inválidos"
                            }
                        },
                        "type": "object"
                    }
                },
                "type": "object"
            },
            "Unauthorized": {
                "description": "Part of the requisition model",
                "properties": {
                    "error": {
                        "type": "integer",
                        "example": 401
                    }
                },
                "type": "object"
            }
        },
        "securitySchemes": {
            "basicAuth": {
                "type": "http",
                "scheme": "basic"
            },
            "bearerAuth": {
                "type": "http",
                "scheme": "bearer",
                "bearerFormat": "JWT"
            }
        }
    }
}