"""
Mission domain signals.

Signals are emitted by the mission service layer after successful business
state transitions. Use transaction.on_commit at send sites so handlers only run
after the database transaction is committed.
"""

from django.dispatch import Signal


# Payload:
# - instance: Mission
# - created_by: Employee
mission_created = Signal()

# Payload:
# - instance: MissionReply
# - mission: Mission
# - responder: Employee
mission_replied = Signal()

# Payload:
# - instance: Mission
# - completed_by: Employee
# - reply: MissionReply
mission_completed = Signal()

# Payload:
# - instance: MissionReply
# - mission: Mission
# - rejected_by: Employee
# - reason: "reject_reply" | "reopen"
mission_reply_rejected = Signal()

# Payload:
# - instance: Mission
# - reopened_by: Employee
# - rejected_reply_ids: list[int]
mission_reopened = Signal()

# Payload:
# - instance: Mission
# - cancelled_by: Employee
mission_cancelled = Signal()
