Skip to content

Change relationship of team members and bookings to many-to-many#6553

Closed
joeauyeung wants to merge 38 commits intomainfrom
change-relationship-of-team-members-and-bookings
Closed

Change relationship of team members and bookings to many-to-many#6553
joeauyeung wants to merge 38 commits intomainfrom
change-relationship-of-team-members-and-bookings

Conversation

@joeauyeung
Copy link
Copy Markdown
Contributor

@joeauyeung joeauyeung commented Jan 18, 2023

What does this PR do?

This PR changes the relationship between team members and bookings to a many-to-many relationship. This should help with future bug fixes and features surrounding teams.

Fixes #6582

TODO:
Ensure that all features involving team members and bookings are working correctly

  • Ensure that bookings show for all team members
    • Allow team members to cancel bookings
    • Allow team members to reschedule bookings
  • Investigate how to convert previous records of just user to booking
  • Write team members in booking for collective event types
  • Write team members in booking for round robin event types
  • Check that reminders are valid for team members
    • In workflows.tsx
  • Check that you can CRUD reoccurring events
  • Check that payments on team events work
  • Check that the CalendarEvent type isn’t used anywhere else

Environment: Staging(main branch) / Production

Type of change

  • For both round robin and collective team events
    • Create a booking under these two team event types
    • Log into a second team member and check that you can reschedule and cancel these bookings
    • Do the same but adding seats, requires confirmation, reoccurring, and payments
    • Also check that workflows are scheduled & emails are being sent to all team members associated with those bookings

Checklist

  • I haven't added tests that prove my fix is effective or that my feature works
  • I haven't checked if new and existing unit tests pass locally with my changes

@vercel
Copy link
Copy Markdown

vercel bot commented Jan 18, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated
cal ✅ Ready (Inspect) Visit Preview 💬 Add your feedback Feb 8, 2023 at 8:02PM (UTC)
cal-com-storybook ✅ Ready (Inspect) Visit Preview 💬 Add your feedback Feb 8, 2023 at 8:02PM (UTC)
ui ✅ Ready (Inspect) Visit Preview 💬 Add your feedback Feb 8, 2023 at 8:02PM (UTC)

@joeauyeung joeauyeung added 🧹 Improvements Improvements to existing features. Mostly UX/UI teams area: teams, round robin, collective, managed event-types labels Jan 26, 2023
@joeauyeung joeauyeung changed the title WIP Change relationship of team members and bookings to many-to-many Change relationship of team members and bookings to many-to-many Jan 26, 2023
@joeauyeung joeauyeung requested a review from a team January 26, 2023 20:57
@joeauyeung joeauyeung marked this pull request as ready for review January 26, 2023 20:57
@zomars
Copy link
Copy Markdown
Contributor

zomars commented Feb 8, 2023

Just to be sure. What problem is this PR solving specifically?

This reverts commit 606e538.

# Conflicts:
#	packages/prisma/schema.prisma
@zomars zomars force-pushed the change-relationship-of-team-members-and-bookings branch from fa37ec8 to 681b6f4 Compare February 8, 2023 19:42
Copy link
Copy Markdown
Contributor

@zomars zomars left a comment

Choose a reason for hiding this comment

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

Will block to address some questions. Maybe I'm missing some context on why this PR is necessary as well. But still I cannot merge a PR that I cannot understand yet.

appId String?
destinationCalendars DestinationCalendar[]
invalid Boolean? @default(false)
bookingReferences BookingReference[]
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Why?

externalCalendarId String?
deleted Boolean?
credentialId Int?
credential Credential? @relation(fields: [credentialId], references: [id])
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

What are we using this for?

id Int @id @default(autoincrement())
uid String @unique
user User? @relation(fields: [userId], references: [id])
user User[]
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Some observations:

  • Are we trying to keep track of attendees here?
  • How do we differentiate between an owner and attendee?
  • What does it means that a Booking has a ´user´?

name: booking.user.name || "",
email: booking.user.email,
timeZone: booking.user.timeZone,
language: { locale: booking.user[0]?.locale || "" },
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I'm not a fan of polluting with ´booking.user[0]´ everywhere. It is not legible. Let's either set a constant (const organizer = booking.user[0]) or rethink where to save the organizer.

@joeauyeung
Copy link
Copy Markdown
Contributor Author

joeauyeung commented May 23, 2023

Closing for now and reevaluate at a later date.

@joeauyeung joeauyeung closed this May 23, 2023
@keithwillcode keithwillcode deleted the change-relationship-of-team-members-and-bookings branch September 17, 2025 11:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🧹 Improvements Improvements to existing features. Mostly UX/UI ❗️ migrations contains migration files teams area: teams, round robin, collective, managed event-types

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[CAL-838] Change relationship of bookings and team members to many-to-many

4 participants