Skip to content

Conversation

@jcortes
Copy link
Collaborator

@jcortes jcortes commented Dec 15, 2025

WHY

Resolves #18231

Summary by CodeRabbit

  • New Features
    • Full Microsoft Bookings support: create/list/cancel appointments; create/list businesses, customers, services, and staff; dynamic selectors for IDs and calendar views.
  • Dependencies
    • Added Microsoft Graph client and fetch runtime.
  • Chores
    • Bumped component version to 0.1.0 and expanded package metadata.

✏️ Tip: You can customize this high-level summary in your review settings.

@jcortes jcortes self-assigned this Dec 15, 2025
@vercel
Copy link

vercel bot commented Dec 15, 2025

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

1 Skipped Deployment
Project Deployment Review Updated (UTC)
pipedream-docs-redirect-do-not-edit Ignored Ignored Dec 17, 2025 3:10pm

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 15, 2025

Walkthrough

Adds a Microsoft Bookings integration: ten action modules (create/list/cancel) for businesses, staff, services, customers, and appointments; a reworked app module with centralized Graph request helpers and async propDefinitions; and package metadata/dependency updates.

Changes

Cohort / File(s) Summary
Action modules (create / cancel / list)
components/microsoft_bookings/actions/create-appointment/create-appointment.mjs, components/microsoft_bookings/actions/cancel-appointment/cancel-appointment.mjs, components/microsoft_bookings/actions/create-business/create-business.mjs, components/microsoft_bookings/actions/create-customer/create-customer.mjs, components/microsoft_bookings/actions/create-service/create-service.mjs, components/microsoft_bookings/actions/create-staff-member/create-staff-member.mjs, components/microsoft_bookings/actions/list-appointments/list-appointments.mjs, components/microsoft_bookings/actions/list-businesses/list-businesses.mjs, components/microsoft_bookings/actions/list-services/list-services.mjs, components/microsoft_bookings/actions/list-staff-members/list-staff-members.mjs
Ten new default-export action descriptors. Each declares metadata and props, builds request payloads where applicable, invokes corresponding app.* helper methods (create/list/cancel/getCalendarView), exports a summary, and returns API responses. create-appointment includes detailed payload assembly and error logging; cancel-appointment enforces a cancellation message.
Core app implementation
components/microsoft_bookings/microsoft_bookings.app.mjs
Reworked app module: adds _accessToken() accessor, client() Graph client factory, makeRequest({ method, path, content }) unified HTTP layer (GET/POST/PATCH/DELETE), CRUD helpers for businesses/staff/services/customers/appointments (list/create/cancel/getCalendarView), and expanded propDefinitions (async options with pagination for businessId, staffMemberId, serviceId, customerId, appointmentId). Removes authKeys().
Package metadata
components/microsoft_bookings/package.json
Version bumped 0.0.1 → 0.1.0, keywords expanded (added "microsoft", "bookings"), and runtime dependencies added: @microsoft/microsoft-graph-client and isomorphic-fetch.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  participant Action as Action (run)
  participant App as microsoft_bookings.app
  participant Graph as Microsoft Graph API
  Note right of Action: action gathers props and calls app helper
  Action->>App: create/list/cancel/getCalendarView(...)
  Note right of App: makeRequest builds request, uses _accessToken()
  App->>Graph: HTTP request (GET/POST/PATCH/DELETE) + Authorization
  Graph-->>App: HTTP response (value / created resource / error)
  App-->>Action: returns response (and summary exported)
  Note over App,Graph: propDefinitions use nextLink-based pagination when listing
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~50 minutes

  • Focus areas:
    • components/microsoft_bookings/microsoft_bookings.app.mjs — token access, client factory, makeRequest behavior, and async propDefinitions with pagination.
    • components/microsoft_bookings/actions/create-appointment/create-appointment.mjs — complex payload construction and numeric parsing/conditional fields.
    • components/microsoft_bookings/actions/cancel-appointment/cancel-appointment.mjs — error handling and required cancellation message enforcement.
    • components/microsoft_bookings/package.json — verify dependency alignment and imports.

Suggested reviewers

  • lcaresia

Pre-merge checks and finishing touches

❌ Failed checks (1 warning, 1 inconclusive)
Check name Status Explanation Resolution
Description check ⚠️ Warning The PR description only states 'Resolves #18231' but lacks details about the implementation, features added, or testing performed. Expand the description to explain what components were added, which Microsoft Graph Booking API methods are implemented, and any testing done.
Linked Issues check ❓ Inconclusive The PR implements most core requirements from #18231: create/list operations for businesses, staff members, services, customers, and appointments; cancel appointment; and calendar view retrieval. However, it does not implement get, update, delete operations, custom questions, currency methods, or scheduling policy updates as specified. Clarify if the PR intentionally addresses only a subset of Batch 1 requirements, or if additional operations will be implemented in follow-up PRs.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title '[ACTION] Microsoft Booking - new components' is clear and accurately reflects the main change: adding new Microsoft Bookings action components.
Out of Scope Changes check ✅ Passed All changes are directly related to implementing Microsoft Bookings components per issue #18231. The addition of dependencies and prop definitions supports the core functionality.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ 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 microsoft-bookings-new-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: 11

📜 Review details

