# Employee Registration Form
#
# This form demonstrates cross-backend compatibility.
# The EXACT SAME form works on CLI, TUI, and Web backends.
# Only the presentation changes based on the backend capabilities.
#
# Run with:
#   CLI:  cargo run -p typedialog -- --config employee-registration.toml
#   TUI:  cargo run -p typedialog-tui -- employee-registration.toml
#   Web:  cargo run -p typedialog-web -- --config employee-registration.toml

name = "Employee Registration"
description = "Complete employee onboarding form - works on CLI, TUI, and Web"

# ====================================================================
# SECTION 1: Personal Information
# ====================================================================

[[sections]]
title = "Personal Information"
description = "Basic employee details"

[[sections.elements]]
name = "first_name"
type = "text"
prompt = "First name"
help = "Employee's first name"
required = true
placeholder = "John"

[[sections.elements]]
name = "last_name"
type = "text"
prompt = "Last name"
help = "Employee's last name"
required = true
placeholder = "Doe"

[[sections.elements]]
name = "email"
type = "text"
prompt = "Work email"
help = "Official company email address"
required = true
placeholder = "john.doe@company.com"

[[sections.elements]]
name = "phone"
type = "text"
prompt = "Phone number"
help = "Contact phone number (optional)"
placeholder = "+1 (555) 123-4567"

[[sections.elements]]
name = "start_date"
type = "date"
prompt = "Start date"
help = "First day of employment"
required = true
min_date = "today"

# ====================================================================
# SECTION 2: Employment Details
# ====================================================================

[[sections]]
title = "Employment Details"
description = "Job and department information"

[[sections.elements]]
name = "department"
type = "select"
prompt = "Department"
help = "Which department will the employee join?"
required = true
options = [
  { value = "engineering", label = "🔧 Engineering" },
  { value = "product", label = "📦 Product" },
  { value = "design", label = "🎨 Design" },
  { value = "sales", label = "💼 Sales" },
  { value = "marketing", label = "📢 Marketing" },
  { value = "hr", label = "👥 Human Resources" },
  { value = "finance", label = "💰 Finance" },
  { value = "operations", label = "⚙️ Operations" },
]

[[sections.elements]]
name = "job_title"
type = "text"
prompt = "Job title"
help = "Employee's position title"
required = true
placeholder = "Senior Engineer"

[[sections.elements]]
name = "employment_type"
type = "select"
prompt = "Employment type"
help = "Type of employment contract"
required = true
default = "full_time"
options = [
  { value = "full_time", label = "Full-time" },
  { value = "part_time", label = "Part-time" },
  { value = "contract", label = "Contract" },
  { value = "intern", label = "Intern" },
]

[[sections.elements]]
name = "manager"
type = "text"
prompt = "Direct manager"
help = "Name of the direct manager"
placeholder = "Jane Smith"

[[sections.elements]]
name = "office_location"
type = "select"
prompt = "Office location"
help = "Primary work location"
required = true
options = [
  { value = "sf", label = "🌉 San Francisco" },
  { value = "nyc", label = "🗽 New York" },
  { value = "london", label = "🇬🇧 London" },
  { value = "tokyo", label = "🗻 Tokyo" },
  { value = "remote", label = "🏠 Remote" },
]

# ====================================================================
# SECTION 3: Skills & Expertise
# ====================================================================

[[sections]]
title = "Skills & Expertise"
description = "Technical skills and areas of expertise"

[[sections.elements]]
name = "primary_skills"
type = "multiselect"
prompt = "Primary skills (select 2-5)"
help = "Select your main areas of expertise"
min_selected = 2
max_selected = 5
required = true
options = [
  { value = "rust", label = "🦀 Rust" },
  { value = "typescript", label = "📘 TypeScript" },
  { value = "python", label = "🐍 Python" },
  { value = "golang", label = "🐹 Go" },
  { value = "java", label = "☕ Java" },
  { value = "cpp", label = "⚙️ C++" },
  { value = "devops", label = "🚀 DevOps" },
  { value = "frontend", label = "🎨 Frontend" },
  { value = "backend", label = "🔧 Backend" },
  { value = "database", label = "🗄️ Database" },
]

