"""Domain signals emitted by the SME-Hub incubation subprocess (SP2).

M&EL listens for the milestone signals (FRSME-INC036, FRSME-MEI003).
Other SME-Hub submodules can subscribe to programme/cohort events to
refresh matchmaking caches when an entrepreneur joins or completes a
programme.
"""
import django.dispatch

# Programme lifecycle ----------------------------------------------------
smehub_programme_published = django.dispatch.Signal()
"""kwargs: programme (Programme), by_user (CustomUser | None)"""

smehub_programme_closed = django.dispatch.Signal()
"""kwargs: programme (Programme), by_user (CustomUser | None)"""

# Application lifecycle -------------------------------------------------
smehub_application_submitted = django.dispatch.Signal()
"""kwargs: application (Application)"""

smehub_application_returned = django.dispatch.Signal()
"""kwargs: application (Application), by_user (CustomUser), message (str)"""

smehub_application_decided = django.dispatch.Signal()
"""kwargs: application (Application), by_user (CustomUser), accepted (bool), score (Decimal | None)"""

# Judging --------------------------------------------------------------
smehub_judges_assigned = django.dispatch.Signal()
"""kwargs: application (Application), assignments (list[JudgeAssignment])"""

smehub_judge_score_submitted = django.dispatch.Signal()
"""kwargs: application (Application), judge (CustomUser)"""

# Cohort lifecycle -----------------------------------------------------
smehub_cohort_confirmed = django.dispatch.Signal()
"""kwargs: cohort (Cohort), members (list[CohortMember])"""

smehub_cohort_member_withdrawn = django.dispatch.Signal()
"""kwargs: member (CohortMember), reason (str)"""

smehub_cohort_member_completed = django.dispatch.Signal()
"""kwargs: member (CohortMember), manual (bool)"""

# Mentorship -----------------------------------------------------------
smehub_mentor_assigned = django.dispatch.Signal()
"""kwargs: assignment (MentorAssignment), reassigned (bool)"""

smehub_session_scheduled = django.dispatch.Signal()
"""kwargs: session (MentorSession)"""

smehub_session_completed = django.dispatch.Signal()
"""kwargs: session (MentorSession)"""

smehub_session_cancelled = django.dispatch.Signal()
"""kwargs: session (MentorSession), reason (str)"""

# Progress + certificate ----------------------------------------------
smehub_progress_milestone = django.dispatch.Signal()
"""Generic milestone update for M&EL. Emitted whenever ProgressRecord changes.

kwargs: member (CohortMember), milestone (str), payload (dict)
"""

smehub_certificate_issued = django.dispatch.Signal()
"""kwargs: certificate (Certificate), member (CohortMember)"""
