"""
Courier serializer
"""

from rest_framework import serializers

from core.apps.eggs import models
from core.http.serializers import user


class CourierSerializer(serializers.ModelSerializer):
    user = user.UserSerializer(read_only=True, source="user_id")

    class Meta:
        model = models.Courier
        fields = (
            "id",
            "user_id",
            "user",
        )

        extra_kwargs = {
            "user_id": {"write_only": True},
        }