Configuration used: CodeRabbit UI

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between a00078f and 6086b71.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (12)
  • components/microsoft_bookings/actions/cancel-appointment/cancel-appointment.mjs (1 hunks)
  • components/microsoft_bookings/actions/create-appointment/create-appointment.mjs (1 hunks)
  • components/microsoft_bookings/actions/create-business/create-business.mjs (1 hunks)
  • components/microsoft_bookings/actions/create-customer/create-customer.mjs (1 hunks)
  • components/microsoft_bookings/actions/create-service/create-service.mjs (1 hunks)
  • components/microsoft_bookings/actions/create-staff-member/create-staff-member.mjs (1 hunks)
  • components/microsoft_bookings/actions/list-appointments/list-appointments.mjs (1 hunks)
  • components/microsoft_bookings/actions/list-businesses/list-businesses.mjs (1 hunks)
  • components/microsoft_bookings/actions/list-services/list-services.mjs (1 hunks)
  • components/microsoft_bookings/actions/list-staff-members/list-staff-members.mjs (1 hunks)
  • components/microsoft_bookings/microsoft_bookings.app.mjs (1 hunks)
  • components/microsoft_bookings/package.json (1 hunks)
🧰 Additional context used
🧠 Learnings (2)
📚 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/microsoft_bookings/actions/create-customer/create-customer.mjs
  • components/microsoft_bookings/actions/create-business/create-business.mjs
  • components/microsoft_bookings/actions/create-staff-member/create-staff-member.mjs
  • components/microsoft_bookings/actions/create-service/create-service.mjs
  • components/microsoft_bookings/actions/create-appointment/create-appointment.mjs
📚 Learning: 2024-10-08T15:33:38.240Z
Learnt from: GTFalcao
Repo: PipedreamHQ/pipedream PR: 12731
File: components/hackerone/actions/get-members/get-members.mjs:3-28
Timestamp: 2024-10-08T15:33:38.240Z
Learning: When exporting a summary message in the `run` method of an action, ensure the message is correctly formatted. For example, in the `hackerone-get-members` action, the correct format is `Successfully retrieved ${response.data.length} members`.

Applied to files:

  • components/microsoft_bookings/actions/list-staff-members/list-staff-members.mjs
🧬 Code graph analysis (8)
components/microsoft_bookings/actions/list-appointments/list-appointments.mjs (3)
components/microsoft_bookings/actions/list-services/list-services.mjs (1)
  • response (29-31)
components/microsoft_bookings/actions/list-staff-members/list-staff-members.mjs (1)
  • response (29-31)
components/microsoft_bookings/microsoft_bookings.app.mjs (5)
  • response (13-17)
  • response (46-52)
  • response (71-77)
  • response (99-105)
  • response (127-133)
components/microsoft_bookings/actions/list-services/list-services.mjs (3)
components/microsoft_bookings/actions/list-businesses/list-businesses.mjs (1)
  • response (20-20)
components/microsoft_bookings/actions/list-staff-members/list-staff-members.mjs (1)
  • response (29-31)
components/microsoft_bookings/microsoft_bookings.app.mjs (5)
  • response (13-17)
  • response (46-52)
  • response (71-77)
  • response (99-105)
  • response (127-133)
components/microsoft_bookings/actions/create-business/create-business.mjs (4)
components/microsoft_bookings/actions/create-customer/create-customer.mjs (2)
  • content (96-100)
  • response (125-128)
components/microsoft_bookings/actions/create-service/create-service.mjs (2)
  • content (115-118)
  • response (136-139)
components/microsoft_bookings/actions/create-staff-member/create-staff-member.mjs (2)
  • content (94-99)
  • response (109-112)
components/microsoft_bookings/microsoft_bookings.app.mjs (5)
  • response (13-17)
  • response (46-52)
  • response (71-77)
  • response (99-105)
  • response (127-133)
components/microsoft_bookings/actions/list-businesses/list-businesses.mjs (1)
components/microsoft_bookings/microsoft_bookings.app.mjs (5)
  • response (13-17)
  • response (46-52)
  • response (71-77)
  • response (99-105)
  • response (127-133)
components/microsoft_bookings/actions/create-service/create-service.mjs (4)
components/microsoft_bookings/actions/create-business/create-business.mjs (2)
  • content (105-107)
  • response (116-118)
components/microsoft_bookings/actions/create-customer/create-customer.mjs (2)
  • content (96-100)
  • response (125-128)
components/microsoft_bookings/actions/list-services/list-services.mjs (1)
  • response (29-31)
components/microsoft_bookings/actions/list-staff-members/list-staff-members.mjs (1)
  • response (29-31)
components/microsoft_bookings/actions/create-appointment/create-appointment.mjs (8)
components/microsoft_bookings/actions/create-business/create-business.mjs (2)
  • content (105-107)
  • response (116-118)
components/microsoft_bookings/actions/create-customer/create-customer.mjs (2)
  • content (96-100)
  • response (125-128)
components/microsoft_bookings/actions/create-service/create-service.mjs (2)
  • content (115-118)
  • response (136-139)
components/microsoft_bookings/actions/create-staff-member/create-staff-member.mjs (2)
  • content (94-99)
  • response (109-112)
components/microsoft_bookings/actions/list-appointments/list-appointments.mjs (1)
  • response (41-45)
components/microsoft_bookings/actions/list-businesses/list-businesses.mjs (1)
  • response (20-20)
components/microsoft_bookings/actions/list-services/list-services.mjs (1)
  • response (29-31)
components/microsoft_bookings/microsoft_bookings.app.mjs (5)
  • response (13-17)
  • response (46-52)
  • response (71-77)
  • response (99-105)
  • response (127-133)
components/microsoft_bookings/actions/list-staff-members/list-staff-members.mjs (3)
components/microsoft_bookings/actions/list-businesses/list-businesses.mjs (1)
  • response (20-20)
components/microsoft_bookings/actions/list-services/list-services.mjs (1)
  • response (29-31)
components/microsoft_bookings/microsoft_bookings.app.mjs (5)
  • response (13-17)
  • response (46-52)
  • response (71-77)
  • response (99-105)
  • response (127-133)
components/microsoft_bookings/microsoft_bookings.app.mjs (9)
components/microsoft_bookings/actions/create-appointment/create-appointment.mjs (2)
  • response (278-281)
  • content (222-252)
components/microsoft_bookings/actions/create-business/create-business.mjs (2)
  • response (116-118)
  • content (105-107)
components/microsoft_bookings/actions/create-customer/create-customer.mjs (2)
  • response (125-128)
  • content (96-100)
components/microsoft_bookings/actions/create-service/create-service.mjs (2)
  • response (136-139)
  • content (115-118)
components/microsoft_bookings/actions/create-staff-member/create-staff-member.mjs (2)
  • response (109-112)
  • content (94-99)
components/microsoft_bookings/actions/list-appointments/list-appointments.mjs (1)
  • response (41-45)
components/microsoft_bookings/actions/list-businesses/list-businesses.mjs (1)
  • response (20-20)
components/microsoft_bookings/actions/list-services/list-services.mjs (1)
  • response (29-31)
components/microsoft_bookings/actions/list-staff-members/list-staff-members.mjs (1)
  • response (29-31)
🪛 GitHub Actions: Pull Request Checks
components/microsoft_bookings/package.json

[error] 21-21: ESLint: 'eol-last' rule violated. Newline required at end of file but not found.

⏰ 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: pnpm publish
  • GitHub Check: Publish TypeScript components
  • GitHub Check: Verify TypeScript components
🔇 Additional comments (14)
components/microsoft_bookings/actions/list-services/list-services.mjs (1)

1-39: LGTM!

The action follows the standard pattern for list operations and correctly normalizes the response, exports a summary, and returns the full response.

components/microsoft_bookings/actions/list-appointments/list-appointments.mjs (1)

41-52: LGTM!

The action correctly calls the calendar view API and handles the response appropriately.

components/microsoft_bookings/package.json (1)

3-11: LGTM!

The version bump to 0.1.0 is appropriate for the new Microsoft Bookings integration features, and the expanded keywords improve package discoverability.

components/microsoft_bookings/actions/cancel-appointment/cancel-appointment.mjs (1)

1-58: LGTM!

The action correctly implements appointment cancellation with appropriate annotations (destructiveHint: true) and handles the void response by returning a success indicator.

components/microsoft_bookings/actions/create-staff-member/create-staff-member.mjs (1)

1-118: LGTM!

The action correctly handles optional boolean fields by explicitly checking for undefined (lines 102-107), which prevents false values from being incorrectly excluded. The role options are comprehensive and the @odata.type annotation is properly included.

components/microsoft_bookings/actions/create-customer/create-customer.mjs (1)

111-123: LGTM!

The address building logic correctly handles optional fields and only creates the addresses array when at least one address field is provided.

components/microsoft_bookings/actions/list-businesses/list-businesses.mjs (1)

1-28: LGTM!

The action correctly implements the list businesses operation with appropriate minimal props and follows the established pattern for list operations.

components/microsoft_bookings/actions/list-staff-members/list-staff-members.mjs (1)

1-39: LGTM!

The action correctly implements the list staff members operation and follows the proper summary message format as per established patterns.

components/microsoft_bookings/actions/create-business/create-business.mjs (2)

3-13: LGTM!

Metadata, annotations, and action structure follow Pipedream conventions correctly.


105-118: No action needed. Microsoft Graph API documentation for bookingBusiness POST omits @odata.type at the root level, making its absence in this action correct. The other actions (create-service, create-customer, create-staff-member) include @odata.type because their respective entity types (bookingService, bookingCustomer, bookingStaffMember) have different API requirements—this is intentional variance, not an inconsistency to fix.

Likely an incorrect or invalid review comment.

components/microsoft_bookings/actions/create-service/create-service.mjs (2)

3-13: LGTM!

Action metadata and annotations are well-defined.


124-134: LGTM!

Good use of !== undefined checks for boolean fields to allow false values to be set explicitly.

components/microsoft_bookings/microsoft_bookings.app.mjs (2)

1-2: LGTM!

Proper imports for MS Graph client with isomorphic-fetch for Node.js compatibility.


179-264: LGTM!

Well-structured CRUD methods with consistent patterns for all booking entities. The centralized request layer provides a clean abstraction over the MS Graph client.

@jcortes jcortes force-pushed the microsoft-bookings-new-components branch from 6086b71 to 718e78d Compare December 16, 2025 00:52
GTFalcao
GTFalcao previously approved these changes Dec 16, 2025
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!

@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: 2

📜 Review details

Configuration used: CodeRabbit UI

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 718e78d and 969ee61.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (12)
  • components/microsoft_bookings/actions/cancel-appointment/cancel-appointment.mjs (1 hunks)
  • components/microsoft_bookings/actions/create-appointment/create-appointment.mjs (1 hunks)
  • components/microsoft_bookings/actions/create-business/create-business.mjs (1 hunks)
  • components/microsoft_bookings/actions/create-customer/create-customer.mjs (1 hunks)
  • components/microsoft_bookings/actions/create-service/create-service.mjs (1 hunks)
  • components/microsoft_bookings/actions/create-staff-member/create-staff-member.mjs (1 hunks)
  • components/microsoft_bookings/actions/list-appointments/list-appointments.mjs (1 hunks)
  • components/microsoft_bookings/actions/list-businesses/list-businesses.mjs (1 hunks)
  • components/microsoft_bookings/actions/list-services/list-services.mjs (1 hunks)
  • components/microsoft_bookings/actions/list-staff-members/list-staff-members.mjs (1 hunks)
  • components/microsoft_bookings/microsoft_bookings.app.mjs (1 hunks)
  • components/microsoft_bookings/package.json (1 hunks)
