Skip to content

Conversation

@michelle0927
Copy link
Collaborator

@michelle0927 michelle0927 commented Oct 31, 2025

Resolves #18893

@vunguyenhung Note: I used the demo authentication to test, which only works for GET requests, so the POST requests are untested.

Summary by CodeRabbit

  • New Features
    • Book invoices to finalize them with optional EAN-based electronic delivery
    • Create and update customers with full contact, group, payment term and VAT support
    • Create draft invoices with multiple product line items and per-item quantities
    • Create vouchers for journal entries with flexible entry types and currency support
    • List and retrieve invoices with status filtering, sorting and pagination
    • Enhanced UI selects for customers, journals, products, layouts, currencies and more
  • Chores
    • Package version bumped to 0.1.0

@vercel
Copy link

vercel bot commented Oct 31, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

2 Skipped Deployments
Project Deployment Preview Comments Updated (UTC)
pipedream-docs Ignored Ignored Nov 3, 2025 4:00pm
pipedream-docs-redirect-do-not-edit Ignored Ignored Nov 3, 2025 4:00pm

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Oct 31, 2025

Walkthrough

Adds a new e-conomic app implementation with propDefinitions, request helpers, pagination, and six new action modules (book-invoice, create-customer, create-invoice, create-voucher, list-invoices, update-customer) that call the app methods to perform REST operations and export summaries and responses.

Changes

Cohort / File(s) Summary
App Core Methods & Prop Definitions
components/e_conomic/e_conomic.app.mjs
New app implementation: _baseUrl, _makeRequest, resource getters/listers (getCustomer, listCustomers, listJournals, listInvoices, listCurrencies, listCustomerGroups, listPaymentTerms, listVatZones, listLayouts, listProducts, listSuppliers), writers (createCustomer, updateCustomer, createDraftInvoice, bookInvoice, createVoucher), pagination helpers (paginate, getPaginatedResources) and expanded propDefinitions for remote-selects and customer fields.
Action: Book Invoice
components/e_conomic/actions/book-invoice/book-invoice.mjs
New action e_conomic-book-invoice exposing draftInvoiceNumber and sendByEan props; run() calls this.economic.bookInvoice(...), sets a success summary, and returns the API response.
Action: Create Customer
components/e_conomic/actions/create-customer/create-customer.mjs
New action e_conomic-create-customer with props mapped to customer fields (group, payment terms, vat zone, contact/address); run() builds payload and calls this.economic.createCustomer, sets a success summary, returns the response.
Action: Create Invoice
components/e_conomic/actions/create-invoice/create-invoice.mjs
New action e_conomic-create-invoice with invoice props and productNumbers dynamic additionalProps() generating per-product quantity fields; run() assembles lines and calls this.economic.createDraftInvoice. Contains a probable prop name typo recipientNmae vs recipientName.
Action: Create Voucher
components/e_conomic/actions/create-voucher/create-voucher.mjs
New action e_conomic-create-voucher with journal/year and multiple entry fields; run() composes voucher payload (entries: customerPayments, financeVouchers, manualCustomerInvoices, supplierInvoices, supplierPayments) and calls this.economic.createVoucher, sets a success summary, returns response.
Action: List Invoices
components/e_conomic/actions/list-invoices/list-invoices.mjs
New action e_conomic-list-invoices with invoiceType, maxResults, sort props; run() uses getPaginatedResources + economic.listInvoices to collect results, sets a summary, returns results.
Action: Update Customer
components/e_conomic/actions/update-customer/update-customer.mjs
New action e_conomic-update-customer that fetches existing customer, merges provided fields with existing values, calls this.economic.updateCustomer, sets a success summary, returns response.
Package Configuration
components/e_conomic/package.json
Version bump 0.0.40.1.0 and adds dependency "@pipedream/platform": "^3.1.0".

Sequence Diagram(s)

