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 Appointment Trigger for Setmore #15315

Merged
merged 6 commits into from
Jan 16, 2025
Merged

New Appointment Trigger for Setmore #15315

merged 6 commits into from
Jan 16, 2025

Conversation

michelle0927
Copy link
Collaborator

@michelle0927 michelle0927 commented Jan 15, 2025

Resolves #15030

Summary by CodeRabbit

  • New Features

    • Added listAppointments method to retrieve appointment data
    • Introduced pagination support for resource retrieval
    • Created new source for tracking newly created appointments
  • Chores

    • Updated package version from 0.1.0 to 0.2.0
    • Updated platform dependency to version ^3.0.3
    • Incremented module versions from 0.0.1 to 0.0.2

Copy link

vercel bot commented Jan 15, 2025

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 Jan 15, 2025 11:19pm
pipedream-docs ⬜️ Ignored (Inspect) Jan 15, 2025 11:19pm
pipedream-docs-redirect-do-not-edit ⬜️ Ignored (Inspect) Jan 15, 2025 11:19pm

Copy link
Contributor

coderabbitai bot commented Jan 15, 2025

Walkthrough

This pull request introduces enhancements to the Setmore Appointments integration in Pipedream. The changes include version updates across multiple files, a new method for listing appointments, and a comprehensive trigger for tracking new appointments. The package has been updated to use a newer version of the Pipedream platform, and a new source has been added to monitor and emit events for newly created appointments.

Changes

File Change Summary
components/setmoreappointments/actions/create-appointment/create-appointment.mjs Version updated from "0.0.1" to "0.0.2"
components/setmoreappointments/actions/create-customer/create-customer.mjs Version updated from "0.0.1" to "0.0.2"
components/setmoreappointments/package.json Package version updated from "0.1.0" to "0.2.0", platform dependency upgraded from "^1.5.1" to "^3.0.3"
components/setmoreappointments/setmoreappointments.app.mjs Added listAppointments() and paginate() methods
components/setmoreappointments/sources/new-appointment-created/new-appointment-created.mjs New module with comprehensive appointment tracking functionality
components/setmoreappointments/sources/new-appointment-created/test-event.mjs Added test event object for new appointment source

Sequence Diagram

sequenceDiagram
    participant Source as New Appointment Source
    participant Setmore API as Setmore API
    participant DB as Database
    
    Source->>DB: Retrieve last processed date
    Source->>Setmore API: Fetch appointments since last date
    Setmore API-->>Source: Return appointment list
    loop For each appointment
        Source->>Source: Generate metadata
        Source->>DB: Emit appointment event
    end
    Source->>DB: Update last processed date
Loading

Assessment against linked issues

Objective Addressed Explanation
Create New Booking Trigger for Setmore
Support Tracking New Appointments

Possibly related PRs

Suggested labels

User submitted, ai-assisted

Suggested reviewers

  • GTFalcao

Poem

🐰 Hop, hop, hooray! A new trigger's in play,
Setmore appointments, now tracked with glee,
Versions bumped up, features unfurled,
A rabbit's delight in this digital world! 🎉


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>, please review it.
    • 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 gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @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 using 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 generate docstrings to generate docstrings for this PR. (Beta)
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

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.

@michelle0927 michelle0927 marked this pull request as ready for review January 15, 2025 23:20
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: 2

🧹 Nitpick comments (3)
components/setmoreappointments/sources/new-appointment-created/test-event.mjs (1)

20-21: Consider using a past or present date for test data.

The test event uses a future date (2025-01-16). While this works, using a past or present date might be more intuitive for testing and documentation purposes.

-  "start_time": "2025-01-16T12:00Z",
-  "end_time": "2025-01-16T12:15Z",
+  "start_time": "2024-01-16T12:00Z",
+  "end_time": "2024-01-16T12:15Z",
components/setmoreappointments/sources/new-appointment-created/new-appointment-created.mjs (2)

9-9: Consider starting with version 0.1.0.

For a new component, it's common practice to start with version 0.1.0 instead of 0.0.1, especially since the parent package is already at 0.2.0.

-  version: "0.0.1",
+  version: "0.1.0",

51-56: Consider using ISO date format for API compatibility.

The current date format (DD-MM-YYYY) might not be compatible with all API implementations. Consider using ISO format (YYYY-MM-DD) which is more widely supported.

   formatDate(date) {
-    const day = String(date.getDate()).padStart(2, "0");
-    const month = String(date.getMonth() + 1).padStart(2, "0");
-    const year = date.getFullYear();
-    return `${day}-${month}-${year}`;
+    return date.toISOString().split('T')[0];
   }
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 5f077a9 and 7860653.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (6)
  • components/setmoreappointments/actions/create-appointment/create-appointment.mjs (1 hunks)
  • components/setmoreappointments/actions/create-customer/create-customer.mjs (1 hunks)
  • components/setmoreappointments/package.json (2 hunks)
  • components/setmoreappointments/setmoreappointments.app.mjs (2 hunks)
  • components/setmoreappointments/sources/new-appointment-created/new-appointment-created.mjs (1 hunks)
  • components/setmoreappointments/sources/new-appointment-created/test-event.mjs (1 hunks)
✅ Files skipped from review due to trivial changes (2)
  • components/setmoreappointments/actions/create-appointment/create-appointment.mjs
  • components/setmoreappointments/actions/create-customer/create-customer.mjs
🧰 Additional context used
🪛 Gitleaks (8.21.2)
components/setmoreappointments/sources/new-appointment-created/test-event.mjs

2-2: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.

(generic-api-key)


5-5: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.

(generic-api-key)


10-10: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.

(generic-api-key)


22-22: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.

(generic-api-key)


23-23: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.

(generic-api-key)


24-24: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.

(generic-api-key)

⏰ Context from checks skipped due to timeout of 90000ms (3)
  • GitHub Check: pnpm publish
  • GitHub Check: Verify TypeScript components
  • GitHub Check: Publish TypeScript components
🔇 Additional comments (2)
components/setmoreappointments/sources/new-appointment-created/test-event.mjs (1)

2-24: Skip false positive API key warnings.

The UUIDs and internal identifiers flagged by static analysis are not actual API keys, but rather Setmore's internal identifiers for appointments, customers, staff, and services.

🧰 Tools
🪛 Gitleaks (8.21.2)

2-2: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.

(generic-api-key)


5-5: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.

(generic-api-key)


10-10: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.

(generic-api-key)


22-22: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.

(generic-api-key)


23-23: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.

(generic-api-key)


24-24: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.

(generic-api-key)

components/setmoreappointments/package.json (1)

3-3: Version updates look appropriate.

The package version bump to 0.2.0 and platform dependency update to ^3.0.3 align well with the new functionality being added.

Also applies to: 16-16

Copy link
Collaborator

@GTFalcao GTFalcao left a comment

Choose a reason for hiding this comment

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

LGTM!

@michelle0927 michelle0927 merged commit a20b084 into master Jan 16, 2025
11 checks passed
@michelle0927 michelle0927 deleted the issue-15030 branch January 16, 2025 15:28
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.

[TRIGGER] New Booking Trigger for Setmore
2 participants