Skip to content
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

New Components - _1crm #12843

Merged
merged 7 commits into from
Jul 29, 2024
Merged

New Components - _1crm #12843

merged 7 commits into from
Jul 29, 2024

Conversation

luancazarine
Copy link
Collaborator

@luancazarine luancazarine commented Jul 15, 2024

Resolves #12758.

Summary by CodeRabbit

  • New Features

    • Introduced enhanced functionalities for interacting with 1CRM, including creating, updating, and managing contacts, leads, accounts, and invoices.
    • Added new methods for handling webhooks and making API requests.
    • Implemented modules for real-time data interaction, such as new or updated accounts, invoices, and leads.
  • Improvements

    • Updated the 1CRM app to version 0.1.0.
    • Added a new constant LIMIT = 100 to manage data retrieval limits.
  • Dependencies

    • Added @pipedream/platform as a new dependency.

@luancazarine luancazarine added the ai-assisted Content generated by AI, with human refinement and modification label Jul 15, 2024
Copy link
Contributor

coderabbitai bot commented Jul 15, 2024

Walkthrough

The changes significantly enhance the functionality of the _1crm app, introducing new properties and methods for API interactions, CRUD operations, and webhook management. New files define actions for creating and updating contacts and leads, while additional sources handle events related to accounts, invoices, and leads, streamlining data handling and processing within the app.

Changes

File Path Change Summary
components/_1crm/_1crm.app.mjs Added imports for axios and LIMIT, new properties, and methods for API requests, model manipulation, and webhook management.
components/_1crm/actions/common/base.mjs Introduced properties and methods for handling CRUD operations in the CRM system.
components/_1crm/actions/create-contact/create-contact.mjs Defined an action for creating contacts in the 1CRM system.
components/_1crm/actions/create-lead/create-lead.mjs Defined a module for creating leads in 1CRM.
components/_1crm/actions/update-contact/update-contact.mjs Introduced an action for updating contacts in the 1CRM system.
components/_1crm/actions/update-lead/update-lead.mjs Introduced an action for updating leads in 1CRM.
components/_1crm/common/constants.mjs Added a constant LIMIT set to 100.
components/_1crm/package.json Updated version to 0.1.0 and added a dependency on @pipedream/platform.
components/_1crm/sources/common/base.mjs Introduced properties for managing webhook IDs and processing incoming data to emit events.
components/_1crm/sources/...account-instant/new-or-updated-account-instant.mjs Defined a source for handling new or updated account events.
components/_1crm/sources/...account-instant/test-event.mjs Defined a data structure for storing account information.
components/_1crm/sources/...invoice-instant/new-or-updated-invoice-instant.mjs Defined a source for handling new or updated invoice events.
components/_1crm/sources/...invoice-instant/test-event.mjs Defined a data structure for storing invoice information.
components/_1crm/sources/...lead-instant/new-or-updated-lead-instant.mjs Defined a source for handling new or updated lead events.
components/_1crm/sources/...lead-instant/test-event.mjs Defined a data structure for storing lead information.

Assessment against linked issues

