from django.core.management.base import BaseCommand
from courses.models import (
    Course, Semester, Subject, CareerProspect, AdmissionStep, 
    DirectAdmission, Recruiter, WhyJoin, Testimonial
)
import random

class Command(BaseCommand):
    help = 'Create comprehensive content for Business Studies courses'

    def handle(self, *args, **options):
        self.stdout.write(self.style.SUCCESS('Starting to create Business Studies course content'))
        
        # Get all Business Studies courses
        business_course_titles = [
            'B.Com', 'BBA', 'Bachelors in Hotel Management', 'Bachelors in Hospital Administration',
            'BA English', 'BA Economics', 'BA Tourism & Management', 'MBA Global',
            'MBA in Pharma Management', 'MBA Executive', 'MBA (with IIM Certification) (Finance/HR/Marketing)'
        ]
        
        courses = Course.objects.filter(title__in=business_course_titles)
        
        for course in courses:
            self.stdout.write(f'Processing {course.title}...')
            
            # Create semesters and subjects
            self._create_semesters_and_subjects(course)
            
            # Create career prospects
            self._create_career_prospects(course)
            
            # Create admission steps
            self._create_admission_steps(course)
            
            # Create direct admission info
            self._create_direct_admission(course)
            
            # Create recruiters
            self._create_recruiters(course)
            
            # Create why join points
            self._create_why_join(course)
            
            # Create testimonials
            self._create_testimonials(course)
            
            self.stdout.write(self.style.SUCCESS(f'Completed content for {course.title}'))
        
        self.stdout.write(self.style.SUCCESS('Successfully created content for all Business Studies courses!'))
    
    def _create_semesters_and_subjects(self, course):
        """Create semester structure and subjects for the course"""
        
        # Define semester count based on course duration
        if 'MBA' in course.title:
            semester_count = 4
        else:
            semester_count = 6
        
        # Create semesters
        for sem_num in range(1, semester_count + 1):
            semester, created = Semester.objects.get_or_create(
                course=course,
                number=sem_num,
                defaults={'name': f'Semester {sem_num}'}
            )
            
            # Create subjects for each semester
            subjects = self._get_subjects_for_semester(course, sem_num)
            for subject_data in subjects:
                Subject.objects.get_or_create(
                    semester=semester,
                    name=subject_data['name'],
                    defaults={
                        'code': subject_data['code'],
                        'credits': subject_data['credits'],
                        'description': subject_data['description']
                    }
                )
    
    def _get_subjects_for_semester(self, course, semester_num):
        """Get subjects for a specific semester based on course type"""
        
        if course.title == 'B.Com':
            subjects_by_semester = {
                1: [
                    {'name': 'Financial Accounting', 'code': 'COM101', 'credits': 4, 'description': 'Fundamentals of accounting principles and practices'},
                    {'name': 'Business Economics', 'code': 'COM102', 'credits': 4, 'description': 'Economic principles applied to business decisions'},
                    {'name': 'Business Communication', 'code': 'COM103', 'credits': 3, 'description': 'Effective communication in business contexts'},
                    {'name': 'Business Mathematics', 'code': 'COM104', 'credits': 3, 'description': 'Mathematical applications in business'},
                    {'name': 'Principles of Management', 'code': 'COM105', 'credits': 3, 'description': 'Basic management concepts and theories'}
                ],
                2: [
                    {'name': 'Corporate Accounting', 'code': 'COM201', 'credits': 4, 'description': 'Advanced accounting for corporations'},
                    {'name': 'Business Statistics', 'code': 'COM202', 'credits': 4, 'description': 'Statistical methods for business analysis'},
                    {'name': 'Company Law', 'code': 'COM203', 'credits': 3, 'description': 'Legal framework for companies'},
                    {'name': 'Marketing Management', 'code': 'COM204', 'credits': 3, 'description': 'Principles and practices of marketing'},
                    {'name': 'Human Resource Management', 'code': 'COM205', 'credits': 3, 'description': 'Managing human resources in organizations'}
                ],
                3: [
                    {'name': 'Cost Accounting', 'code': 'COM301', 'credits': 4, 'description': 'Cost analysis and control systems'},
                    {'name': 'Financial Management', 'code': 'COM302', 'credits': 4, 'description': 'Financial planning and decision making'},
                    {'name': 'Business Law', 'code': 'COM303', 'credits': 3, 'description': 'Legal aspects of business operations'},
                    {'name': 'Organizational Behavior', 'code': 'COM304', 'credits': 3, 'description': 'Behavioral aspects in organizations'},
                    {'name': 'Research Methodology', 'code': 'COM305', 'credits': 3, 'description': 'Research methods in business'}
                ],
                4: [
                    {'name': 'Management Accounting', 'code': 'COM401', 'credits': 4, 'description': 'Accounting for management decisions'},
                    {'name': 'Investment Analysis', 'code': 'COM402', 'credits': 4, 'description': 'Investment planning and portfolio management'},
                    {'name': 'Taxation', 'code': 'COM403', 'credits': 3, 'description': 'Tax laws and compliance'},
                    {'name': 'International Business', 'code': 'COM404', 'credits': 3, 'description': 'Global business operations'},
                    {'name': 'Entrepreneurship', 'code': 'COM405', 'credits': 3, 'description': 'Starting and managing new ventures'}
                ],
                5: [
                    {'name': 'Auditing', 'code': 'COM501', 'credits': 4, 'description': 'Principles and practices of auditing'},
                    {'name': 'Banking and Insurance', 'code': 'COM502', 'credits': 4, 'description': 'Banking operations and insurance principles'},
                    {'name': 'Corporate Finance', 'code': 'COM503', 'credits': 3, 'description': 'Advanced corporate financial management'},
                    {'name': 'Business Ethics', 'code': 'COM504', 'credits': 3, 'description': 'Ethical considerations in business'},
                    {'name': 'Project Management', 'code': 'COM505', 'credits': 3, 'description': 'Planning and executing business projects'}
                ],
                6: [
                    {'name': 'Advanced Accounting', 'code': 'COM601', 'credits': 4, 'description': 'Complex accounting standards and practices'},
                    {'name': 'Strategic Management', 'code': 'COM602', 'credits': 4, 'description': 'Strategic planning and implementation'},
                    {'name': 'Financial Markets', 'code': 'COM603', 'credits': 3, 'description': 'Capital markets and investment instruments'},
                    {'name': 'Business Analytics', 'code': 'COM604', 'credits': 3, 'description': 'Data analysis for business decisions'},
                    {'name': 'Internship/Project', 'code': 'COM605', 'credits': 4, 'description': 'Practical experience in business environment'}
                ]
            }
        elif course.title == 'BBA':
            subjects_by_semester = {
                1: [
                    {'name': 'Principles of Management', 'code': 'BBA101', 'credits': 4, 'description': 'Fundamentals of management theory and practice'},
                    {'name': 'Financial Accounting', 'code': 'BBA102', 'credits': 4, 'description': 'Basic accounting principles and financial statements'},
                    {'name': 'Business Economics', 'code': 'BBA103', 'credits': 3, 'description': 'Economic principles in business context'},
                    {'name': 'Business Communication', 'code': 'BBA104', 'credits': 3, 'description': 'Effective communication skills for business'},
                    {'name': 'Business Mathematics', 'code': 'BBA105', 'credits': 3, 'description': 'Mathematical concepts for business applications'}
                ],
                2: [
                    {'name': 'Marketing Management', 'code': 'BBA201', 'credits': 4, 'description': 'Marketing concepts and strategies'},
                    {'name': 'Human Resource Management', 'code': 'BBA202', 'credits': 4, 'description': 'HR practices and people management'},
                    {'name': 'Financial Management', 'code': 'BBA203', 'credits': 3, 'description': 'Financial planning and analysis'},
                    {'name': 'Organizational Behavior', 'code': 'BBA204', 'credits': 3, 'description': 'Individual and group behavior in organizations'},
                    {'name': 'Business Statistics', 'code': 'BBA205', 'credits': 3, 'description': 'Statistical methods for business analysis'}
                ],
                3: [
                    {'name': 'Operations Management', 'code': 'BBA301', 'credits': 4, 'description': 'Production and operations management'},
                    {'name': 'Strategic Management', 'code': 'BBA302', 'credits': 4, 'description': 'Strategic planning and competitive advantage'},
                    {'name': 'Business Law', 'code': 'BBA303', 'credits': 3, 'description': 'Legal framework for business operations'},
                    {'name': 'Consumer Behavior', 'code': 'BBA304', 'credits': 3, 'description': 'Understanding consumer psychology and behavior'},
                    {'name': 'Research Methodology', 'code': 'BBA305', 'credits': 3, 'description': 'Research methods and data analysis'}
                ],
                4: [
                    {'name': 'International Business', 'code': 'BBA401', 'credits': 4, 'description': 'Global business environment and operations'},
                    {'name': 'Entrepreneurship', 'code': 'BBA402', 'credits': 4, 'description': 'Starting and managing new ventures'},
                    {'name': 'Business Ethics', 'code': 'BBA403', 'credits': 3, 'description': 'Ethical decision making in business'},
                    {'name': 'Supply Chain Management', 'code': 'BBA404', 'credits': 3, 'description': 'Managing supply chains and logistics'},
                    {'name': 'Digital Marketing', 'code': 'BBA405', 'credits': 3, 'description': 'Online marketing strategies and tools'}
                ],
                5: [
                    {'name': 'Project Management', 'code': 'BBA501', 'credits': 4, 'description': 'Planning and executing business projects'},
                    {'name': 'Leadership Development', 'code': 'BBA502', 'credits': 4, 'description': 'Leadership skills and team management'},
                    {'name': 'Business Analytics', 'code': 'BBA503', 'credits': 3, 'description': 'Data-driven decision making'},
                    {'name': 'Corporate Finance', 'code': 'BBA504', 'credits': 3, 'description': 'Advanced financial management'},
                    {'name': 'Negotiation Skills', 'code': 'BBA505', 'credits': 3, 'description': 'Effective negotiation techniques'}
                ],
                6: [
                    {'name': 'Business Strategy', 'code': 'BBA601', 'credits': 4, 'description': 'Strategic planning and implementation'},
                    {'name': 'Change Management', 'code': 'BBA602', 'credits': 4, 'description': 'Managing organizational change'},
                    {'name': 'Innovation Management', 'code': 'BBA603', 'credits': 3, 'description': 'Fostering innovation in organizations'},
                    {'name': 'Global Business Strategy', 'code': 'BBA604', 'credits': 3, 'description': 'International strategic management'},
                    {'name': 'Capstone Project', 'code': 'BBA605', 'credits': 4, 'description': 'Comprehensive business project'}
                ]
            }
        elif 'MBA' in course.title:
            if course.title == 'MBA Global':
                subjects_by_semester = {
                    1: [
                        {'name': 'Global Business Environment', 'code': 'MBA101', 'credits': 4, 'description': 'International business context and frameworks'},
                        {'name': 'International Finance', 'code': 'MBA102', 'credits': 4, 'description': 'Global financial markets and management'},
                        {'name': 'Cross-Cultural Management', 'code': 'MBA103', 'credits': 3, 'description': 'Managing across different cultures'},
                        {'name': 'Global Marketing', 'code': 'MBA104', 'credits': 3, 'description': 'International marketing strategies'},
                        {'name': 'Research Methods', 'code': 'MBA105', 'credits': 3, 'description': 'Advanced research methodology'}
                    ],
                    2: [
                        {'name': 'International Trade', 'code': 'MBA201', 'credits': 4, 'description': 'Global trade theories and practices'},
                        {'name': 'Global Supply Chain', 'code': 'MBA202', 'credits': 4, 'description': 'International supply chain management'},
                        {'name': 'International Economics', 'code': 'MBA203', 'credits': 3, 'description': 'Global economic systems and policies'},
                        {'name': 'Multinational Management', 'code': 'MBA204', 'credits': 3, 'description': 'Managing multinational corporations'},
                        {'name': 'Global Leadership', 'code': 'MBA205', 'credits': 3, 'description': 'Leadership in global context'}
                    ],
                    3: [
                        {'name': 'International Business Strategy', 'code': 'MBA301', 'credits': 4, 'description': 'Strategic management for global businesses'},
                        {'name': 'Global Innovation', 'code': 'MBA302', 'credits': 4, 'description': 'Innovation management in global context'},
                        {'name': 'International Law', 'code': 'MBA303', 'credits': 3, 'description': 'Legal aspects of international business'},
                        {'name': 'Emerging Markets', 'code': 'MBA304', 'credits': 3, 'description': 'Business opportunities in emerging economies'},
                        {'name': 'Sustainable Business', 'code': 'MBA305', 'credits': 3, 'description': 'Sustainability in global business'}
                    ],
                    4: [
                        {'name': 'Global Consulting', 'code': 'MBA401', 'credits': 4, 'description': 'International consulting methodologies'},
                        {'name': 'International Project', 'code': 'MBA402', 'credits': 4, 'description': 'Capstone international business project'},
                        {'name': 'Global Entrepreneurship', 'code': 'MBA403', 'credits': 3, 'description': 'International entrepreneurial ventures'},
                        {'name': 'Digital Transformation', 'code': 'MBA404', 'credits': 3, 'description': 'Technology-driven global business change'},
                        {'name': 'Internship/Thesis', 'code': 'MBA405', 'credits': 4, 'description': 'Practical experience or research thesis'}
                    ]
                }
            else:
                # Generic MBA subjects for other MBA programs
                subjects_by_semester = {
                    1: [
                        {'name': 'Management Fundamentals', 'code': 'MBA101', 'credits': 4, 'description': 'Core management principles and theories'},
                        {'name': 'Financial Management', 'code': 'MBA102', 'credits': 4, 'description': 'Advanced financial analysis and planning'},
                        {'name': 'Marketing Management', 'code': 'MBA103', 'credits': 3, 'description': 'Strategic marketing concepts'},
                        {'name': 'Operations Management', 'code': 'MBA104', 'credits': 3, 'description': 'Production and service operations'},
                        {'name': 'Business Analytics', 'code': 'MBA105', 'credits': 3, 'description': 'Data-driven business decisions'}
                    ],
                    2: [
                        {'name': 'Strategic Management', 'code': 'MBA201', 'credits': 4, 'description': 'Strategic planning and competitive advantage'},
                        {'name': 'Leadership Development', 'code': 'MBA202', 'credits': 4, 'description': 'Advanced leadership skills'},
                        {'name': 'Human Resource Management', 'code': 'MBA203', 'credits': 3, 'description': 'Strategic HR management'},
                        {'name': 'Business Ethics', 'code': 'MBA204', 'credits': 3, 'description': 'Ethical decision making'},
                        {'name': 'Innovation Management', 'code': 'MBA205', 'credits': 3, 'description': 'Managing innovation and change'}
                    ],
                    3: [
                        {'name': 'Specialization Course 1', 'code': 'MBA301', 'credits': 4, 'description': 'Advanced specialized knowledge'},
                        {'name': 'Specialization Course 2', 'code': 'MBA302', 'credits': 4, 'description': 'Applied specialized concepts'},
                        {'name': 'Business Research', 'code': 'MBA303', 'credits': 3, 'description': 'Advanced research methodology'},
                        {'name': 'Consulting Skills', 'code': 'MBA304', 'credits': 3, 'description': 'Management consulting techniques'},
                        {'name': 'Global Business', 'code': 'MBA305', 'credits': 3, 'description': 'International business environment'}
                    ],
                    4: [
                        {'name': 'Capstone Project', 'code': 'MBA401', 'credits': 4, 'description': 'Comprehensive business project'},
                        {'name': 'Industry Internship', 'code': 'MBA402', 'credits': 4, 'description': 'Practical industry experience'},
                        {'name': 'Advanced Specialization', 'code': 'MBA403', 'credits': 3, 'description': 'Expert-level specialized knowledge'},
                        {'name': 'Entrepreneurship', 'code': 'MBA404', 'credits': 3, 'description': 'Starting and scaling businesses'},
                        {'name': 'Business Simulation', 'code': 'MBA405', 'credits': 4, 'description': 'Integrated business simulation'}
                    ]
                }
        else:
            # Generic subjects for other courses
            subjects_by_semester = {
                1: [
                    {'name': 'Foundation Course 1', 'code': 'GEN101', 'credits': 4, 'description': 'Basic concepts and principles'},
                    {'name': 'Foundation Course 2', 'code': 'GEN102', 'credits': 4, 'description': 'Core subject fundamentals'},
                    {'name': 'Communication Skills', 'code': 'GEN103', 'credits': 3, 'description': 'Effective communication'},
                    {'name': 'Mathematics/Statistics', 'code': 'GEN104', 'credits': 3, 'description': 'Quantitative methods'},
                    {'name': 'Introduction to Computers', 'code': 'GEN105', 'credits': 3, 'description': 'Basic computer skills'}
                ],
                2: [
                    {'name': 'Intermediate Course 1', 'code': 'GEN201', 'credits': 4, 'description': 'Building on foundation knowledge'},
                    {'name': 'Intermediate Course 2', 'code': 'GEN202', 'credits': 4, 'description': 'Applied concepts and methods'},
                    {'name': 'Research Methods', 'code': 'GEN203', 'credits': 3, 'description': 'Research methodology'},
                    {'name': 'Professional Skills', 'code': 'GEN204', 'credits': 3, 'description': 'Professional development'},
                    {'name': 'Elective 1', 'code': 'GEN205', 'credits': 3, 'description': 'Specialized elective subject'}
                ]
            }
            # Add more semesters for longer courses
            if semester_num > 2:
                subjects_by_semester[semester_num] = [
                    {'name': f'Advanced Course {semester_num}A', 'code': f'GEN{semester_num}01', 'credits': 4, 'description': 'Advanced specialized knowledge'},
                    {'name': f'Advanced Course {semester_num}B', 'code': f'GEN{semester_num}02', 'credits': 4, 'description': 'Applied advanced concepts'},
                    {'name': f'Practical Course {semester_num}', 'code': f'GEN{semester_num}03', 'credits': 3, 'description': 'Hands-on practical experience'},
                    {'name': f'Elective {semester_num}', 'code': f'GEN{semester_num}04', 'credits': 3, 'description': 'Specialized elective'},
                    {'name': f'Project Work {semester_num}', 'code': f'GEN{semester_num}05', 'credits': 3, 'description': 'Applied project work'}
                ]
        
        return subjects_by_semester.get(semester_num, [])
    
    def _create_career_prospects(self, course):
        """Create career prospects for the course"""
        
        career_prospects_data = {
            'B.Com': [
                {'title': 'Chartered Accountant', 'description': 'Professional accounting and auditing services', 'salary_range': '₹6-15 LPA'},
                {'title': 'Financial Analyst', 'description': 'Financial planning and investment analysis', 'salary_range': '₹4-12 LPA'},
                {'title': 'Banking Professional', 'description': 'Banking operations and customer relationship management', 'salary_range': '₹3-10 LPA'},
                {'title': 'Tax Consultant', 'description': 'Tax planning and compliance services', 'salary_range': '₹4-12 LPA'},
                {'title': 'Business Analyst', 'description': 'Business process analysis and improvement', 'salary_range': '₹5-14 LPA'},
                {'title': 'Finance Manager', 'description': 'Corporate financial management and planning', 'salary_range': '₹8-20 LPA'}
            ],
            'BBA': [
                {'title': 'Management Trainee', 'description': 'Entry-level management positions across industries', 'salary_range': '₹3-8 LPA'},
                {'title': 'Marketing Executive', 'description': 'Brand management and marketing strategy', 'salary_range': '₹3-10 LPA'},
                {'title': 'HR Executive', 'description': 'Human resource management and development', 'salary_range': '₹3-9 LPA'},
                {'title': 'Business Development Executive', 'description': 'Business growth and client acquisition', 'salary_range': '₹4-12 LPA'},
                {'title': 'Operations Manager', 'description': 'Operational efficiency and process management', 'salary_range': '₹5-15 LPA'},
                {'title': 'Entrepreneur', 'description': 'Starting and managing own business ventures', 'salary_range': 'Variable'}
            ],
            'MBA Global': [
                {'title': 'International Business Manager', 'description': 'Managing global business operations', 'salary_range': '₹12-30 LPA'},
                {'title': 'Global Marketing Manager', 'description': 'International marketing strategies', 'salary_range': '₹10-25 LPA'},
                {'title': 'Export-Import Manager', 'description': 'International trade and logistics', 'salary_range': '₹8-20 LPA'},
                {'title': 'Management Consultant', 'description': 'Strategic business consulting', 'salary_range': '₹15-40 LPA'},
                {'title': 'Country Manager', 'description': 'Leading operations in specific countries', 'salary_range': '₹20-50 LPA'},
                {'title': 'Global Supply Chain Manager', 'description': 'International supply chain optimization', 'salary_range': '₹12-28 LPA'}
            ],
            'MBA Executive': [
                {'title': 'Senior Manager', 'description': 'Senior management roles across functions', 'salary_range': '₹15-35 LPA'},
                {'title': 'Director', 'description': 'Strategic leadership and decision making', 'salary_range': '₹25-60 LPA'},
                {'title': 'Vice President', 'description': 'Executive leadership positions', 'salary_range': '₹30-80 LPA'},
                {'title': 'Chief Executive Officer', 'description': 'Top executive leadership', 'salary_range': '₹50-150 LPA'},
                {'title': 'Management Consultant', 'description': 'Senior consulting roles', 'salary_range': '₹20-50 LPA'},
                {'title': 'Board Member', 'description': 'Corporate governance and strategy', 'salary_range': 'Variable'}
            ]
        }
        
        # Use default prospects if course not in specific data
        prospects = career_prospects_data.get(course.title, [
            {'title': 'Industry Professional', 'description': 'Specialized roles in relevant industry', 'salary_range': '₹4-15 LPA'},
            {'title': 'Manager', 'description': 'Management positions in organizations', 'salary_range': '₹6-20 LPA'},
            {'title': 'Consultant', 'description': 'Expert consulting services', 'salary_range': '₹8-25 LPA'},
            {'title': 'Entrepreneur', 'description': 'Starting own ventures', 'salary_range': 'Variable'},
            {'title': 'Senior Specialist', 'description': 'Expert roles in specialization', 'salary_range': '₹10-30 LPA'}
        ])
        
        for prospect_data in prospects:
            CareerProspect.objects.get_or_create(
                course=course,
                title=prospect_data['title'],
                defaults={
                    'description': prospect_data['description'],
                    'salary_range': prospect_data['salary_range']
                }
            )
    
    def _create_admission_steps(self, course):
        """Create admission steps for the course"""
        
        steps = [
            {'step': 1, 'title': 'Check Eligibility', 'description': 'Verify academic qualifications and eligibility criteria'},
            {'step': 2, 'title': 'Online Application', 'description': 'Fill and submit the online application form'},
            {'step': 3, 'title': 'Document Submission', 'description': 'Upload required documents and certificates'},
            {'step': 4, 'title': 'Application Fee', 'description': 'Pay the application processing fee'},
            {'step': 5, 'title': 'Entrance Test', 'description': 'Appear for entrance examination or interview'},
            {'step': 6, 'title': 'Merit List', 'description': 'Check merit list and admission status'},
            {'step': 7, 'title': 'Admission Confirmation', 'description': 'Confirm admission by paying fees'},
            {'step': 8, 'title': 'Document Verification', 'description': 'Physical verification of original documents'},
            {'step': 9, 'title': 'Orientation', 'description': 'Attend orientation and induction program'}
        ]
        
        for step_data in steps:
            AdmissionStep.objects.get_or_create(
                course=course,
                order=step_data['step'],
                defaults={
                    'title': step_data['title'],
                    'description': step_data['description']
                }
            )
    
    def _create_direct_admission(self, course):
        """Create direct admission information"""
        
        DirectAdmission.objects.get_or_create(
            course=course,
            defaults={
                'is_available': True,
                'description': 'Direct admission process based on academic performance and eligibility criteria. Contact admissions office for direct admission guidance.'
            }
        )
    
    def _create_recruiters(self, course):
        """Create recruiters for the course"""
        
        # Common recruiters for business courses
        all_recruiters = [
            'Deloitte', 'EY (Ernst & Young)', 'KPMG', 'PwC', 'Accenture',
            'TCS', 'Infosys', 'Wipro', 'IBM', 'Microsoft',
            'Google', 'Amazon', 'Flipkart', 'Paytm', 'Zomato',
            'HDFC Bank', 'ICICI Bank', 'State Bank of India', 'Axis Bank', 'Kotak Mahindra Bank',
            'Reliance Industries', 'Aditya Birla Group', 'Mahindra Group', 'Bajaj Group', 'L&T',
            'HUL', 'P&G', 'Nestle', 'ITC', 'Asian Paints',
            'Maruti Suzuki', 'Hyundai', 'Honda', 'BMW', 'Mercedes-Benz',
            'McKinsey & Company', 'Boston Consulting Group', 'Bain & Company'
        ]
        
        # Select random recruiters
        selected_recruiters = random.sample(all_recruiters, min(15, len(all_recruiters)))
        
        for recruiter_name in selected_recruiters:
            Recruiter.objects.get_or_create(
                course=course,
                name=recruiter_name,
                defaults={}
            )
    
    def _create_why_join(self, course):
        """Create why join points for the course"""
        
        common_points = [
            {'title': 'Industry-Relevant Curriculum', 'description': 'Updated curriculum aligned with current industry requirements and trends'},
            {'title': 'Experienced Faculty', 'description': 'Learn from industry experts and experienced academicians'},
            {'title': 'Practical Learning', 'description': 'Hands-on experience through projects, internships, and case studies'},
            {'title': 'Placement Support', 'description': 'Dedicated placement cell with excellent industry connections'},
            {'title': 'Industry Partnerships', 'description': 'Strong partnerships with leading companies for internships and placements'},
            {'title': 'Modern Infrastructure', 'description': 'State-of-the-art facilities and learning resources'},
            {'title': 'Global Exposure', 'description': 'International collaborations and exchange programs'},
            {'title': 'Alumni Network', 'description': 'Strong alumni network across various industries and positions'}
        ]
        
        for point_data in common_points:
            WhyJoin.objects.get_or_create(
                course=course,
                title=point_data['title'],
                defaults={
                    'description': point_data['description']
                }
            )
    
    def _create_testimonials(self, course):
        """Create testimonials for the course"""
        
        testimonials = [
            {
                'name': 'Priya Sharma',
                'position': 'Financial Analyst',
                'company': 'HDFC Bank',
                'content': f'The {course.title} program provided me with comprehensive knowledge and practical skills. The faculty support and industry exposure helped me secure a great position in banking.'
            },
            {
                'name': 'Rahul Gupta',
                'position': 'Business Development Manager',
                'company': 'Reliance',
                'content': f'Excellent curriculum and amazing faculty. The {course.title} program shaped my career and provided me with leadership skills necessary for the corporate world.'
            },
            {
                'name': 'Anjali Patel',
                'position': 'Marketing Executive',
                'company': 'HUL',
                'content': f'The practical approach of the {course.title} program and industry collaborations gave me real-world experience. Highly recommend this program.'
            },
            {
                'name': 'Vikash Kumar',
                'position': 'Consultant',
                'company': 'Deloitte',
                'content': f'The {course.title} program provided excellent foundation in business concepts. The placement support was outstanding and helped me achieve my career goals.'
            }
        ]
        
        for testimonial_data in testimonials:
            Testimonial.objects.get_or_create(
                course=course,
                name=testimonial_data['name'],
                defaults={
                    'position': testimonial_data['position'],
                    'company': testimonial_data['company'],
                    'content': testimonial_data['content']
                }
            )
