Fix/dtos budget maximum allowed - #22
Merged
Merged
Conversation
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.
This pull request introduces validation improvements and expanded test coverage for DTOs related to categories, commitments, and transactions. It enforces stricter maximum value and length constraints on numeric and string fields, and adds comprehensive tests to ensure these validations work as expected. Additionally, it refines the formatting logic for monetary values.
Validation enhancements:
@Max(9999999999999)constraint toamountCentsinCreateTransactionDtoandCreateCommitmentDto, and tobudgetAmountinCreateCategoryDto, ensuring these fields cannot exceed 13 digits.namemax length inCreateCategoryDtofrom 20 to 40, and added@MaxLength(60)todescriptioninCreateCommitmentDtofor better flexibility and consistency.typeinCreateTransactionDtoto use@IsEnum(TransactionType)for stricter type validation.Test coverage improvements:
@Maxconstraints onamountCentsinCreateTransactionDtoandCreateCommitmentDto, and onbudgetAmountinCreateCategoryDto, covering edge cases for maximum and minimum values.Utility and formatting updates:
bigintToMoneyStringto improve formatting of negative and large values, ensuring correct display with Brazilian locale and proper handling of cents.