-
Notifications
You must be signed in to change notification settings - Fork 5.4k
Quickbooks Create Purchase Order Updates #17090
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Quickbooks Create Purchase Order Updates #17090
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 3 Skipped Deployments
|
WalkthroughThis update primarily increments version numbers across a wide range of QuickBooks action and source components. Additionally, the "Create Purchase Order" action and a shared utility function were refactored to simplify line item detail handling, restrict selectable accounts and items, and remove certain validation logic. Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant CreatePurchaseOrderAction
participant QuickBooksAPI
User->>CreatePurchaseOrderAction: Configure purchase order
CreatePurchaseOrderAction->>QuickBooksAPI: Fetch accounts (Liability, AccountsPayable)
QuickBooksAPI-->>CreatePurchaseOrderAction: Return filtered accounts
CreatePurchaseOrderAction->>QuickBooksAPI: Fetch items with ExpenseAccountRef
QuickBooksAPI-->>CreatePurchaseOrderAction: Return filtered items
CreatePurchaseOrderAction->>QuickBooksAPI: Create purchase order (all line items use ItemBasedExpenseLineDetail)
QuickBooksAPI-->>CreatePurchaseOrderAction: Confirmation/response
CreatePurchaseOrderAction-->>User: Result
Suggested labels
Poem
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 ESLint
components/quickbooks/actions/create-purchase-order/create-purchase-order.mjsOops! Something went wrong! :( ESLint: 8.57.1 Error [ERR_MODULE_NOT_FOUND]: Cannot find package 'jsonc-eslint-parser' imported from /eslint.config.mjs 📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
⏰ Context from checks skipped due to timeout of 90000ms (3)
✨ Finishing Touches
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed 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)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
🔭 Outside diff range comments (1)
components/quickbooks/common/utils.mjs (1)
176-201
: 🛠️ Refactor suggestionHard-coding
detailType
+ leftover branching adds dead code & complexity
detailType
is now always"ItemBasedExpenseLineDetail"
, yet the subsequentisItemBased
/detailPropertyName
/refPropertyName
logic still branches as if two paths existed.
This:
- Introduces dead code that will never execute the “AccountBased…” path.
- Makes reading harder because future maintainers must mentally evaluate the constant to realise only one path is viable.
Consider collapsing the logic to the minimal shape and removing the unused “AccountBased” references:
-const detailType = "ItemBasedExpenseLineDetail"; -const isItemBased = detailType === "ItemBasedExpenseLineDetail"; -const detailPropertyName = isItemBased ? "ItemBasedExpenseLineDetail" : "AccountBasedExpenseLineDetail"; -const refPropertyName = isItemBased ? "ItemRef" : "AccountRef"; +const detailPropertyName = "ItemBasedExpenseLineDetail"; +const refPropertyName = "ItemRef";…and update the
lineItem
construction accordingly.If future requirements demand supporting Account-based lines again, re-introduce the branching through an explicit prop instead of leaving dormant code.
🧹 Nitpick comments (1)
components/quickbooks/actions/create-purchase-order/create-purchase-order.mjs (1)
132-148
: Filtering null options: simplify & avoid accidental sparse arrays
getPropOptions
already returns an array; the current pattern builds an array containingnull
entries and then filters them out:const options = await ...; // returns [] return options.filter((option) => option !== null);Instead, return only the valid items directly from the mapper:
-return options.filter((option) => option !== null); +return options;and inside the mapper:
-}) => { - if (ExpenseAccountRef) { - return { value, label }; - } - return null; -}, +}) => ExpenseAccountRef ? { value, label } : null,Alternatively, use
flatMap
to dropnull
s in one pass.This tiny cleanup reduces allocations & keeps the intent clear.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (48)
components/quickbooks/actions/create-ap-aging-report/create-ap-aging-report.mjs
(1 hunks)components/quickbooks/actions/create-bill/create-bill.mjs
(1 hunks)components/quickbooks/actions/create-customer/create-customer.mjs
(1 hunks)components/quickbooks/actions/create-estimate/create-estimate.mjs
(1 hunks)components/quickbooks/actions/create-invoice/create-invoice.mjs
(1 hunks)components/quickbooks/actions/create-payment/create-payment.mjs
(1 hunks)components/quickbooks/actions/create-pl-report/create-pl-report.mjs
(1 hunks)components/quickbooks/actions/create-purchase-order/create-purchase-order.mjs
(3 hunks)components/quickbooks/actions/create-purchase/create-purchase.mjs
(1 hunks)components/quickbooks/actions/create-sales-receipt/create-sales-receipt.mjs
(1 hunks)components/quickbooks/actions/delete-purchase/delete-purchase.mjs
(1 hunks)components/quickbooks/actions/get-bill/get-bill.mjs
(1 hunks)components/quickbooks/actions/get-customer/get-customer.mjs
(1 hunks)components/quickbooks/actions/get-invoice/get-invoice.mjs
(1 hunks)components/quickbooks/actions/get-my-company/get-my-company.mjs
(1 hunks)components/quickbooks/actions/get-payment/get-payment.mjs
(1 hunks)components/quickbooks/actions/get-purchase-order/get-purchase-order.mjs
(1 hunks)components/quickbooks/actions/get-purchase/get-purchase.mjs
(1 hunks)components/quickbooks/actions/get-sales-receipt/get-sales-receipt.mjs
(1 hunks)components/quickbooks/actions/get-time-activity/get-time-activity.mjs
(1 hunks)components/quickbooks/actions/search-accounts/search-accounts.mjs
(1 hunks)components/quickbooks/actions/search-customers/search-customers.mjs
(1 hunks)components/quickbooks/actions/search-invoices/search-invoices.mjs
(1 hunks)components/quickbooks/actions/search-items/search-items.mjs
(1 hunks)components/quickbooks/actions/search-products/search-products.mjs
(1 hunks)components/quickbooks/actions/search-purchases/search-purchases.mjs
(1 hunks)components/quickbooks/actions/search-query/search-query.mjs
(1 hunks)components/quickbooks/actions/search-services/search-services.mjs
(1 hunks)components/quickbooks/actions/search-time-activities/search-time-activities.mjs
(1 hunks)components/quickbooks/actions/search-vendors/search-vendors.mjs
(1 hunks)components/quickbooks/actions/send-estimate/send-estimate.mjs
(1 hunks)components/quickbooks/actions/send-invoice/send-invoice.mjs
(1 hunks)components/quickbooks/actions/sparse-update-invoice/sparse-update-invoice.mjs
(1 hunks)components/quickbooks/actions/update-customer/update-customer.mjs
(1 hunks)components/quickbooks/actions/update-estimate/update-estimate.mjs
(1 hunks)components/quickbooks/actions/update-invoice/update-invoice.mjs
(1 hunks)components/quickbooks/actions/update-item/update-item.mjs
(1 hunks)components/quickbooks/actions/void-invoice/void-invoice.mjs
(1 hunks)components/quickbooks/common/utils.mjs
(1 hunks)components/quickbooks/package.json
(1 hunks)components/quickbooks/sources/new-customer-created/new-customer-created.mjs
(1 hunks)components/quickbooks/sources/new-customer-updated/new-customer-updated.mjs
(1 hunks)components/quickbooks/sources/new-employee-created/new-employee-created.mjs
(1 hunks)components/quickbooks/sources/new-employee-updated/new-employee-updated.mjs
(1 hunks)components/quickbooks/sources/new-invoice-created/new-invoice-created.mjs
(1 hunks)components/quickbooks/sources/new-invoice-updated/new-invoice-updated.mjs
(1 hunks)components/quickbooks/sources/new-item-created/new-item-created.mjs
(1 hunks)components/quickbooks/sources/new-item-updated/new-item-updated.mjs
(1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (3)
- GitHub Check: Publish TypeScript components
- GitHub Check: Verify TypeScript components
- GitHub Check: Lint Code Base
🔇 Additional comments (47)
components/quickbooks/actions/search-items/search-items.mjs (1)
8-8
: Version bump only
The version has been updated from"0.1.9"
to"0.1.10"
to align with the coordinated release. No functional changes detected.components/quickbooks/actions/send-estimate/send-estimate.mjs (1)
7-7
: Increment action version
Bumped version to 0.0.2 to align with other QuickBooks components. No functional or logical changes introduced.components/quickbooks/actions/send-invoice/send-invoice.mjs (1)
7-7
: Bump action version
Version updated from0.0.1
to0.0.2
to align with the coordinated QuickBooks action version increments.components/quickbooks/actions/search-vendors/search-vendors.mjs (1)
8-8
: Version bump to 0.1.10
This increment aligns with the coordinated version updates across QuickBooks actions in this PR. No functional or behavioral changes introduced.components/quickbooks/actions/search-accounts/search-accounts.mjs (1)
8-8
: Version bump is correct and consistent
Patched version incremented from “0.2.9” to “0.2.10” aligns with the release pattern for QuickBooks actions. No functional changes introduced here.components/quickbooks/sources/new-item-updated/new-item-updated.mjs (1)
9-9
: Approve version bump to 0.0.7
The version increment aligns with the QA updates and matches the pattern used across other QuickBooks source components.components/quickbooks/actions/get-purchase/get-purchase.mjs (1)
8-8
: Version bump approved. The version has been updated to "0.1.10" with no functional changes.components/quickbooks/actions/get-customer/get-customer.mjs (1)
8-8
: Approve version bump to 0.3.10
This update aligns with the version increments across QuickBooks actions in this PR and introduces no functional changes.components/quickbooks/actions/update-estimate/update-estimate.mjs (1)
12-12
: Consistent version increment
The version string has been correctly updated from "0.0.1" to "0.0.2" to align with other QuickBooks actions. No functional changes introduced.components/quickbooks/sources/new-invoice-created/new-invoice-created.mjs (1)
9-9
: Approve version bump to 0.0.7Version number increment aligns with the rest of the QuickBooks components in this PR. No functional changes detected.
components/quickbooks/actions/search-services/search-services.mjs (1)
8-8
: Version bump is correct and consistent.The action’s version has been updated from
0.0.3
to0.0.4
with no other changes, aligning with the broader QuickBooks component version updates.components/quickbooks/actions/get-payment/get-payment.mjs (1)
8-8
: Version bump is appropriate.The action version was updated from "0.0.3" to "0.0.4" without any functional changes, aligning with the coordinated version updates across QuickBooks components.
components/quickbooks/actions/search-invoices/search-invoices.mjs (1)
8-8
: Version bump: update to 0.0.4
Aligns with the overall QuickBooks component versioning strategy. No logic changes introduced.components/quickbooks/actions/get-bill/get-bill.mjs (1)
8-8
: Component version bump
Updated version from “0.1.9” to “0.1.10” to align with other QuickBooks action components. No functional changes.components/quickbooks/sources/new-item-created/new-item-created.mjs (1)
9-9
: Approve version bump
The version number has been correctly updated to reflect the new release.components/quickbooks/actions/update-invoice/update-invoice.mjs (1)
12-12
: Consistent version bump. Version updated from0.0.1
to0.0.2
to align with the broader QuickBooks action versioning update.components/quickbooks/actions/sparse-update-invoice/sparse-update-invoice.mjs (1)
9-9
: Approve version bump
The version string has been correctly incremented to "0.1.8" to align with the PR’s QA updates.components/quickbooks/actions/create-sales-receipt/create-sales-receipt.mjs (1)
9-9
: Approve version bump to 0.0.9.The action’s version was correctly incremented to remain consistent with the coordinated QuickBooks component updates. No functional changes detected.
components/quickbooks/actions/get-purchase-order/get-purchase-order.mjs (1)
8-8
: Patch version bump looks good.
The action’s version has been updated from0.1.9
to0.1.10
, matching the patch-level increments applied across other QuickBooks components in this PR.components/quickbooks/actions/create-payment/create-payment.mjs (1)
7-7
: Consistent version bump to 0.0.9
The version increment aligns with the pattern used across QuickBooks action components.components/quickbooks/actions/create-pl-report/create-pl-report.mjs (1)
10-10
: Version bump from 0.0.4 to 0.0.5
This change aligns the action’s version with the coordinated QuickBooks release updates. No functional or behavioral changes detected.components/quickbooks/actions/create-estimate/create-estimate.mjs (1)
12-12
: Version bump to 0.0.2: Incremented the action’s version string. Confirm that this update is reflected in your release artifacts (CHANGELOG, CI pipelines, etc.) to keep documentation and automation in sync.components/quickbooks/sources/new-customer-created/new-customer-created.mjs (1)
9-9
: Approve version bump
The patch-level version has been correctly incremented from0.0.6
to0.0.7
, matching the coordinated updates across QuickBooks components. No functional changes were made.components/quickbooks/actions/get-my-company/get-my-company.mjs (1)
7-7
: Bump action version
The version has been correctly incremented from0.1.9
to0.1.10
to align with the coordinated QuickBooks component updates. No functional changes detected.components/quickbooks/actions/update-customer/update-customer.mjs (1)
8-8
: Version bump is consistent
The version update from0.1.9
to0.1.10
aligns with other QuickBooks action components in this PR. No functional changes detected.components/quickbooks/actions/search-time-activities/search-time-activities.mjs (1)
8-8
: Approve patch version bumpThe version update from
0.1.9
to0.1.10
correctly aligns this action with the coordinated QuickBooks release.components/quickbooks/actions/create-bill/create-bill.mjs (1)
9-9
: Version bump looks good: Updated from0.1.9
to0.1.10
, consistent with the coordinated version increments across QuickBooks actions in this PR.components/quickbooks/actions/search-customers/search-customers.mjs (1)
8-8
: Version bump approved.The version has been correctly incremented from
0.1.9
to0.1.10
following the established minor-release pattern. No other logic changes were introduced in this file.components/quickbooks/actions/update-item/update-item.mjs (1)
8-8
: Version bump aligned with other QuickBooks components.The version has been correctly updated from
"0.0.3"
to"0.0.4"
to include the QA-requested fixes. Ensure any related changelog or release notes are updated to reflect this change.components/quickbooks/sources/new-employee-updated/new-employee-updated.mjs (1)
9-9
: Bump component version
Version increment from0.0.4
to0.0.5
is consistent with the batch update across QuickBooks sources. No functional changes detected.components/quickbooks/actions/search-query/search-query.mjs (1)
8-8
: Version bump to 0.1.10 is correct
This patch version increment aligns with the other QuickBooks action components in this PR and introduces no functional changes.components/quickbooks/actions/get-sales-receipt/get-sales-receipt.mjs (1)
8-8
: Consistent version bump to 0.1.10The version update aligns with the coordinated version increments across QuickBooks actions and introduces no functional changes.
components/quickbooks/actions/get-time-activity/get-time-activity.mjs (1)
8-8
: Patch Version Bump
Updating the version from “0.1.9” to “0.1.10” aligns with the patch increments applied across other QuickBooks actions in this PR.components/quickbooks/actions/void-invoice/void-invoice.mjs (1)
8-8
: Version bump approved.
Updating from0.0.1
to0.0.2
with no functional changes aligns with the rest of the QuickBooks action components in this PR.components/quickbooks/sources/new-employee-created/new-employee-created.mjs (1)
9-9
:✅ Verification successful
Version bump to 0.0.5
The version has been updated in alignment with the coordinated QuickBooks integration release. Ensure that this increment is consistently applied across all related QuickBooks components and that your changelog or release notes reflect the new version.Run the following script to verify consistency across sources:
🏁 Script executed:
#!/bin/bash # Verify all QuickBooks source components are bumped to version 0.0.5 rg 'version: "0\.0\.5"' -n components/quickbooks/sourcesLength of output: 254
Version bump to 0.0.5 confirmed across QuickBooks source components
Both QuickBooks source modules incomponents/quickbooks/sources
are now at version 0.0.5:
new-employee-created/new-employee-created.mjs
(line 9)new-employee-updated/new-employee-updated.mjs
(line 9)• Please ensure your changelog or release notes reflect this release.
components/quickbooks/actions/create-customer/create-customer.mjs (1)
8-8
: Version bump to 0.1.10 is correct. Aligns with the coordinated semver update across QuickBooks actions in this PR.components/quickbooks/actions/get-invoice/get-invoice.mjs (1)
8-8
: Version bump to 0.2.11 is correct. Consistent with other QuickBooks action components’ minor version increments.components/quickbooks/actions/create-ap-aging-report/create-ap-aging-report.mjs (1)
8-8
: Version bump to 0.0.5 is correct. Matches the semver pattern applied across all QuickBooks actions.components/quickbooks/actions/search-products/search-products.mjs (1)
8-8
: Version bump to 0.1.10 is correct. Keeps consistency with coordinated version updates in this PR.components/quickbooks/actions/search-purchases/search-purchases.mjs (1)
7-7
: Version bump to 0.0.8 is correct. Aligns with the batch version updates across QuickBooks integrations.components/quickbooks/sources/new-invoice-updated/new-invoice-updated.mjs (1)
9-9
: Approve version bump to 0.0.7
Consistent with the coordinated version updates across QuickBooks components in this PR.components/quickbooks/sources/new-customer-updated/new-customer-updated.mjs (1)
9-9
: Approve version bump to 0.0.7
Matches the overall QuickBooks package version alignment in this release.components/quickbooks/actions/delete-purchase/delete-purchase.mjs (1)
7-7
: Approve version bump to 0.0.8
Version increment aligns with the coordinated release updates for action components.components/quickbooks/package.json (1)
3-3
: Approve package version bump to 0.6.1
This matches the individual component version increments and prepares for release.components/quickbooks/actions/create-purchase/create-purchase.mjs (1)
9-9
: Approve version bump to 0.0.8
Consistent with the rest of the QuickBooks actions in this PR.components/quickbooks/actions/create-invoice/create-invoice.mjs (1)
9-9
: Version bump is fine, but keep cross-file consistency in mindThe action’s version is incremented to
0.2.4
, which is correct. Double-check that:
components/quickbooks/package.json
was also bumped (looks like it was).- Any downstream references (workflows, docs) that pin the previous version are updated.
No other concerns here.
components/quickbooks/actions/create-purchase-order/create-purchase-order.mjs (1)
114-115
: Prop description must match implementationThe description now states
DetailType
is alwaysItemBasedExpenseLineDetail
, which aligns withutils.mjs
. Good catch.
Ensure examples in docs/tests were updated accordingly so users don’t attempt to send other detail types.
components/quickbooks/actions/create-purchase-order/create-purchase-order.mjs
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @michelle0927, LGTM! Ready for QA!
Hi everyone, all test cases are passed! Ready for release! Test report |
QA requested updates for (#17078) that were missed in the original issue (#16906).
Once this is tested and published, I'll continue with the Quickbooks Sandbox followup PR (#17078).
Summary by CodeRabbit
New Features
Other Changes