Overview
src/app/api/auth/signup/route.ts calls validateReferralCode(), referralCodeExists(), and getReferralCodeOwner() but none of these functions appear in the file's import statements. Node.js throws ReferenceError at the point these are invoked, breaking signup for any user who provides a referral code.
Specifications
Features:
- Referral code validation works end-to-end without runtime errors
Tasks:
- Add
import { validateReferralCode, referralCodeExists, getReferralCodeOwner } from '@/lib/referral' to the route file
- Verify each imported function exists and is exported from
src/lib/referral.ts
- Add a test covering the full signup path when a valid referral code is provided
Impacted Files:
src/app/api/auth/signup/route.ts
src/lib/referral.ts
Acceptance Criteria
- Signup with a referral code completes without a
ReferenceError
- All three referral helpers are imported and resolve correctly
- TypeScript compilation succeeds with no missing-module errors
Overview
src/app/api/auth/signup/route.tscallsvalidateReferralCode(),referralCodeExists(), andgetReferralCodeOwner()but none of these functions appear in the file's import statements. Node.js throwsReferenceErrorat the point these are invoked, breaking signup for any user who provides a referral code.Specifications
Features:
Tasks:
import { validateReferralCode, referralCodeExists, getReferralCodeOwner } from '@/lib/referral'to the route filesrc/lib/referral.tsImpacted Files:
src/app/api/auth/signup/route.tssrc/lib/referral.tsAcceptance Criteria
ReferenceError