from rest_framework import serializers

from core.http import models


class UserSerializer(serializers.ModelSerializer):
    class Meta:
        model = models.User
        fields = (
            "id",
            "first_name",
            "last_name",
            "phone",
            "email",
            "role",
            "username",
            "avatar",
        )


class UserUpdateSerializer(serializers.ModelSerializer):
    class Meta:
        model = models.User
        fields = (
            "first_name",
            "last_name",
            "username",
            "phone",
        )


class UserAvatarUpdateSerializer(serializers.ModelSerializer):
    class Meta:
        model = models.User
        fields = ("avatar",)
