Skip to content

Conversation

@michelle0927
Copy link
Collaborator

@michelle0927 michelle0927 commented Jul 31, 2025

Resolves #17625

Note: Will create follow-up PR for Quickbooks Sandbox after this is published.

Summary by CodeRabbit

  • New Features

    • Added a trigger for detecting when a new purchase is created in QuickBooks.
    • Added a trigger for detecting when a purchase is updated in QuickBooks.
  • Chores

    • Updated the QuickBooks integration package version to 0.7.0.

@vercel
Copy link

vercel bot commented Jul 31, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

3 Skipped Deployments
Name Status Preview Comments Updated (UTC)
docs-v2 ⬜️ Ignored (Inspect) Jul 31, 2025 3:05pm
pipedream-docs ⬜️ Ignored (Inspect) Jul 31, 2025 3:05pm
pipedream-docs-redirect-do-not-edit ⬜️ Ignored (Inspect) Jul 31, 2025 3:05pm

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jul 31, 2025

Walkthrough

This change introduces two new QuickBooks Online event source components: one for detecting when a new purchase is created and another for when a purchase is updated. Each source includes its own test event data and supporting logic. The package version is incremented to reflect these new features.

Changes

Cohort / File(s) Change Summary
QuickBooks Source: New Purchase Created
components/quickbooks/sources/new-purchase-created/new-purchase-created.mjs
Adds a new event source component for detecting newly created purchases in QuickBooks.
QuickBooks Source: New Purchase Created Test Event
components/quickbooks/sources/new-purchase-created/test-event.mjs
Adds a sample event payload for the "new purchase created" trigger.
QuickBooks Source: New Purchase Updated
components/quickbooks/sources/new-purchase-updated/new-purchase-updated.mjs
Adds a new event source component for detecting updates to purchases in QuickBooks.
QuickBooks Source: New Purchase Updated Test Event
components/quickbooks/sources/new-purchase-updated/test-event.mjs
Adds a sample event payload for the "new purchase updated" trigger.
Package Version Bump
components/quickbooks/package.json
Updates the package version from 0.6.1 to 0.7.0.

Sequence Diagram(s)

sequenceDiagram
    participant QBO as QuickBooks Online
    participant Source as QuickBooks Source Component
    participant User as User Workflow

    QBO->>Source: POST Purchase.create or Purchase.update event
    Source->>Source: Parse event, deduplicate, generate summary
    Source->>User: Emit event with purchase data and summary
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Assessment against linked issues