Objective Addressed Explanation
Create contact action (###12758)
Update contact action (###12758)
Create lead action (###12758)
Update lead action (###12758)
Webhook sources for account, invoice, lead (###12758)

Poem

In the world of CRM, data flows anew,
Contacts and leads, with just a few cues.
Webhooks dance with an instant spark,
Accounts and invoices leave a mark.
The rabbit smiles, the code's just right,
A 1CRM app shining bright! 🌟🐇


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?

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>.
    • Generate unit testing code for this file.
    • 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 generate unit testing code for this file.
    • @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 generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @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.

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 as 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 resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

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.

Copy link

vercel bot commented Jul 15, 2024

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) Visit Preview Jul 24, 2024 3:22pm
pipedream-docs ⬜️ Ignored (Inspect) Jul 24, 2024 3:22pm
pipedream-docs-redirect-do-not-edit ⬜️ Ignored (Inspect) Jul 24, 2024 3:22pm

Sources
 - New Or Updated Account (Instant)
 - New Or Updated Invoice (Instant)
 - New Or Updated Lead (Instant)

Actions
 - Create Contact
 - Update Contact
 - Create Load
 - Update Load
@luancazarine luancazarine marked this pull request as ready for review July 18, 2024 12:51
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: 0

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 5f95b69 and 7015c83.

Files ignored due to path filters (2)
  • components/_1crm/yarn.lock is excluded by !**/yarn.lock, !**/*.lock
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
Files selected for processing (15)
  • components/_1crm/_1crm.app.mjs (1 hunks)
  • components/_1crm/actions/common/base.mjs (1 hunks)
  • components/_1crm/actions/create-contact/create-contact.mjs (1 hunks)
  • components/_1crm/actions/create-lead/create-lead.mjs (1 hunks)
  • components/_1crm/actions/update-contact/update-contact.mjs (1 hunks)
  • components/_1crm/actions/update-lead/update-lead.mjs (1 hunks)
  • components/_1crm/common/constants.mjs (1 hunks)
  • components/_1crm/package.json (2 hunks)
  • components/_1crm/sources/common/base.mjs (1 hunks)
  • components/_1crm/sources/new-or-updated-account-instant/new-or-updated-account-instant.mjs (1 hunks)
  • components/_1crm/sources/new-or-updated-account-instant/test-event.mjs (1 hunks)
  • components/_1crm/sources/new-or-updated-invoice-instant/new-or-updated-invoice-instant.mjs (1 hunks)
  • components/_1crm/sources/new-or-updated-invoice-instant/test-event.mjs (1 hunks)
  • components/_1crm/sources/new-or-updated-lead-instant/new-or-updated-lead-instant.mjs (1 hunks)
  • components/_1crm/sources/new-or-updated-lead-instant/test-event.mjs (1 hunks)
Files skipped from review due to trivial changes (4)
  • components/_1crm/common/constants.mjs
  • components/_1crm/sources/new-or-updated-account-instant/test-event.mjs
  • components/_1crm/sources/new-or-updated-invoice-instant/test-event.mjs
  • components/_1crm/sources/new-or-updated-lead-instant/test-event.mjs
Additional context used
Biome
components/_1crm/actions/common/base.mjs

[error] 40-40: The assignment should not be in an expression.

The use of assignments in expressions is confusing.
Expressions are often considered as side-effect free.

(lint/suspicious/noAssignInExpressions)


[error] 44-48: The assignment should not be in an expression.

The use of assignments in expressions is confusing.
Expressions are often considered as side-effect free.

(lint/suspicious/noAssignInExpressions)


[error] 57-57: Avoid the delete operator which can impact performance.

Unsafe fix: Use an undefined assignment instead.

(lint/performance/noDelete)


[error] 58-58: Avoid the delete operator which can impact performance.

Unsafe fix: Use an undefined assignment instead.

(lint/performance/noDelete)

Additional comments not posted (31)
components/_1crm/package.json (2)

3-3: Version increment is appropriate.

The version increment from "0.0.1" to "0.1.0" is appropriate given the new features added.


15-16: New dependency is appropriate.

The addition of @pipedream/platform with version "^3.0.0" is appropriate for the new components.

components/_1crm/actions/create-lead/create-lead.mjs (2)

1-1: Import statement is appropriate.

The import statement for the common module is appropriate for reusing common functionality.


3-18: Export default object is well-structured.

The object defines the "Create Lead" action with necessary properties and methods. The structure and logic are appropriate.

components/_1crm/actions/create-contact/create-contact.mjs (2)

1-1: Import statement is appropriate.

The import statement for the common module is appropriate for reusing common functionality.


3-18: Export default object is well-structured.

The object defines the "Create Contact" action with necessary properties and methods. The structure and logic are appropriate.

components/_1crm/sources/new-or-updated-lead-instant/new-or-updated-lead-instant.mjs (2)

1-2: Import statements are appropriate.

The import statements for the common module and sample event are appropriate for reusing common functionality and providing a sample event.


4-22: Export default object is well-structured.

The object defines the "New or Updated Lead (Instant)" source with necessary properties and methods. The structure and logic are appropriate.

components/_1crm/sources/new-or-updated-invoice-instant/new-or-updated-invoice-instant.mjs (3)

1-2: Imports look good!

The import statements correctly bring in the necessary modules.


4-22: Exported object structure looks good!

The structure correctly extends the common object and defines additional properties and methods specific to the new-or-updated-invoice-instant source.


12-20: Custom methods look good!

The methods getModel and getSummary are correctly implemented. The sampleEmit is correctly referenced.

components/_1crm/sources/new-or-updated-account-instant/new-or-updated-account-instant.mjs (3)

1-2: Imports look good!

The import statements correctly bring in the necessary modules.


4-22: Exported object structure looks good!

The structure correctly extends the common object and defines additional properties and methods specific to the new-or-updated-account-instant source.


12-20: Custom methods look good!

The methods getModel and getSummary are correctly implemented. The sampleEmit is correctly referenced.

components/_1crm/actions/update-contact/update-contact.mjs (3)

1-1: Import looks good!

The import statement correctly brings in the necessary module.


3-34: Exported object structure looks good!

The structure correctly extends the common object and defines additional properties and methods specific to the update-contact action.


22-33: Custom methods look good!

The methods getMethod, getUpdateId, and getSummary are correctly implemented.

components/_1crm/actions/update-lead/update-lead.mjs (3)

1-1: Import looks good!

The import statement correctly brings in the necessary module.


3-36: Exported object structure looks good!

The structure correctly extends the common object and defines additional properties and methods specific to the update-lead action.


24-34: Custom methods look good!

The methods getMethod, getUpdateId, and getSummary are correctly implemented.

components/_1crm/sources/common/base.mjs (4)

3-11: Props section looks good.

The props section correctly defines properties for _1crm, http, and db.


12-19: Methods section looks good.

The methods for setting and getting the webhook ID from the database are correctly implemented.


20-34: Hooks section looks good.

The hooks for creating and deleting webhooks are correctly implemented.


36-43: Run function looks good.

The run function correctly emits an event with the body and additional metadata.

components/_1crm/_1crm.app.mjs (3)

1-2: Imports section looks good.

The imports for axios and LIMIT are correctly included.


7-30: PropDefinitions section looks good.

The recordId property with an asynchronous options function is correctly implemented.


32-95: Methods section looks good.

The methods for interacting with the 1crm API are correctly implemented.

components/_1crm/actions/common/base.mjs (4)

3-12: Props section looks good.

The props section correctly defines properties for _1crm and checkDuplicates.


14-49: Methods section looks good.

The methods for handling data and API interactions are correctly implemented.

Tools
Biome

[error] 40-40: The assignment should not be in an expression.

The use of assignments in expressions is confusing.
Expressions are often considered as side-effect free.

(lint/suspicious/noAssignInExpressions)


[error] 44-48: The assignment should not be in an expression.

The use of assignments in expressions is confusing.
Expressions are often considered as side-effect free.

(lint/suspicious/noAssignInExpressions)


51-76: AdditionalProps function looks good.

The function correctly retrieves fields metadata and constructs properties for the component.

Tools
Biome

[error] 57-57: Avoid the delete operator which can impact performance.

Unsafe fix: Use an undefined assignment instead.

(lint/performance/noDelete)


[error] 58-58: Avoid the delete operator which can impact performance.

Unsafe fix: Use an undefined assignment instead.

(lint/performance/noDelete)


78-105: Run function looks good.

The function correctly performs the action and handles the response.

jcortes
jcortes previously approved these changes Jul 18, 2024
Copy link
Collaborator

@jcortes jcortes left a comment

Choose a reason for hiding this comment

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

Hi @luancazarine I've just left a few observations other than that lgtm! Ready for QA!

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

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 7015c83 and 71d3e5d.

Files selected for processing (3)
  • components/_1crm/sources/new-or-updated-account-instant/test-event.mjs (1 hunks)
  • components/_1crm/sources/new-or-updated-invoice-instant/test-event.mjs (1 hunks)
  • components/_1crm/sources/new-or-updated-lead-instant/test-event.mjs (1 hunks)
Files skipped from review as they are similar to previous changes (2)
  • components/_1crm/sources/new-or-updated-account-instant/test-event.mjs
  • components/_1crm/sources/new-or-updated-invoice-instant/test-event.mjs
Additional comments not posted (37)
components/_1crm/sources/new-or-updated-lead-instant/test-event.mjs (37)

2-2: LGTM!

The property assigned_user is correctly defined as a string.


3-3: LGTM!

The property assigned_user_id is correctly defined as a string.


4-4: LGTM!

The property name is correctly defined as a string.


5-5: LGTM!

The property converted is correctly defined as a boolean.


6-6: LGTM!

The property categories is correctly defined as an array of strings.


7-7: LGTM!

The property temperature is correctly defined as a string.


8-8: LGTM!

The property salutation is correctly defined as a string.


9-9: LGTM!

The property first_name is correctly defined as a string.


10-10: LGTM!

The property last_name is correctly defined as a string.


11-11: LGTM!

The property title is correctly defined as a string.


13-13: LGTM!

The property lead_source is correctly defined as a string.


14-14: LGTM!

The property lead_source_description is correctly defined as a string.


15-15: LGTM!

The property status is correctly defined as a string.


16-16: LGTM!

The property status_description is correctly defined as a string.


17-17: LGTM!

The property department is correctly defined as a string.


18-18: LGTM!

The property reports_to is correctly defined as a string.


19-19: LGTM!

The property reports_to_id is correctly defined as a string.


20-20: LGTM!

The property do_not_call is correctly defined as a boolean.


21-21: LGTM!

The property phone_home is correctly defined as a string.


22-22: LGTM!

The property phone_mobile is correctly defined as a string.


23-23: LGTM!

The property phone_work is correctly defined as a string.


24-24: LGTM!

The property phone_other is correctly defined as a string.


25-25: LGTM!

The property phone_fax is correctly defined as a string.


26-26: LGTM!

The property skype_id is correctly defined as a string.


27-27: LGTM!

The property email1 is correctly defined as a string.


28-28: LGTM!

The property email2 is correctly defined as a string.


29-29: LGTM!

The property email_opt_out is correctly defined as a boolean.


30-30: LGTM!

The property email_opt_in is correctly defined as a boolean.


31-31: LGTM!

The property website is correctly defined as a string.


32-32: LGTM!

The property primary_address_street is correctly defined as a string.


33-33: LGTM!

The property primary_address_city is correctly defined as a string.


34-34: LGTM!

The property primary_address_state is correctly defined as a string.


35-35: LGTM!

The property primary_address_postalcode is correctly defined as a string.


36-36: LGTM!

The property primary_address_country is correctly defined as a string.


37-37: LGTM!

The property primary_address_statecode is correctly defined as a string.


38-38: LGTM!

The property primary_address_countrycode is correctly defined as a string.


39-39: LGTM!

The property alt_address_street is correctly defined as a string.

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: 0

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 71d3e5d and 7a59268.

Files selected for processing (1)
  • components/_1crm/_1crm.app.mjs (1 hunks)
Files skipped from review as they are similar to previous changes (1)
  • components/_1crm/_1crm.app.mjs

@luancazarine
Copy link
Collaborator Author

/approve

@luancazarine luancazarine merged commit 241de66 into master Jul 29, 2024
11 checks passed
@luancazarine luancazarine deleted the issue-12758 branch July 29, 2024 14:59
This was referenced Oct 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ai-assisted Content generated by AI, with human refinement and modification
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Components] 1crm
2 participants