feat(quickbooks): add procurement integration - #6061
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
PR SummaryMedium Risk Overview OAuth and configuration: Intuit OAuth is wired through auth, env ( Tools and block: About 20 tools cover generic CRUD, SQL-like query, financial reports, CDC ( Attachment upload: Multipart uploads go through Tests: Unit/route tests cover URL building, delete payload rules, upload auth and fault handling, and block param mapping. Reviewed by Cursor Bugbot for commit 117f122. Bugbot is set up for automated code reviews on this repo. Configure here. |
Greptile SummaryAdds QuickBooks Online OAuth, procurement-focused tools/block, upload-attachment API route, docs, and registry metadata.
Confidence Score: 5/5This PR appears safe to merge; prior review threads are resolved or accepted as intentional v1 tradeoffs. No blocking failure remains. Sandbox API host selection is implemented and tested; manual Company ID was accepted as a v1 constraint of the OAuth hook boundary.
|
| Filename | Overview |
|---|---|
| apps/sim/tools/quickbooks/utils.ts | Shared URL/query builders with production/sandbox host selection and validation. |
| apps/sim/blocks/blocks/quickbooks.ts | Block UI/ops mapping including required Company ID and advanced Environment selector. |
| apps/sim/lib/auth/auth.ts | QuickBooks genericOAuth provider and userinfo fetch; realmId left as manual Company ID for v1. |
| apps/sim/tools/quickbooks/quickbooks.test.ts | Covers sandbox host selection and invalid environment rejection. |
Sequence Diagram
sequenceDiagram
participant User
participant Block as QuickBooks Block
participant OAuth as OAuth / Better Auth
participant Tools as QuickBooks Tools
participant QBO as Intuit QBO API
User->>OAuth: Connect QuickBooks
OAuth->>QBO: OAuth2 authorize + token
OAuth-->>User: Stored credential
User->>Block: Operation + Company ID + Environment
Block->>Tools: Map params (realmId, apiEnvironment, ...)
Tools->>QBO: Request to prod or sandbox host
QBO-->>Tools: JSON / PDF / attachment
Tools-->>Block: Normalized tool output
Reviews (5): Last reviewed commit: "fix(quickbooks): validate attachment upl..." | 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 75579c9. Configure here.
|
@cursor review |
|
@cursor review |
|
@cursor review |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using high effort and found 2 potential issues.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 117f122. Configure here.
| Authorization: `Bearer ${accessToken}`, | ||
| Accept: 'application/json', | ||
| 'Content-Type': 'application/json', | ||
| } |
There was a problem hiding this comment.
Direct calls skip token sanitization
Medium Severity
The upload-attachment API rejects accessToken values containing CR/LF, but buildQuickBooksHeaders builds Authorization: Bearer … for every other QuickBooks tool without the same check, so header-breaking tokens blocked on upload can still reach direct Intuit requests.
Additional Locations (1)
Reviewed by Cursor Bugbot for commit 117f122. Configure here.
| record: extractQuickBooksRecord(data, entity), | ||
| entity, | ||
| time: typeof data.time === 'string' ? data.time : null, | ||
| }, |
There was a problem hiding this comment.
CRUD marks success without record
Medium Severity
After parseQuickBooksJson succeeds, create, get, and update tools always return success: true even when extractQuickBooksRecord yields no entity payload, so workflows can treat failed or empty Intuit bodies as completed operations.
Additional Locations (2)
Reviewed by Cursor Bugbot for commit 117f122. Configure here.


Summary
Type of Change
Testing
bun run scripts/generate-docs.tsbun run lintbun run test tools/quickbooks/quickbooks.test.ts lib/oauth/oauth.test.tsbun run type-checkbun run check:api-validation:strictbun run check:bare-iconsChecklist