qbo_api icon indicating copy to clipboard operation
qbo_api copied to clipboard

Cannot delete a journalentry

Open map7 opened this issue 1 year ago • 3 comments

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 avatar Apr 09 '24 06:04 map7

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)

map7 avatar Apr 10 '24 00:04 map7

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.

minimul avatar Apr 10 '24 16:04 minimul

Pull Request: #133

map7 avatar Apr 10 '24 23:04 map7