sequenceDiagram
    autonumber
    participant User
    participant Action
    participant App
    participant API as e-conomic API

    User->>Action: Trigger action with inputs
    activate Action
    Action->>Action: Validate & prepare payload
    Action->>App: Call app method (e.g., createCustomer / createDraftInvoice / bookInvoice / createVoucher / listInvoices)
    activate App
    App->>App: _makeRequest -> build HTTP request
    App->>API: HTTP request (GET/POST/PUT)
    activate API
    API-->>App: Response (data or error)
    deactivate API
    App-->>Action: Return response
    deactivate App
    Action->>Action: $.export("$summary", "Success message")
    Action-->>User: Return API response
    deactivate Action
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

  • Files/areas needing extra attention:
    • components/e_conomic/actions/create-invoice/create-invoice.mjs — probable typo recipientNmae vs recipientName and dynamic product quantity prop generation.
    • components/e_conomic/e_conomic.app.mjs — verify _makeRequest auth/token handling, endpoint paths, pagination correctness and response mappings.
    • components/e_conomic/actions/create-voucher/create-voucher.mjs — complex voucher payload and optional fields handling across multiple entry types.
    • Cross-file consistency: ensure actions call correct app methods and consistent success/error export behavior.

Suggested reviewers

  • luancazarine

Poem

🐇 I hopped through props and API streams,
Drafts and vouchers, and invoice dreams.
I stitched each endpoint, line by line,
Paginated hops — everything fine.
A little rabbit clap for this new e-conomic rhyme!

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Description check ⚠️ Warning The pull request description does not follow the required template structure. The repository template specifies a 'WHY' section to be completed by the author, but the provided description only includes the issue reference and a testing note. The description lacks essential context explaining why these new components are being added, what problems they solve, and the scope of changes being introduced. Update the pull request description to include the 'WHY' section explaining the motivation and rationale for adding these new e-conomic components. Additionally, provide a summary of the new actions being introduced (Create/Update Customer, Create/Send Invoice, Create Voucher, Get Open Invoices) and mention any known limitations or testing constraints upfront in a structured format.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The pull request title 'E_conomic - new components' clearly and concisely summarizes the primary change in the changeset. It accurately reflects that this PR introduces new components/actions for the Visma e-conomic integration, covering customer management, invoicing, and voucher creation functionality. The title is specific enough for teammates to understand the nature of the changes without being overly detailed.
Linked Issues check ✅ Passed The pull request successfully implements all coding requirements from the linked issue #18893. It provides components for Create/Update Customer (create-customer.mjs, update-customer.mjs), Create/Send Invoice (create-invoice.mjs, book-invoice.mjs), Create Voucher (create-voucher.mjs), and Get Open Invoices (list-invoices.mjs). The e_conomic.app.mjs file includes the necessary API integration methods, propDefinitions, and pagination support to enable these actions.
Out of Scope Changes check ✅ Passed All code changes are directly aligned with the requirements in linked issue #18893. The PR introduces five new action modules (book-invoice, create-customer, create-invoice, create-voucher, list-invoices), an updated app module with API integration methods, and a package.json version bump to 0.1.0. Each change supports the four requested action categories: customer management, invoice operations, voucher creation, and invoice listing. No unrelated modifications were introduced.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch issue-18893

📜 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 a43a812 and 750f5e5.

