Skip to content

Verified contact onboarding#99

Open
zzawook wants to merge 3 commits into
masterfrom
feat/account-contact-85
Open

Verified contact onboarding#99
zzawook wants to merge 3 commits into
masterfrom
feat/account-contact-85

Conversation

@zzawook

@zzawook zzawook commented May 25, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • add nullable account phone, DOB, and guardian contact fields plus private guardian OTP storage in Supabase
  • collect DOB and account phone during signup and /complete-profile, leaving existing users incomplete until they finish the gate
  • require verified account phone for all users and verified guardian email + phone for users under 18
  • surface contact completeness in middleware, admin approval, profile/admin views, export schema, and reminder emails
  • add manual coverage notes in documentation/pr99-manual-test-guide.md

Closes #85
Closes #91

Validation

  • npm test -- --reporter=dot — 79 files, 938 tests passed
  • NEXT_PUBLIC_SUPABASE_URL=https://example.supabase.co NEXT_PUBLIC_SUPABASE_ANON_KEY=dummy NEXT_PUBLIC_MAPBOX_TOKEN=dummy NEXT_PUBLIC_APP_URL=http://localhost:3000 npm run build
  • Targeted ESLint on changed PR99 files passed
  • Playwright smoke on /login desktop/mobile passed; under-18 signup reveals guardian fields and phone auto-formatting works
  • Linked Supabase schema verified for contact columns, guardian OTP table, and signup trigger metadata copy

Notes

  • Full npm run lint still reports existing unrelated repo-wide issues in map hooks, analytics typing, and older test mocks.
  • The local dev server is responding at http://localhost:3000.

@Shamanbenny

Copy link
Copy Markdown
Collaborator

Refer to the comments on #85 (comment) and #91 (comment) respectively for clarification to the requirements relevant to the current PR.

@zzawook zzawook marked this pull request as ready for review July 5, 2026 17:26
{user.fullName && <p className="truncate text-sm text-gray-500">{user.email}</p>}
<p className="mt-1 flex items-center gap-1.5 truncate text-xs text-gray-500">
<Phone className="h-3.5 w-3.5 shrink-0" />
{user.phoneNumber || 'No phone on file'}

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I think it would be nicer if phone numbers (not limited to this instance) would be displayed with a whitespace between the country code and the actual number so the number itself is more easily readable.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

When a user who has not completed their profile (e..g missing contact number and birth month) logs in, they are directed to a page to complete their profile but there is currently no way to navigate out of the page. The only way to navigate out is to clear the cookies. I think a back button which redirects them back to the login page (and clears any necessary data/cookies) would suffice.

<p className="mt-1 text-sm text-gray-500">Used by coordinators for walk and safety follow-up.</p>
</div>
<Link
href="/complete-profile"

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

If a user has already completed their profile, while clicking the button will redirect them to the /complete-profile page, the page itself redirects them back to the home page so there is no way for the user to change their contact number.

className="w-full bg-green-600 text-white py-3 px-4 rounded-xl hover:bg-green-700 disabled:opacity-50 font-medium transition-colors"
>
{isJoining ? 'Joining...' : walk.joinBlockedInfo?.label || 'Join Walk'}
{isJoining ? 'Joining...' : walk.joinBlockedInfo?.label || (!roundRequirement.complete ? 'Complete Requirements' : 'Join Walk')}

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Rather than changing the button text, maybe you can consider displaying Requirements not complete (or Please complete requirements to join walk as a warning (in red or yellow) while disabling the Join Walk button instead?

</label>

<div className="space-y-2">
<label className="space-y-1">

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Suggested change
<label className="space-y-1">
<label className="block space-y-1">

There is currently no gap between both input fields (unlike the phone number/sms code input fields in https://github.com/seanlim/primap/pull/99/changes#diff-85407fd95558f0a2143d3445d579f0ced30463e5ff4c063c02d151f36c2cc977R177
Image

import { revalidatePath } from 'next/cache'

export async function updateProfile(fullName: string) {
export async function updateProfile(input: string | { fullName: string }) {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Why should updateProfile accept both string and object inputs now?

Comment thread lib/constants/settings.ts
export const DEFAULT_MAX_MEDIA_PER_REPORT = 10
export const DEFAULT_HIGH_PARTICIPATION_THRESHOLD = 8
export const DEFAULT_INDEMNITY_FORM_URL =
'https://docs.google.com/forms/d/e/1FAIpQLSeyEo0vrWJVWliNvA5Q9xaz1CX7dimhJlRYUbojbbLO9ewtBQ/viewform'

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Unless I'm missing out on specific details, I think there should be a clarification on whether Dr. Andie re-uses the same indemnity form every round or create a new form. Nonetheless this can be kept for now, just wanted to raise this up.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I think an extra test case for users without phone number can be included.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Currently there is no indicator whether a user is underage or require guardian, which I think would be nice as an extra label added beside the current Contact complete/Missing contact label

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Perhaps you can consider having a unit test for verifying guardian otp as well?

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.

1.7 Auto-add guardian details and reminders for under-18 volunteers 1.1 Make phone number mandatory in volunteer profiles

3 participants