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

Support acknowledgment entries ack & atx #327 #331

Merged
merged 10 commits into from
Oct 30, 2018

Conversation

bkmoovio
Copy link
Contributor

No description provided.

create batchATX and batchATX_test

CTX and ACK adjustments
ACk and AXT testing adjustments
read and write test
change SetOriginalTraceNumber argument from int to string
gofmt
add ATX write and read test
minor adjustments for ACK write tes
Update README.md for ACK and ATX
@coveralls
Copy link

Coverage Status

Coverage increased (+0.09%) to 96.338% when pulling 0169af4 on Support-acknowledgment-entries---ACK-&-ATX-#327 into 8e9c346 on master.

@coveralls
Copy link

coveralls commented Oct 29, 2018

Coverage Status

Coverage decreased (-0.2%) to 96.063% when pulling 08653b1 on Support-acknowledgment-entries---ACK-&-ATX-#327 into 8e9c346 on master.

@bkmoovio
Copy link
Contributor Author

#327

// Position 21-22 of underlying Individual Name are reserved blank space for CTX " "
func (ed *EntryDetail) SetCTXReceivingCompany(s string) {
func (ed *EntryDetail) SetCATXReceivingCompany(s string) {
Copy link
Member

Choose a reason for hiding this comment

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

This will break any users who had the old method, is that okay?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That's correct, that would have to update the methods to use the new methods. I can leave the old methods and we can deprecate them later. I'm not sure how many clients are using the CTX* functions. This may be a good way to find out. Let me know if you want me to leave the CTX methods and deprecate later.

Copy link
Member

@adamdecaf adamdecaf Oct 29, 2018

Choose a reason for hiding this comment

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

Can we ask on the mailing list? cc @wadearnold

It's likely not a big deal, but we should double check.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure, the company the updates would know right away. It's not like they would update production. I'll send out a note to the mailing list.

Copy link
Member

Choose a reason for hiding this comment

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

We can ask the mailing list. I don't understand the motivation for the renaming of CTX -> CATX ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

To be a bit more relevant to what it supports both CTX and ATX EntryDetail, although I don't really like it.

I can leave CTX and both CTX EntryDetail and ATX EntryDetail can use it. I don't like that either.

We can create ATX specific functions. In this case specific to adding it in EntryDetail, I don't like that either.

So I chose the one I thought was best from 3 solutions I didn't like. If it's agreed that another above is more preferable or some other solution is better I can make the adjustment. Just let me know.

go.sum Outdated
@@ -1,7 +1,12 @@
github.com/VividCortex/gohistogram v1.0.0 h1:6+hBz+qvs0JOrrNhhmR7lFxo5sINxBCGXrdtl/UvroE=
Copy link
Member

Choose a reason for hiding this comment

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

Can we drop these files from the PR? I'd like to update dependencies in their own PR's.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yep

mockBatch.AddEntry(mockACKEntryDetail())
mockBatch.GetEntries()[0].AddAddenda(mockAddenda05())
if err := mockBatch.Create(); err != nil {
log.Fatal(err)
Copy link
Member

Choose a reason for hiding this comment

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

This should be t.Fatal, right?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The way that is currently defined throughout ach it could be a panic(err), but I'd prefer it log. At some point we could clean up those test still using panic(err)

Copy link
Member

@adamdecaf adamdecaf Oct 29, 2018

Choose a reason for hiding this comment

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

Ah, that's fine. log.Fatal calls do break control flow away from the current goroutine anyway and testing picks up those to mark as failed.

Copy link
Member

Choose a reason for hiding this comment

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

I would prefer in the library that we always return an error and not dictate a logging structure. We can have stronger opinions in our own services that consume the library.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I can make it panic(err)

Copy link
Member

Choose a reason for hiding this comment

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

This is test code, so why not t.Fatal? That doesn't panic -- it just stops the test.

Copy link
Member

Choose a reason for hiding this comment

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

gah! Sorry i can't read a code snippet! I thought that was the factory in the batch.go

Copy link
Contributor Author

@bkmoovio bkmoovio Oct 29, 2018

Choose a reason for hiding this comment

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

yes it's creating a mockBatch, it's not actually running a test, but tests use it to create a mockBatch. no different then *entryDetail creates an entryDetail. There is some additional logic to panic(err) if batch creates fail. There is no point in continuing with the test if that batch fails. I like it the way it is except I'd prefer to log. If you want to change the library to use t.Fatal, please do. I'm not sure it is necessary or needed. Or create an issue and we can address the entire library under that issue, if it makes sense too.

remove go.mod and go.sum
go.mod Outdated
@@ -1,20 +0,0 @@
module github.com/moov-io/ach
Copy link
Member

Choose a reason for hiding this comment

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

@bkmoovio Sorry, I just meant to delete your changes from these go.* files. We need them to Go modules.

replace go/mod and go.sum
Add back removed CTX functions to be deprecated in the future
@bkmoovio bkmoovio merged commit 049055e into master Oct 30, 2018
@bkmoovio bkmoovio deleted the Support-acknowledgment-entries---ACK-&-ATX-#327 branch October 30, 2018 02:03
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.

4 participants