Skip to content

require SN for UBC students - #534

Draft
ahosseini06 wants to merge 1 commit into
mainfrom
enforce-ubc-student-number
Draft

ahosseini06 wants to merge 1 commit into
mainfrom
enforce-ubc-student-number

Conversation

@ahosseini06

@ahosseini06 ahosseini06 commented Sep 11, 2026

Copy link
Copy Markdown
Contributor

Summary

  • The onboarding Zod schema treated studentNumber as optional for everyone, so a UBC student could submit the questionnaire with no student number and get a 406 from POST /profiles.
  • onboardingValidationSchema now requires exactly 8 digits when education === "UBC". Other students may leave it blank, but any value entered must be numeric.
  • This matches the rule the backend create handler enforces and the rule membershipValidationSchema already uses on the membership page.

Behaviour

  • Step 2 of the wizard already re-validates studentNumber after education is chosen and jumps back to step 1 on failure, so the error surfaces under the field before the request is sent.

Test plan

  • Pick "I'm a UBC student" with an empty student number, click Continue: should return to step 1 with "Please provide a valid student number".
  • Same with a 7-digit or non-numeric value: should fail the same way.
  • Pick "I'm a university student" or "Not Applicable" with an empty student number: should proceed and POST successfully.
  • Non-UBC with a non-numeric value: should show "Student number must contain numbers only".

🤖 Generated with Claude Code

https://claude.ai/code/session_012NWdgq8oozGXrwiukGFUtv

@vercel

vercel Bot commented Sep 11, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
biztech-v2 Ready Ready Preview Sep 11, 2026 7:33pm UTC

@ahosseini06
ahosseini06 marked this pull request as draft September 11, 2026 19:22
@ahosseini06 ahosseini06 changed the title Require 8-digit student number for UBC students in onboarding student number for UBC students in onboarding Sep 11, 2026
@ahosseini06 ahosseini06 changed the title student number for UBC students in onboarding require SN for UBC students Sep 11, 2026
@ahosseini06
ahosseini06 force-pushed the enforce-ubc-student-number branch from b2be06d to 7e38c95 Compare September 11, 2026 19:26
The onboarding Zod schema left studentNumber optional for everyone, so
UBC students could reach the POST /profiles call with an empty value and
get a 406 from the backend. Enforce the same rule the backend and the
membership form use: UBC students must enter exactly 8 digits, other
students may leave it blank but any value must be numeric.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012NWdgq8oozGXrwiukGFUtv
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 participant