-
Notifications
You must be signed in to change notification settings - Fork 151
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
Change TraceNumber and OriginalTrace to strings to prevent errors #366
Comments
For reference, here's all other AddendaRecordIndicator int // 0 or 1
AddendaRecords int // count
Amount int // non-negative int
BatchCount int // count
BatchNumber int // count
BlockCount int // count
EntryAddendaCount int // count
EntryDetailSequenceNumber int // non-negative int
EntryHash int // sum of ABA's
ForeignExchangeReferenceIndicator int // fixed set of values (0, 1, 2)
ForeignPaymentAmount int // non-negative int
OriginatorStatusCode int // fixed set of values (0, 1, 2)
SequenceNumber int // non-negative int
ServiceClassCode int // fixed set of values
TotalCreditEntryDollarAmountInFile int // sum
TotalDebitEntryDollarAmountInFile int // sum
TransactionCode int // fixed set of values |
Going by that table I don't think we need to change any other values. Double checking with @bkmoovio and @wadearnold |
Remind me why we are doing this again? If I recall you were running a 32 bit system? Didn’t you put a check in that says we don’t support 32 bit systems? Just trying to remember the issue? |
Yes, but the 32bit issue was a problem of overflow. There's still the problem of any integer type truncating leading 0's from routing numbers. |
Which routing numbers are not string? |
TraceNumber (and OriginalTrace) have routing numbers as their prefix. |
Why hasn't it been an issue? Sorry just trying to understand that? I'm just wondering if you are fixing something that may never be an issue? Or is it that we just have had a routing number with leading 0? |
I just changed the PPD file write to have routing numbers with leading zero's. There were no errors. Apologies. I'm sure there is an issue, but I'm just not seeing it. 101 031380104 0210428821811090000A094101Federal Reserve Bank My Bank Name |
I see a few problems, but maybe we can suggest The following are all invalid, but could be written by accident.
|
The underlying library uses TraceNumberField(), right? |
// TraceNumberField returns a zero padded TraceNumber string |
I was thinking about this over the weekend. What if we un-export traceNumber string
// ... later on
// returns either traceNumber (if non-empty) or concat the strings
func (..) TraceNumberField() string {
} Doing so breaks an implicit 1:1 mapping we have from "ACH field" to "struct field". |
Consumers of the API will need access to the trace number. Without question, they will need to be able to read it. For Returns they will need to be able to set the trace number as it has to be the original number. Currently a Return, Dishonored Return, Contested Dishonored Return all use the same entry detail struct. |
Gah, I forgot to imply a setter would exist. |
Is this something we're ok with changing? |
This should point users towards getting the proper value rather than using the int (which has known bugs). Issue: moov-io#366
This should point users towards getting the proper value rather than using the int (which has known bugs). Issue: moov-io#366
(The original issue was #236.)
TraceNumber
(and likely other fields) have known edge cases and bugs.TraceNumber
is a 15 digit value whose prefix is an ABA routing number.int
in Go is only defined: "int is a signed integer type that is at least 32 bits in size"We should change this type to be a string (perhaps a TraceNumber type) to prevent both bugs. This is a breaking change however, so we should release it sooner rather than later.
We should also scan the other fields (
int
types) for similar problems.The text was updated successfully, but these errors were encountered: