-
Notifications
You must be signed in to change notification settings - Fork 79
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
Fixes issue #29 and allows optional fields to be omitted during object creation #30
base: master
Are you sure you want to change the base?
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.
lib/file/header.js
Outdated
type: 'alphanumeric', | ||
value: utils.SPACE.repeat(8) | ||
} | ||
}; |
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.
I suppose removing the newline at the end of the file was not intentional. Could you put it back in?
lib/utils.js
Outdated
module.exports.getNextMultipleDiff = getNextMultipleDiff; | ||
module.exports.SPACE = SPACE; |
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.
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. |
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). |
Address issue #29 by adding default value to discretionary data field and all "required: false" fields. Default value is space-filled to field width.