Repository navigation
feat(agent): add durable QuickBooks OAuth refresh - #231
Draft
MennaAhmed2024 wants to merge 1 commit into
Draft
MennaAhmed2024 wants to merge 1 commit into
MennaAhmed2024 wants to merge 1 commit into
Conversation
|
@mennademrdash is attempting to deploy a commit to the Comp AI - PoC Team on Vercel. A member of the Team first needs to authorize it. |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Add durable QuickBooks OAuth refresh, realm-bound reads, and human-approved estimate drafts.
Closes #228
Problem
Issue #228 references a static-token integration. No QuickBooks implementation exists on the current upstream branches.
This PR adds the required agent integration rather than replacing a nonexistent client.
Solution
Persist encrypted tokens in PostgreSQL. Serialize refreshes with a row lock and commit rotated credentials before replaying requests.
A
401permits one refresh and one replay. Refresh failures stop the replay.Bind requests to the enrolled realm and environment. Restrict reads to customer, item, and estimate IDs.
Require human approval for every estimate. Deny scheduled creation and preserve request IDs across retries.
Estimates remain Pending and unsent.
Keep the integration disabled by default. Add an owner enrollment command and Intuit/Vercel setup instructions.
Enrollment checks owner membership and the QuickBooks company before storing credentials.
Validation
bun run check-types: passes across all 13 tasks.bun run lint: passes, with existing repository warnings.bun run lint:slop: passes.Deployment boundary
Production remains disabled. The owner must complete live OAuth enrollment, sandbox verification, and production sign-off.
No live Intuit requests or external accounting writes were performed during development.
Intuit rotation and PostgreSQL cannot share a transaction. A crash between them requires token recovery or owner re-enrollment.
The setup guide documents this recovery path.
Summary by cubic
Adds a QuickBooks integration to the agent with durable OAuth refresh, realm-bound reads, and human-approved estimate drafts. Closes issue #228; no QuickBooks integration existed upstream, so this is net-new rather than a replacement.
Behavior
quickBooksConnectiontable, with a row lock serializing concurrent refreshes across instances.401triggers exactly one refresh and one replay; refresh, parse, or save failures stop the replay without further retries.Migration and rollout
QUICKBOOKS_ENCRYPTION_KEYenvironment variable; losing or changing it forces owner re-enrollment.Written for commit cbb786d. Summary will update on new commits.