📒 Files selected for processing (1)
  • components/e_conomic/actions/list-invoices/list-invoices.mjs (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • components/e_conomic/actions/list-invoices/list-invoices.mjs
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
  • GitHub Check: Lint Code Base
  • GitHub Check: Publish TypeScript components
  • GitHub Check: Verify TypeScript components

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

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 4

🧹 Nitpick comments (1)
components/e_conomic/actions/create-customer/create-customer.mjs (1)

95-122: Consider filtering out undefined optional fields from the payload.

The payload includes optional fields (email, mobilePhone, website, ean, address, city, zip, country) even when they are undefined. Some APIs reject undefined values in request bodies. Consider filtering them out:

 async run({ $ }) {
+  const data = {
+    name: this.name,
+    currency: this.currency,
+    customerGroup: {
+      customerGroupNumber: this.customerGroupNumber,
+    },
+    paymentTerms: {
+      paymentTermsNumber: this.paymentTermNumber,
+    },
+    vatZone: {
+      vatZoneNumber: this.vatZoneNumber,
+    },
+  };
+
+  // Add optional fields only if provided
+  if (this.email) data.email = this.email;
+  if (this.mobilePhone) data.mobilePhone = this.mobilePhone;
+  if (this.website) data.website = this.website;
+  if (this.ean) data.ean = this.ean;
+  if (this.address) data.address = this.address;
+  if (this.city) data.city = this.city;
+  if (this.zip) data.zip = this.zip;
+  if (this.country) data.country = this.country;
+
   const response = await this.economic.createCustomer({
     $,
-    data: {
-      name: this.name,
-      currency: this.currency,
-      customerGroup: {
-        customerGroupNumber: this.customerGroupNumber,
-      },
-      paymentTerms: {
-        paymentTermsNumber: this.paymentTermNumber,
-      },
-      vatZone: {
-        vatZoneNumber: this.vatZoneNumber,
-      },
-      email: this.email,
-      mobilePhone: this.mobilePhone,
-      website: this.website,
-      ean: this.ean,
-      address: this.address,
-      city: this.city,
-      zip: this.zip,
-      country: this.country,
-    },
+    data,
   });
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 7b1b976 and 3ea006e.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (8)
  • components/e_conomic/actions/book-invoice/book-invoice.mjs (1 hunks)
  • components/e_conomic/actions/create-customer/create-customer.mjs (1 hunks)
  • components/e_conomic/actions/create-invoice/create-invoice.mjs (1 hunks)
  • components/e_conomic/actions/create-voucher/create-voucher.mjs (1 hunks)
  • components/e_conomic/actions/list-invoices/list-invoices.mjs (1 hunks)
  • components/e_conomic/actions/update-customer/update-customer.mjs (1 hunks)
  • components/e_conomic/e_conomic.app.mjs (1 hunks)
  • components/e_conomic/package.json (2 hunks)
🧰 Additional context used
🧠 Learnings (3)
📚 Learning: 2024-12-12T19:23:09.039Z
Learnt from: jcortes
Repo: PipedreamHQ/pipedream PR: 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/e_conomic/package.json
📚 Learning: 2024-10-30T15:24:39.294Z
Learnt from: jcortes
Repo: PipedreamHQ/pipedream PR: 14467
File: components/gainsight_px/actions/create-account/create-account.mjs:4-6
Timestamp: 2024-10-30T15:24:39.294Z
Learning: In `components/gainsight_px/actions/create-account/create-account.mjs`, the action name should be "Create Account" instead of "Create Memory".

Applied to files:

  • components/e_conomic/actions/create-customer/create-customer.mjs
📚 Learning: 2025-06-04T17:52:05.780Z
Learnt from: GTFalcao
Repo: PipedreamHQ/pipedream PR: 16954
File: components/salesloft/salesloft.app.mjs:14-23
Timestamp: 2025-06-04T17:52:05.780Z
Learning: In the Salesloft API integration (components/salesloft/salesloft.app.mjs), the _makeRequest method returns response.data which directly contains arrays for list endpoints like listPeople, listCadences, listUsers, and listAccounts. The propDefinitions correctly call .map() directly on these responses without needing to destructure a nested data property.

Applied to files:

  • components/e_conomic/e_conomic.app.mjs
🧬 Code graph analysis (7)
components/e_conomic/actions/book-invoice/book-invoice.mjs (1)
components/e_conomic/actions/create-invoice/create-invoice.mjs (1)
  • response (92-114)
components/e_conomic/actions/list-invoices/list-invoices.mjs (1)
components/e_conomic/e_conomic.app.mjs (1)
  • results (406-406)
components/e_conomic/actions/update-customer/update-customer.mjs (1)
components/e_conomic/actions/create-customer/create-customer.mjs (1)
  • response (96-119)
components/e_conomic/actions/create-voucher/create-voucher.mjs (3)
components/e_conomic/actions/book-invoice/book-invoice.mjs (1)
  • response (30-40)
components/e_conomic/actions/create-customer/create-customer.mjs (1)
  • response (96-119)
components/e_conomic/actions/create-invoice/create-invoice.mjs (1)
  • response (92-114)
components/e_conomic/actions/create-customer/create-customer.mjs (1)
components/e_conomic/actions/update-customer/update-customer.mjs (1)
  • response (111-141)
components/e_conomic/actions/create-invoice/create-invoice.mjs (2)
components/e_conomic/actions/book-invoice/book-invoice.mjs (1)
  • response (30-40)
components/e_conomic/actions/create-customer/create-customer.mjs (1)
  • response (96-119)
components/e_conomic/e_conomic.app.mjs (1)
components/e_conomic/actions/list-invoices/list-invoices.mjs (1)
  • results (46-55)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (4)
  • GitHub Check: pnpm publish
  • GitHub Check: Verify TypeScript components
  • GitHub Check: Publish TypeScript components
  • GitHub Check: Lint Code Base
🔇 Additional comments (4)
components/e_conomic/package.json (1)

3-16: LGTM!

The version bump and platform dependency addition are appropriate for the new features being introduced in this PR.

components/e_conomic/actions/list-invoices/list-invoices.mjs (1)

1-61: LGTM!

The action properly implements pagination using getPaginatedResources and provides a clear interface for listing invoices by type.

components/e_conomic/e_conomic.app.mjs (1)

1-411: LGTM!

The app file is well-structured with comprehensive API method coverage and proper pagination implementation. The propDefinitions correctly integrate with the list methods to provide dynamic UI options.

components/e_conomic/actions/book-invoice/book-invoice.mjs (1)

1-44: LGTM!

The action correctly implements the book invoice functionality with proper conditional handling of the sendBy field.

lcaresia
lcaresia previously approved these changes Nov 1, 2025
@vunguyenhung
Copy link
Collaborator

Hello everyone, I have tested this PR and there're some test cases failed or needed improvement.

Please check test reports below for more information:

Copy link
Contributor

@coderabbitai coderabbitai bot left a 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

🧹 Nitpick comments (1)
components/e_conomic/actions/list-invoices/list-invoices.mjs (1)

38-43: Consider documenting available sort fields.

The sort prop description could be enhanced by listing the available fields that users can sort by (e.g., date, dueDate, customerName). This would improve the developer experience.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 3ea006e and a43a812.

📒 Files selected for processing (1)
  • components/e_conomic/actions/list-invoices/list-invoices.mjs (1 hunks)
🧰 Additional context used
🧬 Code graph analysis (1)
components/e_conomic/actions/list-invoices/list-invoices.mjs (1)
components/e_conomic/e_conomic.app.mjs (1)
  • results (406-406)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (4)
  • GitHub Check: Lint Code Base
  • GitHub Check: pnpm publish
  • GitHub Check: Publish TypeScript components
  • GitHub Check: Verify TypeScript components
🔇 Additional comments (2)
components/e_conomic/actions/list-invoices/list-invoices.mjs (2)

1-13: LGTM!

The import and metadata structure follow Pipedream conventions. The annotations correctly indicate this is a read-only, non-destructive action.


45-60: Remove the args structure concern; it is correct as written. Consider error handling as optional.

The args structure is correct and matches the listInvoices method signature. The method explicitly destructures type from the object parameter and captures remaining properties (including params) with spread syntax. The current code passes type at the top level and params as a nested object, which is the expected pattern.

The proposed refactoring in the review comment would actually break this code by moving type inside params, contradicting the method's signature.

Error handling remains an optional enhancement if desired.

Likely an incorrect or invalid review comment.

@vunguyenhung
Copy link
Collaborator

Hello everyone, I have tested this PR and there're some test cases failed or needed improvement.

Please check test reports below for more information:

@michelle0927
Copy link
Collaborator Author

@vunguyenhung Re: List Invoices, are you sure you're testing with the latest version? The screenshot in the report shows "notDue" as invoiceType, but that's not an option in the latest version as it was changed to "not-due".

@vunguyenhung
Copy link
Collaborator

Hi @michelle0927, thank you for checking.

I think something wrong with my automation that it published the older version. I'll QA this again.

Sorry for any inconvenience 🙏

@vunguyenhung
Copy link
Collaborator

Hi everyone, all test cases are passed! Ready for release!

Test reports

@michelle0927
Copy link
Collaborator Author

/approve

@michelle0927 michelle0927 merged commit 1d006eb into master Nov 5, 2025
10 checks passed
@michelle0927 michelle0927 deleted the issue-18893 branch November 5, 2025 18:24
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.

[APP] Visma e-conomic

4 participants