feat(quickbooks): add read-only procurement integration - #6099
feat(quickbooks): add read-only procurement integration#6099BillLeoutsakosvl346 wants to merge 6 commits into
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
PR SummaryHigh Risk Overview OAuth and credentials are extended so one connected company is fixed at callback time: the auth route validates The PR introduces workflow tools and API routes beyond read-only lists—master data CRUD, sales and purchasing transactions (create/update/void where supported), accounting entries, financial reports, transaction email, PDF download, and attachment upload/download—with bounded file handling and SSRF-guarded attachment URLs in the document download path. Reviewed by Cursor Bugbot for commit 78c0b29. Bugbot is set up for automated code reviews on this repo. Configure here. |
Greptile SummaryAdds a QuickBooks Online integration with OAuth-bound company selection and generated documentation.
Confidence Score: 5/5The PR appears safe to merge with no eligible blocking failure identified in this follow-up review. No blocking failure remains within the scope of the available previous review threads.
|
| Filename | Overview |
|---|---|
| apps/sim/lib/oauth/quickbooks.ts | Adds QuickBooks OAuth profile resolution and company-bound account identifiers. |
| apps/sim/tools/quickbooks/client.ts | Centralizes QuickBooks environment selection, bounded API reads, and CompanyInfo validation. |
| apps/sim/tools/quickbooks/utils.ts | Adds shared request, pagination, response transformation, and Fault-handling utilities. |
| apps/sim/lib/internal/quickbooks/execute-tool.ts | Dispatches registered QuickBooks operations through the internal tool execution boundary. |
| apps/sim/lib/internal/quickbooks/provider-operations.ts | Implements provider-facing QuickBooks accounting operations. |
| apps/sim/lib/internal/tool-operations/registry.server.ts | Registers QuickBooks tool identifiers with the internal operation handler. |
| apps/sim/blocks/blocks/quickbooks.ts | Defines the QuickBooks workflow block and its supported actions. |
| apps/sim/app/api/auth/oauth/token/route.ts | Extends OAuth token resolution for QuickBooks credential metadata. |
| packages/sim-setup/src/capability-config.ts | Adds QuickBooks capability configuration to deployment setup. |
Sequence Diagram
sequenceDiagram
participant User
participant Sim as Sim Workflow
participant OAuth as OAuth Connection
participant Intuit as Intuit OAuth
participant QBO as QuickBooks API
User->>Sim: Connect QuickBooks company
Sim->>Intuit: OAuth authorization
Intuit-->>OAuth: Tokens and company identity
OAuth->>QBO: Validate CompanyInfo
QBO-->>OAuth: Bound company details
OAuth-->>Sim: Persist company-bound credential
User->>Sim: Run QuickBooks action
Sim->>OAuth: Resolve token and realm
Sim->>QBO: Execute bounded API request
QBO-->>Sim: Entity response or sanitized Fault
Sim-->>User: Structured tool output
Reviews (3): Last reviewed commit: "fix(quickbooks): migrate provider operat..." | Re-trigger Greptile
|
@cursor review |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit 33d9afb. Configure here.
|
@cursor review |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit 29bfcc5. Configure here.
|
@cursor review |
|
@cursor review |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit 19e00eb. Configure here.
|
@cursor review |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit 00fc671. Configure here.
|
@cursor review |
|
@cursor review |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit 970d3b1. Configure here.
QuickBooks codebase-standardization updateI simplified the QuickBooks implementation to follow Sim’s existing integration patterns and removed the shared infrastructure that had been introduced specifically for QuickBooks. What was removed
The cleanup removed substantially more code than it added:
No QuickBooks operations, block fields, OAuth scopes, endpoints, accounting behavior, or output contracts changed. Standard filesThese now follow the normal structure used by other Sim integrations:
The tools remain provider-local, generally with one file per operation and small shared QuickBooks utilities for sales, purchasing, accounting, reports, faults, and documents. Semi-standard filesThese use established Sim patterns needed by integrations with OAuth metadata, binary files, or structured provider errors. OAuth and company binding
QuickBooks now uses Better Auth’s standard Basic-auth token exchange and Sim’s normal refresh-lock behavior. The remaining provider-specific callback code is required because Intuit returns the selected company’s The credential-derived Binary documents and attachments
These routes follow the established file-backed integration pattern. They are needed for workspace-file authorization, binary size limits, secure downloads, and conversion to Sim Structured faults and operational tokens
QuickBooks faults use Sim’s existing extractor registry. Unique infrastructureNone. QuickBooks no longer introduces a custom shared framework or QuickBooks-only platform architecture. Its remaining nonstandard requirements are implemented through patterns already used by comparable integrations. Validation
Cleanup commit: |
|
@cursor review |
1 similar comment
|
@cursor review |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit 78c0b29. Configure here.
78c0b29 to
48e7dbc
Compare
48e7dbc to
006afcb
Compare
ffa7acb to
be3ffc5
Compare
be3ffc5 to
80b3121
Compare
80b3121 to
2405a19
Compare
Summary
Adds a clean, read-only QuickBooks Online procurement integration with one OAuth connection bound to one selected QuickBooks company.
realmIdto the validated OAuth credential, so workflows cannot choose or override a company.Review fixes included
Validation
bunx vitest run tools/index.test.ts tools/quickbooks lib/oauth/quickbooks.test.ts lib/oauth/oauth.test.ts lib/oauth/utils.test.ts app/api/auth/oauth/token/route.test.ts blocks/blocks.test.ts— 8 files, 387 tests passed.bun run type-check— 23/23 monorepo tasks passed.bun run lint:check— passed; only two pre-existing Biome false-positive warnings on terminalfit()method calls.bun run generate-docs— passed.bun run check:bare-icons— passed.bun run check:icon-paths— passed.bun run check:api-validation— passed.git diff --check origin/staging...HEAD— passed.READY FOR DRAFT PR.Manual sandbox acceptance still required
This PR remains a draft until a live Intuit sandbox confirms UserInfo
realmIddelivery and the full acceptance flow: CompanyInfo identity matching, all four actions, explicit page continuation, empty pages, two-company isolation, reconnect behavior, refresh-token rotation, revoked-credential guidance, and sandbox-host isolation. No credentials or unsanitized accounting data are committed.