3
`C                 @   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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+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!dS )7    )models)User)gettext)GenericForeignKey)ContentType)*Nc               @   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	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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_deletenullblankd   customer)
max_lengthdefaultr
   r   )r   r
   r   )r   uniquer
   r   )r   r   r
      )r   r
   i,  i  F)r   )auto_now_addc             C   s
   t | jS )N)struser)self r   9/var/www/html/Stanley/GoodsDeliveryOLD/Customer/models.py__str__$   s    zCustomer.__str__N) __name__
__module____qualname____doc__r   
ForeignKeyr   CASCADEr   	CharFieldrolenameemailcountrycodephone	FileFieldimage	TextFieldaddressidprooffcmtokenemailverificationlinkforgot_password_linkBooleanFieldemailverifiedaccountverifiedaccountapproved
isdisabled	isdeletedDateTimeField
created_atr   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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   9   s    zStoredCard.__str__N)r   r   r   r   r   r   r   r   r   r   r7   r8   Z!stripe_card_number_lastfourdigitsZstripe_card_exp_monthZstripe_card_exp_yearr-   r9   r3   r4   
updated_atr   r   r   r   r   r5   (   s   r5   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   )r6   c             C   s
   t | jS )N)r   r   )r   r   r   r   r   O   s    zCompanyDetail.__str__N)r   r   r   r   r   r   r   r   r   r   Z	job_titler!   ZwebsiteZmonthly_delivery_volumeZregistration_numberZindustry
FloatFieldcreditsr3   r4   r:   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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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 Company.
	T)r	   r   r
   r   )r   r   r
   )r   r   r   r
   r   )r   r
   )r   r
   r   i,  F)r   c             C   s
   t | jS )N)r   r   )r   r   r   r   r   f   s    zCompany.__str__N)r   r   r   r   r   r   r   r   r   r   r!   r"   r#   r$   r%   r&   r'   r(   Z	tinnumberr*   r+   r-   r.   r0   r2   r   r   r   r   r   r>   R   s   r>   zSame Day Delivery   zTwo Days Delivery   zMultiple Days DeliveryzParcel PendingzParcel AssignedzParcel DeliveredPending	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   )r6   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   rG   Zrepeat_date_stringrH   rI   end_datepickuptimeslotdropofftimeslotZlast_booking_dater-   Zis_cancelledr3   r4   r:   r   r   r   r   r   rE      s   rE   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
   rD   )r   choicesr   )r   )r6   c             C   s4   t | jd t | j d t | j d t | j S )Nz - )r   rF   company_emailr=   status)r   r   r   r   r      s    zCreditsRequested.__str__N)r   r   r   r   r   r   rO   r<   r=   r'   Znote_by_companyCREDITSREQUEST_STATUS_CHOICESrP   r3   r4   r:   r   r   r   r   r   rM      s   rM   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   )rN   r   r    )r   r   r   r
   g        )r   r   r
   )r   )r   )r6   Fc             C   s&   t | jd t | j d t | j S )Nz - )r   rF   r   rP   )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_cardr<   ZtotalamountZparceldelivery_chargesZspecialbooking_chargesORDERSTATUS_CHOICESrP   	DateFielddatetimedatetodaycreation_dater3   r4   r:   r-   r2   r   r   r   r   r   rR      s   rR   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   )r6   c             C   s   t | jd t | j S )Nz - )r   rF   order)r   r   r   r   r      s    zOrderPayment.__str__N)r   r   r   r   r   r   rR   r   r^   r   methodr<   credits_to_be_usedr'   stripe_charge_responsestripe_charge_idstripe_amountr3   r4   r:   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	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   )rN   r   r   )r   r   r
   i,  rS   )r   r   r   r
   )r   r
   )r
   r   )r	   r   r
   g        )r   r   r
   r   F)r   )r   )r6   r?   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 - )r^   r   rF   r   )r   r   r   r   r     s    ,zCustomerJob.__str__N)Ir   r   r   r   r   r   rR   r   r^   r   r   rT   PARCELSTATUS_CHOICESrP   r   Z
sendernamesenderemailZsendercountrycodeZsenderphoneZpickupaddressZ
sendercitysenderlatitudesenderlongituder'   Zpickupspecialnoter3   ZpickupdatetimeZnoofparcelsZno_of_item_in_parcelZrecipientnameZrecipientcountrycodeZrecipientphonerecipientlatituderecipientlongitudeZdropoffaddressZdropoffspecialnoteZdropoffdatetimeDELIVERYDURATION_CHOICESZdeliverydurationlengthwidthheightZweight
parceltypeZpickuptimeslotDaterK   rL   VehicleTypeSET_NULLvehicletyper<   priceZspecialbooking_charger%   r&   ZqrcodeZ	parcelpdfr-   Zspecialbookingr2   r1   ZdeliverySafePlacerW   rX   rY   rZ   r[   Zcomment_of_Parcelr4   r:   ZsameIdForParcelsDetailsZpriorityBaseIDForParcelr   r   r   r   r   rd      sd   rd   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   r]   )r   r   r   r
   g        )r   r   r
   )r   r   r
   )r   )r6   c             C   s   t | jd t | j S )Nz - )r   rF   job)r   r   r   r   r   0  s    zCustomerJobPayment.__str__N)r   r   r   r   r   r   rd   r   ru   r   r_   r<   r`   r'   ra   rb   rc   r3   r4   r:   r   r   r   r   r   rt   "  s   rt   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   )r6   c             C   s
   t | jS )N)r   ru   )r   r   r   r   r   B  s    zCustomerJobDateTime.__str__N)r   r   r   r   r   rd   r   ru   r3   Zpayment_datetimeZdriver_job_started_datetimeZdriver_pickuparrived_datetimeZpickup_datetimeZstartDropOffTimeZarrivedDropOffLocationZitemsdelivered_datetimedeliveryfailed_datetimer4   r:   r   r   r   r   r   rv   4  s   rv   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   ru   )r   r   r   r   r   K  s    z!CustomerJobDeliveryFailed.__str__N)r   r   r   r   r%   Zdeliveryfailed_imager   rd   r   ru   r3   rw   r   Zdeliveryfailurereasonr-   r2   r   r   r   r   r   rx   E  s   rx   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   ru   )r   r   r   r   r   Z  s    z'CustomerJobDeliveryExtraDetails.__str__N)r   r   r   r   r   rd   r   ru   r   Zpickup_proof_methodZpickup_fromperson_namer%   Zpickup_fromperson_signatureZ
pickup_otpZdelivery_proof_methodZdelivery_toperson_nameZdelivery_toperson_signatureZdelivery_otpr   r   r   r   r   ry   N  s   ry   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   rF   )r   r   r   r   r   c  s    z!DisputeMessageThreadModel.__str__N)	r   r   r   r   r   rd   r   customerjobr   r   r   r   r   rz   `  s   rz   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   )r6   )r   c             C   s
   t | jS )N)r   rF   )r   r   r   r   r   p  s    zDisputeMessageModel.__str__N)r   r   r   r   r   rz   r   Zdisputemessagethreadrd   r{   r'   messager-   ZfromuserZtouserr3   r4   r:   r   r   r   r   r   r|   g  s   r|   )"	django.dbr   django.contrib.auth.modelsr   django.utils.translationr   _"django.contrib.contenttypes.fieldsr   "django.contrib.contenttypes.modelsr   ZAdminApp.modelsrX   Modelr   r5   r;   r>   rk   re   rV   rU   rQ   rE   rM   rR   r\   rd   rt   rv   rx   ry   rz   r|   r   r   r   r   <module>   sD   







K	