3
JaP                 @   s(  d dl mZ d dlmZ d dlmZ d dlmZ d dl	m
Z
 d dlT d dlZdedfd	ed	fd
ed
ff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 edfdedfdedffZd edfdedfdedffZd edfdedffZdedfdedffZd edfd!ed"fd#ed$ff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/d0 d0ejZG d1d2 d2ejZG d3d4 d4ejZ G d5d6 d6ejZ!G d7d8 d8ejZ"G d9d: d:ejZ#dS );    )models)User)gettext)GenericForeignKey)ContentType)*NPendingAcceptedRejectedc               @   s   e Zd Zejdd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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	Zd
d ZdS )baseinfod   customerT)
max_lengthdefaultnullblank)r   uniquer   r   )r   r   r   )r   r   r   )r   r   )auto_now_addc             C   s
   t | jS )N)str	firstname)self r   6/var/www/html/Stanley/GoodsDelivery/Customer/models.py__str__   s    zbaseinfo.__str__N)__name__
__module____qualname__r   	CharFieldroleZinfoIdr   lastnameemailpasswordcountrycodephone	TextFieldaddressDateTimeField
created_atr   r   r   r   r   r      s   r   c               @   sf  e Zd Z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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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eddZej	d
dddZej	deddZejddZejddZejddZejddZ ejddZ!ej"ddZ#dd Z$dS )Customerz<
	This model is used to store the information of Customer.
	T)	on_deleter   r   r   r   )r   r   r   r   )r   r   r   )r   r   r   r   )r   r   r      )r   r   i,  i  r   )r   choicesr   F)r   )r   c             C   s
   t | jS )N)r   user)r   r   r   r   r   ?   s    zCustomer.__str__N)%r   r   r   __doc__r   
ForeignKeyr   CASCADEr,   r   r   namer    r"   r#   	FileFieldimager$   r%   idprooffcmtokenemailverificationlinkforgot_password_linkinsuranceImageCOMPANY_DOCUMENT_STATUSinsuranceImageStatuslicenceImagelicenceImageStatusBooleanFieldemailverifiedaccountverifiedaccountapproved
isdisabled	isdeletedr&   r'   r   r   r   r   r   r(   "   s0   r(   c               @   s   e Zd 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ZejddZejdd	Zd
d ZdS )
StoredCardz<
	This model is used to store the information of Customer.
	T)r)   r   r   r   )r   r   r   F)r   )r   )auto_nowc             C   s8   t t | jd t | j d t | j d t | j S )Nz - )r   r   stripe_customer_idstripe_card_id
is_default)r   r   r   r   r   T   s    zStoredCard.__str__N)r   r   r   r-   r   r.   r(   r/   r   r   rD   rE   Z!stripe_card_number_lastfourdigitsZstripe_card_exp_monthZstripe_card_exp_yearr<   rF   r&   r'   
updated_atr   r   r   r   r   rB   C   s   rB   c               @   s   e Zd 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ejddddZejdd	Zejdd
Zdd ZdS )CompanyDetailz<
	This model is used to store the information of Customer.
	T)r)   r   r   r   )r   r   r   )r   r   r   g        )r   r   r   )r   )rC   c             C   s
   t | jS )N)r   r   )r   r   r   r   r   j   s    zCompanyDetail.__str__N)r   r   r   r-   r   r.   r(   r/   r   r   Z	job_titler0   ZwebsiteZmonthly_delivery_volumeZregistration_numberZindustry
FloatFieldcreditsr&   r'   rG   r   r   r   r   r   rH   Y   s   rH   c               @   sl  e Zd Z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d	Zej	dddd
Zej	d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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eddZej	dddd
Zej	deddZejddZejddZejddZ ejddZ!ejddZ"dd Z#dS )Companyz<
	This model is used to store the information of Customer.
	T)r)   r   r   2    )r   r   r   r   r   r   )r   r   r   r   )r   r   r   )r   r   r   r   )r   r   r   r*   )r   r   i,  i  r   )r   r+   r   F)r   c             C   s
   t | jS )N)r   r,   )r   r   r   r   r      s    zCompany.__str__N)$r   r   r   r-   r   r.   r   r/   r,   r   userIDr   r   r   r    r"   r#   r1   r2   r$   r%   r4   r5   Zforgotpasswordlinkr7   r8   r9   r:   r;   r<   r=   r>   r?   r@   rA   r   r   r   r   r   rK      s0   rK   zSame Day Delivery   zTwo Days Delivery   zMultiple Days DeliveryzParcel PendingzParcel AssignedzParcel Delivered	CompletedSinglez
Multi-DroppendingZapprovedZApprovedZdisapprovedZDisapprovedc               @   s   e Zd 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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	Zd
d ZdS )RepeatOrderz?
	This model is used to store the information of Order table.
	T)r)   r   r   r   )r   r   r   F)r   )r   )rC   c             C   s4   t | jd t | j d t | j d t | j S )Nz - )r   idbase_customerjob_idrepeat_after_days
start_date)r   r   r   r   r      s    zRepeatOrder.__str__N)r   r   r   r-   r   r.   r(   r/   r   r   rV   Zrepeat_date_stringrW   rX   Zend_datepickuptimeslotdropofftimeslotZlast_booking_dater<   Zis_cancelledr&   r'   rG   r   r   r   r   r   rT      s   rT   c               @   sh   e Zd ZdZejddddZejddddZej	 Z
ejdeddZejdd	Zejdd
Zdd ZdS )CreditsRequestedz?
	This model is used to store the information of Order table.
	r   T)r   r   r   g        )r   r   r   rS   )r   r+   r   )r   )rC   c             C   s4   t | jd t | j d t | j d t | j S )Nz - )r   rU   company_emailrJ   status)r   r   r   r   r      s    zCreditsRequested.__str__N)r   r   r   r-   r   r   r\   rI   rJ   r$   Znote_by_companyCREDITSREQUEST_STATUS_CHOICESr]   r&   r'   rG   r   r   r   r   r   r[      s   r[   c               @   s   e Zd ZdZejeejdddZej	e
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	eddZejejjdZejddZejddZejddZdd ZdS )Orderz?
	This model is used to store the information of Order table.
	T)r)   r   r   r   )r+   r   r   rM   )r   r   r   r   g        )r   r   r   )r   )r   )rC   Fc             C   s&   t | jd t | j d t | j S )Nz - )r   rU   r   r]   )r   r   r   r   r      s    zOrder.__str__N)r   r   r   r-   r   r.   r(   r/   r   IntegerFieldORDERTYPE_CHOICESZ	ordertyper   Zcharge_from_cardrI   ZtotalamountZparceldelivery_chargesZspecialbooking_chargesORDERSTATUS_CHOICESr]   	DateFielddatetimedatetodaycreation_dater&   r'   rG   r<   rA   r   r   r   r   r   r_      s   r_   c               @   s   e Zd Z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 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dd ZdS )OrderPaymentz?
	This model is used to store the information of Order table.
	T)r)   r   r   r   card)r   r   r   r   g        )r   r   r   )r   r   r   )r   )rC   c             C   s   t | jd t | j S )Nz - )r   rU   order)r   r   r   r   r     s    zOrderPayment.__str__N)r   r   r   r-   r   r.   r_   r/   rj   r   methodrI   credits_to_be_usedr$   stripe_charge_responsestripe_charge_idstripe_amountr&   r'   rG   r   r   r   r   r   rh      s   rh   c               @   s
  e Zd ZdZejeejdddZeje	ejdddZ
eje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d
Zejdd	ddd
Zejdd	ddd
Zej ZejdddZejdd	ddd
ZejdddZejddddZejdd	ddd
Zejdd	ddd
Zejdd	ddd
Z ejdd	ddd
Z!ejddddZ"ej Z#ejdddZ$eje%ddZ&ejdd	ddd
Z'ejdd	ddd
Z(ejdd	ddd
Z)ejdd	ddd
Z*ejdd	ddd
Z+ejdd	ddd
Z,ejdd	ddd
Z-ejdd	ddd
Z.eje/ej0dddZ1ej2ddddZ3ej2ddddZ4ej5ddddZ6ej5ddddZ7ej5ddddZ8ej9ddZ:ej9ddZ;ej9ddZ<ej9ddZ=ej>e?j@jAdZBejddddZCejddZDejddZEejddZFejddZGdd ZHdS )CustomerJobz?
	This model is used to store the information of CustomerJob.
	T)r)   r   r   r   )r+   r   r   )r   r   r   i,  rM   )r   r   r   r   )r   r   )r   r   )r)   r   r   g        )r   r   r   r*   F)r   )r   )rC   rO   c             C   sR   | j r2tt| jd t| j d t| j j S tt| jd t| j S d S )Nz - )rj   r   rU   r   )r   r   r   r   r   S  s    ,zCustomerJob.__str__N)Ir   r   r   r-   r   r.   r_   r/   rj   r(   r   r`   PARCELSTATUS_CHOICESr]   r   Z
sendernamesenderemailZsendercountrycodeZsenderphoneZpickupaddressZ
sendercitysenderlatitudesenderlongituder$   Zpickupspecialnoter&   ZpickupdatetimeZnoofparcelsZno_of_item_in_parcelZrecipientnameZrecipientcountrycodeZrecipientphonerecipientlatituderecipientlongitudeZdropoffaddressZdropoffspecialnoteZdropoffdatetimeDELIVERYDURATION_CHOICESZdeliverydurationlengthwidthheightZweight
parceltypeZpickuptimeslotDaterY   rZ   VehicleTypeSET_NULLvehicletyperI   priceZspecialbooking_charger1   r2   ZqrcodeZ	parcelpdfr<   ZspecialbookingrA   r@   ZdeliverySafePlacerc   rd   re   rf   rg   Zcomment_of_Parcelr'   rG   ZsameIdForParcelsDetailsZpriorityBaseIDForParcelr   r   r   r   r   rp     sd   rp   c               @   s   e Zd Z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 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dd ZdS )CustomerJobPaymentz?
	This model is used to store the information of Order table.
	T)r)   r   r   r   ri   )r   r   r   r   g        )r   r   r   )r   r   r   )r   )rC   c             C   s   t | jd t | j S )Nz - )r   rU   job)r   r   r   r   r   i  s    zCustomerJobPayment.__str__N)r   r   r   r-   r   r.   rp   r/   r   r   rk   rI   rl   r$   rm   rn   ro   r&   r'   rG   r   r   r   r   r   r   [  s   r   c               @   s   e Zd Zejeej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dZej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Zdd ZdS )	CustomerJobDateTimeT)r)   r   r   )r   r   )r   )rC   c             C   s
   t | jS )N)r   r   )r   r   r   r   r   {  s    zCustomerJobDateTime.__str__N)r   r   r   r   r.   rp   r/   r   r&   Zpayment_datetimeZdriver_job_started_datetimeZdriver_pickuparrived_datetimeZpickup_datetimeZstartDropOffTimeZarrivedDropOffLocationZitemsdelivered_datetimedeliveryfailed_datetimer'   rG   r   r   r   r   r   r   m  s   r   c               @   sb   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ZejddddZejddZd	d
 ZdS )CustomerJobDeliveryFailedr*   T)r   r   r   )r)   r   r   )r   r   r   F)r   c             C   s
   t | jS )N)r   r   )r   r   r   r   r     s    z!CustomerJobDeliveryFailed.__str__N)r   r   r   r   r1   Zdeliveryfailed_imager.   rp   r/   r   r&   r   r   Zdeliveryfailurereasonr<   rA   r   r   r   r   r   r   ~  s   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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dS )	CustomerJobDeliveryExtraDetailsT)r)   r   r   r   )r   r   r   r*   c             C   s
   t | jS )N)r   r   )r   r   r   r   r     s    z'CustomerJobDeliveryExtraDetails.__str__N)r   r   r   r   r.   rp   r/   r   r   Zpickup_proof_methodZpickup_fromperson_namer1   Zpickup_fromperson_signatureZ
pickup_otpZdelivery_proof_methodZdelivery_toperson_nameZdelivery_toperson_signatureZdelivery_otpr   r   r   r   r   r     s   r   c               @   s(   e Zd ZejeejdddZdd ZdS )DisputeMessageThreadModelT)r)   r   r   c             C   s
   t | jS )N)r   rU   )r   r   r   r   r     s    z!DisputeMessageThreadModel.__str__N)	r   r   r   r   r.   rp   r/   customerjobr   r   r   r   r   r     s   r   c               @   st   e Zd ZejeejdddZejeejdddZ	ej
 ZejddZejddZejddZejddZdd Zd	S )
DisputeMessageModelT)r)   r   r   F)r   )rC   )r   c             C   s
   t | jS )N)r   rU   )r   r   r   r   r     s    zDisputeMessageModel.__str__N)r   r   r   r   r.   r   r/   Zdisputemessagethreadrp   r   r$   messager<   ZfromuserZtouserr&   r'   rG   r   r   r   r   r   r     s   r   )$	django.dbr   django.contrib.auth.modelsr   django.utils.translationr   _"django.contrib.contenttypes.fieldsr   "django.contrib.contenttypes.modelsr   ZAdminApp.modelsrd   r8   Modelr   r(   rB   rH   rK   rw   rq   rb   ra   r^   rT   r[   r_   rh   rp   r   r   r   r   r   r   r   r   r   r   <module>   sL   

!+







K	