Skip to content
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

feat: weather location cptec #590

Open
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

enieber
Copy link

@enieber enieber commented Feb 23, 2024

I wanna create app weather without use city code only latitude and longitude, when I search in CPTEC API I found one endpoint with this resource so I add in here to facility use.

  • add endpoint to get weather by location
  • add test to weather location
  • add doc of weather location API

Maybe some changes not in scope because npm run fix command.

- add endpoint to get weather by location
- add test to weather location
- add doc of weather location api
Copy link

vercel bot commented Feb 23, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
brasilapi ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 10, 2024 11:43pm

@enieber
Copy link
Author

enieber commented Feb 23, 2024

I need change documentation response...

- fix documentation with location sample of Campinas city, change to Brejo Alegre city
@enieber
Copy link
Author

enieber commented Feb 23, 2024

change location to Brejo Alegre city sample

RodriAndreotti
RodriAndreotti previously approved these changes Feb 23, 2024
Copy link
Collaborator

@RodriAndreotti RodriAndreotti left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Obrigado pela contribuição, @enieber!

Achei que o PR ficou muito bom.
Só deixei uma observação, mas não é um block, na minha opinião ;-)

pages/_app.js Outdated Show resolved Hide resolved
revert change from pages/_app.js not require in this scope
RodriAndreotti
RodriAndreotti previously approved these changes Feb 23, 2024
services/cptec/weather.js Outdated Show resolved Hide resolved
tests/cpetc/previsao-v1.test.js Outdated Show resolved Hide resolved
@enieber
Copy link
Author

enieber commented Feb 24, 2024 via email

Co-authored-by: Lorhan Sohaky <16273730+LorhanSohaky@users.noreply.github.com>
- add test iinvalid latitude
- add test invalid longitude
- add test invalid city
@enieber
Copy link
Author

enieber commented Mar 5, 2024

Testes implementados, os testes que estão falhando são relacionados a:

  • ncm
  • fipe

Copy link
Member

@LorhanSohaky LorhanSohaky left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Só seria interessante entender se haveria alguma maneira de evitar esse 500. Não que o status code esteja errado, mas se pode ser algum caso que possamos tratar, por exemplo, quando não encontra a localidade, qual status code retornado pela api deles? Não daria para utilizar isso para informar que a cidade não foi encontrada?

@enieber
Copy link
Author

enieber commented Mar 9, 2024

Só seria interessante entender se haveria alguma maneira de evitar esse 500. Não que o status code esteja errado, mas se pode ser algum caso que possamos tratar, por exemplo, quando não encontra a localidade, qual status code retornado pela api deles? Não daria para utilizar isso para informar que a cidade não foi encontrada?

Deveria ser 404, pois não encontrou a localidade..

Copy link

sonarcloud bot commented Mar 9, 2024

Quality Gate Passed Quality Gate passed

Issues
3 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud

@enieber
Copy link
Author

enieber commented Mar 9, 2024

@LorhanSohaky alterei para 404 qiuando não encontrar a cidade.

Copy link
Member

@LorhanSohaky LorhanSohaky left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Aprovado! Muito obrigado 😊

Copy link
Collaborator

@RodriAndreotti RodriAndreotti left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bom dia, pessoal!
Aprovei, porém deixei um comentário num bloco de todo só para entender mesmo.

Novamente, parabéns pelo PR

estado: 'SP',
});
});
// TODO: verify response to positive lat/long
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Existe algo que impeça, temporariamente, este todo de se concretizar?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A api está respondendo a cidade como São Paulo sp ao invés de Campinas.

Copy link

sonarcloud bot commented May 10, 2024

Quality Gate Passed Quality Gate passed

Issues
3 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants