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.
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
adding ValidateOpts #295
base: master
Are you sure you want to change the base?
adding ValidateOpts #295
Changes from 1 commit
74c4927
1aa2813
64bf1e1
7964276
7c2ee0c
d15b6ee
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
SkipAll
can be checked insideFile.Validate()
to bypass all checks.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.
exact validation function of record will hit within reader function only
it seems that we should use skipall flag in validation function of record
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.
In ACH we passed the ValidateOpts through a file so all records in a file have the same validation overrides.
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.
Right, ACH used above logic
but imagecashletter is different with ACH
Actually we need to hit validation function of ReturnDetail and CheckDetail
Validation function of file doesn't hit these validation functions
The validation functions will hit only when parsing file
I am not sure the reason yet. anyway we should use this parameter for supporting current logic
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.
cc @atonks2 thoughts?
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.
ACH adds an instance of
validateOpts
to several record types, but then still exposes aValidateWith
method on some of them to pass opts through.If we add a validateOpts field to each record that has options defined and wire it all the way through from file creation, that would probably cover the most code paths (trying to think through HTTP API vs library). That said, it's not clear to me from a quick review of ACH how the opts get wired through.
@adamdecaf Can you provide more context on how the validate opts work in ACH? How/when are they wired through when using ACH as an API vs a library.
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.
They're wired through from the
File
object so you can accumulate records and the opts are respected during validation. The HTTP api accepts them as a top-level object in JSON.The ACH library's
Reader
can also haveValidateOpts
which are put onto each file that's read.