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

feat: booking with phone number #14461

Open
wants to merge 64 commits into
base: main
Choose a base branch
from
Open

Conversation

Udit-takkar
Copy link
Contributor

@Udit-takkar Udit-takkar commented Apr 8, 2024

What does this PR do?

Fixes #14534
Follow up: #15415

How to create event type with only phone number?

  1. Create a Team Event type

Screenshot 2024-05-13 at 9 03 09 PM

  1. Make Email field not required and toggle off to hide the field

Screenshot 2024-05-13 at 9 03 49 PM

Turn the toggle on for attendee phone number

Screenshot 2024-05-13 at 9 04 07 PM

  1. Fill the form

Screenshot 2024-05-13 at 9 06 16 PM

  • Added 4 Unit Tests

    • [Event Type with only Attendee Phone number as required field and Email as hidden field] succesfully creates a booking when the users are available as per the common schedule selected in the event-type
    • [Event Type with both Attendee Phone number and Email as required fields] succesfully creates a booking when the users are available as per the common schedule selected in the event-type
    • [Event Type that requires confirmation with only Attendee Phone number as required field and Email as optional field] succesfully creates a booking when the users are available as per the common schedule selected in the event-type
    • [Event Type with Both Email and Attendee Phone Number as required fields] should send rescheduling emails when round robin is rescheduled to same host
  • Added 2 E2E tests

    • Can create a booking for Round Robin EventType with both phone number and email required
    • Can create a booking for Collective EventType with only phone number

Type of change

  • New feature (non-breaking change which adds functionality)

Copy link

vercel bot commented Apr 8, 2024

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

Name Status Preview Comments Updated (UTC)
platform-starter-kit ❌ Failed (Inspect) Jul 17, 2024 7:53pm
4 Skipped Deployments
Name Status Preview Comments Updated (UTC)
ai ⬜️ Ignored (Inspect) Visit Preview Jul 17, 2024 7:53pm
cal ⬜️ Ignored (Inspect) Visit Preview Jul 17, 2024 7:53pm
calcom-web-canary ⬜️ Ignored (Inspect) Visit Preview Jul 17, 2024 7:53pm
qa ⬜️ Ignored (Inspect) Visit Preview Jul 17, 2024 7:53pm

@github-actions github-actions bot added the ❗️ migrations contains migration files label Apr 8, 2024
Copy link
Contributor

github-actions bot commented Apr 8, 2024

Thank you for following the naming conventions! 🙏 Feel free to join our discord and post your PR link.

Copy link

deploysentinel bot commented Apr 8, 2024

Current Playwright Test Results Summary

✅ 318 Passing - ❌ 3 Failing - ⚠️ 16 Flaky

Run may still be in progress, this comment will be updated as current testing workflow or job completes...

(Last updated on 05/21/2024 03:16:11pm UTC)

Run Details

Running Workflow PR Update on Github Actions

Commit: eb72e57

Started: 05/21/2024 03:12:32pm UTC

❌ Failures

📄   apps/web/playwright/profile.e2e.ts • 1 Failure

Test Case Results

Test Case Last 7 days Failures Last 7 days Flakes
Update Profile Can update a users email (verification enabled)
Retry 2Retry 1Initial Attempt
Error: page.waitForURL: Timeout 30000ms exceeded....
page.waitForURL: Timeout 30000ms exceeded.
=========================== logs ===========================
waiting for navigation to "/event-types" until "load"
  navigated to "http://localhost:3000/auth/login"
============================================================
38.81% (104) 104 / 268 runs
failed over last 7 days
33.58% (90) 90 / 268 runs
flaked over last 7 days

📄   apps/web/playwright/managedBooking/advancedOptions.e2e.ts • 1 Failure

Test Case Results

Test Case Last 7 days Failures Last 7 days Flakes
Check advanced options in a managed team event type Check advanced options in a managed team event type with offer seats
Retry 2Retry 1Initial Attempt
Error: Test timeout of 60000ms exceeded.
Test timeout of 60000ms exceeded.
2.53% (6) 6 / 237 runs
failed over last 7 days
5.49% (13) 13 / 237 runs
flaked over last 7 days

📄   apps/web/playwright/manage-booking-questions.e2e.ts • 1 Failure

Test Case Results

Test Case Last 7 days Failures Last 7 days Flakes
Manage Booking Questions For Team EventType Do a booking with a user added question and verify a few thing in b/w
Retry 2Retry 1Initial Attempt
Error: Timed out 30000ms waiting for expect(received).toBeVisible()...
Timed out 30000ms waiting for expect(received).toBeVisible()
Call log:
  - expect.toBeVisible with timeout 30000ms
  - waiting for locator('[data-fob-field-name]:not(.hidden)').nth(5).locator('[name="how-are-you"]')
  - waiting for locator('[data-fob-field-name]:not(.hidden)').nth(5).locator('[name="how-are-you"]')

