Skip to content
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

Add BatchENR #349

Merged
merged 1 commit into from
Nov 6, 2018
Merged

Add BatchENR #349

merged 1 commit into from
Nov 6, 2018

Conversation

adamdecaf
Copy link
Member

Fixes: #343

// for a depository financial institution.
//
// Allowed TransactionCode values: 22 Demand Credit, 27 Demand Debit, 32 Savings Credit, 37 Savings Debit
type BatchENR struct {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Each Addenda05.PaymentRelatedInformation contains the following data. Should we write a parser and validator for this BatchENR type? I started one with EnrolleeClassificationCode below.

// PaymentRelatedInformation (*) (\ ends)
// Example: 22*12200004*3*123987654321*777777777*DOE*JOHN*0\
//
// transaction code
// RDFI Identification Number (ABA)
// Check Digit
// DFI Account Number
// Individual Identification: SSN
// Individual Name
// Representive Payee Indicator / Enrollee Classification Code: Gov Benefits: 0 (no), otherwise 1 (yes - initiated by someone other than named beneficiary)
//   - A: enrollee is consumer,  B enrollee is a company

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. CCD+ and CTX have something similar that is not currently implemented. I left it off because the data CAN be formatted but it doesn't have to be formatted in that way for commercial payments.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added a struct and parse method for this.

return bh.alphaField("", 6) // YYMMDD
} else {
return bh.formatSimpleDate(bh.EffectiveEntryDate)
}
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a bit hackey, but I didn't think of a better way to ensure the files are written properly in this case.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't see that as a hack.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems weird that the writer code has to be aware of specifics for ENR, but it's not a big deal.

@adamdecaf
Copy link
Member Author

I've added ParsePaymentInformation onto BatchENR and a related struct for all the parsable fields.

msg := fmt.Sprintf(msgBatchAmountZero, entry.Amount, "ENR")
return &BatchError{BatchNumber: batch.Header.BatchNumber, FieldName: "Amount", Msg: msg}
}

This comment was marked as outdated.

@adamdecaf adamdecaf merged commit 83902a2 into moov-io:master Nov 6, 2018
@adamdecaf adamdecaf deleted the batchenr branch November 6, 2018 17:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants