-
Notifications
You must be signed in to change notification settings - Fork 5.5k
E_conomic - new components #18918
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
E_conomic - new components #18918
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. 2 Skipped Deployments
|
WalkthroughAdds 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
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
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes
Suggested reviewers
Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (3 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 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. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
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. Comment |
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: 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
⛔ Files ignored due to path filters (1)
pnpm-lock.yamlis 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
getPaginatedResourcesand 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.
|
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:
|
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
🧹 Nitpick comments (1)
components/e_conomic/actions/list-invoices/list-invoices.mjs (1)
38-43: Consider documenting available sort fields.The
sortprop 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
📒 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
listInvoicesmethod signature. The method explicitly destructurestypefrom the object parameter and captures remaining properties (includingparams) with spread syntax. The current code passestypeat the top level andparamsas a nested object, which is the expected pattern.The proposed refactoring in the review comment would actually break this code by moving
typeinsideparams, contradicting the method's signature.Error handling remains an optional enhancement if desired.
Likely an incorrect or invalid review comment.
|
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:
|
|
@vunguyenhung Re: List Invoices, are you sure you're testing with the latest version? The screenshot in the report shows "notDue" as |
|
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 🙏 |
|
Hi everyone, all test cases are passed! Ready for release! Test reports
|
|
/approve |
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