from __future__ import annotations

from django import forms

from apps.alumni.careers.models import JobListing


class PartnerJobSubmissionForm(forms.ModelForm):
    """Form used by verified partner organisations to submit alumni-only listings.

    ``audience`` and ``listing_status`` are forced server-side in the view —
    never expose them on the form so partners cannot self-publish.
    """

    class Meta:
        model = JobListing
        fields = [
            "title",
            "company",
            "location",
            "job_type",
            "sector",
            "salary_range",
            "description",
            "requirements",
            "closes_at",
        ]
        widgets = {
            "description": forms.Textarea(attrs={"rows": 8, "class": "field-input"}),
            "requirements": forms.Textarea(attrs={"rows": 5, "class": "field-input"}),
            "closes_at": forms.DateInput(attrs={"type": "date"}),
        }
