"""Demo data generator for toil-tracker."""
import yaml


def get_demo_inventory() -> str:
    """Generate sample toil inventory with various SRE tasks."""
    inventory = {
        "tasks": [
            {
                "name": "Manual deployments",
                "description": "SSH into servers and run deployment scripts manually",
                "category": "deployment",
                "frequency": "daily",
                "duration_minutes": 45,
                "team_size": 2,
                "is_automatable": True,
                "automation_potential": "high",
                "automation_effort_hours": 80,
                "owner": "platform-team",
                "service": "web-app",
            },
            {
                "name": "User access provisioning",
                "description": "Manually create accounts and assign permissions in 5 systems",
                "category": "access_management",
                "frequency": "daily",
                "duration_minutes": 20,
                "team_size": 1,
                "is_automatable": True,
                "automation_potential": "high",
                "automation_effort_hours": 60,
                "owner": "security-team",
                "service": "iam",
            },
            {
                "name": "Restart stuck pods",
                "description": "Identify and restart pods that get into CrashLoopBackOff",
                "category": "incident_response",
                "frequency": "daily",
                "duration_minutes": 15,
                "team_size": 1,
                "is_automatable": True,
                "automation_potential": "high",
                "automation_effort_hours": 20,
                "owner": "sre-team",
                "service": "kubernetes",
            },
            {
                "name": "Database capacity scaling",
                "description": "Monitor database utilization and manually scale when needed",
                "category": "scaling",
                "frequency": "weekly",
                "duration_minutes": 60,
                "team_size": 1,
                "is_automatable": True,
                "automation_potential": "medium",
                "automation_effort_hours": 40,
                "owner": "dba-team",
                "service": "postgres",
            },
            {
                "name": "SSL certificate renewal",
                "description": "Manually renew and deploy SSL certificates across services",
                "category": "certificate_rotation",
                "frequency": "monthly",
                "duration_minutes": 120,
                "team_size": 2,
                "is_automatable": True,
                "automation_potential": "high",
                "automation_effort_hours": 30,
                "owner": "security-team",
                "service": "all-services",
            },
            {
                "name": "Compliance audit review",
                "description": "Manually review and document compliance controls",
                "category": "manual_intervention",
                "frequency": "quarterly",
                "duration_minutes": 480,
                "team_size": 3,
                "is_automatable": False,
                "automation_potential": "low",
                "automation_effort_hours": 200,
                "owner": "compliance-team",
                "service": "all-services",
            },
            {
                "name": "Log rotation cleanup",
                "description": "Archive and delete old log files from servers",
                "category": "data_management",
                "frequency": "weekly",
                "duration_minutes": 30,
                "team_size": 1,
                "is_automatable": True,
                "automation_potential": "high",
                "automation_effort_hours": 16,
                "owner": "ops-team",
                "service": "logging",
            },
            {
                "name": "Config drift remediation",
                "description": "Compare and fix configuration drift across environments",
                "category": "configuration",
                "frequency": "weekly",
                "duration_minutes": 90,
                "team_size": 1,
                "is_automatable": True,
                "automation_potential": "medium",
                "automation_effort_hours": 60,
                "owner": "platform-team",
                "service": "infrastructure",
            },
        ]
    }
    return yaml.dump(inventory, default_flow_style=False)
