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: support phone based booking api #17635

Merged
merged 16 commits into from
Jan 8, 2025
Merged

feat: support phone based booking api #17635

merged 16 commits into from
Jan 8, 2025

Conversation

Udit-takkar
Copy link
Contributor

@Udit-takkar Udit-takkar commented Nov 14, 2024

What does this PR do?

  • Fixes #XXXX (GitHub issue number)
  • Fixes CAL-XXXX (Linear issue number - should be visible at the bottom of the GitHub issue description)

https://app.campsite.com/cal/posts/muplmwz5gjpg

  1. Create an event type and go to advance settings and make email field as not required and Phone number required and visible on booking page.

request payload:-

{
  "start": "2024-11-18T05:15:00.000Z",
  "eventTypeId": 32,
  "attendee": {
    "name": "John Doe",
    "attendeePhoneNumber":"+919876543210",
    "timeZone": "Asia/Kolkata",
    "language": "en"
  }
}

Screenshot 2024-11-14 at 6 41 38 PM

Mandatory Tasks (DO NOT REMOVE)

  • I have self-reviewed the code (A decent size PR without self-review might be rejected).
  • N/A I have updated the developer docs in /docs if this PR makes changes that would require a documentation change. If N/A, write N/A here and check the checkbox.
  • I confirm automated tests are in place that prove my fix is effective or that my feature works.

How should this be tested?

@graphite-app graphite-app bot requested a review from a team November 14, 2024 13:11
Copy link
Contributor

Hey there and thank you for opening this pull request! 👋🏼

We require pull request titles to follow the Conventional Commits specification and it looks like your proposed title needs to be adjusted.

Details:

No release type found in pull request title "Feat/phone based api". Add a prefix to indicate what kind of release this pull request corresponds to. For reference, see https://www.conventionalcommits.org/

Available types:
 - feat: A new feature
 - fix: A bug fix
 - docs: Documentation only changes
 - style: Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc)
 - refactor: A code change that neither fixes a bug nor adds a feature
 - perf: A code change that improves performance
 - test: Adding missing tests or correcting existing tests
 - build: Changes that affect the build system or external dependencies (example scopes: gulp, broccoli, npm)
 - ci: Changes to our CI configuration files and scripts (example scopes: Travis, Circle, BrowserStack, SauceLabs)
 - chore: Other changes that don't modify src or test files
 - revert: Reverts a previous commit

@Udit-takkar Udit-takkar changed the title Feat/phone based api feat: support phone based booking api Nov 14, 2024
@keithwillcode keithwillcode added core area: core, team members only enterprise area: enterprise, audit log, organisation, SAML, SSO labels Nov 14, 2024
@dosubot dosubot bot added api area: API, enterprise API, access token, OAuth ✨ feature New feature or request labels Nov 14, 2024
@Udit-takkar Udit-takkar added this to the v4.7 milestone Nov 14, 2024
Copy link

graphite-app bot commented Nov 14, 2024

Graphite Automations

"Add consumer team as reviewer" took an action on this PR • (11/14/24)

1 reviewer was added to this PR based on Keith Williams's automation.

"Add foundation team as reviewer" took an action on this PR • (01/08/25)

1 reviewer was added to this PR based on Keith Williams's automation.

Copy link
Contributor

@supalarry supalarry left a comment

Choose a reason for hiding this comment

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

The PR looks good but the problem I see is that right now we can make a booking using attendee phone number for event types that don't have attendee phone number booking field. Just like we have in this PR RequireEmailOrPhone we should have the same logic in event type.

The 4.5 release blog states

To enable this (phone based bookings), go to your event type and enable 'Phone' under booking questions, mark it as required, and you can then turn off 'Email'.

So i think we should follow same logic and at least allow enabling phone based event types (event type without email but with phone) and allow an event type to have either phone or email booking field in files I described in the thread.

However, to not block users who do have event types with phone I guess we could merge this after tests are added to unblock those users, but a follow up for the event types would be needed. Do you think you would have time for that?

Copy link

vercel bot commented Nov 15, 2024

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

2 Skipped Deployments
Name Status Preview Comments Updated (UTC)
cal ⬜️ Ignored (Inspect) Visit Preview Jan 8, 2025 3:00pm
calcom-web-canary ⬜️ Ignored (Inspect) Visit Preview Jan 8, 2025 3:00pm

Copy link
Contributor

github-actions bot commented Dec 3, 2024

This PR is being marked as stale due to inactivity.

Copy link
Contributor

github-actions bot commented Jan 5, 2025

This PR is being marked as stale due to inactivity.