[[sections.elements]]
name = "years_experience"
type = "text"
prompt = "Years of professional experience"
help = "Total years working in the industry"
placeholder = "5"

# ====================================================================
# SECTION 4: Benefits & Preferences
# ====================================================================

[[sections]]
title = "Benefits & Preferences"
description = "Insurance and preference options"

[[sections.elements]]
name = "health_insurance"
type = "select"
prompt = "Health insurance plan"
help = "Choose a health insurance option"
required = true
options = [
  { value = "basic", label = "Basic Plan" },
  { value = "premium", label = "Premium Plan (recommended)" },
  { value = "family", label = "Family Plan" },
  { value = "none", label = "Opt out" },
]

[[sections.elements]]
name = "work_schedule"
type = "select"
prompt = "Preferred work schedule"
help = "Flexible working arrangements"
default = "standard"
options = [
  { value = "standard", label = "Standard (9-5)" },
  { value = "flexible", label = "Flexible hours" },
  { value = "compressed", label = "Compressed week (4 days)" },
]

[[sections.elements]]
name = "remote_days"
type = "text"
prompt = "Remote work days per week"
help = "Number of days working remotely (0-5)"
when = "office_location != remote"
placeholder = "2"

[[sections.elements]]
name = "equipment_needs"
type = "multiselect"
prompt = "Equipment needs"
help = "Required equipment and hardware"
options = [
  { value = "laptop", label = "💻 Laptop" },
  { value = "monitor", label = "🖥️ Monitor" },
  { value = "keyboard", label = "⌨️ Mechanical Keyboard" },
  { value = "mouse", label = "🖱️ Mouse" },
  { value = "headphones", label = "🎧 Headphones" },
  { value = "desk_stand", label = "📊 Desk Stand" },
  { value = "chair", label = "🪑 Ergonomic Chair" },
]

# ====================================================================
# SECTION 5: Security & Compliance
# ====================================================================

[[sections]]
title = "Security & Compliance"
description = "Security settings and agreements"

[[sections.elements]]
name = "enable_2fa"
type = "confirm"
prompt = "Enable two-factor authentication"
help = "Recommended for security"
default = "true"

[[sections.elements]]
name = "2fa_method"
type = "select"
prompt = "2FA method"
help = "Choose your two-factor authentication method"
when = "enable_2fa == true"
required = true
options = [
  { value = "authenticator", label = "🔐 Authenticator App" },
  { value = "sms", label = "📱 SMS" },
  { value = "security_key", label = "🔑 Security Key" },
]

[[sections.elements]]
name = "vpn_required"
type = "confirm"
prompt = "VPN required for data access"
help = "Employee will need VPN for sensitive systems"
default = "false"

[[sections.elements]]
name = "agreed_policies"
type = "confirm"
prompt = "I agree to company policies and code of conduct"
help = "Must accept to proceed"
required = true
default = "false"

[[sections.elements]]
name = "privacy_consent"
type = "confirm"
prompt = "I consent to privacy and data handling policies"
help = "Required for employment"
required = true
default = "false"

# ====================================================================
# SECTION 6: Additional Information
# ====================================================================

[[sections]]
title = "Additional Information"
description = "Extra notes and preferences"

[[sections.elements]]
name = "emergency_contact"
type = "text"
prompt = "Emergency contact name"
help = "Name of emergency contact person"
placeholder = "Jane Doe"

[[sections.elements]]
name = "emergency_phone"
type = "text"
prompt = "Emergency contact phone"
help = "Phone number of emergency contact"
placeholder = "+1 (555) 987-6543"

[[sections.elements]]
name = "additional_notes"
type = "editor"
prompt = "Additional notes"
help = "Any special requirements or notes (optional)"
file_extension = "md"
placeholder = "Special accommodations, preferences, etc."
