Authentication schemas
userLoginSchema
Validates user login form data.User email address (validated, trimmed, lowercased)
User password (minimum 1 character)
Remember user session
organizationLoginSchema
Validates organization login form data.Organization domain (e.g. “empresa.com”)
Corporate email address
Organization password
Remember session
userRegistrationSchema
Validates user registration form with password confirmation.User full name (2-100 characters)
Email address (validated, trimmed, lowercased)
Password (minimum 6 characters)
Password confirmation (must match password)
User profession (1-100 characters)
Terms and conditions acceptance (must be true)
organizationRegistrationSchema
Validates organization registration form.Contact person name (2-100 characters)
Corporate email address
Password (minimum 8 characters for organizations)
Password confirmation
Contact person position (1-100 characters)
Organization name (2-200 characters)
Organization website URL (must start with http:// or https://)
Terms acceptance (must be true)
validateForm
Helper function that safely parses data and returns formatted errors.Zod schema to validate against
Data to validate
Validation result:
- Success:
{ success: true, data: T } - Failure:
{ success: false, errors: Record<string, string> }
Profile schemas
userProfileSchema
Full user profile validation.User name (2-100 characters)
Email address
Phone number (8-20 characters, international format)
User location (2-200 characters)
Profession (up to 100 characters)
Biography (up to 2000 characters)
Experience description (up to 50 characters)
Array of skills (1-20 items, each 1-50 characters)
Avatar URL or base64 data URI
avatarFileSchema
Validates avatar file uploads.Image file (JPEG, PNG, WebP, or GIF, max 2MB)
validateProfileSave
Validates profile data for save operation.Profile data to validate (requires name, email, profession)
Validation result with success boolean and formatted errors
Job schemas
jobSearchSchema
Validates job search filters.Search query text (up to 200 characters)
Location filter (up to 200 characters)
Show only remote jobs
Job type: “any”, “full-time”, “part-time”, “contract”, “internship”
Experience level: “any”, “junior”, “mid”, “senior”
Minimum salary (0 to 100,000,000)
Maximum salary (0 to 100,000,000, must be >= minSalary)
jobPostingSchema
Validates job posting data.Job title (5-200 characters)
Company name (2-200 characters)
Job location (2-200 characters)
Minimum salary (0 to 100,000,000)
Maximum salary (0 to 100,000,000, must be >= salaryMin)
Job type enum value
Experience level enum value
Job description (50-10,000 characters)
Job requirements (20-5,000 characters)
Job tags (1-20 items, each 1-50 characters)
Is this a remote position
Is this job posting active
jobApplicationSchema
Validates job application submissions.Job UUID
Cover letter (50-5,000 characters)
Resume URL (valid URL format)
Optional screening question answers
- Each item:
{ question: string, answer: string }
validateJobSearch
Validates job search filters with salary range validation.Search filters to validate
Validation result with formatted errors
validateJobPosting
Validates job posting data with salary range validation.Job posting to validate
Validation result with formatted errors
Contact schemas
organizationContactSchema
Validates organization contact form (landing page).First name (2-100 characters)
Last name (2-100 characters)
Corporate email address
Phone number (8-20 characters)
Company name (2-200 characters)
Message (10-5,000 characters)
generalContactSchema
Validates general contact form.Contact name
Email address
Subject line (5-200 characters)
Message content (10-5,000 characters)
supportContactSchema
Validates support request form.User name
Email address
Issue type: “login”, “profile”, “jobs”, “applications”, “billing”, “other”
Issue description (10-5,000 characters)
File attachments (max 5 files, each max 5MB, JPEG/PNG/PDF only)
Waitlist schemas
waitlistSchema
Validates waitlist signup data.Email address (validated and normalized)
Role: “professional” or “empresa”
Primitive schemas
Base validation schemas used throughout the application.Email schemas
- emailSchema: RFC 5322 compliant email (max 254 chars, trimmed, lowercased)
- corporateEmailSchema: Same as emailSchema (for organization emails)
Password schemas
- userPasswordSchema: User password (6-128 characters)
- organizationPasswordSchema: Organization password (8-128 characters)
Text schemas
- nameSchema: Person name (2-100 chars, letters/spaces/hyphens/apostrophes only)
- shortTextSchema: Generic short text (1-100 chars)
- bioSchema: Biography/description (up to 2000 chars)
- messageSchema: Message content (10-5000 chars)
URL schemas
- urlSchema: Valid URL (must start with http:// or https://)
- domainSchema: Domain name only (lowercase, no protocol)
Other schemas
- phoneSchema: International phone number (8-20 chars, optional)
- locationSchema: Location string (2-200 chars, optional)
- skillsSchema: Array of skill strings (1-20 items, each 1-50 chars)
Enum schemas
- userTypeSchema: “persona” | “organización”
- waitlistRoleSchema: “professional” | “empresa”
- jobTypeSchema: “any” | “full-time” | “part-time” | “contract” | “internship”
- experienceLevelSchema: “any” | “junior” | “mid” | “senior”
Type exports
All schemas export TypeScript types usingz.infer:
Source
Defined in:lib/validations/auth.ts- Authentication schemaslib/validations/profile.ts- Profile schemaslib/validations/job.ts- Job schemaslib/validations/contact.ts- Contact schemaslib/validations/waitlist.ts- Waitlist schemaslib/validations/primitives.ts- Base primitive schemaslib/validations/index.ts- Main export