🧰 Additional context used
🧠 Learnings (5)
📚 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/microsoft_bookings/actions/create-staff-member/create-staff-member.mjs
  • components/microsoft_bookings/actions/create-business/create-business.mjs
  • components/microsoft_bookings/actions/create-appointment/create-appointment.mjs
  • components/microsoft_bookings/actions/create-service/create-service.mjs
  • components/microsoft_bookings/actions/create-customer/create-customer.mjs
📚 Learning: 2024-10-08T15:33:38.240Z
Learnt from: GTFalcao
Repo: PipedreamHQ/pipedream PR: 12731
File: components/hackerone/actions/get-members/get-members.mjs:3-28
Timestamp: 2024-10-08T15:33:38.240Z
Learning: When exporting a summary message in the `run` method of an action, ensure the message is correctly formatted. For example, in the `hackerone-get-members` action, the correct format is `Successfully retrieved ${response.data.length} members`.

Applied to files:

  • components/microsoft_bookings/actions/list-businesses/list-businesses.mjs
  • components/microsoft_bookings/actions/list-staff-members/list-staff-members.mjs
  • components/microsoft_bookings/actions/create-appointment/create-appointment.mjs
📚 Learning: 2025-09-11T01:53:51.070Z
Learnt from: GTFalcao
Repo: PipedreamHQ/pipedream PR: 18334
File: components/buddee/actions/list-employees/list-employees.mjs:147-155
Timestamp: 2025-09-11T01:53:51.070Z
Learning: In Buddee list-employees action, the "manager" prop should be a boolean type to filter employees who have direct reports, not an employeeId propDefinition which would send an employee ID instead of the expected boolean value.

Applied to files:

  • components/microsoft_bookings/actions/create-appointment/create-appointment.mjs
📚 Learning: 2024-10-08T16:42:59.225Z
Learnt from: GTFalcao
Repo: PipedreamHQ/pipedream PR: 14229
File: components/americommerce/actions/update-customer/update-customer.mjs:89-94
Timestamp: 2024-10-08T16:42:59.225Z
Learning: When defining boolean properties in AmeriCommerce components (e.g., in `update-customer.mjs`), ensure that the label and description are consistent and clearly indicate the intent, especially when using negations like "No Account", to avoid confusion.

Applied to files:

  • components/microsoft_bookings/actions/create-appointment/create-appointment.mjs
📚 Learning: 2025-01-29T22:59:38.825Z
Learnt from: GTFalcao
Repo: PipedreamHQ/pipedream PR: 15436
File: components/printful/printful.app.mjs:55-63
Timestamp: 2025-01-29T22:59:38.825Z
Learning: Console.log statements should be removed before merging PRs to maintain code quality and prevent potential security risks from exposing sensitive information in logs.

Applied to files:

  • components/microsoft_bookings/actions/create-appointment/create-appointment.mjs
🧬 Code graph analysis (8)
components/microsoft_bookings/actions/list-services/list-services.mjs (3)
components/microsoft_bookings/actions/list-businesses/list-businesses.mjs (1)
  • response (20-20)
components/microsoft_bookings/actions/list-staff-members/list-staff-members.mjs (1)
  • response (29-31)
components/microsoft_bookings/microsoft_bookings.app.mjs (5)
  • response (13-17)
  • response (46-52)
  • response (71-77)
  • response (99-105)
  • response (127-133)
components/microsoft_bookings/actions/list-businesses/list-businesses.mjs (8)
components/microsoft_bookings/actions/create-appointment/create-appointment.mjs (1)
  • response (272-275)
components/microsoft_bookings/actions/create-customer/create-customer.mjs (1)
  • response (125-128)
components/microsoft_bookings/actions/create-service/create-service.mjs (1)
  • response (136-139)
components/microsoft_bookings/actions/create-staff-member/create-staff-member.mjs (1)
  • response (109-112)
components/microsoft_bookings/actions/list-appointments/list-appointments.mjs (1)
  • response (41-45)
components/microsoft_bookings/actions/list-services/list-services.mjs (1)
  • response (29-31)
components/microsoft_bookings/actions/list-staff-members/list-staff-members.mjs (1)
  • response (29-31)
components/microsoft_bookings/microsoft_bookings.app.mjs (5)
  • response (13-17)
  • response (46-52)
  • response (71-77)
  • response (99-105)
  • response (127-133)
components/microsoft_bookings/actions/list-staff-members/list-staff-members.mjs (1)
components/microsoft_bookings/microsoft_bookings.app.mjs (5)
  • response (13-17)
  • response (46-52)
  • response (71-77)
  • response (99-105)
  • response (127-133)
components/microsoft_bookings/actions/create-business/create-business.mjs (4)
components/microsoft_bookings/actions/create-customer/create-customer.mjs (2)
  • content (96-100)
  • response (125-128)
components/microsoft_bookings/actions/create-service/create-service.mjs (2)
  • content (115-118)
  • response (136-139)
components/microsoft_bookings/actions/create-staff-member/create-staff-member.mjs (2)
  • content (94-99)
  • response (109-112)
components/microsoft_bookings/microsoft_bookings.app.mjs (5)
  • response (13-17)
  • response (46-52)
  • response (71-77)
  • response (99-105)
  • response (127-133)
components/microsoft_bookings/actions/list-appointments/list-appointments.mjs (3)
components/microsoft_bookings/actions/list-services/list-services.mjs (1)
  • response (29-31)