6.78% (16) 16 / 236 runs
failed over last 7 days
1.27% (3) 3 / 236 runs
flaked over last 7 days

⚠️ Flakes

📄   apps/web/playwright/integrations-stripe.e2e.ts • 1 Flake

Test Case Results

Test Case Last 7 days Failures Last 7 days Flakes
Stripe integration When event is paid and confirmed Payment should confirm pending payment booking
Retry 1Initial Attempt
4.55% (10) 10 / 220 runs
failed over last 7 days
5.45% (12) 12 / 220 runs
flaked over last 7 days

📄   apps/web/playwright/signup.e2e.ts • 1 Flake

Test Case Results

Test Case Last 7 days Failures Last 7 days Flakes
Signup Flow Test Email verification sent if enabled
Retry 1Initial Attempt
0.81% (2) 2 / 247 runs
failed over last 7 days
28.74% (71) 71 / 247 runs
flaked over last 7 days

📄   packages/embeds/embed-core/playwright/tests/action-based.e2e.ts • 9 Flakes

Top 1 Common Error Messages

null

9 Test Cases Affected

Test Case Results

Test Case Last 7 days Failures Last 7 days Flakes
Popup Tests should open embed iframe on click - Configured with light theme
Retry 1Initial Attempt
2.55% (6) 6 / 235 runs
failed over last 7 days
60.43% (142) 142 / 235 runs
flaked over last 7 days
Popup Tests should be able to reschedule
Retry 1Initial Attempt
-163.22% (-142) -142 / 87 runs
failed over last 7 days
163.22% (142) 142 / 87 runs
flaked over last 7 days
Popup Tests should open Routing Forms embed on click
Retry 1Initial Attempt
-163.22% (-142) -142 / 87 runs
failed over last 7 days
163.22% (142) 142 / 87 runs
flaked over last 7 days
Popup Tests Floating Button Popup Pro User - Configured in App with default setting of system theme should open embed iframe according to system theme when no theme is configured through Embed API
Retry 1Initial Attempt
-159.77% (-139) -139 / 87 runs
failed over last 7 days
160.92% (140) 140 / 87 runs
flaked over last 7 days
Popup Tests Floating Button Popup Pro User - Configured in App with default setting of system theme should open embed iframe according to system theme when configured with 'auto' theme using Embed API
Retry 1Initial Attempt
-161.63% (-139) -139 / 86 runs
failed over last 7 days
161.63% (139) 139 / 86 runs
flaked over last 7 days
Popup Tests Floating Button Popup Pro User - Configured in App with default setting of system theme should open embed iframe(Booker Profile Page) with dark theme when configured with dark theme using Embed API
Retry 1Initial Attempt
-161.63% (-139) -139 / 86 runs
failed over last 7 days
161.63% (139) 139 / 86 runs
flaked over last 7 days
Popup Tests Floating Button Popup Pro User - Configured in App with default setting of system theme should open embed iframe(Event Booking Page) with dark theme when configured with dark theme using Embed API
Retry 1Initial Attempt
-161.63% (-139) -139 / 86 runs
failed over last 7 days
161.63% (139) 139 / 86 runs
flaked over last 7 days
Popup Tests prendered embed should be loaded and apply the config given to it
Retry 1Initial Attempt
-161.63% (-139) -139 / 86 runs
failed over last 7 days
161.63% (139) 139 / 86 runs
flaked over last 7 days
Popup Tests should open on clicking child element
Retry 1Initial Attempt
-159.30% (-137) -137 / 86 runs
failed over last 7 days
159.30% (137) 137 / 86 runs
flaked over last 7 days

📄   packages/embeds/embed-core/playwright/tests/namespacing.e2e.ts • 4 Flakes

Top 1 Common Error Messages

null

4 Test Cases Affected

Test Case Results

Test Case Last 7 days Failures Last 7 days Flakes
Namespacing Inline Embed Double install Embed Snippet with inline embed using a namespace
Retry 1Initial Attempt
0.43% (1) 1 / 234 run
failed over last 7 days
61.54% (144) 144 / 234 runs
flaked over last 7 days
Namespacing Inline Embed Add inline embed using a namespace without reload
Retry 1Initial Attempt
0% (0) 0 / 234 runs
failed over last 7 days
63.68% (149) 149 / 234 runs
flaked over last 7 days
Namespacing Inline Embed Double install Embed Snippet with inline embed without a namespace(i.e. default namespace)
Retry 1Initial Attempt
0% (0) 0 / 234 runs
failed over last 7 days
64.53% (151) 151 / 234 runs
flaked over last 7 days
Namespacing Different namespaces can have different init configs
Retry 1Initial Attempt
0% (0) 0 / 233 runs
failed over last 7 days
61.37% (143) 143 / 233 runs
flaked over last 7 days

