Fixes issue #29 and allows optional fields to be omitted during object creation#30
Open
ianberryman wants to merge 2 commits into
Open
Fixes issue #29 and allows optional fields to be omitted during object creation#30ianberryman wants to merge 2 commits into
ianberryman wants to merge 2 commits into
Conversation
Address issue glenselle#29 by adding default value to discretionary data field and all "required: false" fields, except those with "blank: true". Default value is space-filled to field width.
waldyrious
reviewed
Mar 14, 2019
| type: 'alphanumeric', | ||
| value: utils.SPACE.repeat(8) | ||
| } | ||
| }; No newline at end of file |
There was a problem hiding this comment.
I suppose removing the newline at the end of the file was not intentional. Could you put it back in?
waldyrious
reviewed
Mar 14, 2019
| module.exports.computeBusinessDay = computeBusinessDay; | ||
| module.exports.getNextMultipleDiff = getNextMultipleDiff; No newline at end of file | ||
| module.exports.getNextMultipleDiff = getNextMultipleDiff; | ||
| module.exports.SPACE = SPACE; No newline at end of file |
There was a problem hiding this comment.
While we're at it, it would be nice to add the file-ending newline here too.
|
@berryman17 thanks for this, I hit the same issue myself. Could you please add a test to it('should create an entry even if optional fields are missing', function(){
var entry = new Entry({
receivingDFI: '081000210',
DFIAccount: '12345678901234567',
amount: '3521',
transactionCode: '22',
individualName: 'Glen Selle',
});
entry.generateString(function(string) {
console.log(string);
});
});This fails on current master, but it should pass with this PR. |
Author
|
Thanks for the review @waldyrious I've committed some changes to address your requests. |
|
@joaopaulofonseca can you take a look when you get the chance? This would be useful for us, as we discussed previously (to avoid having to pass empty strings in these fields). |
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.
Address issue #29 by adding default value to discretionary data field and all "required: false" fields. Default value is space-filled to field width.