-
Notifications
You must be signed in to change notification settings - Fork 33
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
base: develop
Are you sure you want to change the base?
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
3 Skipped Deployments
|
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.
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.
packages/apps/job-launcher/server/src/common/decorators/enum-insensitive.ts
Outdated
Show resolved
Hide resolved
packages/apps/job-launcher/server/src/common/decorators/enum-insensitive.ts
Outdated
Show resolved
Hide resolved
packages/apps/job-launcher/server/src/modules/job/job.controller.ts
Outdated
Show resolved
Hide resolved
packages/apps/job-launcher/server/src/common/interceptors/enum-insensitive.ts
Outdated
Show resolved
Hide resolved
...pps/job-launcher/server/src/database/migrations/1728411922919-updateEnumValuesToLowerCase.ts
Show resolved
Hide resolved
packages/apps/job-launcher/server/src/modules/auth/auth.service.ts
Outdated
Show resolved
Hide resolved
* 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
Description
Added enums parsing.
Summary of changes
Implemented@isEnumInsensitive
decorator.Implemented unit tests for decorator.EnumTransformInterceptor
interceptor.JobController
unit tests.How test the changes
yarn test
Related issues
Enums parsing #2600