📄   apps/web/playwright/login.e2e.ts • 1 Flake

Test Case Results

Test Case Last 7 days Failures Last 7 days Flakes
user can login & logout succesfully -- future login flow user & logout using dashboard
Retry 1Initial Attempt
4.18% (10) 10 / 239 runs
failed over last 7 days
35.56% (85) 85 / 239 runs
flaked over last 7 days

View Detailed Build Results


Copy link
Contributor

github-actions bot commented Apr 10, 2024

📦 Next.js Bundle Analysis for @calcom/web

This analysis was generated by the Next.js Bundle Analysis action. 🤖

This PR introduced no changes to the JavaScript bundle! 🙌

@keithwillcode keithwillcode added this to the v4.1 milestone Apr 16, 2024
Copy link
Member

@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.

Overall nice work so far @Udit-takkar. I only have 2 asks to increase the confidence for merging.

  • Since this is a significant change of the booking process. Can we at least add a couple of tests cases for our E2E booking flow tests?
  • Since email is not required anymore I feel like this is introducing a lot of nesting and overall it's becoming harder to track these fields. What's the rationale behind the DB design? What other alternatives were considered and why was this the winner?

apps/web/components/booking/BookingListItem.tsx Outdated Show resolved Hide resolved
@@ -64,7 +64,7 @@ export function getMockPaymentService() {
paymentData: Payment
): Promise<void> {
// TODO: App implementing PaymentService is supposed to send email by itself at the moment.
await sendAwaitingPaymentEmail({
await sendAwaitingPaymentEmailAndSMS({
Copy link
Member

Choose a reason for hiding this comment

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

Instead of keep adding to the name. Let's rename it to something more generic that infers handling more than one type of notification.

Suggested change
await sendAwaitingPaymentEmailAndSMS({
await sendAwaitingPaymentNotification({

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I have to create a single notification manager class in follow up PR #15415 (comment)

@@ -62,11 +63,11 @@ export default class ExchangeCalendarService implements Calendar {
appointment.Location = event.location || "";
appointment.Body = new MessageBody(event.description || "");
event.attendees.forEach((attendee: Person) => {
appointment.RequiredAttendees.Add(new Attendee(attendee.email));
appointment.RequiredAttendees.Add(new Attendee(attendee.email ?? BOOKED_WITH_SMS_EMAIL));
Copy link
Member

Choose a reason for hiding this comment

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

Why is the BOOKED_WITH_SMS_EMAIL necessary?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

email is required field here to create an event and BOOKED_WITH_SMS would also help us know that it was booked with phone number.

packages/platform/atoms/booker/BookerWebWrapper.tsx Outdated Show resolved Hide resolved
@zomars zomars added the high-risk Requires approval by Foundation team label Jul 15, 2024
@Udit-takkar
Copy link
Contributor Author

Udit-takkar commented Jul 15, 2024

Since this is a significant change of the booking process. Can we at least add a couple of tests cases for our E2E booking flow tests?

Yeah sure. I already added few unit tests. is there any specific scenario that i should add?

Since email is not required anymore I feel like this is introducing a lot of nesting and overall it's becoming harder to track these fields. What's the rationale behind the DB design? What other alternatives were considered and why was this the winner?

The changes in DB schema are:-

I made email an optional field now and added a new field phoneNumber in Attendee model with a constraint that make sure atleast one of the two exist

ALTER TABLE "Attendee"
ADD CONSTRAINT check_email_or_phone
CHECK ("email" IS NOT NULL OR "phoneNumber" IS NOT NULL);

BOOKED_WITH_SMS is used as a placeholder email address when it's not present as a lot of our codebase depend upon bookerEmail and this is a very big change. Few things like creating a calendar event would also require email of attendee.

Eventually I have to completely remove BOOKED_WITH_SMS after some time on production. This feature is only limited to org team event types for now and we need it fast for cal ai feature which some customers are waiting for.

@zomars
Copy link
Member

zomars commented Jul 15, 2024

Yeah sure. I already few unit tests. is there any specific scenario that i should add?

Booking with only phone required. Booking with both phone and email required.

@Udit-takkar
Copy link
Contributor Author

Booking with only phone required. Booking with both phone and email required.

Done.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
5 points Created by SyncLinear.com automated-tests area: unit tests, e2e tests, playwright booking-page area: booking page, public booking page, booker bookings area: bookings, availability, timezones, double booking consumer core area: core, team members only ❗️ .env changes contains changes to env variables event-types area: event types, event-types ✨ feature New feature or request High priority Created by Linear-GitHub Sync high-risk Requires approval by Foundation team ❗️ migrations contains migration files 🚧 wip / in the making This is currently being worked on
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[CAL-3403] Allow booking with phone only
6 participants