from apps.shared.domain.exceptions import DomainError class InvalidPersonName(DomainError): code = "invalid_name" field = "name" class InternRequiresEndDate(DomainError): code = "intern_requires_end_date" field = "employment_ends_on" class InternRequiresSupervisor(DomainError): code = "intern_requires_supervisor" field = "supervisor_id" class InvalidSupervisor(DomainError): """The supervisor must be an active management or employee user, not the user itself.""" code = "invalid_supervisor" field = "supervisor_id" class EmailAlreadyTaken(DomainError): code = "email_taken" field = "email" class LastActiveAdmin(DomainError): """The last active admin cannot be deactivated or moved to another role.""" code = "last_active_admin" class SupervisorHasInterns(DomainError): """A supervisor of active interns cannot be deactivated or moved to a non-supervising role.""" code = "supervisor_has_interns" class UserNotFound(DomainError): code = "user_not_found"