moov-io / ach

ACH implements a reader, writer, and validator for Automated Clearing House (ACH) files. The HTTP server is available in a Docker image and the Go package is available.
https://moov-io.github.io/ach/
Apache License 2.0
446 stars 149 forks source link

achcli -skip-validation flag depends on -validate <filepath> being present #1414

Closed joanofxyz closed 2 months ago

joanofxyz commented 2 months ago

ACH Version

v1.38.0

What were you trying to do?

Right now -skip-validation is only considered if the -validate flag is present. The name of the flag implies it being a boolean flag and it is unintuitive that it needs another flag to be present referencing a config file that will be ignored.

What did you expect to see?

I expect files using the -skip-validation to be built into an ach file regardless of the validations

What did you see?

The tool fails because of validations. For the example shown below, I got the output:

unable to parse json ACH file: batch #1 (WEB) FieldError RDFIIdentification 9 does not match calculated check digit 0

How can we reproduce the problem?

achcli -skip-validation -reformat=ach <file> where the file is a json file containing

{"fileHeader": {"immediateDestination": "026073150", "immediateDestinationName": "DEST", "immediateOrigin": "691000134", "immediateOriginName": "ORIG", "fileIDModifier": "D", "fileCreationTime": "1448", "fileCreationDate": "240422"}, "batches": [{"batchHeader": {"serviceClassCode": 225, "companyName": "COMPANY", "companyDiscretionaryData": "SOME DATA", "companyIdentification": "001", "standardEntryClassCode": "WEB", "companyEntryDescription": "DESC", "companyDescriptiveDate": "240422", "effectiveEntryDate": "240422", "ODFIIdentification": "26073150", "batchNumber": 1}, "entryDetails": [{"category": "Forward", "transactionCode": 27, "RDFIIdentification": "02607315", "checkDigit": "9", "DFIAccountNumber": "269608840015", "amount": 10, "identificationNumber": "817928", "individualName": "John Doe", "addendaRecordIndicator": 0, "traceNumber": "026073150000001"}], "batchControl": {"serviceClassCode": 225, "entryAddendaCount": 1, "entryHash": 23138010, "totalDebit": 10, "totalCredit": 0, "companyIdentification": "001", "ODFIIdentification": "26073150", "batchNumber": 1}}], "IATBatches": null, "fileControl": {"batchCount": 1, "blockCount": 1, "entryAddendaCount": 1, "entryHash": 0, "totalDebit": 10, "totalCredit": 0}, "NotificationOfChange": null, "ReturnEntries": null}
adamdecaf commented 2 months ago

Yep, it makes sense to use -skip-validation without any validate opts.

adamdecaf commented 2 months ago

Released in https://github.com/moov-io/ach/releases/tag/v1.38.1