@github-actions github-actions bot added the Stale label Jan 5, 2025
@Udit-takkar Udit-takkar requested a review from supalarry January 7, 2025 10:44
@github-actions github-actions bot removed the Stale label Jan 8, 2025
const body: UpdateTeamEventTypeInput_2024_06_14 = {
bookingFields: [
{
type: "email",
Copy link
Contributor

Choose a reason for hiding this comment

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

Like before - shouldn't we also omit email booking field here?

@IsBoolean()
@IsOptional()
@DocsProperty()
required = true;
Copy link
Contributor

Choose a reason for hiding this comment

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

Why does it have to be required if we can have phone based bookings aka without email?

Copy link
Contributor

Choose a reason for hiding this comment

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

In the request payload of the PR description there is only attendee phone number.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

there was no required field defined for email i just set the default value true if it hasn't been passed as false or empty

@graphite-app graphite-app bot requested a review from a team January 8, 2025 12:58
Copy link

socket-security bot commented Jan 8, 2025

Removed dependencies detected. Learn more about Socket for GitHub ↗︎

View full report↗︎

Copy link
Contributor

github-actions bot commented Jan 8, 2025

E2E results are ready!

@Udit-takkar Udit-takkar merged commit c9c5493 into main Jan 8, 2025
38 checks passed
@Udit-takkar Udit-takkar deleted the feat/phone-based-api branch January 8, 2025 15:46
MuhammadAimanSulaiman pushed a commit to hit-pay/cal.com that referenced this pull request Feb 24, 2025
* chore: save progress

* feat: support phone based booking using API v2

* chore: change name of the variable

* fix: update event types and booking fields for improved validation and new properties

- Updated imports in input and output event types services to use the correct library version.
- Added new `avatarUrl` and `successRedirectUrl` properties to the Swagger documentation for user and booking schemas.
- Enhanced booking fields validation by changing the `required` property to a boolean type.
- Improved descriptions and examples in the OpenAPI specifications for better clarity.
- Refactored booking fields input and output classes to include new properties and ensure proper validation.

* fix: booking with phone number

* test: add event type update test

* test: add test for creating booking

* chore: update unit test

* fix: tests

* fix: add turbo

* chore: remove emial

* refactor: make email optional and move it to service

* fix: test

* chore: bump platform-libraries

* fix: e2e test

---------

Co-authored-by: supalarry <laurisskraucis@gmail.com>
MuhammadAimanSulaiman pushed a commit to hit-pay/cal.com that referenced this pull request Feb 24, 2025
* chore: save progress

* feat: support phone based booking using API v2

* chore: change name of the variable

* fix: update event types and booking fields for improved validation and new properties

- Updated imports in input and output event types services to use the correct library version.
- Added new `avatarUrl` and `successRedirectUrl` properties to the Swagger documentation for user and booking schemas.
- Enhanced booking fields validation by changing the `required` property to a boolean type.
- Improved descriptions and examples in the OpenAPI specifications for better clarity.
- Refactored booking fields input and output classes to include new properties and ensure proper validation.

* fix: booking with phone number

* test: add event type update test

* test: add test for creating booking

* chore: update unit test

* fix: tests

* fix: add turbo

* chore: remove emial

* refactor: make email optional and move it to service

* fix: test

* chore: bump platform-libraries

* fix: e2e test

---------

Co-authored-by: supalarry <laurisskraucis@gmail.com>
MuhammadAimanSulaiman pushed a commit to hit-pay/cal.com that referenced this pull request Feb 25, 2025
* chore: save progress

* feat: support phone based booking using API v2

* chore: change name of the variable

* fix: update event types and booking fields for improved validation and new properties

- Updated imports in input and output event types services to use the correct library version.
- Added new `avatarUrl` and `successRedirectUrl` properties to the Swagger documentation for user and booking schemas.
- Enhanced booking fields validation by changing the `required` property to a boolean type.
- Improved descriptions and examples in the OpenAPI specifications for better clarity.
- Refactored booking fields input and output classes to include new properties and ensure proper validation.

* fix: booking with phone number

* test: add event type update test

* test: add test for creating booking

* chore: update unit test

* fix: tests

* fix: add turbo

* chore: remove emial

* refactor: make email optional and move it to service

* fix: test

* chore: bump platform-libraries

* fix: e2e test

---------

Co-authored-by: supalarry <laurisskraucis@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api area: API, enterprise API, access token, OAuth bookings area: bookings, availability, timezones, double booking core area: core, team members only enterprise area: enterprise, audit log, organisation, SAML, SSO ✨ feature New feature or request ready-for-e2e
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants