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

[Job launcher] Added enums parsing #2610

Open
wants to merge 19 commits into
base: develop
Choose a base branch
from

Conversation

eugenvoronov
Copy link
Contributor

@eugenvoronov eugenvoronov commented Oct 8, 2024

Description

Added enums parsing.

Summary of changes

  • Implemented @isEnumInsensitive decorator.
  • Implemented unit tests for decorator.
  • Implemented EnumTransformInterceptor interceptor.
  • Implemented unit tests for interceptor.
  • Implemented JobController unit tests.

How test the changes

yarn test

Related issues

Enums parsing #2600

@eugenvoronov eugenvoronov self-assigned this Oct 8, 2024
Copy link

vercel bot commented Oct 8, 2024

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

Name Status Preview Comments Updated (UTC)
human-app ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 25, 2024 2:10pm
3 Skipped Deployments
Name Status Preview Comments Updated (UTC)
faucet-frontend ⬜️ Ignored (Inspect) Visit Preview Oct 25, 2024 2:10pm
faucet-server ⬜️ Ignored (Inspect) Visit Preview Oct 25, 2024 2:10pm
human-dashboard-frontend ⬜️ Skipped (Inspect) Oct 25, 2024 2:10pm

@eugenvoronov eugenvoronov marked this pull request as draft October 8, 2024 07:29
Copy link
Collaborator

@portuu3 portuu3 left a comment

Choose a reason for hiding this comment

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

I think you should use an interceptor instead of a validator, in the end you don't want to validate, what you need is to convert any enum value received (upper or lower case) to the case defined in the internal enums (lowercase). Also using an interceptor I think might be possible to use it as a middleware and affect to all enums instead of having to specify it for all dtos.

@vercel vercel bot temporarily deployed to Preview – human-dashboard-frontend October 9, 2024 04:41 Inactive
@eugenvoronov eugenvoronov marked this pull request as ready for review October 9, 2024 04:45
portuu3
portuu3 previously approved these changes Oct 10, 2024
* Added enum parsing

* Updated solution error

* Lint fix

* Lint fix

* Updated interceptor

* Lint fix

* Updated imports
* Added enums parsing

* Update decorator export

* Moved decorator
* Implemented enum parsing for exchange oracle

* Updated lint

* Updated decorator and interceptor

* Resolved conflicts

* Add guards

* Update decorator export

* Deleted console.log
* Added enums parsing

* Improved interceptor

* Removed comments
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