feat(api): Standardize DTOs and Enhance Validation#101
Merged
Conversation
… DTOs with class-validator
Closed
5 tasks
This file contains hidden or 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
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.
Description
This pull request addresses the need for standardized and robust request validation across the API. The primary goal was to enforce consistent data structures for incoming requests, improve API reliability by catching malformed data early, and enhance developer experience with clear validation rules and up-to-date API documentation.
To achieve this, a comprehensive audit of Data Transfer Objects (DTOs) was performed, focusing on the auth, investment, and portfolio modules. All DTOs have been annotated with class-validator decorators to enforce validation rules and @ApiProperty to ensure accurate and descriptive Swagger documentation.
A key part of this effort involved refactoring redundant DTOs, notably consolidating portfolio-related DTOs into a single source of truth, which simplified the codebase and reduced maintenance overhead.
Closes #96