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

Project dependencies update, bug fixes, alterations and implementations #158

Merged
merged 3 commits into from
Mar 11, 2024

Conversation

PatrickOtero
Copy link
Contributor

@PatrickOtero PatrickOtero commented Feb 27, 2024

Major changes:
1 - All old dependencies were updated.
2 - All breaking changes were solved

Breaking changes:
1 - The typeormConfig is now on a separated file called "data-source.ts" and it is instantiated to be used anywhere on the api

2 - Now the repositories don't extend the Repository class anymore. They are injectable and inside their constructors we need to use the @injectRepository decorator with their entities as a parameter before declaring their private variables containing their repositories instantiated by typeorm. Now the private variables are declared this way:
eg: "private jobsRepository: Repository"

3 - The "ttl" property from the throttler module are now assigned with milliseconds value instead of seconds and are declared inside an attribute called "throttlers" that is an array.

4 - The @throttler decorator arguments now are declared with an object inside an attribute with the name of the target method or controller and that is an object.

Bug Fixes:
1 - The pipe-entity.pipe.ts was an unnecessary file. Its logic was complex and not practic for the project situation. A simplified solution was implemented in all the pipe target files instead.
2 - The company now can list their own jobs with success

Implementations:
1 - IGlobalResponse interface was added to help create a standard for responses in the api. Each module will have its own extended version of this interface.

Alterations:
1 - The "indefinideContract" column was renamed to "openEndedContract"

2 - The "IN_PERSON" enum from "modality" job column was renamed to "ON_SITE"

3 - The route path that lists the specific company's jobs was renamed to "loggedCompanyJobs", now the complete path is: GET /job/loggedCompanyJobs"

@PatrickOtero PatrickOtero self-assigned this Feb 27, 2024
@PatrickOtero PatrickOtero changed the title Project dependecies update and bug fixes Project dependencies update and bug fixes Feb 27, 2024
Copy link

Quality Gate Passed Quality Gate passed

Issues
0 New issues

Measures
0 Security Hotspots
No data about Coverage
No data about Duplication

See analysis details on SonarCloud

@PatrickOtero PatrickOtero changed the title Project dependencies update and bug fixes Project dependencies update, bug fixes, alterations and implementations Feb 27, 2024
@EddieSCJ
Copy link

Já notei o PR, devo revisar até o fim da semana.

@EddieSCJ
Copy link

EddieSCJ commented Mar 6, 2024

@PatrickOtero é um PR grande hein, rodei alguns testes localmente aqui e eles falharam, talvez antes de mergear e analisar PR seja bom adicionar a parte de coverage do SonarQube no sistema, ja que ele e free pra open source.

O que acha?

@EddieSCJ
Copy link

EddieSCJ commented Mar 6, 2024

Mandei uma mensagem para o @wolwerr para verificarmos a possibilidade, como o PR é muito grande, só o review n traz muita segurança, seria muito útil escrever mais testes e até uns de integração ou e2e, o que podemos fazer junto anyway

import { ReportsEntity } from '../../database/entities/reports.entity';
import { UsersEntity } from '../../database/entities/users.entity';
import { WorkExperiencesEntity } from '../../database/entities/work-experiences.entity';
// import {
Copy link

Choose a reason for hiding this comment

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

Podemos deletar essa classe comentada?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sim.

@@ -0,0 +1,3 @@
export interface IGlobalResponse {
Copy link

Choose a reason for hiding this comment

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

Essa seria uma interface de marcação?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

É uma interface que determina um padrão de resposta nas rotas.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Cada módulo tem sua própria interface que extende essa interface adicionando suas peculiaridades em relação aos outros.

@PatrickOtero
Copy link
Contributor Author

@PatrickOtero é um PR grande hein, rodei alguns testes localmente aqui e eles falharam, talvez antes de mergear e analisar PR seja bom adicionar a parte de coverage do SonarQube no sistema, ja que ele e free pra open source.

O que acha?

A gente poderia fazer isso depois de aceitar esse PR?

O Mikael (back-end vagas) está esperando essa aprovação pra poder prosseguir com uma tarefa dele.

@PatrickOtero
Copy link
Contributor Author

Mandei uma mensagem para o @wolwerr para verificarmos a possibilidade, como o PR é muito grande, só o review n traz muita segurança, seria muito útil escrever mais testes e até uns de integração ou e2e, o que podemos fazer junto anyway

Penso que seria interessante fazermos isso depois de estabelecermos o primeiro MVP desse projeto. Ficaríamos menos atolados e enrolados, pois precisaríamos nos preocupar só com os testes e no momento temos a preocupação de fazer o primeiro MVP acontecer.

@EddieSCJ EddieSCJ self-requested a review March 11, 2024 19:34
@EddieSCJ
Copy link

Mandei uma mensagem para o @wolwerr para verificarmos a possibilidade, como o PR é muito grande, só o review n traz muita segurança, seria muito útil escrever mais testes e até uns de integração ou e2e, o que podemos fazer junto anyway

Penso que seria interessante fazermos isso depois de estabelecermos o primeiro MVP desse projeto. Ficaríamos menos atolados e enrolados, pois precisaríamos nos preocupar só com os testes e no momento temos a preocupação de fazer o primeiro MVP acontecer.

Mandei uma mensagem para o @wolwerr para verificarmos a possibilidade, como o PR é muito grande, só o review n traz muita segurança, seria muito útil escrever mais testes e até uns de integração ou e2e, o que podemos fazer junto anyway

Penso que seria interessante fazermos isso depois de estabelecermos o primeiro MVP desse projeto. Ficaríamos menos atolados e enrolados, pois precisaríamos nos preocupar só com os testes e no momento temos a preocupação de fazer o primeiro MVP acontecer.

Aprovei o PR, todavia, sugiro elaborar mais testes daqui para frente, e repensar se vale a pena usar interfaces de marcação como forma de garantir o contrato das rotas, me parece ser uma complexidade adicional e desnecessária, mas como estou por fora das boas práticas da comunidade typescript, deixo apenas como reflexão.

@PatrickOtero PatrickOtero merged commit d8300ee into SouJunior:main Mar 11, 2024
2 checks passed
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.

2 participants