# Wizard questions for deployment generator
# Defines interactive questions with types, validation, and conditions
#
# Format:
# [[questions]]
# id = "unique_identifier"
# text = "Question to ask user"
# type = "string|bool|number|choice|multichoice|list"
# required = true/false
# default = "default_value"
# validate = "regex_pattern or numeric_range (1..100)"
# followup = [{condition = "...", ...question...}]

# Basic project information

[[questions]]
id = "project_name"
text = "Project name"
type = "string"
required = true
default = "myproject"
validate = "^[a-z][a-z0-9-]*$"  # lowercase with hyphens

[[questions]]
id = "project_version"
text = "Project version (semantic versioning)"
type = "string"
required = true
default = "1.0.0"
validate = "^\\d+\\.\\d+\\.\\d+$"  # x.y.z

[[questions]]
id = "project_description"
text = "Project description (optional)"
type = "string"
required = false
default = ""

# Service availability

[[questions]]
id = "has_cli"
text = "Does the project have a CLI binary?"
type = "bool"
required = true
default = "true"

[[questions.followup]]
condition = "has_cli == true"
id = "cli_name"
text = "CLI binary name"
type = "string"
required = true
default = "${project_name}-cli"

[[questions]]
id = "has_api"
text = "Does the project have a REST API server?"
type = "bool"
required = true
default = "false"

[[questions.followup]]
condition = "has_api == true"
id = "api_port"
text = "API server default port"
type = "number"
required = true
default = "3000"
validate = "1..65535"

[[questions.followup]]
condition = "has_api == true"
id = "api_health_check"
text = "API health check endpoint"
type = "string"
required = true
default = "/health"

[[questions]]
id = "has_tui"
text = "Does the project have a Terminal UI (TUI)?"
type = "bool"
required = true
default = "false"

[[questions.followup]]
condition = "has_tui == true"
id = "tui_name"
text = "TUI binary name"
type = "string"
required = true
default = "${project_name}-tui"

[[questions]]
id = "has_dashboard"
text = "Does the project have a web dashboard?"
type = "bool"
required = true
default = "false"

[[questions.followup]]
condition = "has_dashboard == true"
id = "dashboard_port"
text = "Dashboard default port"
type = "number"
required = true
default = "8080"
validate = "1..65535"

[[questions.followup]]
condition = "has_dashboard == true"
id = "dashboard_requires_api"
text = "Does dashboard require the API?"
type = "bool"
required = true
default = "true"

# Database configuration

[[questions]]
id = "databases"
text = "Supported databases (select all that apply)"
type = "multichoice"
required = true
default = ["sqlite"]
options = [
    { id = "sqlite", name = "SQLite", description = "File-based, no server" },
    { id = "postgres", name = "PostgreSQL", description = "Server-based RDBMS" },
    { id = "mysql", name = "MySQL", description = "Open source RDBMS" },
    { id = "surrealdb", name = "SurrealDB", description = "Multi-model database" },
]

[[questions]]
id = "default_database"
text = "Default database type"
type = "choice"
required = true
default = "sqlite"
# Options derived from previous 'databases' answer

[[questions]]
id = "min_memory_mb"
text = "Minimum memory requirement (MB)"
type = "number"
required = true
default = "128"
validate = "64..65536"

# Caching

[[questions]]
id = "has_cache"
text = "Does the project support caching?"
type = "bool"
required = true
default = "false"

[[questions.followup]]
condition = "has_cache == true"
id = "cache_types"
text = "Supported cache backends"
type = "multichoice"
required = true
default = ["redis"]
options = [
    { id = "redis", name = "Redis", description = "In-memory data structure store (recommended)" },
    { id = "memcached", name = "Memcached", description = "Distributed memory cache" },
]

# Deployment presets

[[questions]]
id = "presets_to_generate"
text = "Which deployment presets to generate?"
type = "multichoice"
required = true
default = ["local", "dev"]
options = [
    { id = "local", name = "Local", description = "CLI only (development machine)" },
    { id = "dev", name = "Development", description = "Full stack with provctl (dev environment)" },
    { id = "staging", name = "Staging", description = "Multi-machine with provisioning (staging environment)" },
    { id = "production", name = "Production", description = "HA setup with provisioning (production environment)" },
]

[[questions]]
id = "default_preset_manager"
text = "Default preset manager (for non-local presets)"
type = "choice"
required = true
default = "provctl"
options = [
    { id = "manual", name = "Manual", description = "User runs commands manually" },
    { id = "provctl", name = "provctl", description = "Local orchestration" },
    { id = "provisioning", name = "provisioning", description = "Infrastructure as code" },
]

# Output

[[questions]]
id = "output_directory"
text = "Output directory for generated files"
type = "string"
required = true
default = "."
validate = "^[\\.\\-/a-zA-Z0-9_]+$"

# Additional syntaxis-specific settings (future extension points)
[[questions]]
id = "include_docker_configs"
text = "Generate Docker configuration files?"
type = "bool"
required = false
default = "false"

[[questions]]
id = "include_kubernetes_manifests"
text = "Generate Kubernetes manifests?"
type = "bool"
required = false
default = "false"

[[questions.followup]]
condition = "include_kubernetes_manifests == true"
id = "k8s_namespace"
text = "Kubernetes namespace"
type = "string"
required = true
default = "syntaxis"
validate = "^[a-z0-9-]+$"

[[questions]]
id = "vapora_enabled"
text = "Enable VAPORA taskservs integration?"
type = "bool"
required = false
default = "false"

[[questions.followup]]
condition = "vapora_enabled == true"
id = "vapora_description"
text = "Description for VAPORA integration"
type = "string"
required = true
default = "Integration as VAPORA taskservs"

[[questions.followup]]
condition = "vapora_enabled == true"
id = "vapora_taskservs_mode"
text = "VAPORA taskservs mode"
type = "choice"
required = true
default = "full"
options = [
    { id = "full", name = "Full", description = "Full VAPORA taskservs integration" },
    { id = "lite", name = "Lite", description = "Lightweight VAPORA taskservs integration" },
]