Objective Addressed Explanation
Implement QuickBooks triggers for Purchase.create and Purchase.update events (#17625)
Ensure event sources emit correct payloads for new purchase creation and updates (#17625)
Include logic to differentiate Purchase and Check by PaymentType field in event data (#17625)
Provide sample/test event data matching QuickBooks schema for both triggers (#17625)

Poem

A bunny hops with QuickBooks cheer,
New purchases and updates now appear!
Triggers leap at every change,
With payloads structured, never strange.
Version bumped, the code is neat—
Hop on workflows, skip to the beat!
🐇✨

Note

⚡️ Unit Test Generation is now available in beta!

Learn more here, or try it out under "Finishing Touches" below.


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between c168487 and b532c46.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (5)
  • components/quickbooks/package.json (1 hunks)
  • components/quickbooks/sources/new-purchase-created/new-purchase-created.mjs (1 hunks)
  • components/quickbooks/sources/new-purchase-created/test-event.mjs (1 hunks)
  • components/quickbooks/sources/new-purchase-updated/new-purchase-updated.mjs (1 hunks)
  • components/quickbooks/sources/new-purchase-updated/test-event.mjs (1 hunks)
🧰 Additional context used
🧠 Learnings (6)
📓 Common learnings
Learnt from: GTFalcao
PR: PipedreamHQ/pipedream#15376
File: components/monday/sources/name-updated/name-updated.mjs:6-6
Timestamp: 2025-01-23T03:55:15.166Z
Learning: Source names in Monday.com components don't need to start with "New" if they emit events for updated items (e.g., "Name Updated", "Column Value Updated") rather than new items. This follows the component guidelines exception where the "New" prefix is only required when emits are limited to new items.
📚 Learning: when developing pipedream components, do not add built-in node.js modules like `fs` to `package.json...
Learnt from: jcortes
PR: PipedreamHQ/pipedream#14935
File: components/sailpoint/package.json:15-18
Timestamp: 2024-12-12T19:23:09.039Z
Learning: When developing Pipedream components, do not add built-in Node.js modules like `fs` to `package.json` dependencies, as they are native modules provided by the Node.js runtime.

Applied to files:

  • components/quickbooks/package.json
📚 Learning: in `components/the_magic_drip/sources/common.mjs`, when processing items in `getandprocessdata`, `sa...
Learnt from: GTFalcao
PR: PipedreamHQ/pipedream#14265
File: components/the_magic_drip/sources/common.mjs:35-43
Timestamp: 2024-10-10T19:18:27.998Z
Learning: In `components/the_magic_drip/sources/common.mjs`, when processing items in `getAndProcessData`, `savedIds` is intentionally updated with IDs of both emitted and non-emitted items to avoid emitting retroactive events upon first deployment and ensure only new events are emitted as they occur.

Applied to files:

  • components/quickbooks/sources/new-purchase-created/test-event.mjs
  • components/quickbooks/sources/new-purchase-created/new-purchase-created.mjs
  • components/quickbooks/sources/new-purchase-updated/test-event.mjs
  • components/quickbooks/sources/new-purchase-updated/new-purchase-updated.mjs
📚 Learning: the `processtimerevent` method in the `components/salesforce_rest_api/sources/common.mjs` file is in...
Learnt from: GTFalcao
PR: PipedreamHQ/pipedream#12697
File: components/salesforce_rest_api/sources/common.mjs:97-98
Timestamp: 2024-07-24T02:05:59.531Z
Learning: The `processTimerEvent` method in the `components/salesforce_rest_api/sources/common.mjs` file is intentionally left unimplemented to enforce that subclasses must implement this method, similar to an abstract class in object-oriented programming.

Applied to files:

  • components/quickbooks/sources/new-purchase-created/test-event.mjs
📚 Learning: source names in monday.com components don't need to start with "new" if they emit events for updated...
Learnt from: GTFalcao
PR: PipedreamHQ/pipedream#15376
File: components/monday/sources/name-updated/name-updated.mjs:6-6
Timestamp: 2025-01-23T03:55:15.166Z
Learning: Source names in Monday.com components don't need to start with "New" if they emit events for updated items (e.g., "Name Updated", "Column Value Updated") rather than new items. This follows the component guidelines exception where the "New" prefix is only required when emits are limited to new items.

Applied to files:

  • components/quickbooks/sources/new-purchase-created/new-purchase-created.mjs
  • components/quickbooks/sources/new-purchase-updated/test-event.mjs
  • components/quickbooks/sources/new-purchase-updated/new-purchase-updated.mjs
📚 Learning: the `common-webhook-methods.mjs` object is designed to be extended, similar to an abstract class, an...
Learnt from: GTFalcao
PR: PipedreamHQ/pipedream#12697
File: components/salesforce_rest_api/sources/common-webhook-methods.mjs:1-71
Timestamp: 2024-10-08T15:33:38.240Z
Learning: The `common-webhook-methods.mjs` object is designed to be extended, similar to an abstract class, and intentionally does not implement certain methods like `generateWebhookMeta` and `getEventType` to enforce implementation in subclasses.

Applied to files:

  • components/quickbooks/sources/new-purchase-created/new-purchase-created.mjs
  • components/quickbooks/sources/new-purchase-updated/new-purchase-updated.mjs
🔇 Additional comments (11)
components/quickbooks/package.json (1)

3-3: LGTM! Appropriate version bump for new features.

The minor version bump from 0.6.1 to 0.7.0 correctly follows semantic versioning for the addition of new Purchase event source components.

components/quickbooks/sources/new-purchase-created/test-event.mjs (1)

1-55: LGTM! Well-structured test event for Purchase creation.

The test event properly represents a QuickBooks Purchase object with all necessary fields including PaymentType "Check" which aligns with the PR objectives. The matching CreateTime and LastUpdatedTime timestamps correctly simulate a newly created purchase.

components/quickbooks/sources/new-purchase-created/new-purchase-created.mjs (3)

6-7: Good naming convention for creation events.

The component name "New Purchase Created" correctly uses the "New" prefix for creation events, following Pipedream component guidelines.


20-22: LGTM! Appropriate summary format.

The summary message clearly identifies the event type and includes the Purchase ID for easy identification.


14-16: Verify QuickBooks API query syntax.

I didn’t find any matching query patterns elsewhere in the codebase, so please manually confirm that this query string aligns with the QuickBooks Online API requirements:

getQuery(lastDate) {
  return `select * from Purchase Where Metadata.CreateTime >= '${lastDate}' orderby Metadata.CreateTime desc`;
}

• Ensure the property name matches the QuickBooks schema (e.g. MetaData.CreateTime vs. Metadata.CreateTime)
• Verify the ORDERBY clause syntax and casing (should be ORDERBY, not orderby)
• Check for any additional required clauses (pagination, filtering) per the QuickBooks Online API docs

components/quickbooks/sources/new-purchase-updated/test-event.mjs (2)

30-32: Verify timezone consistency in test data.

The CreateTime uses "-07:00" timezone while LastUpdatedTime uses "-00:00" (UTC). Ensure this timezone difference is intentional or consider using consistent timezones for clearer test data.


1-55: LGTM! Appropriate test event for Purchase updates.

The test event correctly represents an updated Purchase with LastUpdatedTime being later than CreateTime, properly simulating an update scenario.

components/quickbooks/sources/new-purchase-updated/new-purchase-updated.mjs (4)

6-8: LGTM! Appropriate naming for update events.

The component name "New Purchase Updated" correctly indicates this source detects newly updated purchases, which aligns with the component's functionality.


14-16: LGTM! Correct query for update detection.

The query properly uses Metadata.LastUpdatedTime to filter for recently updated purchases, ordered by update time descending.


20-22: LGTM! Useful additional method for update tracking.

The getFieldDate() method correctly specifies "LastUpdatedTime" as the field to track, which likely helps the base class determine the appropriate timestamp field for this component.


23-25: LGTM! Clear summary for update events.

The summary message clearly distinguishes update events from creation events and includes the Purchase ID for identification.

✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch issue-17625

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai generate unit tests to generate unit tests for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@vunguyenhung vunguyenhung merged commit aa09fba into master Aug 1, 2025
11 checks passed
@vunguyenhung vunguyenhung deleted the issue-17625 branch August 1, 2025 04:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[TRIGGER] Quickbooks - Purchase created/Purchase updated

4 participants