Fix Read API calls#9
Conversation
|
Thanks for the PR. Always appreciate the help! I am thinking that rather than add a few levels of complexity to try to get the tag's case to match the API specification, it would make more sense to remove the case transformation logic. The gem would then instead rely on the case of the key that is passed What do you think? |
|
Hey, makes sense to rely on the provided keys. I have updated the code, ReadMe and tests accordingly. Only |
toddsiegel
left a comment
There was a problem hiding this comment.
This looks good. Thanks, @bezoar17. IMO, I think the code commits should be squashed down to one or two cohesive commits, with descriptive commit messages. The README commit can be left as-is. What do you think @danielpowell4?
| @@ -1,3 +1,3 @@ | |||
| module IntacctRuby | |||
| VERSION = '1.7.0'.freeze | |||
| VERSION = '1.8.0'.freeze | |||
There was a problem hiding this comment.
No need to bump the version, we'll do that when we cut a new version of the gem.
| </operation> | ||
| </request> | ||
| ``` | ||
|
|
There was a problem hiding this comment.
Thanks for the doc updates!
|
@bezoar17, I agree with @toddsiegel. If you could squash down your commits, we would appreciate it. What we mean by this is that these commits make a change and only to then undo it a step later. We prefer one-directional code stories when possible. As you will notice when you click through the All of this work (sans the ruby and gem version bumps) could be broken into a single commit along the lines of: @bezoar17 Did you by change run the test suite and assess the damage? |
|
Updated with cleaner commits. @toddsiegel @danielpowell4 . |
|
@bezoar17, again, thanks for the work! What do you think about removing the Sorry for the slow reply. We are working on rearranging some permissions on this repo and making a roadmap for the future. |
The Intacct API calls for different format and cases in read and write requests.
For example, a read request would look like:
request.readByQuery(nil, { object: 'VENDOR',
query: '',
fields: '*',
pagesize: 100})
Note: Object-Type VENDOR is passed as a value in key-value pair and the keys are lowercase.
A write request, on the other hand looks like:
request.create(:CUSTOMER, { CUSTOMERID: '1',
FIRST_NAME: 'Han',
LAST_NAME: 'Solo',
TYPE: 'Person',
EMAIL1: 'han@solo.com',
STATUS: 'active'
})
Note: Object-Type CUSTOMER is passed as the first argument and is in uppercase along with the keys.
Before this commit, the gem was artificially upcasing all keys it was passed as hashes.
This meant that it did not work with any of the read queries. This commit removes
this iterative upcase instead keying on the case of the key which it is passed.It also adds
a new function type readMore to allowed function types.
This is a breaking change.
|
@danielpowell4 , removed forceful upcase for |
|
@bezoar17 I have seen this. Looks good. Getting travisCI hooked up as I type. Hope to have this out in a new release this/next week! |
|
@bezoar17 Thanks again! I cherry picked your commits and merge in another branch as these conflicts arose. Aiming to cut a new version of the gem (1.8) today |
Fix read types of Intacct API calls e.g. https://developer.intacct.com/api/accounts-payable/vendors/#get-vendor
Ref: #7