-
Notifications
You must be signed in to change notification settings - Fork 299
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
Leandro-reis/challenge-implementation #314
Open
leandroepr
wants to merge
43
commits into
hurbcom:main
Choose a base branch
from
leandroepr:leandro-reis/challenge-implementation
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Leandro-reis/challenge-implementation #314
leandroepr
wants to merge
43
commits into
hurbcom:main
from
leandroepr:leandro-reis/challenge-implementation
Conversation
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
… function The Calculator class was removed as it was no longer needed. It was used only to test the jest and typescript configuration
…valid currency code is passed
Include the GetCurrencyRateByCode use-case to support the test
…d of ExchangeRateGateway
…tes using value objects
… and test error scenarios
- Added PostgreSQL database setup to the application using Docker - Configured docker-compose.yml for PostgreSQL service - Created initialization scripts for database schema and seed data
- Created new repository class `CurrencyRateRepositoryApi` to manage currency rates. - Implemented methods to find, add, and delete currency rates. - Integrated the repository with the remote API gateway for fetching data. - Updated the `CurrencyApiGateway` to support filtering and fetching currencies and rates. - Added necessary imports and updated the application logic to use the new repository.
…port internal modules - Added `index.ts` files in various module directories to simplify imports and exports. - Updated all files to use the new restructured import paths. - Organized project structure to improve code clarity and maintainability.
- Installed and configured Prettier and ESLint for code formatting and linting. - Added .prettierrc and .eslintrc.json configuration files. - Integrated Prettier with ESLint to ensure consistent code style. - Reformatted all source files according to Prettier and ESLint rules. - Updated import paths and adjusted formatting in various modules.
- Integrate swagger-ui-express library to serve API documentation - Add swagger.json file to define API specifications - Configure Express server to serve the Swagger UI at /api-docs endpoint
- Created ListCurrenciesController class to handle GET requests for listing currencies. - Integrated ListCurrenciesQuery to execute the query and retrieve the currency data. - Added route registration for '/currencies' endpoint in ExpressAdapter. - Update swagger documentation
- Refactored CurrencyController into separate controllers, each handling a specific route. - Updated routes and imports to use the new controllers. - Modified main setups to instantiate and use the new controllers. - Improved code modularity and maintainability by following the Single Responsibility Principle.
- Removed route handling responsibility from controllers to improve separation of concerns. - Updated the following controllers to focus only on handling their specific logic: - ConvertCurrencyController - CreateCurrencyController - DeleteCurrencyController - GetCurrencyByCodeController - ListCurrenciesController - Updated the main application setup files to register routes separately from the controller logic. - Modified `main-express-pg.ts`, `main-express.ts`, `main-gateway.ts`, and `main-hapi.ts` to use the new routing structure. Affected files: - src/application/query/* - src/application/use-case/* - src/infra/http-server/* - src/main/*
- Created a new CurrenciesRoutes class to handle the registration of routes. - Removed route handling responsibility from the main files to improve separation of concerns. - Updated the following files to utilize the new CurrenciesRoutes class: - main-express-pg.ts - main-express.ts - main-gateway.ts - main-hapi.ts
- Added error handling in ConvertCurrencyController to catch NotFoundError and return a 404 response with the appropriate message.
- Renamed 'currency-rate-not-found.error.ts' to 'currency-not-found.error.ts'; - Updated 'delete-currency.controller.ts' to handle 'CurrencyNotFoundError' and return a 404 response.
- Refactored tests to improve structure and maintainability. - Expanded test coverage to ensure comprehensive validation of the currency management process. - Ensured error handling is properly tested to maintain robustness.
…ity and ease of use. - Renamed files to be more self-explanatory: - main-express-gateway-offline.ts - main-express-gateway-online.ts - main-express-with-fake.ts - main-hapi-with-fake.ts - Updated package.json scripts: - Added `start` script - Added `dev:express+gw-on` script - Renamed existing scripts for consistency and clarity
- Added Dockerfile with appropriate configuration for building and running the app. - Updated docker-compose.yml to include the app service and configure environment variables. - Installed and configured dotenv for managing environment variables. - Updated main*.ts files to use environment variables for database connection strings. - Updated gateway online configuration to utilize environment variables. - Modified database connection logic to use environment variables for connection string. These changes ensure the application can be built and run in a Docker environment with proper environment variable management for configuration consistency.
…ME with the challenge implementation information
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
No description provided.