use super::flow_models::{step, FlowStep, StepAction, StepDomain, StepFlags};

pub(super) fn host_and_vm_setup_steps() -> Vec<FlowStep> {
    vec![
        step(
            "host.require-admin",
            "Require elevated host privileges",
            StepDomain::Host,
            StepAction::Check,
            "initial-setup.ps1 #Requires -RunAsAdministrator",
            "Windows token elevation check",
            StepFlags::new(true, false),
        ),
        step(
            "host.check-hyperv-module",
            "Check Hyper-V module",
            StepDomain::Host,
            StepAction::Check,
            "Get-Module -ListAvailable -Name Hyper-V",
            "Windows capability/provider check; strict JSON fallback is allowed",
            StepFlags::new(true, false),
        ),
        step(
            "host.check-vmms",
            "Check vmms service",
            StepDomain::Host,
            StepAction::Check,
            "Get-Service vmms",
            "Windows service query; strict JSON fallback is allowed",
            StepFlags::new(true, false),
        ),
        step(
            "package.locate-vmcx",
            "Locate packaged VM configuration",
            StepDomain::Files,
            StepAction::Detect,
            "Virtual Machines/*.vmcx",
            "Rust filesystem glob",
            StepFlags::new(false, false),
        ),
        step(
            "host.select-destination",
            "Select VM files destination",
            StepDomain::Files,
            StepAction::Choose,
            "Get-PSDrive free > 100GB",
            "Rust drive/disk discovery plus caller-selected destination",
            StepFlags::new(false, false),
        ),
        step(
            "hyperv.detect-existing-vm",
            "Detect existing vendor VM",
            StepDomain::HyperV,
            StepAction::Detect,
            "Get-VM -Name <vendor-vm-name>",
            "Hyper-V provider get_vm",
            StepFlags::new(true, false),
        ),
        step(
            "hyperv.stop-existing-vm",
            "Stop existing VM before destructive replacement",
            StepDomain::HyperV,
            StepAction::Stop,
            "Stop-VM -TurnOff -Force",
            "Hyper-V provider stop_vm(turn_off=true)",
            StepFlags::new(true, true),
        ),
        step(
            "hyperv.remove-existing-vm",
            "Remove existing VM",
            StepDomain::HyperV,
            StepAction::Stop,
            "Remove-VM -Force",
            "Hyper-V provider remove_vm",
            StepFlags::new(true, true),
        ),
        step(
            "host.clear-vm-destination",
            "Clear selected VM destination",
            StepDomain::Files,
            StepAction::Configure,
            "Remove-Item destination",
            "Rust filesystem delete guarded by resolved-path containment and confirmation",
            StepFlags::new(false, true),
        ),
        step(
            "hyperv.compare-vm",
            "Compare packaged VM compatibility",
            StepDomain::HyperV,
            StepAction::Check,
            "Compare-VM -Copy",
            "Hyper-V provider compare_import",
            StepFlags::new(true, false),
        ),
        step(
            "hyperv.import-vm",
            "Import VM copy",
            StepDomain::HyperV,
            StepAction::Import,
            "Import-VM -CompatibilityReport",
            "Hyper-V provider import_vm_copy",
            StepFlags::new(true, false),
        ),
        step(
            "host.detect-physical-nics",
            "Detect active physical network adapters",
            StepDomain::Host,
            StepAction::Detect,
            "Get-NetAdapter Status Up excluding Hyper-V/Virtual",
            "Network adapter provider with IPv4/range metadata",
            StepFlags::new(true, false),
        ),
        step(
            "hyperv.choose-or-create-switch",
            "Choose or create external switch",
            StepDomain::HyperV,
            StepAction::Create,
            "Get-VMSwitch/New-VMSwitch",
            "Hyper-V provider ensure_external_switch",
            StepFlags::new(true, false),
        ),
        step(
            "hyperv.connect-switch",
            "Connect VM adapter to switch",
            StepDomain::HyperV,
            StepAction::Configure,
            "Connect-VMNetworkAdapter",
            "Hyper-V provider connect_network_adapter",
            StepFlags::new(true, false),
        ),
        step(
            "hyperv.resize-vhd",
            "Resize virtual disk to 100GB",
            StepDomain::HyperV,
            StepAction::Configure,
            "Resize-VHD -SizeBytes 100GB",
            "Hyper-V provider resize_vhd",
            StepFlags::new(true, false),
        ),
        step(
            "hyperv.set-first-boot",
            "Set VM first boot device",
            StepDomain::HyperV,
            StepAction::Configure,
            "Set-VMFirmware -FirstBootDevice",
            "Hyper-V provider set_first_boot_disk",
            StepFlags::new(true, false),
        ),
        step(
            "hyperv.choose-memory",
            "Choose VM memory profile",
            StepDomain::HyperV,
            StepAction::Choose,
            "20/30/40GB Read-Host menu",
            "Caller-selected memory profile enum",
            StepFlags::new(false, false),
        ),
        step(
            "hyperv.set-memory",
            "Set VM startup memory",
            StepDomain::HyperV,
            StepAction::Configure,
            "Set-VMMemory",
            "Hyper-V provider set_startup_memory",
            StepFlags::new(true, false),
        ),
        step(
            "hyperv.start-vm",
            "Start VM",
            StepDomain::HyperV,
            StepAction::Start,
            "Start-VM",
            "Hyper-V provider start_vm",
            StepFlags::new(true, false),
        ),
        step(
            "hyperv.wait-ip",
            "Wait for VM IPv4 address",
            StepDomain::HyperV,
            StepAction::Wait,
            "Get-VMNetworkAdapter IPAddresses loop",
            "Hyper-V provider wait_ipv4",
            StepFlags::new(true, false),
        ),
        step(
            "ssh.prepare-key",
            "Seed and rotate VM SSH key",
            StepDomain::Ssh,
            StepAction::Configure,
            "Update-SshKey -UseBundledKey",
            "Rust key rotation into host-local active VM key",
            StepFlags::new(false, false),
        ),
    ]
}
