$this->title, 'body' => $this->body, 'type' => $this->type->value, 'send_to' => $this->level, 'sender_id' => $this->senderId, 'receiver_id' => $this->receiverId, 'class_id' => $this->classId, ]; } private static function normalizeType(NotificationType|string $type): NotificationType { if ($type instanceof NotificationType) { return $type; } return NotificationType::from($type); } }