- 
                Notifications
    
You must be signed in to change notification settings  - Fork 5.5k
 
Quickbooks - additional fields #15793
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 - additional fields #15793
Conversation
| 
           The latest updates on your projects. Learn more about Vercel for Git ↗︎  | 
    
          
WalkthroughThe changes update the invoice creation process by modifying the payload structure in the invoice creation action. A new optional property,  Changes
 Sequence Diagram(s)sequenceDiagram
    participant Client
    participant InvoiceAction
    participant QuickbooksAPI
    Client->>InvoiceAction: Submit invoice creation request with billEmail, allowOnlineCreditCardPayment, allowOnlineACHPayment
    InvoiceAction->>QuickbooksAPI: Send updated data object with new parameters
    QuickbooksAPI-->>InvoiceAction: Return confirmation response
    InvoiceAction-->>Client: Deliver invoice creation confirmation
    Suggested labels
 Suggested reviewers
 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-invoice/create-invoice.mjsOops! Something went wrong! :( ESLint: 8.57.1 Error [ERR_MODULE_NOT_FOUND]: Cannot find package 'jsonc-eslint-parser' imported from /eslint.config.mjs ✨ Finishing Touches
 Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit: 
 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: 0
🧹 Nitpick comments (1)
components/quickbooks/actions/create-invoice/create-invoice.mjs (1)
143-148: Consider adding email format validation.While the billEmail implementation works as expected, consider adding basic email format validation to prevent potential issues with invalid email addresses.
if (this.billEmail) { + // Simple regex for basic email validation + const emailRegex = /^[^\s@]+@[^\s@]+\.[^\s@]+$/; + if (!emailRegex.test(this.billEmail)) { + throw new ConfigurationError("Invalid email format for billEmail"); + } params.include = "invoiceLink"; data.BillEmail = { Address: this.billEmail, }; }
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
components/quickbooks/actions/create-invoice/create-invoice.mjs(3 hunks)components/quickbooks/package.json(1 hunks)
✅ Files skipped from review due to trivial changes (1)
- components/quickbooks/package.json
 
⏰ Context from checks skipped due to timeout of 90000ms (4)
- GitHub Check: pnpm publish
 - GitHub Check: Verify TypeScript components
 - GitHub Check: Publish TypeScript components
 - GitHub Check: Lint Code Base
 
🔇 Additional comments (8)
components/quickbooks/actions/create-invoice/create-invoice.mjs (8)
9-9: Version increment looks appropriate.The version has been updated from 0.2.0 to 0.2.1, which is appropriate for the feature enhancements made in this PR.
19-24: Good addition of the billEmail property.This new optional field allows users to specify an email address where the invoice should be sent, enhancing the functionality of the component.
31-36: Property name change improves clarity.Renaming from
includeInvoiceLinktoallowOnlineCreditCardPaymentbetter describes the actual purpose of this property, making the API more intuitive and aligned with QuickBooks terminology.
37-42: Valuable addition of ACH payment option.Adding support for online bank transfer payments enhances the component's flexibility, giving users more payment configuration options when creating invoices.
43-48: Proper placement of currencyRefValue.The currencyRefValue property has been relocated to a more logical position in the props list and maintains its original functionality.
132-141: Cleaner data structure with improved payment options.The refactored data structure is more concise and properly includes the new payment options. The direct assignment of values provides a cleaner implementation compared to the previous approach.
149-153: Good conditional handling of currency reference.The conditional addition of CurrencyRef to the data object ensures it's only included when a value is provided, preventing undefined values in the request.
157-158: Simplified parameter passing.The streamlined approach to passing parameters to createInvoice() is cleaner and easier to maintain.
WHY
Summary by CodeRabbit
New Features
Chores