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

Implementing CustomReturnCode validation #966

Merged

Conversation

emarcey
Copy link
Contributor

@emarcey emarcey commented Jul 22, 2021

Implementing new custom validator customReturnCode that allows returns with non-standard return codes to be parsed successfully.

Fixes #964

@emarcey emarcey requested a review from vxio as a code owner July 22, 2021 21:29

// CustomReturnCodes can be set to skip validation for the Return Code field in an Addenda99
// This allows for non-standard/deprecated return codes (e.g. R97)
CustomReturnCodes bool `json:"customReturnCodes"`
Copy link
Member

Choose a reason for hiding this comment

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

@vxio What are your thoughts on a CheckReturnCode func(code string) error function that allows validating codes like "R97" as the issue mentions.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

For ref: https://moov-io.slack.com/archives/CD9J8EJKX/p1626989492134600?thread_ts=1626981488.133100&cid=CD9J8EJKX

I went with the bool so that I can call from an API endpoint more easily with the base docker image

Copy link
Member

Choose a reason for hiding this comment

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

Yea that's a good idea. We can add a validation func in a separate PR.

@codecov-commenter
Copy link

Codecov Report

Merging #966 (cbee3b7) into master (a2ae6d6) will increase coverage by 0.01%.
The diff coverage is 84.61%.

❗ Current head cbee3b7 differs from pull request most recent head 966986a. Consider uploading reports for the commit 966986a to get more accurate results

@@            Coverage Diff             @@
##           master     #966      +/-   ##
==========================================
+ Coverage   92.22%   92.23%   +0.01%     
==========================================
  Files          66       66              
  Lines        6058     6068      +10     
==========================================
+ Hits         5587     5597      +10     
+ Misses        295      294       -1     
- Partials      176      177       +1     

@adamdecaf adamdecaf merged commit b525358 into moov-io:master Jul 23, 2021
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.

validation: support custom return codes on return entries
3 participants