U
    ?ÿcs!  ã                   @   sÎ   d dl mZ d dlmZ G dd„ dejƒZG dd„ dejƒZG dd„ deƒZG d	d
„ d
ejƒZG dd„ dejƒZ	G dd„ dejƒZ
G dd„ dejƒZG dd„ dejƒZG dd„ dejƒZG dd„ dejƒZdS )é    )Úmodels)ÚAbstractUserc                   @   sf   e Zd ZdZdZdZdZdZedfedfedfed	fed
fgZe	j
ddd�ZG dd„ dƒZdd„ ZdS )ÚRoleé   é   é   é   é   ÚADMINÚSUBADMINÚ	PUBLISHERÚSUBPUBLISHERÚUSERé2   F)Ú
max_lengthÚnullc                   @   s   e Zd ZdZdS )z	Role.MetaZ
user_rolesN©Ú__name__Ú
__module__Ú__qualname__Údb_table© r   r   úU/var/www/html/staging.mfahmagazine.net/magazine_api/magazine_web_admin/base/models.pyÚMeta   s   r   c                 C   s   | j S )N)Úrole©Úselfr   r   r   Ú__str__   s    zRole.__str__N)r   r   r   r
   r   r   r   r   ZROLE_CHOICESr   Ú	CharFieldr   r   r   r   r   r   r   r      s   "r   c                   @   sr   e Zd Zejdd�Zejdd�Zejdddd�Zejdddd�Zejdddd�Z	ejdddd�Z
G dd„ dƒZd	S )
ÚCountryé   )r   é   T©r   r   Úblankr	   c                   @   s   e Zd ZdZdS )zCountry.MetaZcountry_userNr   r   r   r   r   r      s   r   N)r   r   r   r   r   ZsortnameÚnameÚcountry_codeZ
commissionÚcurrency_symbolZcurrency_coder   r   r   r   r   r      s   r   c                   @   sþ  e Zd Zejdddd�Zejeejddd�Z	ej
ddddd�Zej
dddd�Zejdddd�Zej
dddd�Zejdd	�Zejdd	�Zej
d
ddd�Zejddd�Zejdd�Zejdd	�Zejdd	�Zej
dddd�Zej
dddd�Zej
dddd�Zej
dddd�Zej
dddd�Zejdddd�Zejeejddd�Z ejdd	�Z!ej
dddd�Z"ej
dddd�Z#ej$ddd�Z%ej$ddd�Z&ej
dddd�Z'ej
dddd�Z(ej
dddd�Z)ej
dddd�Z*ej
dddd�Z+ej
dddd�Z,dd„ Z-G dd„ dƒZ.dS )ÚUseréd   Tr"   ©Ú	on_deleter   r#   r!   )r   r   r#   Úunique©Úauto_now_addr#   r   F©Údefaulté
   ©r   r#   ©Úauto_nowéÈ   i,  éú   zprofile_pic/)Ú	upload_tor   r#   r    r   é   c                 C   s   d  | j¡S )Nz{})ÚformatÚemailr   r   r   r   r   E   s    zUser.__str__c                   @   s"   e Zd ZdZejddgd�gZdS )z	User.MetaÚmaster_userr9   Úroles©ÚfieldsN©r   r   r   r   r   ÚIndexÚindexesr   r   r   r   r   G   s   ÿr   N)/r   r   r   r   Ú
