-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
# Refatoração de Código, Correções e Melhoria de Documentação #145
Merged
Changes from all commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
03a2880
chore: Movendo rotas descontinuadas para 'deprecated'
isaacbatista26 b6b0970
chore: Movendo controladores descontinuados para 'deprecated'
isaacbatista26 905f40b
chore: Movendo serviços descontinuados para 'deprecated'
isaacbatista26 cf006ae
chore: Renomeando index.js -> server.js
isaacbatista26 5d1dbc4
chore: Movendo scripts descontinuados para 'deprecated'
isaacbatista26 49696be
chore: Movendo testes descontinuados para 'deprecated'
isaacbatista26 6110c5c
test: Adicionando teste de integração do endpoint /health
isaacbatista26 befcdb0
test: Refatorando teste de integração do endpoint de licitações mensais
isaacbatista26 dd219f5
test: Adicionando teste de integração do endpoint de licitações anuais
isaacbatista26 6e9b328
feat: Adicionando endpoint que verifica a saúde da aplicação
isaacbatista26 e542001
fix: Corrigindo bug no serviço de licitações mensais
isaacbatista26 73bec88
docs: Adicionando documentação da modelagem do banco de dados
isaacbatista26 06bccda
docs: Adicionando alterações relacionadas ao backend
isaacbatista26 098f99d
docs: Adicionando uma explicação mais detalhada ao backend
isaacbatista26 0fafe9d
docs: Adicionando detalhes ao 'Getting Started'
isaacbatista26 e384589
fix: Corrigindo warnings do lint
isaacbatista26 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
backend/src/services/citiesService.js → ...nd/[deprecated]/services/citiesService.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
backend/src/services/tendersService.js → ...d/[deprecated]/services/tendersService.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
backend/src/services/unitsService.js → ...end/[deprecated]/services/unitsService.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
const request = require('supertest'); | ||
const app = 'https://minas-cultura-api.onrender.com'; | ||
|
||
describe('Testes do Endpoint de Health', () => { | ||
it('Deve retornar "OK"', async () => { | ||
|
||
const res = await request(app) | ||
.get(`/health`) | ||
.expect('Content-Type', /json/) | ||
.expect(200); | ||
|
||
expect(res.status).toBe(200); | ||
expect(res.body).toBeDefined(); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
const request = require('supertest'); | ||
const app = 'https://minas-cultura-api.onrender.com'; | ||
|
||
describe('Testes do Endpoint de Licitações Anuais', () => { | ||
it('Deve retornar a licitação referente ao ano fornecido', async () => { | ||
const year = '2023'; | ||
|
||
const res = await request(app) | ||
.get(`/tenders/year?year=${year}`) | ||
.expect('Content-Type', /json/) | ||
.expect(200); | ||
|
||
expect(res.status).toBe(200); | ||
expect(res.body).toBeDefined(); | ||
expect(Array.isArray(res.body)).toBe(true); | ||
|
||
res.body.forEach(tender => { | ||
expect(tender).toHaveProperty('committed_value'); | ||
expect(tender).toHaveProperty('liquidated_value'); | ||
expect(tender).toHaveProperty('paid_value'); | ||
expect(tender).toHaveProperty('year'); | ||
}); | ||
}); | ||
|
||
it('Deve retornar um erro quando a data não for fornecida', async () => { | ||
const year = null; | ||
|
||
const res = await request(app) | ||
.get(`/tenders/year?year=${year}`); | ||
|
||
expect(res.status).toBe(400); | ||
expect(res.body).toBeDefined(); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
const express = require('express'); | ||
const router = express.Router(); | ||
|
||
router.get('/', async (_req, res) => { | ||
const healthcheck = { | ||
message: 'OK' | ||
}; | ||
try { | ||
res.send(healthcheck); | ||
} catch (error) { | ||
healthcheck.message = error; | ||
res.status(503).send(); | ||
} | ||
}); | ||
|
||
module.exports = router; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A atualização da documentação foi vem feita!