minimul / qbo_api

Ruby JSON-only client for QuickBooks Online API v3. Built on top of the Faraday gem.
MIT License
85 stars 46 forks source link

Cannot delete a journalentry #132

Closed map7 closed 6 months ago

map7 commented 7 months ago

When using

@qbo_api.delete(:journalentry, id: id)

I get the following error

Error: test_journal_create(ReportCraftTest): QboApi::NotImplementedError: Delete is only for transaction entities. Use .deactivate instead

But from what I've read in the code it should pass, but the problem I think is the following line doesn't match properly. https://github.com/minimul/qbo_api/blob/f06ffbe5ed98aae28c5e0eca7116ffd275bfb904/lib/qbo_api/entity.rb#L37

(ruby) singular(entity) "Journalentry"

This doesn't find it in the accepted list because the accepted list only includes JournalEntry.

map7 commented 7 months ago

Workaround; @qbo_api.delete(:journal_entry, id: id)

Maybe this should be added as an example to the docs as it's inconsistent with how we call :journalentry for other things such as @qbo_api.create(:journalentry, payload: journal)

minimul commented 7 months ago

The workaround example to me is the proper style considering that QuickBooks has it at as JournalEntry in the API (even though to query the entities they are treated as case-insensitive).

But you're right about the inconsistency.

Yes, something in the docs would be the best way to go.

map7 commented 7 months ago

Pull Request: #133