from django.core.management.base import BaseCommand

from seekers.cv_library import sync_all_seeker_cvs


class Command(BaseCommand):
    help = 'Index all uploaded seeker CVs into the CV library'

    def handle(self, *args, **options):
        count = sync_all_seeker_cvs()
        self.stdout.write(self.style.SUCCESS(f'Indexed {count} seeker CV(s) in the library.'))