components/microsoft_bookings/actions/list-staff-members/list-staff-members.mjs (1)
  • response (29-31)
components/microsoft_bookings/microsoft_bookings.app.mjs (5)
  • response (13-17)
  • response (46-52)
  • response (71-77)
  • response (99-105)
  • response (127-133)
components/microsoft_bookings/actions/create-appointment/create-appointment.mjs (7)
components/microsoft_bookings/actions/create-business/create-business.mjs (2)
  • content (105-107)
  • response (116-118)
components/microsoft_bookings/actions/create-customer/create-customer.mjs (2)
  • content (96-100)
  • response (125-128)
components/microsoft_bookings/actions/create-service/create-service.mjs (2)
  • content (115-118)
  • response (136-139)
components/microsoft_bookings/actions/list-businesses/list-businesses.mjs (1)
  • response (20-20)
components/microsoft_bookings/actions/list-services/list-services.mjs (1)
  • response (29-31)
components/microsoft_bookings/actions/list-staff-members/list-staff-members.mjs (1)
  • response (29-31)
components/microsoft_bookings/microsoft_bookings.app.mjs (5)
  • response (13-17)
  • response (46-52)
  • response (71-77)
  • response (99-105)
  • response (127-133)
components/microsoft_bookings/actions/create-service/create-service.mjs (5)
components/microsoft_bookings/actions/create-business/create-business.mjs (2)
  • content (105-107)
  • response (116-118)
components/microsoft_bookings/actions/create-customer/create-customer.mjs (2)
  • content (96-100)
  • response (125-128)
components/microsoft_bookings/actions/create-staff-member/create-staff-member.mjs (2)
  • content (94-99)
  • response (109-112)
components/microsoft_bookings/actions/list-services/list-services.mjs (1)
  • response (29-31)
components/microsoft_bookings/microsoft_bookings.app.mjs (5)
  • response (13-17)
  • response (46-52)
  • response (71-77)
  • response (99-105)
  • response (127-133)
components/microsoft_bookings/actions/create-customer/create-customer.mjs (3)
components/microsoft_bookings/actions/create-business/create-business.mjs (3)
  • content (105-107)
  • address (98-98)
  • response (116-118)
components/microsoft_bookings/actions/create-service/create-service.mjs (2)
  • content (115-118)
  • response (136-139)
components/microsoft_bookings/actions/create-staff-member/create-staff-member.mjs (2)
  • content (94-99)
  • response (109-112)
⏰ 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). (6)
  • GitHub Check: Verify TypeScript components
  • GitHub Check: Publish TypeScript components
  • GitHub Check: pnpm publish
  • GitHub Check: Lint Code Base
  • GitHub Check: Verify TypeScript components
  • GitHub Check: Publish TypeScript components
🔇 Additional comments (19)
components/microsoft_bookings/actions/create-business/create-business.mjs (2)

1-81: LGTM!

The action metadata and props are well-defined with appropriate types, labels, and descriptions.


82-104: LGTM!

The address building logic correctly handles optional fields and prevents adding an empty address object.

components/microsoft_bookings/actions/create-service/create-service.mjs (4)

1-98: LGTM!

The action metadata and props are correctly defined with appropriate types and propDefinitions.


99-121: LGTM!

The content payload initialization and conditional field additions are correctly implemented.


123-134: LGTM!

The conditional field additions correctly handle boolean props with undefined checks and array props with length validation.


136-144: LGTM!

The API call and success summary follow the established pattern for create actions.

components/microsoft_bookings/actions/create-appointment/create-appointment.mjs (7)

1-30: LGTM!

The action metadata and initial props (businessId, serviceId) are correctly defined.


42-86: LGTM!

The customer-related props and appointment time props are well-defined with appropriate types and descriptions.


87-182: LGTM!

The remaining props are appropriately defined with correct types and helpful descriptions.


183-210: LGTM!

The prop destructuring is comprehensive and organized.


216-255: LGTM!

The content payload structure correctly follows the Microsoft Graph bookingAppointment schema with proper @odata.type annotations and nested dateTimeTimeZone objects.


257-269: LGTM!

The conditional field additions appropriately handle optional props with undefined checks for booleans.


271-276: LGTM!

The API call follows the established pattern for create actions.

components/microsoft_bookings/microsoft_bookings.app.mjs (6)

1-31: LGTM!

The imports and businessId propDefinition correctly implement pagination with nextLink handling.


32-63: LGTM!

The staffMemberId propDefinition correctly implements pagination and provides a flexible mapper interface for custom field mappings.


64-119: LGTM!

The serviceId and customerId propDefinitions consistently follow the established pagination pattern.


120-134: LGTM!

The appointmentId propDefinition correctly implements pagination for listing appointments.


150-159: LGTM!

The access token retrieval and Graph client initialization are correctly implemented.


179-262: LGTM!

The API methods provide a clean, consistent interface for all Microsoft Bookings operations with correct endpoint paths.

@vunguyenhung
Copy link
Collaborator

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

Test reports

@jcortes jcortes force-pushed the microsoft-bookings-new-components branch from 969ee61 to 06b77ef Compare December 17, 2025 15:10
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

♻️ Duplicate comments (13)
components/microsoft_bookings/package.json (1)

21-21: Verify the newline at end of file.

This file had a previous review comment flagging a missing newline at EOF which violates the eol-last ESLint rule. Ensure the file ends with a newline character to pass pipeline checks.

components/microsoft_bookings/actions/create-customer/create-customer.mjs (1)

102-109: Simplify redundant phoneType fallback.

