Skip to content
This repository was archived by the owner on Apr 3, 2024. It is now read-only.

Fix read calls#13

Merged
danielrose7 merged 2 commits into
masterfrom
fix-read-calls
Mar 8, 2018
Merged

Fix read calls#13
danielrose7 merged 2 commits into
masterfrom
fix-read-calls

Conversation

@danielrose7
Copy link
Copy Markdown
Contributor

@danielrose7 danielrose7 commented Mar 8, 2018

Contributor Self-Check:

  • My commits and messages are solid
  • I have included tests that check success and failure
  • I have updated the README as appropriate

Which GitHub Issues does this PR address?

#7

Really an adjustment of PRs #8 #9

What does this PR do?

Allows for varying cases in the keys of calls. This is needed to support more than create and update calls!

How do I manually test this?

N/A CI is enough!

Additional Comments

This is a breaking change.

bezoar17 added 2 commits March 8, 2018 13:31
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 for create and update calls
@danielrose7
Copy link
Copy Markdown
Contributor Author

@bezoar17 I cherry-picked your commits!

Wanted to be sure it passed CI and needed to resolve a merge conflict with master after another PR went through

Will release a new gem version shortly!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants