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

server: unable to read json encoded addenda records #295

Closed
adamdecaf opened this issue Oct 8, 2018 · 2 comments
Closed

server: unable to read json encoded addenda records #295

adamdecaf opened this issue Oct 8, 2018 · 2 comments

Comments

@adamdecaf
Copy link
Member

#291 was a discovery (and fix) for being unable to read batches in the JSON structure for an ach.File, but we're also unable to read addenda records.

type EntryDetail struct {
  // ... 
  Addendum []Addendumer `json:"addendum,omitempty"`
}

The problem is that Addendumer is an interface and so encoding/json can't read that into a concrete type. We need to do something similar for addenda records as we did in #292.

Also, the json encoding for addenda records often overlaps. We need to find a unique key to unmarshal into the correct addenda records. Export typeCode?

@adamdecaf adamdecaf added the bug label Oct 8, 2018
@adamdecaf adamdecaf changed the title server: unable to read addenda records server: unable to read json encoded addenda records Oct 8, 2018
@adamdecaf
Copy link
Member Author

@bkmoovio
Copy link
Contributor

bkmoovio commented Oct 8, 2018

I don't exactly what you are trying to do but the typeCode has a default value
// NewAddenda02 returns a new Addenda02 with default values for none exported fields
func NewAddenda02() *Addenda02 {
addenda02 := new(Addenda02)
addenda02.recordType = "7"
addenda02.typeCode = "02"
return addenda02
}

How do you handle recordType? Can you do the same?

Dis-regard I modified typeCode to to be exportable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants