# development
$ npm run start
# watch mode
$ npm run start:dev
# production mode
$ npm run start:prod
# unit tests
$ npm run test
Documentação de uso: Rotas, requisições e expectativas
- URL:
/tarefa
- Method:
POST
- Description: Cria uma nova tarefa.
- Request Body:
{
"descricao": "string",
"categoriaId": "number"
}
- Response:
Status: 201 Created
{
"id": "number",
"descricao": "string",
"foiFeita": "boolean",
"categoriaId": "number"
}
- URL:
/tarefa/completas
- Method:
GET
- Description: Obtém todas as tarefas que foram completadas.
- Response:
- Body:
[
{
"id": "number",
"descricao": "string",
"foiFeita": "boolean",
"categoriaId": "number"
}
]
- URL:
/tarefa/ativas
- Method:
GET
- Description: Obtém todas as tarefas que estão ativas.
- Response:
- Body:
[
{
"id": "number",
"descricao": "string",
"foiFeita": "boolean",
"categoriaId": "number"
}
]
- URL:
/tarefa
- Method:
GET
- Description: Obtém todas as tarefas.
- Response:
- Body:
[
{
"id": "number",
"descricao": "string",
"foiFeita": "boolean",
"categoriaId": "number"
}
]
- URL:
/tarefa/:id
- URL Params:
id (ID da tarefa)
- Method:
GET
- Description: Obtém uma tarefa pelo ID fornecido.
- Response:
- Body:
[
{
"id": "number",
"descricao": "string",
"foiFeita": "boolean",
"categoriaId": "number"
}
]
- URL:
/tarefa:id
- URL Params:
id (ID da tarefa)
- Method:
PATCH
- Description: Atualiza uma tarefa.
- Request Body:
{
"descricao": "string",
"foiFeita": "boolean",
"categoriaId": "number"
}
- Response:
Status: 200 OK
{
"id": "number",
"descricao": "string",
"foiFeita": "boolean",
"categoriaId": "number"
}
- URL:
/tarefa/completas
- Method:
DELETE
- Description: Deleta todas as tarefas completas.
- Response:
- Body:
[
{
"id": "number",
"descricao": "string",
"foiFeita": "boolean",
"categoriaId": "number"
}
]
- URL:
/tarefa/:id
- URL Params:
id (ID da tarefa)
- Method:
DELETE
- Description: Deleta uma tarefa pelo ID fornecido.
- Response:
- Body:
[
{
"id": "number",
"descricao": "string",
"foiFeita": "boolean",
"categoriaId": "number"
}
]
- URL:
/categoria
- Method:
POST
- Description: Cria uma nova categoria.
- Request Body:
- Response:
Status: 201 Created
{
"id": "number",
"nome": "string"
}
- URL:
/categoria
- Method:
GET
- Description: Obtém todas as categorias.
- Response:
- Body:
[
{
"id": "number",
"nome": "string"
}
]
- URL:
/categoria/:id
- URL Params:
id (ID da Categoria)
- Method:
GET
- Description: Obtém uma categoria pelo ID fornecido.
- Response:
- Body:
{
"id": "number",
"nome": "string",
"tarefas": [
{
"id": "number",
"descricao": "string",
"foiFeita": "boolean",
"categoriaId": "number"
}
]
}
Obter Tarefas Por Categoria
- URL:
/tarefa/categoria/:categoriaId
- URL Params:
CategoriaId (ID da categoria em tarefa)
- Method:
GET
- Description: Obtém todas as tarefas pelo Categoria ID fornecido.
- Response:
- Body:
[
{
"id": "number",
"descricao": "string",
"foiFeita": "boolean",
"categoriaId": "number"
}
]
- URL:
/categoria:id
- URL Params:
id (ID da categoria)
- Method:
PATCH
- Description: Atualiza uma categoria.
- Request Body:
- Response:
Status: 200 OK
{
"id": "number",
"nome": "string"
}
Deletar Categorias Por ID
- URL:
/categoria/:id
- URL Params:
id (ID da categoria)
- Method:
DELETE
- Description: Deleta uma categoria pelo ID fornecido.
- Response:
- Body:
[
{
"id": "number",
"nome": "string"
}
]