- fix(seeder): add PASSWORD_PEPPER to all bcrypt hashes (admin + candidates/recruiters) - fix(seeder): add created_by field to jobs INSERT (was causing NOT NULL violation) - feat(backend): add custom job questions support in applications - feat(backend): add payment handler and Stripe routes - feat(frontend): add navbar and footer to /register and /register/user pages - feat(frontend): add custom question answers to job apply page - feat(frontend): update home page hero section and navbar buttons - feat(frontend): update auth/api lib with new endpoints - chore(db): add migration 045 for application answers Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
41 lines
1.6 KiB
Go
Executable file
41 lines
1.6 KiB
Go
Executable file
package models
|
|
|
|
import "time"
|
|
|
|
// Application represents a job application (from user or guest)
|
|
type Application struct {
|
|
ID string `json:"id" db:"id"`
|
|
JobID string `json:"jobId" db:"job_id"`
|
|
UserID *string `json:"userId,omitempty" db:"user_id"` // NULL for guest applications
|
|
|
|
// Applicant Info (for guest applications)
|
|
Name *string `json:"name,omitempty" db:"name"`
|
|
Phone *string `json:"phone,omitempty" db:"phone"`
|
|
LineID *string `json:"lineId,omitempty" db:"line_id"`
|
|
WhatsApp *string `json:"whatsapp,omitempty" db:"whatsapp"`
|
|
Email *string `json:"email,omitempty" db:"email"`
|
|
|
|
// Application Content
|
|
Message *string `json:"message,omitempty" db:"message"`
|
|
ResumeURL *string `json:"resumeUrl,omitempty" db:"resume_url"`
|
|
Documents JSONMap `json:"documents,omitempty" db:"documents"` // Array of {type, url}
|
|
Answers JSONMap `json:"answers,omitempty" db:"answers"` // Map of form answers and custom question responses
|
|
|
|
// Status & Notes
|
|
Status string `json:"status" db:"status"` // pending, reviewed, shortlisted, rejected, hired
|
|
Notes *string `json:"notes,omitempty" db:"notes"`
|
|
|
|
// Metadata
|
|
CreatedAt time.Time `json:"createdAt" db:"created_at"`
|
|
UpdatedAt time.Time `json:"updatedAt" db:"updated_at"`
|
|
}
|
|
|
|
// ApplicationWithDetails includes job and user information
|
|
type ApplicationWithDetails struct {
|
|
Application
|
|
JobTitle string `json:"jobTitle"`
|
|
CompanyID string `json:"companyId"`
|
|
CompanyName string `json:"companyName"`
|
|
ApplicantName string `json:"applicantName"` // From user or guest name
|
|
ApplicantPhone *string `json:"applicantPhone,omitempty"`
|
|
}
|