The inline fallback phoneType || "home" is redundant because phoneType already has default: "home" at line 48.

Apply this diff to remove the redundant fallback:

 if (phoneNumber) {
   content.phones = [
     {
       number: phoneNumber,
-      type: phoneType || "home",
+      type: phoneType,
     },
   ];
 }
components/microsoft_bookings/actions/cancel-appointment/cancel-appointment.mjs (1)

45-61: Fix misleading error handling that obscures API failures.

The try-catch block has critical issues:

  1. The error message claims cancellationMessage is missing, but it's a required prop (lines 31-35, no optional: true), so the platform enforces it before run() executes.
  2. All actual errors (authentication failures, invalid appointment IDs, network issues, API validation failures) are swallowed and replaced with the misleading message.
  3. Users cannot diagnose the real problem.

Apply this diff to preserve the original error:

-    try {
-      await app.cancelAppointment({
-        businessId,
-        appointmentId,
-        content: {
-          cancellationMessage,
-        },
-      });
+    await app.cancelAppointment({
+      businessId,
+      appointmentId,
+      content: {
+        cancellationMessage,
+      },
+    });

-      $.export("$summary", "Successfully cancelled appointment");
+    $.export("$summary", "Successfully cancelled appointment");

-      return {
-        success: true,
-      };
-    } catch (error) {
-      throw new Error("Failed to cancel appointment, you must provide a cancellation message");
-    }
+    return {
+      success: true,
+    };
components/microsoft_bookings/actions/list-appointments/list-appointments.mjs (1)

22-31: Consider validating date format.

The startDate and endDate props accept any string without format validation. Invalid ISO 8601 dates will cause API errors rather than early validation feedback.

Apply this diff to add basic pattern validation:

 startDate: {
   type: "string",
   label: "Start Date",
   description: "The start date and time for the calendar view in ISO 8601 format (e.g., `2024-05-01T00:00:00Z`)",
+  pattern: "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}Z$",
 },
 endDate: {
   type: "string",
   label: "End Date",
   description: "The end date and time for the calendar view in ISO 8601 format (e.g., `2024-05-31T23:59:59Z`)",
+  pattern: "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}Z$",
 },
components/microsoft_bookings/actions/create-business/create-business.mjs (1)

105-107: Add missing @odata.type field to content payload.

Other create actions in this PR (create-service, create-customer, create-staff-member) include @odata.type in the content object. Add it here for consistency with Microsoft Graph API conventions.

     const content = {
+      "@odata.type": "#microsoft.graph.bookingBusiness",
       displayName,
     };
components/microsoft_bookings/actions/create-service/create-service.mjs (1)

122-122: Handle invalid defaultPrice input to avoid NaN.

parseFloat(defaultPrice) returns NaN for non-numeric strings, which could cause unexpected API behavior.

-    if (defaultPrice) content.defaultPrice = parseFloat(defaultPrice);
+    if (defaultPrice) {
+      const parsedPrice = parseFloat(defaultPrice);
+      if (!isNaN(parsedPrice)) {
+        content.defaultPrice = parsedPrice;
+      }
+    }
components/microsoft_bookings/actions/create-appointment/create-appointment.mjs (5)

31-41: Wrong propDefinition used for customerId.

This prop uses staffMemberId propDefinition but the field is for selecting customers. The app module has a customerId propDefinition that should be used here.

     customerId: {
       propDefinition: [
         app,
-        "staffMemberId",
+        "customerId",
         ({ businessId }) => ({
           businessId,
         }),
       ],
       label: "Customer ID",
       description: "Select an existing customer. **Important**: Customers must exist in the system before booking appointments.",
     },

212-214: Redundant validation for implicitly required prop.

Since customerId doesn't have optional: true, Pipedream's framework already enforces it as required. This manual check is unnecessary.

-    if (!customerId) {
-      throw new Error("Customer ID is required. Please select an existing customer.");
-    }

256-256: Handle invalid price input to avoid NaN.

Same as create-service.mjs - parseFloat returns NaN for invalid input.

-    if (price) content.price = parseFloat(price);
+    if (price) {
+      const parsedPrice = parseFloat(price);
+      if (!isNaN(parsedPrice)) {
+        content.price = parsedPrice;
+      }
+    }

277-277: Summary may display undefined when customerName is not provided.

customerName is optional, so the summary could show "Successfully created appointment for undefined".

-      $.export("$summary", `Successfully created appointment for ${customerName}`);
+      $.export("$summary", `Successfully created appointment${customerName ? ` for ${customerName}` : ""}`);

280-283: Avoid logging sensitive customer data.

The error handler logs the full request payload which may contain PII (customer email, phone, name). This could violate privacy requirements.

     } catch (error) {
-      console.error("Error creating appointment:", error);
-      console.error("Request payload:", JSON.stringify(content, null, 2));
+      console.error("Error creating appointment:", error.message || error);
       throw new Error(`Failed to create appointment: ${error.message || error.toString()}`);
     }
components/microsoft_bookings/microsoft_bookings.app.mjs (2)

135-138: Use customers array for customer name instead of legacy customerName field.

The current Microsoft Graph API uses a customers array of bookingCustomerInformation objects. Access customer name via appointment.customers?.[0]?.name with fallback to the legacy field.

         const options = response.value?.map((appointment) => ({
-          label: `${appointment.customerName} - ${appointment.serviceName}`,
+          label: `${appointment.customers?.[0]?.name || appointment.customerName || "Unknown"} - ${appointment.serviceName}`,
           value: appointment.id,
         })) || [];

160-178: Simplify method dispatch by removing redundant conditionals.

The explicit if/else checks are redundant since line 177 handles all methods via dynamic dispatch. Simplify to a single dispatch pattern.

     async makeRequest({
       method = "get",
       path,
       content,
     }) {
       const api = this.client().api(path);
-
-      if (method === "get") {
-        return api.get();
-      } else if (method === "post") {
-        return api.post(content);
-      } else if (method === "patch") {
-        return api.patch(content);
-      } else if (method === "delete") {
-        return api.delete();
-      }
-
-      return api[method](content);
+      return content ? api[method](content) : api[method]();
     },
📜 Review details

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 969ee61 and 06b77ef.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (12)
  • components/microsoft_bookings/actions/cancel-appointment/cancel-appointment.mjs (1 hunks)
  • components/microsoft_bookings/actions/create-appointment/create-appointment.mjs (1 hunks)
  • components/microsoft_bookings/actions/create-business/create-business.mjs (1 hunks)
  • components/microsoft_bookings/actions/create-customer/create-customer.mjs (1 hunks)
  • components/microsoft_bookings/actions/create-service/create-service.mjs (1 hunks)
  • components/microsoft_bookings/actions/create-staff-member/create-staff-member.mjs (1 hunks)
  • components/microsoft_bookings/actions/list-appointments/list-appointments.mjs (1 hunks)
  • components/microsoft_bookings/actions/list-businesses/list-businesses.mjs (1 hunks)
  • components/microsoft_bookings/actions/list-services/list-services.mjs (1 hunks)
  • components/microsoft_bookings/actions/list-staff-members/list-staff-members.mjs (1 hunks)
  • components/microsoft_bookings/microsoft_bookings.app.mjs (1 hunks)
  • components/microsoft_bookings/package.json (1 hunks)
🧰 Additional context used
🧠 Learnings (5)
📚 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/microsoft_bookings/actions/create-customer/create-customer.mjs
  • components/microsoft_bookings/actions/create-appointment/create-appointment.mjs
  • components/microsoft_bookings/actions/create-business/create-business.mjs
  • components/microsoft_bookings/actions/create-staff-member/create-staff-member.mjs
  • components/microsoft_bookings/actions/create-service/create-service.mjs
📚 Learning: 2025-09-11T01:53:51.070Z
Learnt from: GTFalcao
Repo: PipedreamHQ/pipedream PR: 18334
File: components/buddee/actions/list-employees/list-employees.mjs:147-155
Timestamp: 2025-09-11T01:53:51.070Z
Learning: In Buddee list-employees action, the "manager" prop should be a boolean type to filter employees who have direct reports, not an employeeId propDefinition which would send an employee ID instead of the expected boolean value.

Applied to files:

  • components/microsoft_bookings/actions/create-appointment/create-appointment.mjs
📚 Learning: 2024-10-08T16:42:59.225Z
Learnt from: GTFalcao
Repo: PipedreamHQ/pipedream PR: 14229
File: components/americommerce/actions/update-customer/update-customer.mjs:89-94
Timestamp: 2024-10-08T16:42:59.225Z
Learning: When defining boolean properties in AmeriCommerce components (e.g., in `update-customer.mjs`), ensure that the label and description are consistent and clearly indicate the intent, especially when using negations like "No Account", to avoid confusion.

Applied to files:

  • components/microsoft_bookings/actions/create-appointment/create-appointment.mjs
📚 Learning: 2024-10-08T15:33:38.240Z
Learnt from: GTFalcao
Repo: PipedreamHQ/pipedream PR: 12731
File: components/hackerone/actions/get-members/get-members.mjs:3-28
Timestamp: 2024-10-08T15:33:38.240Z
Learning: When exporting a summary message in the `run` method of an action, ensure the message is correctly formatted. For example, in the `hackerone-get-members` action, the correct format is `Successfully retrieved ${response.data.length} members`.

Applied to files:

  • components/microsoft_bookings/actions/create-appointment/create-appointment.mjs
  • components/microsoft_bookings/actions/list-staff-members/list-staff-members.mjs
📚 Learning: 2025-01-29T22:59:38.825Z
Learnt from: GTFalcao
Repo: PipedreamHQ/pipedream PR: 15436
File: components/printful/printful.app.mjs:55-63
Timestamp: 2025-01-29T22:59:38.825Z
Learning: Console.log statements should be removed before merging PRs to maintain code quality and prevent potential security risks from exposing sensitive information in logs.

Applied to files:

  • components/microsoft_bookings/actions/create-appointment/create-appointment.mjs
🧬 Code graph analysis (7)
components/microsoft_bookings/actions/list-businesses/list-businesses.mjs (1)
components/microsoft_bookings/microsoft_bookings.app.mjs (5)
  • response (13-17)
  • response (46-52)
  • response (71-77)
  • response (99-105)
  • response (127-133)
components/microsoft_bookings/actions/create-customer/create-customer.mjs (3)
components/microsoft_bookings/actions/create-business/create-business.mjs (1)
  • content (105-107)
components/microsoft_bookings/actions/create-service/create-service.mjs (1)
  • content (115-118)
components/microsoft_bookings/actions/create-staff-member/create-staff-member.mjs (1)
  • content (94-99)
components/microsoft_bookings/actions/list-services/list-services.mjs (4)
components/microsoft_bookings/actions/list-appointments/list-appointments.mjs (1)
  • response (41-45)
components/microsoft_bookings/actions/list-businesses/list-businesses.mjs (1)
  • response (20-20)
components/microsoft_bookings/actions/list-staff-members/list-staff-members.mjs (1)
  • response (29-31)
components/microsoft_bookings/microsoft_bookings.app.mjs (5)
  • response (13-17)
  • response (46-52)
  • response (71-77)
  • response (99-105)
  • response (127-133)
components/microsoft_bookings/actions/list-staff-members/list-staff-members.mjs (1)
components/microsoft_bookings/microsoft_bookings.app.mjs (5)
  • response (13-17)
  • response (46-52)
  • response (71-77)
  • response (99-105)
  • response (127-133)
components/microsoft_bookings/actions/create-staff-member/create-staff-member.mjs (6)
components/microsoft_bookings/actions/create-appointment/create-appointment.mjs (2)
  • content (216-246)
  • response (272-275)
components/microsoft_bookings/actions/create-business/create-business.mjs (2)
  • content (105-107)
  • response (116-118)
components/microsoft_bookings/actions/create-service/create-service.mjs (2)
  • content (115-118)
  • response (136-139)
components/microsoft_bookings/actions/list-services/list-services.mjs (1)
  • response (29-31)
components/microsoft_bookings/actions/list-staff-members/list-staff-members.mjs (1)
  • response (29-31)
components/microsoft_bookings/microsoft_bookings.app.mjs (5)
  • response (13-17)
  • response (46-52)
  • response (71-77)
  • response (99-105)
  • response (127-133)
components/microsoft_bookings/actions/list-appointments/list-appointments.mjs (9)
components/microsoft_bookings/actions/create-appointment/create-appointment.mjs (1)
  • response (272-275)
components/microsoft_bookings/actions/create-business/create-business.mjs (1)
  • response (116-118)
components/microsoft_bookings/actions/create-customer/create-customer.mjs (1)
  • response (125-128)
components/microsoft_bookings/actions/create-service/create-service.mjs (1)
  • response (136-139)
components/microsoft_bookings/actions/create-staff-member/create-staff-member.mjs (1)
  • response (109-112)
components/microsoft_bookings/actions/list-businesses/list-businesses.mjs (1)
  • response (20-20)
components/microsoft_bookings/actions/list-services/list-services.mjs (1)
  • response (29-31)
components/microsoft_bookings/actions/list-staff-members/list-staff-members.mjs (1)
  • response (29-31)
components/microsoft_bookings/microsoft_bookings.app.mjs (5)
  • response (13-17)
  • response (46-52)
  • response (71-77)
  • response (99-105)
  • response (127-133)
components/microsoft_bookings/actions/create-service/create-service.mjs (4)
components/microsoft_bookings/actions/create-business/create-business.mjs (2)
  • content (105-107)
  • response (116-118)
components/microsoft_bookings/actions/create-customer/create-customer.mjs (2)
  • content (96-100)
  • response (125-128)
components/microsoft_bookings/actions/create-staff-member/create-staff-member.mjs (2)
  • content (94-99)
  • response (109-112)
components/microsoft_bookings/microsoft_bookings.app.mjs (5)
  • response (13-17)
  • response (46-52)
  • response (71-77)
  • response (99-105)
  • response (127-133)
⏰ 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: Verify TypeScript components
  • GitHub Check: pnpm publish
  • GitHub Check: Publish TypeScript components
🔇 Additional comments (11)
components/microsoft_bookings/actions/list-services/list-services.mjs (1)

23-38: LGTM!

The implementation follows the established pattern for list actions: calls the app method, normalizes the response, exports a summary with the count, and returns the full response. The defensive || [] fallback for response.value is good practice.

components/microsoft_bookings/actions/list-businesses/list-businesses.mjs (1)

17-27: LGTM!

The implementation is correct and follows the standard pattern for list actions. The defensive || [] fallback ensures the summary count works even if the API response structure is unexpected.

components/microsoft_bookings/actions/create-staff-member/create-staff-member.mjs (1)

101-107: LGTM!

The conditional logic correctly uses !== undefined checks for boolean properties, ensuring that explicit false values are properly included in the payload while omitting genuinely undefined values.

components/microsoft_bookings/actions/list-staff-members/list-staff-members.mjs (1)

23-38: LGTM!

The implementation is correct and consistent with the other list actions. The summary format properly uses template literals with the count, and the defensive || [] fallback ensures robust handling of unexpected API responses.

components/microsoft_bookings/actions/list-appointments/list-appointments.mjs (1)

33-52: LGTM!

The implementation correctly calls app.getCalendarView with the date range parameters, normalizes the response, and exports an appropriate summary. The pattern is consistent with the other list actions.

components/microsoft_bookings/actions/create-business/create-business.mjs (1)

3-13: LGTM on action metadata.

The action key, name, description with documentation link, version, type, and annotations are well-defined and consistent with the component pattern.

components/microsoft_bookings/actions/create-service/create-service.mjs (2)

3-13: LGTM on action metadata.

The action descriptor is well-structured with appropriate key, name, description linking to Microsoft documentation, and correct annotations.


115-118: Good: @odata.type included in content payload.

The content object correctly includes the OData type annotation for Microsoft Graph API compliance.

components/microsoft_bookings/actions/create-appointment/create-appointment.mjs (1)

3-13: LGTM on action metadata.

Well-structured action descriptor with appropriate key, name, description with documentation link, and correct annotations.

components/microsoft_bookings/microsoft_bookings.app.mjs (2)

1-2: LGTM on imports.

Proper imports for Microsoft Graph client with isomorphic-fetch polyfill for Node.js environments.


7-31: LGTM on businessId propDefinition.

Well-implemented async options with pagination support via nextLink.

@jcortes
Copy link
Collaborator Author

jcortes commented Dec 17, 2025

/approve

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.

[ACTION] Microsoft Booking

4 participants