jwoertink / nacha

A Crystal shard for parsing and generating Nacha (ACH) files
MIT License
4 stars 0 forks source link

Add a way to validate a file #9

Open jwoertink opened 1 year ago

jwoertink commented 1 year ago

Maybe something like

Nacha::Validator.new.validate(file_data) #=> <#Nacha::ValidationFailures @file_control="mismatch whatever" >

For example, the File Control total debit / credit are a sum of the entires. This shard should be able to see if that value in the File Control is actually correct. Or checking that the company identification in the batch control is the same in the batch header. There's a few other spots where data is either calculated, or substring that can be checked against.

jwoertink commented 1 year ago

Found this repo https://github.com/thunderblaster/nacha-file-viewer which is pretty cool. Would be neat to generate a flat HTML file that can be loaded up and easily see issues.