from rest_framework import serializers

from people.models import Customer
from people.models import InternalUser

class CustomerSerializer(serializers.ModelSerializer):

    class Meta:
        model = Customer
        fields = '__all__'

class InternalUserSerializer(serializers.ModelSerializer):

    class Meta:
        model = InternalUser
        fields = '__all__'


from rest_framework import serializers

from people.models import Customer
from people.models import InternalUser

class CustomerSerializer(serializers.ModelSerializer):
    phone_number = serializers.IntegerField(validators=[lambda x: len(str(x)) == 10])

    class Meta:
        model = Customer
        fields = '__all__'

class InternalUserSerializer(serializers.ModelSerializer):

    class Meta:
        model = InternalUser
        fields = '__all__'


Make the phone number an int
Make the phone number an int

  from rest_framework import serializers
  
  from people.models import Customer
  from people.models import InternalUser
  
  class CustomerSerializer(serializers.ModelSerializer):
+     phone_number = serializers.IntegerField(validators=[lambda x: len(str(x)) == 10])
  
      class Meta:
          model = Customer
          fields = '__all__'
  
  class InternalUserSerializer(serializers.ModelSerializer):
  
      class Meta:
          model = InternalUser
          fields = '__all__'
  
  
Make the phone number an int
## Code Before:
from rest_framework import serializers

from people.models import Customer
from people.models import InternalUser

class CustomerSerializer(serializers.ModelSerializer):

    class Meta:
        model = Customer
        fields = '__all__'

class InternalUserSerializer(serializers.ModelSerializer):

    class Meta:
        model = InternalUser
        fields = '__all__'


## Instruction:
Make the phone number an int
## Code After:
from rest_framework import serializers

from people.models import Customer
from people.models import InternalUser

class CustomerSerializer(serializers.ModelSerializer):
    phone_number = serializers.IntegerField(validators=[lambda x: len(str(x)) == 10])

    class Meta:
        model = Customer
        fields = '__all__'

class InternalUserSerializer(serializers.ModelSerializer):

    class Meta:
        model = InternalUser
        fields = '__all__'

