o
    E£gý  ã                   @   s:   d dl mZ d dlmZ d dlmZ G dd„ dejƒZdS )é    )Úmake_password)Úserializers)Ú	Customersc                   @   s"   e Zd ZG dd„ dƒZdd„ ZdS )ÚCustomerRegistrationSerializerc                   @   s   e Zd ZeZg d¢ZdS )z#CustomerRegistrationSerializer.Meta)ÚpasswordÚ
first_nameÚ	last_nameÚgenderÚheight_feetÚheight_inchesÚweightÚaddress_line1Úaddress_line2ÚcityÚstateÚpinÚphoneÚemailÚprofile_imageÚ
valid_uptoÚregistration_dateÚemergency_phone1Úemergency_email1Úemergency_name1Úemergency_phone2Úemergency_email2Úemergency_name2Úprimary_physician_nameÚprimary_physician_contactÚblood_groupÚmedical_historyÚ	allergiesN)Ú__name__Ú
__module__Ú__qualname__r   ÚmodelÚfields© r'   r'   úT/var/www/rescue_company/customer_api/serializers/customer_registration_serializer.pyÚMeta   s    r)   c                 C   s"   |rt |ƒdk rt d¡‚t|ƒS )Né   z,Password must be at least 4 characters long.)Úlenr   ÚValidationErrorr   )ÚselfÚvaluer'   r'   r(   Úvalidate_password   s   
z0CustomerRegistrationSerializer.validate_passwordN)r"   r#   r$   r)   r/   r'   r'   r'   r(   r      s    	r   N)Údjango.contrib.auth.hashersr   Úrest_frameworkr   Úaccounts.modelsr   ÚModelSerializerr   r'   r'   r'   r(   Ú<module>   s    