from rest_framework import serializers

from LiveStock.models import  Union
from authentication.serializer.serializer import BankCardSerializer, SystemUserProfileForInspectionSerializer
from authentication.serializers import SystemAddressSerializer


class UnionSerializer(serializers.ModelSerializer):
    user = SystemUserProfileForInspectionSerializer(read_only=True)
    address = SystemAddressSerializer(read_only=True)
    user_bank_info = BankCardSerializer(required=False)

    class Meta:
        model = Union
        fields = '__all__'
