diff --git a/db.sqlite3 b/db.sqlite3 index 2e5ca91..d2c0aab 100644 Binary files a/db.sqlite3 and b/db.sqlite3 differ diff --git a/recruitment/__pycache__/admin.cpython-312.pyc b/recruitment/__pycache__/admin.cpython-312.pyc index e63ade8..72b3fe5 100644 Binary files a/recruitment/__pycache__/admin.cpython-312.pyc and b/recruitment/__pycache__/admin.cpython-312.pyc differ diff --git a/recruitment/__pycache__/models.cpython-312.pyc b/recruitment/__pycache__/models.cpython-312.pyc index 2d2f89b..5e2cde2 100644 Binary files a/recruitment/__pycache__/models.cpython-312.pyc and b/recruitment/__pycache__/models.cpython-312.pyc differ diff --git a/recruitment/admin.py b/recruitment/admin.py index 88de900..69c46b4 100644 --- a/recruitment/admin.py +++ b/recruitment/admin.py @@ -32,11 +32,11 @@ class JobPostingAdmin(ModelAdmin): list_display = ('title','description','qualifications') -@admin.register(models.Job) -class JobAdmin(ModelAdmin): - list_display = ('title', 'is_published', 'posted_to_linkedin', 'created_at') - list_filter = ('is_published', 'posted_to_linkedin') - search_fields = ('title', 'description_en', 'description_ar') +# @admin.register(models.Job) +# class JobAdmin(ModelAdmin): +# list_display = ('title', 'is_published', 'posted_to_linkedin', 'created_at') +# list_filter = ('is_published', 'posted_to_linkedin') +# search_fields = ('title', 'description_en', 'description_ar') # @admin.action(description="Parse selected resumes") # def parse_resumes(modeladmin, request, queryset): diff --git a/recruitment/migrations/0015_hiringagency_candidate_submitted_by_agency_and_more.py b/recruitment/migrations/0015_hiringagency_candidate_submitted_by_agency_and_more.py new file mode 100644 index 0000000..91ce2f3 --- /dev/null +++ b/recruitment/migrations/0015_hiringagency_candidate_submitted_by_agency_and_more.py @@ -0,0 +1,43 @@ +# Generated by Django 5.2.7 on 2025-10-05 16:46 + +import django.db.models.deletion +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('recruitment', '0014_source_jobposting_source'), + ] + + operations = [ + migrations.CreateModel( + name='HiringAgency', + fields=[ + ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('name', models.CharField(max_length=200, unique=True, verbose_name='Agency Name')), + ('contact_person', models.CharField(blank=True, max_length=150, verbose_name='Contact Person')), + ('email', models.EmailField(blank=True, max_length=254)), + ('phone', models.CharField(blank=True, max_length=20)), + ('website', models.URLField(blank=True)), + ('notes', models.TextField(blank=True, help_text='Internal notes about the agency')), + ('created_at', models.DateTimeField(auto_now_add=True)), + ('updated_at', models.DateTimeField(auto_now=True)), + ], + options={ + 'verbose_name': 'Hiring Agency', + 'verbose_name_plural': 'Hiring Agencies', + 'ordering': ['name'], + }, + ), + migrations.AddField( + model_name='candidate', + name='submitted_by_agency', + field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='submitted_candidates', to='recruitment.hiringagency', verbose_name='Submitted by Agency'), + ), + migrations.AddField( + model_name='jobposting', + name='hiring_agency', + field=models.ForeignKey(blank=True, help_text='External agency responsible for sourcing candidates for this role', null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='jobs', to='recruitment.hiringagency', verbose_name='Hiring Agency'), + ), + ] diff --git a/recruitment/migrations/__pycache__/0015_hiringagency_candidate_submitted_by_agency_and_more.cpython-312.pyc b/recruitment/migrations/__pycache__/0015_hiringagency_candidate_submitted_by_agency_and_more.cpython-312.pyc new file mode 100644 index 0000000..6ff14ba Binary files /dev/null and b/recruitment/migrations/__pycache__/0015_hiringagency_candidate_submitted_by_agency_and_more.cpython-312.pyc differ diff --git a/recruitment/models.py b/recruitment/models.py index 9e87292..a7aab57 100644 --- a/recruitment/models.py +++ b/recruitment/models.py @@ -112,6 +112,16 @@ class JobPosting(Base): help_text="The system or channel from which this job posting originated or was first published." ) + hiring_agency = models.ForeignKey( + 'HiringAgency', + on_delete=models.SET_NULL, + null=True, + blank=True, + related_name='jobs', + verbose_name=_('Hiring Agency'), + help_text=_("External agency responsible for sourcing candidates for this role") + ) + class Meta: ordering = ['-created_at'] verbose_name = "Job Posting" @@ -203,6 +213,16 @@ class Candidate(Base): weaknesses = models.TextField(blank=True) criteria_checklist = models.JSONField(default=dict, blank=True) + + submitted_by_agency = models.ForeignKey( + 'HiringAgency', + on_delete=models.SET_NULL, + null=True, + blank=True, + related_name='submitted_candidates', + verbose_name=_('Submitted by Agency') + ) + class Meta: verbose_name = _('Candidate') verbose_name_plural = _('Candidates') @@ -356,5 +376,24 @@ class Source(models.Model): verbose_name_plural = _('Sources') +class HiringAgency(models.Model): + name = models.CharField(max_length=200, unique=True, verbose_name=_('Agency Name')) + contact_person = models.CharField(max_length=150, blank=True, verbose_name=_('Contact Person')) + email = models.EmailField(blank=True) + phone = models.CharField(max_length=20, blank=True) + website = models.URLField(blank=True) + notes = models.TextField(blank=True, help_text=_("Internal notes about the agency")) + + created_at = models.DateTimeField(auto_now_add=True) + updated_at = models.DateTimeField(auto_now=True) + + def __str__(self): + return self.name + + class Meta: + verbose_name = _('Hiring Agency') + verbose_name_plural = _('Hiring Agencies') + ordering = ['name'] + \ No newline at end of file