You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 5407a0c
Browse filesBrowse the repository at this point in the historyBrowse files
fix(quickbooks): stop item full updates from corrupting inventory and transaction history
Two of these silently rewrite a customer's accounting records.
An Item full update echoes the record read back from QuickBooks. Intuit
documents InvStartDate asymmetrically: "For read operations, the date returned
in this field is always the originally provided inventory start date. For
update operations, the date supplied is interpreted as the inventory adjust
date, is stored as such in the underlying data model, and is reflected in the
QuickBooks Online UI." QtyOnHand is re-asserted the same way. Both are
"Required for Inventory type items", so neither can simply be dropped from the
body — refuse the update instead, matching create_item's existing
Service/NonInventory restriction. Intuit also documents inactivation as "Not
valid for Category item types", so an Active change on a Category is refused
too.
The Item update also posted to a bare endpoint. Intuit: "Add the query
parameter, include=donotupdateaccountontxns, to the endpoint to supress
updating the income or expense account on any existing transactions associated
with this Item object." Without it, changing an item's account rewrote every
historical transaction linked to it. The parameter is documented on the Item
update alone, so it is not applied to any other entity.
Also aligns the shared plumbing with the documented model:
- PhysicalAddress documents Line1-Line5; the write map carried only Line1/Line2,
so an address Sim had just read could not be written back.
- Fault.type (ValidationFault / SystemFault / AuthenticationFault /
AuthorizationFault) was discarded, hiding the classification that separates a
bad payload from a dead token. Matched by prefix because Intuit's pages
disagree between "ValidationFault" and type="Validation".
- The query string used the form-encoded "+" for spaces; Intuit's own example
percent-encodes them.
- MAXRESULTS was capped at 100 against a documented maximum of 1,000.
- Validates documented constraints locally: DisplayName <=500, Item.Name <=100
with no tabs, new lines, or colons, and an email address Intuit can store.
- update_item's activeStatus and update_employee's displayName now carry the
Category and Payroll caveats Intuit documents.
Adds the missing query-builder coverage and a full-update test that would catch
feeding the sanitized record into the merge, which would null every vendor's
TaxIdentifier.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RB5M2gk7zZgGomnQqr7WRB
0 commit comments