from django.core.management.base import BaseCommand
from programs.models import Program

class Command(BaseCommand):
    help = 'Creates initial program data'

    def handle(self, *args, **kwargs):
        # Create initial programs if they don't exist
        programs_data = [
            {
                'title': 'Scholarships',
                'description': 'Financial support for women pursuing higher education in various fields.',
                'category': 'scholarship',
                'features': [
                    'Full and partial scholarships for undergraduate studies',
                    'Graduate research grants and fellowships',
                    'Special focus on STEM fields and underrepresented areas',
                    'Merit and need-based selection criteria'
                ],
                'order': 1,
            },
            {
                'title': 'Mentorship Program',
                'description': 'Connecting experienced professionals with aspiring young women for guidance and support.',
                'category': 'mentorship',
                'features': [
                    'One-on-one mentoring sessions',
                    'Career guidance and professional development',
                    'Networking opportunities with industry leaders',
                    'Regular mentorship events and workshops'
                ],
                'order': 2,
            },
            {
                'title': 'Professional Workshops',
                'description': 'Educational workshops and seminars focused on career development and personal growth.',
                'category': 'workshop',
                'features': [
                    'Professional skills development',
                    'Leadership and management training',
                    'Technology and digital literacy programs',
                    'Personal growth and empowerment sessions'
                ],
                'order': 3,
            }
        ]

        for data in programs_data:
            Program.objects.get_or_create(
                title=data['title'],
                defaults={
                    'description': data['description'],
                    'category': data['category'],
                    'features': data['features'],
                    'order': data['order'],
                    'active': True
                }
            )

        self.stdout.write(self.style.SUCCESS('Successfully created initial programs'))
