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

Highest Credit "required" validator fails for 0 value(s) #121

Closed
ebisrat opened this issue Oct 5, 2022 · 4 comments · Fixed by #123
Closed

Highest Credit "required" validator fails for 0 value(s) #121

ebisrat opened this issue Oct 5, 2022 · 4 comments · Fixed by #123
Assignees
Labels
bug Something isn't working hacktoberfest-accepted

Comments

@ebisrat
Copy link
Contributor

ebisrat commented Oct 5, 2022

HighestCredit int `json:"highestCredit" validate:"required"`

The highest credit field in the base_segment.go struct has the required json flag, which doesn't allow for 0 int values:

https://pkg.go.dev/gopkg.in/go-playground/validator.v8#hdr-Required

This validates that the value is not the data types default zero value. For numbers ensures value is not zero. For strings ensures value is not "". For slices, maps, pointers, interfaces, channels and functions ensures the value is not nil.
@ebisrat
Copy link
Contributor Author

ebisrat commented Oct 6, 2022

According to the CRRG:

Highest Credit or Original Loan Amount
Report the following values in whole dollars only:
Line of Credit = Highest amount of credit utilized by the

consumer

Installment = Original amount of the loan excluding

interest payments

Mortgage = Original amount of the loan excluding

interest payments

Open = Highest amount of credit utilized by the

consumer, if applicable

Revolving = Highest amount of credit utilized by the

consumer

A zero value forHighest Credit or Original Loan Amount should be allowed. For example, a credit card that that has had no current balance.

@adamdecaf
Copy link
Member

@mfdeveloper508 could you take a look?

@adamdecaf adamdecaf added bug Something isn't working hacktoberfest-accepted labels Oct 7, 2022
@mfdeveloper508 mfdeveloper508 linked a pull request Oct 11, 2022 that will close this issue
@mfdeveloper508 mfdeveloper508 self-assigned this Oct 11, 2022
@adamdecaf
Copy link
Member

@ebisrat can you try out the latest release? https://github.com/moov-io/metro2/releases/tag/v0.5.1

@ebisrat
Copy link
Contributor Author

ebisrat commented Oct 26, 2022

just confirming that fix worked!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working hacktoberfest-accepted
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants