/** * TypeScript types for the hiring/recruitment module. * Internal hiring tracker — tracks open positions and applicant pipeline. * NOT a public job board. */ export type EmploymentType = "full_time" | "part_time" | "casual" | "contractor"; export type PositionStatus = "draft" | "open" | "closed"; export type ApplicantStage = "applied" | "screening" | "interview" | "offer" | "hired" | "rejected"; export interface Position { id: string; organisation_id: string; title: string; department_id: string | null; description: string | null; employment_type: EmploymentType; status: PositionStatus; created_by: string; created_at: string; } export interface PositionWithRelations extends Position { department: { name: string } | null; applicant_count: number; } export interface Applicant { id: string; organisation_id: string; job_posting_id: string; first_name: string; last_name: string; email: string; phone: string | null; resume_url: string | null; stage: ApplicantStage; notes: string | null; created_at: string; } export interface CreatePositionInput { title: string; department_id?: string; description?: string; employment_type: EmploymentType; status: PositionStatus; } export interface UpdatePositionInput { title?: string; department_id?: string | null; description?: string | null; employment_type?: EmploymentType; status?: PositionStatus; } export interface CreateApplicantInput { job_posting_id: string; first_name: string; last_name: string; email: string; phone?: string; resume_url?: string; } export const EMPLOYMENT_TYPE_LABELS: Record = { full_time: "Full time", part_time: "Part time", casual: "Casual", contractor: "Contractor", }; export const POSITION_STATUS_LABELS: Record = { draft: "Draft", open: "Open", closed: "Closed", }; export const STAGE_LABELS: Record = { applied: "Applied", screening: "Screening", interview: "Interview", offer: "Offer", hired: "Hired", rejected: "Rejected", }; export const STAGE_COLORS: Record = { applied: "bg-blue-50 text-blue-700 border-blue-200", screening: "bg-amber-50 text-amber-700 border-amber-200", interview: "bg-purple-50 text-purple-700 border-purple-200", offer: "bg-indigo-50 text-indigo-700 border-indigo-200", hired: "bg-emerald-50 text-emerald-700 border-emerald-200", rejected: "bg-red-50 text-red-700 border-red-200", }; export const POSITION_STATUS_COLORS: Record = { draft: "bg-gray-100 text-gray-600 border-gray-200", open: "bg-teal-50 text-teal-700 border-teal-200", closed: "bg-red-50 text-red-700 border-red-200", }; export function getInitials(first: string, last: string): string { return `${first.charAt(0)}${last.charAt(0)}`.toUpperCase(); }