Skip to content

feat: Guest booking with email/phone OTP - #137

Merged
NagariaHussain merged 28 commits into
bwhtech:mainfrom
UmakanthKaspa:feat/guest-booking
Feb 2, 2026
Merged

feat: Guest booking with email/phone OTP#137
NagariaHussain merged 28 commits into
bwhtech:mainfrom
UmakanthKaspa:feat/guest-booking

Conversation

@UmakanthKaspa

@UmakanthKaspa UmakanthKaspa commented Jan 23, 2026

Copy link
Copy Markdown
Contributor

closes: #89

Summary

Let guests book tickets without logging in. Event organizers can turn this on per event and pick how
to verify the guest: no check, email code, or phone code.

What changed

  • New fields on Buzz Event: "Allow Guest Booking" toggle and "Verification Method" dropdown (None /
    Email OTP / Phone OTP)
  • New API endpoints to send a 6-digit code by email or SMS, limited to 5 requests per hour
  • Wrong code locks you out after 5 tries for 10 minutes, and each code can only be used once
  • A user account is created for the guest silently (no password, no welcome email) so the booking has
    a real owner
  • Booking page now works without login when guest booking is on — guests see only basic event info,
    not the full event doc
  • Coupon per-user limit now checks the guest's actual email instead of the shared "Guest" user
  • Frontend: guest contact form, code verification popup with resend timer, success screen with login
    link
  • Navbar shows "Log In" button for guests

How to test

  • 6 backend tests cover: booking without code, booking with code, disabled guest booking, wrong code,
    missing email, and lockout after too many tries
  • 3 end-to-end browser tests cover: no verification, email code, and phone code
  • CI sets e2e_test_mode so code endpoints return the code in the response instead of sending real
    emails/SMS

##Demo

Screen.Recording.2026-01-27.at.9.53.06.PM.mov
Screen.Recording.2026-01-27.at.9.59.53.PM.mov

@UmakanthKaspa
UmakanthKaspa marked this pull request as draft January 23, 2026 02:15
@coderabbitai

coderabbitai Bot commented Jan 23, 2026

Copy link
Copy Markdown

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.


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.

@NagariaHussain

Copy link
Copy Markdown
Contributor

Let’s make both SMS and Email OTP options available to the user (they can also set it to No OTP verification btw). There is a PR somewhere in Framework repo by Bhushan to add generic phone OTP feature, from which we can borrow the code.

@UmakanthKaspa

UmakanthKaspa commented Jan 23, 2026

Copy link
Copy Markdown
Contributor Author

@NagariaHussain

Without OTP:

  • How do we know the email is really theirs?
  • If someone enters wrong email, tickets go to wrong person
  • We create user account when guest books. Next time, how do we know it's the same person?

@NagariaHussain

Copy link
Copy Markdown
Contributor

Let the event organisers decide. If someone is paying, they will enter their real email ID. If not the event organisers can turn it on.

@UmakanthKaspa
UmakanthKaspa marked this pull request as ready for review January 27, 2026 07:05
@UmakanthKaspa

Copy link
Copy Markdown
Contributor Author

@NagariaHussain

@NagariaHussain

Copy link
Copy Markdown
Contributor

Let's add some e2e test @UmakanthKaspa

All the three scenarios:

  • Guest
  • Guest with email OTP
  • Guest with phone OTP

You can use some flag in backend to return some hardcoded OTPs.

Comment thread dashboard/src/router.js Outdated
Comment thread dashboard/src/pages/BookTickets.vue Outdated
Comment thread dashboard/src/components/BookingForm.vue Outdated
Comment thread buzz/ticketing/doctype/event_booking/test_guest_booking.py Outdated
Comment thread buzz/ticketing/doctype/event_booking/event_booking.py Outdated
Comment thread buzz/api.py Outdated
@NagariaHussain

Copy link
Copy Markdown
Contributor

@UmakanthKaspa please add videos and relevant screenshots.

@UmakanthKaspa

Copy link
Copy Markdown
Contributor Author

@NagariaHussain added

Comment thread .github/workflows/ui-tests.yml Outdated
Comment thread buzz/api.py Outdated
Comment thread buzz/api.py Outdated
Comment thread buzz/api.py Outdated
Comment thread dashboard/src/pages/BookTickets.vue Outdated
Comment thread e2e/tests/guest-booking.spec.ts Outdated
@NagariaHussain

Copy link
Copy Markdown
Contributor

Looks odd, let's remove for now.

image

Instead of a toast let's show an error message below the input:

image

Use error message component from FrappeUI.

@UmakanthKaspa
UmakanthKaspa marked this pull request as draft January 28, 2026 08:57
@NagariaHussain

Copy link
Copy Markdown
Contributor

Commits are no longer conventional 😅

Let's maintain the convention.

@vishwajeet-13

Copy link
Copy Markdown
Collaborator

If I am logging in as a guest and buying a ticket for myself we shouldnt need to add our details two times?
Your details then attendee 1 details again

Screenshot 2026-01-30 at 4 50 06 PM

@UmakanthKaspa

Copy link
Copy Markdown
Contributor Author

If I am logging in as a guest and buying a ticket for myself we shouldnt need to add our details two times? Your details then attendee 1 details again
Screenshot 2026-01-30 at 4 50 06 PM

@vishwajeet-13 Good catch! Will auto-fill Attendee 1 from guest details — they can edit if booking for someone else 👍

@UmakanthKaspa

Copy link
Copy Markdown
Contributor Author

@vishwajeet-13

  • Guest name/email/phone saved to localStorage
  • Auto-fills attendee 1 on blur, only if field is empty
  • User can edit both guest and attendee fields independently
Screen.Recording.2026-01-30.at.8.20.54.PM.mov

@NagariaHussain

Copy link
Copy Markdown
Contributor

Can you add this case in the e2e test please?

@UmakanthKaspa

Copy link
Copy Markdown
Contributor Author

@NagariaHussain added

Comment thread buzz/api.py
Comment thread dashboard/src/components/BookingForm.vue
@NagariaHussain NagariaHussain changed the title Feat/guest booking feat: Guest booking with email/phone OTP Jan 31, 2026
@UmakanthKaspa
UmakanthKaspa marked this pull request as draft February 1, 2026 05:34
@UmakanthKaspa
UmakanthKaspa marked this pull request as ready for review February 1, 2026 06:53
@NagariaHussain

Copy link
Copy Markdown
Contributor

Why maintain two config keys? in_test and allow_tests? Let's make "in_test" work (toggle before running UI tests too, check how it is toggled for unit tests) everywhere both in UI and unit tests.

Comment thread buzz/__init__.py Outdated
@NagariaHussain

Copy link
Copy Markdown
Contributor

Always look in Frappe code for patterns before reinventing them 😉

@UmakanthKaspa

Copy link
Copy Markdown
Contributor Author

@NagariaHussain I tried bench execute toggle_test_mode - doesn't work before or after server start.

Why: bench execute runs in separate process. When bench start runs, those flags are lost.

Fix: We need either env var or site config. Currently using CI env var. Can switch to allow_tests if you
prefer.

Did I miss anything? Let me know your thoughts.

@NagariaHussain
NagariaHussain merged commit fc10fda into bwhtech:main Feb 2, 2026
4 checks passed
@nanoharsha

nanoharsha commented Feb 16, 2026

Copy link
Copy Markdown

Hello @UmakanthKaspa
Could you pls check this issue w.r.t Ticket booking screen not visible post booking via Guest Login.
#167

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.

Guest booking

4 participants