-
-
Notifications
You must be signed in to change notification settings - Fork 186
feat(api): attach attendees when retrieving events #147
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
Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
WalkthroughThe changes introduce comprehensive attendee support for calendar events across Google and Microsoft providers. New types and interfaces for attendees are defined, and parsing logic is added to normalize attendee data from both providers into a unified internal format. Existing event parsing functions are updated to include attendee information. Changes
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. 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)
Other keywords and placeholders
CodeRabbit Configuration File (
|
|
@coderabbitai full review |
✅ Actions performedFull review triggered. |
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: 0
🧹 Nitpick comments (1)
packages/api/src/providers/google-calendar/utils.ts (1)
165-178: Consider safer type handling for response status.The attendee parsing function is well-structured, but the type assertion on line 173 could be safer.
Consider this safer approach:
export function parseGoogleCalendarAttendee( attendee: GoogleCalendarEventAttendee, ): Attendee { return { id: attendee.id, email: attendee.email, name: attendee.displayName, - status: parseGoogleCalendarAttendeeStatus( - attendee.responseStatus as GoogleCalendarEventAttendeeResponseStatus, - ), + status: attendee.responseStatus + ? parseGoogleCalendarAttendeeStatus(attendee.responseStatus as GoogleCalendarEventAttendeeResponseStatus) + : "unknown", type: parseGoogleCalendarAttendeeType(attendee), additionalGuests: attendee.additionalGuests, }; }
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (5)
packages/api/src/providers/google-calendar/interfaces.ts(1 hunks)packages/api/src/providers/google-calendar/utils.ts(3 hunks)packages/api/src/providers/interfaces.ts(2 hunks)packages/api/src/providers/microsoft-calendar.ts(1 hunks)packages/api/src/providers/microsoft-calendar/utils.ts(4 hunks)
🧰 Additional context used
🧬 Code Graph Analysis (2)
packages/api/src/providers/microsoft-calendar/utils.ts (1)
packages/api/src/providers/interfaces.ts (2)
AttendeeStatus(49-49)Attendee(39-47)
packages/api/src/providers/google-calendar/utils.ts (2)
packages/api/src/providers/interfaces.ts (2)
AttendeeStatus(49-49)Attendee(39-47)packages/api/src/providers/google-calendar/interfaces.ts (2)
GoogleCalendarEventAttendeeResponseStatus(35-39)GoogleCalendarEventAttendee(32-34)
🪛 GitHub Actions: Check formatting
packages/api/src/providers/microsoft-calendar/utils.ts
[error] 1-1: Prettier formatting check failed. Run 'prettier --write' to fix code style issues.
🔇 Additional comments (11)
packages/api/src/providers/microsoft-calendar.ts (1)
11-11: LGTM: Good refactoring to make color utility provider-agnostic.Moving the
assignColorimport from the Google-specific path to the generic./colorsmodule is a sensible refactoring that supports usage across multiple calendar providers.packages/api/src/providers/interfaces.ts (2)
30-30: LGTM: Appropriate optional field for attendees.Adding the optional
attendeesfield toCalendarEventis the right approach since not all events have attendees.
39-49: LGTM: Well-designed attendee interface with proper cross-provider support.The
Attendeeinterface is thoughtfully designed with:
- Appropriate optional/required field balance
- Clear status and type enumerations
- Proper documentation of provider-specific fields
- Good type safety with the
AttendeeStatustype aliaspackages/api/src/providers/google-calendar/interfaces.ts (1)
32-39: LGTM: Well-constructed type definitions for Google Calendar attendees.The type definitions are properly structured:
GoogleCalendarEventAttendeecorrectly usesNonNullableto handle the optional attendees arrayGoogleCalendarEventAttendeeResponseStatusaccurately represents Google's API response values- Both types provide strong typing support for the parsing utilities
packages/api/src/providers/microsoft-calendar/utils.ts (3)
118-118: LGTM: Proper integration of attendee parsing.The attendees field correctly uses the parsing function and handles the case where attendees might be undefined with the nullish coalescing operator.
205-229: LGTM: Comprehensive status mapping with appropriate fallback.The status mapping function properly handles all Microsoft response statuses and provides a sensible fallback to "unknown" for unmapped cases.
231-240: Let’s locate the type definitions to confirm a safe fallback fortype:#!/bin/bash # Search for MicrosoftEventAttendee definition rg 'MicrosoftEventAttendee' -n packages/api # Show Attendee interface around its definition sed -n '30,80p' packages/api/src/providers/interfaces.tspackages/api/src/providers/google-calendar/utils.ts (4)
82-82: LGTM: Proper attendee integration with null safety.The attendees field correctly uses the parsing function and handles undefined cases appropriately.
131-139: LGTM: Enhanced function now supports broader AttendeeStatus type.The function properly handles the expanded
AttendeeStatustype, mapping "unknown" to Google's "needsAction" status appropriately.
141-149: LGTM: Clean status conversion with proper mapping.The status parsing function correctly maps Google's "needsAction" to the internal "unknown" status while preserving other statuses.
151-163: LGTM: Well-structured attendee type determination.The function uses a logical priority order (resource > optional > required) to determine attendee types based on Google's boolean flags.
Description
Briefly describe what you did and why.
Screenshots / Recordings
Add screenshots or recordings here to help reviewers understand your changes.
Type of Change
Related Areas
Testing
Checklist
Notes
(Optional) Add anything else you'd like to share.
By submitting, I confirm I understand and stand behind this code. If AI was used, I’ve reviewed and verified everything myself.
Summary by CodeRabbit