from rest_framework import serializers

from notification.models import Notification, NotificationToken, DashboardNotification
from authentication.serializers import GroupSerializer


class NotificationTokenSerializer(serializers.ModelSerializer):
    class Meta:
        Model = NotificationToken
        fields = "__all__"


class NotificationSerializer(serializers.ModelSerializer):
    notif_user = NotificationTokenSerializer()
    notif_group = GroupSerializer()

    class Meta:
        Model = Notification
        fields = "__all__"


class DashboardNotificationSerializer(serializers.ModelSerializer):
    role = GroupSerializer(read_only=True,many=True)

    class Meta:
        model = DashboardNotification
        fields = "__all__"