EmailFieldr9   Ú
ForeignKeyr   ÚCASCADEr;   r   Úphone_numberr%   ÚDateTimeFieldÚ
created_onÚ
created_byÚBooleanFieldZfirst_loginÚstatusZotpZexp_otp_datetimeÚ
updated_onZemail_varificationZphone_varificationZdevice_tokenZ	device_idZ	fcm_tokenZsocial_login_typeÚdescriptionÚ	FileFieldZprofile_picr   ÚcountryZotp_varificationÚuidÚtypeÚ	DateFieldÚ
start_dateÚend_dateÚaddressZaddress_line_2ÚstateZzipcodeZcityZcountry_namer   r   r   r   r   r   r'   $   sB   r'   c                   @   sÖ   e Zd Zejeejddd�Zejdddd�Z	ejdddd�Z
ejddd�Zejdddd�Zejdd�Zejdddd�Zejdddd�Zejddd�Zejdddd	�Zejdddd	�Zejdddd
�ZG dd„ dƒZdS )ÚSubscriptionTypeTr)   r    r"   r0   r1   r.   r5   r,   )r3   r#   r   c                   @   s$   e Zd ZdZdZejdgd�gZdS )zSubscriptionType.MetaZSubscription_day_Type)Úsubscription_typerM   rM   r<   N)r   r   r   r   Úunique_togetherr   r?   r@   r   r   r   r   r   a   s   ÿr   N)r   r   r   r   rB   r   rC   rM   r   rV   ÚdaysÚ
FloatFieldÚpriceZdiscountrH   Úsubscription_statusrO   rK   Úper_month_pricerE   rF   Z	create_onrJ   r   r   r   r   r   rU   T   s   rU   c                   @   sä   e Zd Zejeejddd�Zejeejddd�Z	ej
dddd�Zej
dddd�Zejddd�Zejddd�Zejddd�Zejdd�Zej
dddd�Zej
d	ddd�Zej
d
ddd�Zejdddd�Zejdd�ZG dd„ dƒZdS )ÚSubscriptionTr)   r(   r"   r1   Fr.   r   r4   r5   r,   r2   c                   @   s    e Zd ZdZejdgd�gZdS )zSubscription.MetaZuser_subscriptionÚusersr<   Nr>   r   r   r   r   r   y   s   ÿr   N)r   r   r   r   rB   r'   rC   r^   rU   Úsubscriptionr   rV   r$   rY   rZ   rP   rQ   rR   rH   r[   Zsave_percentager\   rK   rE   rF   rJ   r   r   r   r   r   r]   i   s   r]   c                   @   sF   e Zd Zejeejdddd�Zejeejdddd�ZG dd„ dƒZ	dS )ÚSubPublisherUserTr:   )r*   r   r#   Úrelated_nameZcreated_by_userc                   @   s    e Zd ZdZejdgd�gZdS )zSubPublisherUser.MetaZSub_Publisher_Userr^   r<   Nr>   r   r   r   r   r   „   s   ÿr   N)
r   r   r   r   rB   r'   rC   r^   rG   r   r   r   r   r   r`   €   s   r`   c                   @   sv   e Zd Zejeejddd�Zejdddd�Z	ej
dd�Zej
dd�Zejdddd�Zejdddd�ZG d	d
„ d
ƒZdS )ÚMasterCurrencyTr)   r    r"   Fr.   ©r-   r   r#   ©r3   r   r#   c                   @   s"   e Zd ZdZejddgd�gZdS )zMasterCurrency.MetaZMaster_Currencyr%   Úcurrencyr<   Nr>   r   r   r   r   r   “   s   ÿr   N)r   r   r   r   rB   r   rC   r%   r   re   rH   Zcurrency_statusZ
is_deletedrE   rF   rJ   r   r   r   r   r   rb   ‹   s   rb   c                   @   s^   e Zd Zejeejddd�Zejdddd�Z	ej
dddd�Zej
dddd�ZG dd„ dƒZd	S )
ÚPaymentGetWayTr)   r	   r"   rc   rd   c                   @   s"   e Zd ZdZejddgd�gZdS )zPaymentGetWay.MetaZPayment_Get_WayrM   Úgetway_commissionr<   Nr>   r   r   r   r   r       s   ÿr   N)r   r   r   r   rB   r   rC   rM   r   rg   rE   rF   rJ   r   r   r   r   r   rf   š   s
   rf   c                   @   sŽ   e Zd Zejeejddd�Zejdddd�Z	ej
dddd�Zejdddd�Zejdddd�Zejdddd�Zejdddd	�ZG d
d„ dƒZdS )Ú
ContactsUsTr)   r    r"   r(   r!   éô  rc   rd   c                   @   s    e Zd ZdZejdgd�gZdS )zContactsUs.MetaZcontacts_usÚuserr<   Nr>   r   r   r   r   r   °   s   ÿr   N)r   r   r   r   rB   r'   rC   rj   r   Ú
first_namerA   r9   rD   Ú	TextFieldÚmessagerE   rF   rJ   r   r   r   r   r   rh   §   s   rh   c                   @   s^   e Zd Zejeejddd�Zejdddd�Z	ej
dddd�Zej
dddd�ZG dd„ dƒZd	S )
ÚNotificationTr)   ri   r"   rc   rd   c                   @   s    e Zd ZdZejdgd�gZdS )zNotification.MetaZuser_notificationrj   r<   Nr>   r   r   r   r   r   ½   s   ÿr   N)r   r   r   r   rB   r'   rC   rj   rl   rm   rE   rF   rJ   r   r   r   r   r   rn   ·   s
   rn   N)Ú	django.dbr   Údjango.contrib.auth.modelsr   ÚModelr   r   r'   rU   r]   r`   rb   rf   rh   rn   r   r   r   r   Ú<module>   s   0