
    `9i                    B   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
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mZ d dlZd dlmZ ddlT d dlmZmZmZ d dlmZ d dlmZ d dlZd dlmZ d dl m!Z! d dl"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 dl*T d dl+T d dl,m-Z- d dl.m/Z/ d dl0m1Z1 d dl2Z2d dl3Z3d dl4m5Z5m6Z6m7Z7 d dl8m9Z9 d dl:m;Z; d dl<m=Z= d dl>m?Z? d d lm@Z@mAZA d d!l(mBZB ejC        ZDejE        ZFejG        ZHejI        ZJejK        ZLejM        ZN e9eDeF          ZO G d" d#e          ZP G d$ d%e          ZQ G d& d'e          ZR G d( d)e          ZS G d* d+e          ZT G d, d-e          ZU G d. d/e          ZV G d0 d1e          ZW G d2 d3e          ZX G d4 d5e          ZY G d6 d7e          ZZ G d8 d9e          Z[ G d: d;e          Z\ G d< d=e          Z] G d> d?e          Z^ G d@ dAe          Z_ G dB dCe          Z` G dD dEe          Za G dF dGe          Zb G dH dIe          Zc G dJ dKe          Zd G dL dMe          Ze G dN dOe          Zf G dP dQe          Zg G dR dSe          Zh G dT dUe          Zi G dV dWe          Zj G dX dYe          Zk G dZ d[e          Zl G d\ d]e          Zm G d^ d_e          Zn G d` dae          Zo G db dce          Zp G dd dee          Zq G df dge          Zr G dh die          Zs G dj dke          Zt G dl dme          Zu G dn doe          Zv G dp dqe          Zw G dr dse          Zx G dt due          Zy G dv dwe          Zz G dx dye          Z{ G dz d{e          Z| G d| d}e          Z} G d~ de          Z~ G d de          Z G d de          Z G d de          Z G d de          Z G d de          Z G d de          Z G d de          Z G d de          ZdS )    )render)APIView)Responsestatus)	timedelta)timezone)datetime)settings)RefreshToken)TokenBackend)get_authorization_headerN)
exceptions   )*)	PaginatorPageNotAnInteger	EmptyPage)Q)date)render_to_string)HttpResponse)JsonResponse)redirect)authenticated)mail)EmailMultiAlternatives)authenticate)	SyncGrant	ChatGrant
VideoGrant)Client)AccessToken)	timesince)
TruncMonth)CountAvg)FinalizeAgencyTablec                       e Zd Zd ZdS )AgncyRegisterc                 ,   	 |j         }|                    d          }|                    d          }|                    d          }|                    d          }|                    d          }|                    d          }|                    d          }	|                    d          }
|                    d	          }|                    d
          }|                    d          }|                    d          }|                    d          }|                    d          }|                    d          }|                    d          }d}|st          ddit          j                  S |st          ddit          j                  S |st          ddit          j                  S |st          ddit          j                  S t          j        ||          st          ddit          j                  S t          j        	                    |          
                                }|rt          ddit          j                  S t          j                            ||          }t          j                            |||||||
|	|||||||          }t          j                            |dz   |z   dz   dd !           t!          d"           t#                      }t!          d#           ||_        |                                 d$|z   }i }t!          d%           |j        }d&}t+          |t,          j        |g|'          }|                    d()           t2          j        	                    |*          
                                }|                    d+d(          }|rt2          j        	                    |*          
                                }|st4          j        	                    d,-          
                                }|rwt7          j                                                    }|t=          d./          z   }t2          j                            ||||d0           d|_        |                                 nt@          j        	                    |*          
                                }|stB          j        	                    d12          
                                }|rut7          j                                                    }|t=          d./          z   }tD          j                            ||d3           d|_        |                                 tG          j$        |          } t2          j        	                    |d4          %                    d5          
                                }!t!          d6           |!r|!j&        }"nd}"|j'        |j(        |j)        |j        |j        |j*        |j+        |j        |"d7	}#tY          |           tY          | j-                  |#d8}$t          d9|$d:          S # t\          $ r4}%t          dtY          |%          it          j/                  cY d }%~%S d }%~%ww xY w);Ncompany_name
first_name	last_nameemailpasswordloginUserTypelatitude	longitudehouse_numberstreet_nameregioncityzipcodecountryaddressstatez*^[a-z0-9]+[\._]?[a-z0-9]+[@]\w+[.]\w{2,3}$messagefirst_name is requiredr   last_name is requiredemail is requiredpassword is requiredzInvalid EmailusernamezThe email is already registeredrB   r0   )user	firstNamelastNamer/   r1   agency_companyr3   r2   r4   r5   r6   r7   r8   r9   r:    z1 agency has been successfully registered with us.Tnew_agency_registeredr<   is_readnotification_typezhere here29
OTP has been sent on you registered email successfully:
zhere 3Verify OTP:subject
from_emailtobodyFfail_silently)customerisRoleAgencyBasic)planName   )days)rW   plansub_start_datesub_expiry_date	is_activeSilver)name)rW   r]   r`   rW   r`   -idzhere 4)	r-   r.   companyr/   otpemail_verifiedcustomer_idhas_subscriptionsubscription_idrefreshaccessrD   Successr<   data)0rp   getr   r   HTTP_400_BAD_REQUESTresearchUserobjectsfilterfirstHTTP_409_CONFLICTcreate_userCustomercreateAdminNotificationsprint
GernateOTPrf   saver/   r   r   EMAIL_HOST_USERsendAgencySubscriptionsAgencySubscriptionPlanr	   nowr   r   ri   CustomersSubscriptionsFeatureAddPricingCustomersFeatureAdsHistoryr   for_userorder_byplan_idrE   rF   rG   emailVerifiedidstraccess_token	ExceptionHTTP_500_INTERNAL_SERVER_ERROR)&selfrequestrp   re   r-   r.   r/   r0   r1   r2   r3   r4   r5   r6   r7   r8   r9   r:   r;   regexuserObjcustomerObjOTPr<   context	to_emailsrQ   existing_subrX   
basic_plan
start_dateend_daterefresh_tokensub_datar   userDataallDataes&                                         1/var/www/html/Sam_Eipo/Eipo/agency_panel/views.pypostzAgncyRegister.post9   s   e	]<Dhh~..G,//J--IHHW%%Exx
++H HH_55Mxx
++H--I88N33L((=11KXXh''F88F##Dhhy))Ghhy))Ghhy))GHHW%%E@E i+C DFLghhhh h+B C6Kfgggg d+> ?vGbcccc g+A B&Jeffff& IeE** `? ;6C^____l))5)99??AAG rF+L MU[Umnnnn,22ePX2YY&.557Zajqv  FS  el  w@  JR  `l  yD  LR  X\  el  u|  EL5  M  M"*11:b=;R  TG  <G  PT  g~1      gLLg #  """WZ]] h'-	'0XMektju  |C  D  D  D51112:AA;AWW]]__.  $xx>> &/#6#>#E#E{#E#[#[#a#a#c#cL' /%;%C%J%JT[%J%\%\%b%b%d%d
% /)1)<)<)>)>J'1I24F4F4F'FH/7>>)4%//908*. ?    <@K8',,... $:#A#H#HR]#H#^#^#d#d#f#fL' /%6%>%E%E8%E%T%T%Z%Z%\%\
% /)1)<)<)>)>J'1I24F4F4F'FH6>EE)4%/*. F    <@K8',,... , 5g > >.6=={]a=bbkklqrrxxzzh !&.GG G!,!6 + 4)8'-%/%0%>"-.'2'C&-
 
  #=11!-"<==$   9G D DEEE 	] 	] 	]Ys1vv.f6[\\\\\\\\\	]sD   E7Y :Y Y 8Y 1Y 	AY O:Y 
Z)ZZZN__name__
__module____qualname__r        r   r*   r*   8   s-        f] f] f] f] f]r   r*   c                       e Zd Zd ZdS )AgencyemailVerifyOtpc                 :   	 |j         }|                    d          }|                    d          }t          j                            |                                          }t          j                            |                                          }|st          ddit          j	                  S |j
        |k    rt          ddit          j	                  S d	|_        |                                 t          j        |          }t          j                            |d	
                              d                                          }|r|j        }	nd}	|j        |j        |j        |j        |j        |j
        |j        |j        |j        |j        |j        |	d}
t7          |          t7          |j                  |
d}t          d|d          S # t:          $ r4}t          dt7          |          it          j                  cY d }~S d }~ww xY w)Nr/   rf   r/   rA   r<   zotp is requiredr   zInvalid OtpTrc   rd   rH   )r-   r.   re   profile_imager/   rf   rg   isProfileCompletedphoneVerifiedrh   ri   rj   rk   zOTP Verifiedro   )rp   rq   r{   rv   rw   rx   ru   r   r   rr   rf   r   r   r   r   r   r   r   rE   rF   rG   profileImager/   r   r   r   ri   r   r   r   r   )r   r   rp   r/   rf   r   r   r   r   r   r   r   r   s                r   r   zAgencyemailVerifyOtp.post   s!   )	]DHHW%%E((5//C (//e/<<BBDDKl))5)99??AAG b+< =VE`aaaa#%%= 9A\]]]](,K%(1'::M*299;Y]9^^gghmnnttvvH "*!,!6 + 4)8$/$<'-%/%0%>)4)G$/$="-.'2'C&- H"  #=11!-"<==$ G
 ~WEEFFF 	] 	] 	]Ys1vv.f6[\\\\\\\\\	]s+   B3G 6'G C=G 
H&)HHHNr   r   r   r   r   r      s(        *] *] *] *] *]r   r   c                       e Zd Zd ZdS )AgencyregisterResendOtpc                    	 |j         }|                    d          }t          j                            |                                          }t                      }||_        |                                 d|z   }i }|}d}	t          |	t          j        |g|          }|                    d           t          d|d	          S # t          $ r4}
t          d
t          |
          it           j                  cY d }
~
S d }
~
ww xY w)Nr/   r   rN   rO   rP   FrU   zThank you for registering with us! To complete your sign-up process and verify your account, please use the One-Time Password (OTP) below:

Your OTP is:)r<   rf   r<   r   )rp   rq   r{   rv   rw   rx   r   rf   r   r   r   r   r   r   r   r   r   r   )r   r   rp   r/   r   r   r<   r   r   rQ   r   s              r   r   zAgencyregisterResendOtp.post  s4   	]DHHW%%E (//e/<<BBDDKCKOSVYYGGI#G,WIagpfqw~GLLuL---  (D  KN  O  O  P  P  P 	] 	] 	]Ys1vv.f6[\\\\\\\\\	]s   CC
 

D)D=DDNr   r   r   r   r   r     (        ] ] ] ] ]r   r   c                       e Zd Zd ZdS )Agencyloginc                 *   	 |j         }|                    d          }|                    d          }|st          ddit          j                  S |st          ddit          j                  S t          ||          }|st          ddit          j                  S t          j                            |d	
          	                                }|st          ddit          j                  S |j
        dk    rmt                      }||_        |                                 d|z   }i }	|j        }
d}t          |t           j        |
g|          }|                    d           t'          j        |          }t*          j                            |d                              d          	                                }|r|j        }nd}|j        |j        |j        |j        |j        |j        |j        |j
        |j        |j        ||j         |j         d}tC          |          tC          |j"                  |d}t          d|d          S # tF          $ r4}t          dtC          |          it          j$                  cY d }~S d }~ww xY w)Nr/   r0   r<   r?   r   r@   rC   zemail or password is incorrectagencyrD   r1   zInvalid Credentialsr   rN   rO   rP   FrU   Trc   rd   rH   )r-   r.   re   r/   r   r   r   rg   rh   ri   rj   r1   rolerk   zLogin Successfullyro   )%rp   rq   r   r   rr   r   r{   rv   rw   rx   r   r   rf   r   r/   r   r   r   r   r   r   r   r   r   rE   rF   rG   r   r   r   r   ri   r1   r   r   r   r   )r   r   rp   r/   r0   r   r   r   r<   r   r   rQ   r   r   r   r   r   r   s                     r   r   zAgencylogin.post#  s   7	]<DHHW%%Exx
++H d+> ?vGbcccc g+A B&Jeffff"eIIIG q+K LTZTopppp"*11wX1VV\\^^Kth	:O/PX^Xs&t&t&tt(A--LL #  """WZ]]'-	'0XMektju  |C  D  D  D5111(1'::M*299;Y]9^^gghmnnttvvH "* "-!6 + 4)8'-$/$<)4)G$/$=%0%>"-.'2'C&-$/$=&4 H   #=11!-"<==$ G ';7KKLLL 	] 	] 	]Ys1vv.f6[\\\\\\\\\	]s8   AI I 1/I !AI 3E I 
J)JJJNr   r   r   r   r   r   "  s(        8] 8] 8] 8] 8]r   r   c                       e Zd Zd Zd ZdS )AgencycompleteProfilec                    	 	 t          |          }nA# t          $ r4}t          dt          |          it          j                  cY d }~S d }~ww xY wi }t          j                            |          	                                }t          j                            |d                              d          	                                }|r|j        }nd}|r|                    i d|j        d	|j        d
|j        d|j        d|j        d|j        d|j        d|j        d|j        d|j        d|j        d|d|j        d|j        d|j        d|j        d|j                   t          d|d          S # t          $ r4}t          dt          |          it          j                  cY d }~S d }~ww xY w)Nr<   r   rD   Trc   rd   rH   r-   r.   rG   r/   r`   r   r   r   r   rh   ri   rj   phone_number	your_selfr:   r2   r3   rn   ro   )r   r   r   r   r   HTTP_401_UNAUTHORIZEDr{   rv   rw   rx   r   r   r   updaterE   rF   rG   r/   r`   r   r1   r   r   r   ri   phoneNumberbior:   r2   r3   r   )r   r   uidr   r   r   r   r   s           r   rq   zAgencycompleteProfile.get_  sn   &	_Z#G,, Z Z ZCFF 3F<XYYYYYYYYYZ G"*11s1;;AACCK*299;Z^9__hhinoouuwwH "*    +"7 !5  %k&@  [.	 
  !6  $[%=  K5  )+*H  $[%>  ";>  '(D  &w  #K$;     k1   {3! "   5#    * 	7CCDDD 	_ 	_ 	_YA/8]^^^^^^^^^	_sD    F 
A)AAF AD4F 
G)F?9G?Gc                 @   	 	 t          |          }nA# t          $ r4}t          dt          |          it          j                  cY d }~S d }~ww xY w|j        }t          j        	                    |          
                                }|                    d          }|                    d          }|                    d          }|                    d          }	|                    d          }
|                    d	          }|                    d
          }|                    d          }|                    d          }|                    d          }|
st          ddit          j                  S |st          ddit          j                  S |st          ddit          j                  S |st          ddit          j                  S |	st          ddit          j                  S |st          ddit          j                  S |st          ddit          j                  S ||_        ||_        ||_        |	|_        |
|_        ||_        ||_        ||_        ||_        d|_        ||_        |                                 t2          j                            |j        dz   |j        z   dz   dd           t          ddi          S # t          $ r4}t          dt          |          it          j                  cY d }~S d }~ww xY w)Nr<   r   r   r:   r2   r3   r   r-   r.   r/   re   r   r   r=   r>   r?   zaddress is requiredzyour_self is requiredcompany is requiredphone_number is requiredTrH   z# agnecy has completed their profilecomplete_profilerJ   rn   )r   r   r   r   r   r   rp   r{   rv   rw   rx   rq   rr   r:   r2   r3   r   rE   rF   r/   r   rG   r   r   r   r}   r|   r   )r   r   r   r   rp   r   r:   r2   r3   r   r-   r.   r/   re   r   r   s                   r   r   zAgencycompleteProfile.post  sR   (	]X#G,, X X X3q66 2&:VWWWWWWWWWX<D (//S/99??AAKhhy))Gxx
++H--I--I,//J--IHHW%%Ehhy))G HH_55M88N33LvXy9Q.RZ`Zu%v%v%vvtHi8O-PX^Xs$t$t$ttl)4G)HPVPk l l llp(I6K+LTZTo"p"p"pptHi8O-PX^Xs$t$t$ttp(I6K+LTZTo"p"p"ppzx;U0V^d^y'z'z'z z")K#+K $-K!'KO$.K!$-K  %K'4K$)0K&-1K*&2K#&--{7LR7OP[Pd7d  fK  8K  TX  k}-  ~  ~  ~Yy1222 	] 	] 	]Ys1vv.f6[\\\\\\\\\	]so    K 
A)AAK AD,K >K K <K K :K K 8B&K 
L))LLLNr   r   r   rq   r   r   r   r   r   r   ^  s;        '_ '_ '_V)] )] )] )] )]r   r   c                       e Zd Zd ZdS )AgencyPropertyRequestc           
         	 	 t          |          }nA# t          $ r4}t          dt          |          it          j                  cY d }~S d }~ww xY wt          j                            |d          	                                }t          j                            |j                  }g }|D ]w}t          j                            |j        |j                  }|rd}	nd}	|j        |j        |j        |j        |j        |j        |	|j        d	}
|                    |
           xt          t          j        d
||j        d          S # t          $ r4}t          dt          |          it          j                  cY d }~S d }~ww xY w)Nr<   r   r   r   )location_agency)r   property_requestTF)r   mobile_numberrb   r/   property_typer   is_requestedr   rn   )status_codestatus_messagerp   ri   )r   r   r   r   r   r   r{   rv   rw   rx   AgencyPropertyRequestsr   AgencyApprovedPropertyr   rb   r/   r   property_statusr   appendHTTP_200_OKri   r   )r   r   r   r   r   propertyObjpropertyDatapropertyapproved_requestedr   rp   s              r   rq   zAgencyPropertyRequest.get  s   	]X#G,, X X X3q66 2&:VWWWWWWWWWX (//Sx/PPVVXXK19@@S^Sa@bbKL' * *%;%C%J%JT_Tbv~  wB%J  &C  &C"% )#'LL#(L "$,$:#=$N$,$:%5#/#.	 	 ##D))))6+=y`l  AL  A]  ^  ^  _  _  _ 	] 	] 	]Ys1vv.f6[\\\\\\\\\	]sD    E 
A)AAE AC9E 
F	)F>F	F	Nr   r   r   rq   r   r   r   r   r     s(        ] ] ] ] ]r   r   c                       e Zd Zd ZdS )ApprovePropertyRequestc                    	 	 t          |          }nA# t          $ r4}t          dt          |          it          j                  cY d }~S d }~ww xY wt          j                            |d          	                                }|j
                            d          }|st          ddit          j                  S t          j                            |          	                                }|st          ddit          j                  S t          j                            |j        j                  	                                }t           j                            |j        ||	           t          t          j        d
d          S # t          $ r4}t          dt          |          it          j                  cY d }~S d }~ww xY w)Nr<   r   r   r   property_idproperty_id is requiredr   zProperty request not found)	agency_idrW   r   rn   r   r   )r   r   r   r   r   r   r{   rv   rw   rx   rp   rq   rr   r   rW   r   r   r|   r   r   )r   r   r   r   r   r   property_objrequest_customers           r   r   zApprovePropertyRequest.post  s   	]X#G,, X X X3q66 2&:VWWWWWWWWWX (//Sx/PPVVXXK!,**=99K j+D EVMhiiii19@@[@QQWWYYL m+G HPVPkllll'/66,:O:R6SSYY[["*11knXh  }I1  J  J  J6+=yYYZZZ 	] 	] 	]Ys1vv.f6[\\\\\\\\\	]sR    F 
A)AAF AA.F  AF A>F 
G)G	G	GNr   r   r   r   r   r     s(        ] ] ] ] ]r   r   c                       e Zd Zd ZdS )AgencyNotificationc                    	 	 t          |          }nA# t          $ r4}t          dt          |          it          j                  cY d }~S d }~ww xY wt          j                            |d          	                                }t          j                            |d                              d          }g }|D ]8}|j        |j        |j        |j        |j        d}|                    |           9t          d	|d
          S # t          $ rC}t%          |           t          dt          |          it          j                  cY d }~S d }~ww xY w)Nr<   r   r   r   T)r   end_date__isnullrd   )r   r<   rL   rK   r   successro   )r   r   r   r   r   r   r{   rv   rw   rx   AgencyNotificationsr   r   r<   rL   rK   r   r   r~   r   )	r   r   r   r   r   notificationObjr   notifyalldatas	            r   rq   zAgencyNotification.get  s   	]X#G,, X X X3q66 2&:VWWWWWWWWWX (//Sx/PPVVXXK2:AAKkoAppyyz   A   AOG) ( ($n(.(@$n!,  w''''y@@AAA 	] 	] 	]!HHHYs1vv.f6[\\\\\\\\\	]sD    D
 
A)AAD
 AB8D
 

E8EEENr   r   r   r   r   r     (        ] ] ] ] ]r   r   c                       e Zd Zd ZdS )AgencyDeleteNotificationsc                    	 	 t          |          }nA# t          $ r4}t          dt          |          it          j                  cY d }~S d }~ww xY wt          j                            |d          	                                }|j
        }|                    d          }|st          ddit          j                  S |D ]R}t          j                            |                              t          j                                                   St          dd	i          S # t          $ rC}t#          |           t          dt          |          it          j                  cY d }~S d }~ww xY w)
Nr<   r   r   r   r   zid requiredr   )r   r   )r   r   r   r   r   r   r{   rv   rw   rx   rp   rq   rr   r   r   r
   r   r~   r   )r   r   r   r   r   rp   notificaton_idsis           r   r   zAgencyDeleteNotifications.post  s   	]X#G,, X X X3q66 2&:VWWWWWWWWWX (//Sx/PPVVXXK<D"hhtnnO" ^= 9A\]]]]$ d d#+22a288??8K\K`K`KbKb?ccccYy1222 	] 	] 	]!HHHYs1vv.f6[\\\\\\\\\	]sK    D( 
A)AAD( AA0D( A%D( (
E528E0*E50E5Nr   r   r   r   r   r     r   r   r   c                       e Zd Zd ZdS )AgencyReadNotificationsc                     	 	 t          |          }nA# t          $ r4}t          dt          |          it          j                  cY d }~S d }~ww xY wt          j                            |d          	                                }|j
        }|                    d          }|r:|D ]6}t          j                            |                              d           7n@t          j                            d	          }|D ]}	d|	_        |	                                 t          dd
i          S # t          $ rC}t!          |           t          dt          |          it          j                  cY d }~S d }~ww xY w)Nr<   r   r   r   r   r   T)rK   Fr   )r   r   r   r   r   r   r{   rv   rw   rx   rp   rq   r   r   rK   r   r~   r   )
r   r   r   r   r   rp   r   r   not_objr   s
             r   r   zAgencyReadNotifications.post  s   	]X#G,, X X X3q66 2&:VWWWWWWWWWX (//Sx/PPVVXXK<D"hhtnnO "( T TA'/66!6<<CCdCSSSST .5<<u<MM% " "F%)FNKKMMMMYy1222 	] 	] 	]!HHHYs1vv.f6[\\\\\\\\\	]sD    D0 
A)AAD0 ACD0 0
E=:8E82E=8E=Nr   r   r   r   r   r     s(        ] ] ] ] ]r   r   c                       e Zd Zd ZdS )AgencyAcceptedRequestc                 T   	 	 t          |          }nA# t          $ r4}t          dt          |          it          j                  cY d }~S d }~ww xY wt          d|            t          j        	                    |d          
                                }t          d|j                   t          j        	                    |          }t          |j                            dd	                    }t          |j                            d
d                    }|d	z
  |z  }||z   }	|                                }
|||	         }g }|D ]{}t          |j                   |j        |j        |j        |j        |j        |j        j        |j        |j        |j        |j        |j        |j        d}|                    |           |t          t          j        d|
|||d          S # t          $ r4}t          dt          |          it          j                  cY d }~S d }~ww xY w)Nr<   r   Logged in agency id :r   r   customerObj.idr   pager   	page_size
   r   r   rb   r/   r   rh   property_namer   property_imageproperty_videoproperty_docr   rn   r   r   total_recordsr  r  rp   )r   r   r   r   r   r   r~   r{   rv   rw   rx   r   r   intGETrq   countr	  r   rb   r/   r   rW   r  r
  r  r   r   r   r   )r   r   r   r   r   r   r  r  startendtotalpaginated_property_objr   property_datarp   s                  r   rq   zAgencyAcceptedRequest.get5  sk   2	_Z#G,, Z Z ZCFF 3F<XYYYYYYYYYZ /#//000"*11s(1SSYY[[K"KN33308??{?SSK w{vq1122DGKOOK<<==IAX*E)#C%%''E%0s%;"L!7 * *m2333'*%2%@).*0%2%@#0#9#<%2%@%2%@&3&B&3&B$1$>+;  ##D))))%1"+!&&$      	_ 	_ 	_YA/8]^^^^^^^^^	_sD    G) 
A)AAG) AFG) )
H'3)H"H'"H'Nr   r   r   r   r   r   4  s(        3_ 3_ 3_ 3_ 3_r   r   c                       e Zd Zd ZdS )AgencyAcceptedRequestDetailc                    	 	 t          |          }nA# t          $ r4}t          dt          |          it          j                  cY d }~S d }~ww xY wt          d|            t          j        	                    |d          
                                }t          d|j                   |j                            d          }t          j        	                    |          }t          |j                            d	d
                    }t          |j                            dd                    }|d
z
  |z  }	|	|z   }
|                                }||	|
         }g }|D ]{}t          |j                   |j        |j        |j        |j        |j        |j        j        |j        |j        |j        |j        |j        |j        d}|                    |           |t          t          j        d||||d          S # t          $ r4}t          dt          |          it          j                  cY d }~S d }~ww xY w)Nr<   r   r  r   r   r  r   r   r  r   r  r  r  rn   r  )r   r   r   r   r   r   r~   r{   rv   rw   rx   r   r  rq   r   r  r  r	  r   rb   r/   r   rW   r  r
  r  r   r   r   r   )r   r   r   r   r   r   r   r  r  r  r  r  r  r   r  rp   s                   r   rq   zAgencyAcceptedRequestDetail.getk  s~   3	_Z#G,, Z Z ZCFF 3F<XYYYYYYYYYZ /#//000"*11s(1SSYY[[K"KN33366K08??;?OOK w{vq1122DGKOOK<<==IAX*E)#C%%''E%0s%;"L!7 * *m2333'*%2%@).*0%2%@#0#9#<%2%@%2%@&3&B&3&B$1$>+;  ##D))))%1"+!&&$      	_ 	_ 	_YA/8]^^^^^^^^^	_sD    H 
A)AAH AF1H 
I)H<6I<INr   r   r   r   r  r  j  s(        4_ 4_ 4_ 4_ 4_r   r  c                       e Zd Zd ZdS )AgencyAcceptRejectRequestc                 j   	 	 t          |          }nA# t          $ r4}t          dt          |          it          j                  cY d }~S d }~ww xY wt          d|            t          j        	                    |d          
                                }|j                            d          }|j                            d          }|st          ddit          j                  S |st          dd	it          j                  S t          j        	                    |
          
                                }||_        |                                 t          t          j        dd          S # t          $ r4}t          dt          |          it          j                  cY d }~S d }~ww xY w)Nr<   r   r  r   r   
request_idresponse_typezrequest_id is requiredzresponse_type is requiredr   r   r   )r   r   r   r   r   r   r~   r{   rv   rw   rx   rp   rq   rr   r   r   r   r   r   )r   r   r   r   r   r  r  r   s           r   r   zAgencyAcceptRejectRequest.post  s   	]X#G,, X X X3q66 2&:VWWWWWWWWWX/#//000 (//Sx/PPVVXXK|''55J!,**?;;M i+C DFLghhhh  l+F GvOjkkkk19@@j@QQWWYYK(5K'6+=yYYZZZ 	] 	] 	]Ys1vv.f6[\\\\\\\\\	]sQ    E4 
A)AAE4 ABE4 ,E4 A(E4 4
F2>)F-'F2-F2Nr   r   r   r   r  r    s(        ] ] ] ] ]r   r  c                       e Zd Zd ZdS )AgencyLoginAsUserc                 4   	 t          |          }||dk    s|                                dk    rt          j        d          t	          j        |t          j                  }|d         }|j        }|	                    d          }|s(t          t          j        ddt          j                  S t          j                            |	                                          }|st          d
dit          j                  S t#          j        |          }t'          |          t'          |j                  dd}	t          t          j        d|	d          S # t,          $ r4}
t          d
t'          |
          it          j                  cY d }
~
S d }
~
ww xY w)NnullrH   z;Authorization Header or Token is missing on Request Headersuser_idr   zid is requiredr   r   r   r<   no user foundr   )rl   rm   login_byr   r   r   rp   )r   stripr   AuthenticationFailedjwtdecoder   
SECRET_KEYrp   rq   r   r   rr   r{   rv   rw   rx   r   r   r   r   r   r   r   )r   r   tokendecodedr"  rp   rh   customer_objr   r   r   s              r   r   zAgencyLoginAsUser.post  s   	],W55E}5;;==B3F3F 56stttj(;<<Gi(GD((4..K Rv/J\l m mu{  vQ  R  R  R  R#+22k2BBHHJJL `? ;6C^____(1,??M"=11!-"<==' G
 6+=y`ghhiii 	] 	] 	]Ys1vv.f6[\\\\\\\\\	]s,   B/E 2AE AE 
F#)FFFNr   r   r   r   r  r    r   r   r  c                       e Zd Zd ZdS )AgencyChangePasswordc                    	 	 t          |          }nA# t          $ r4}t          dt          |          it          j                  cY d }~S d }~ww xY wt          j                            |d          	                                }|st          ddit          j
                  S |j                            d          }|st          ddit          j
                  S |j                            d          }|st          dd	it          j
                  S |j                            d
          }|st          ddit          j
                  S |j                            |          dk    r(t          t          j
        ddt          j
                  S |j                            |          dk    r(t          t          j
        ddt          j
                  S |j                            |           |j                                         t          t          j        ddd          S # t          $ rN}t%          |           t          t          j        t          |          dt          j                  cY d }~S d }~ww xY w)Nr<   r   r   r   r#  old_passwordzOld password is requiredr0   zPassword is requiredconfirm_passwordzConfirm password is requiredFz$Does not match with the old passwordr   Tz0You cannot set new password same as old passwordzSuccessfully Password ChangedrH   r%  )r   r   r   r   r   r   r{   rv   rw   rx   rr   rp   rq   rD   check_passwordset_passwordr   r   r~   r   )r   r   r   r   r-  r1  r0   r2  s           r   r   zAgencyChangePassword.post  s   	XX#G,, X X X3q66 2&:VWWWWWWWWWX!)00c0QQWWYYL `? ;6C^____"<++N;;L k+E FfNijjjj|''
33H g+A B&Jeffff&|//0BCC# o+I JRXRmnnnn //==FFv/J  ]C  !D  !D  LR  Lg  h  h  h  h //0@AATII#63N  aS  %T  %T  \b  \w  x  x  x  x**+;<<<""$$$6+=Onvxyyzzz 	X 	X 	X!HHH6+Pbefgbhbhiiqw  rW  X  X  X  X  X  X  X  X  X	Xsl    H- 
A)AAH- AAH- &8H- 8H- 8H- AH- AH- AH- -
J7AJ :J JNr   r   r   r   r/  r/    s(        X X X X Xr   r/  c                       e Zd Zd ZdS )AgencyCustomerLeadsc                    	 	 t          |          }nA# t          $ r4}t          dt          |          it          j                  cY d }~S d }~ww xY wt          j                            |d          	                                }|st          ddit          j
                  S t          j                            |j                  	                                }|r|j        j        nd }t          j                            |d                              d	          }g }|
|d |         }|D ]Y}	|                    i d	|	j        d
|	j        j        d|	j        j        d|	j        j        d|	j        j        d|	j        j        d|	j        j        d|	j        j        d|	j        j        d|	j        j        d|	j        j        d|	j        j        d|	j        j        d|	j        j        d|	j        j        d|	j        j        d|	j        j         |	j        j!        |	j        j"        |	j        j#        |	j        j$        |	j        j%        |	j        j&        |	j        j'        |	j(        |	j)        |	j*        |	j+        dd           [t          d|d          S # t          $ r4}t          dt          |          it          j,                  cY d }~S d }~ww xY w)Nr<   r   r   r   zAgency user not found)rh   r   property_project__agency_idr   r   r   r  
image_datavideosproperty_documentr4   postal_codeproperty_dimensionr6   r   rent_to_landlordcashflow_pcmcashflow_pareturn_on_investmentproperty_descriptionPropertyProjectrental_descriptionvision_descriptioncashflow_forecastcosts_to_considerlocationr2   r3   	telephonerb   contract_statuscontract_idtyper   ro   )-r   r   r   r   r   r   r{   rv   rw   rx   HTTP_404_NOT_FOUNDr   r   r]   property_numberinquirePropertyProjectr   r   property_projectr  r:  r;  r<  r4   r=  r>  r6   r   r?  r@  rA  rB  rC  rF  rG  rH  rI  rJ  r2   r3   rK  rb   rL  rM  r   )
r   r   r   r   r   planObjmax_propertiesinquirePropertyProjectObjr   	ppinquires
             r   rq   zAgencyCustomerLeads.get  s}   4	aX#G,, X X X3q66 2&:VWWWWWWWWWX (//Sx/PPVVXXK h,C DVMfgggg)188[^8TTZZ\\G=DNW\99$N(>(F(M(Mju}~(M((  )I  )I  JN  )O  )O%G)*CO^O*T)6    	   !9#=#@  $I$>$L  !!;!F	 
 !!;!F  Y7>  (	(B(T  #9#=#J  ")"<"H  ))C)V  Y7>  #9#=#J  'y'A'R  #9#=#J  ")"<"H   +9+E+Z! " +9+E+Z# $ *3)C)V)2)C)V(1(B(T(1(B(T(9B(9B ) : D ) 3$>&/&?"+"7,;         @ y@@AAA 	a 	a 	a3q66 2&:_`````````	asK    J 
A)AAJ AAJ &G7J 
K()KKKNr   r   r   r   r6  r6    s(        5a 5a 5a 5a 5ar   r6  c                       e Zd Zd ZdS )AgencyDashboardc                    	 t          |          }nA# t          $ r4}t          dt          |          it          j                  cY d }~S d }~ww xY wt          j                            |d          	                                }t          j                                                                        }t          j                            |j        d                                          }t          j                            |d                                          }t          j                                                            d	          d d
         }t          j                            d                                                                          }	t          j                            |d                                          }
g }|D ]>}|j        |j        |j        |j        |j        |j        d}|                    |           ?t          j                            |d                              d	          d d
         }g }|D ]Y}|                    i d|j        d|j        j        d|j        j        d|j        j        d|j        j        d|j        j        d|j        j        d|j        j        d|j        j        d|j        j        d|j        j         d|j        j!        d|j        j"        d|j        j#        d|j        j$        d|j        j%        d|j        j&        |j        j'        |j        j(        |j        j)        |j        j*        |j        j+        |j        j,        |j        j-        |j.        |j        |j/        |j0        dd           [t          j        1                    te          d                                         d!          1                    tg          d          "                              d!          }d# |D             d$ |D             d%}t          d&||||||	|
|d'	          S )(Nr<   r   r   r   Acceptedr   r   r   r8  rd      rW   )r   r   rb   r/   r   r   r   r   r  r:  r;  r<  r4   r=  r>  r6   r   r?  r@  rA  rB  rC  rD  rE  r   )monthr]  request_countc                 D    g | ]}|d                               d          S )r]  z%Y-%m)strftime.0entrys     r   
<listcomp>z'AgencyDashboard.get.<locals>.<listcomp>v  s*    ZZZ5>227;;ZZZr   c                     g | ]
}|d          S r^  r   rb  s     r   re  z'AgencyDashboard.get.<locals>.<listcomp>w  s    NNNE/NNNr   )labelsrp   r   )	r<   total_requestsapproved_requests
total_leadr   allLeadsDataunique_customers_countlead_customer
graph_data)4r   r   r   r   r   r   r{   rv   rw   rx   r   allr  r   rQ  r   valuesdistinctr   rb   r/   r   r   r   rR  r  r:  r;  r<  r4   r=  r>  r6   r   r?  r@  rA  rB  rC  rF  rG  rH  rI  rJ  r2   r3   rK  rL  rM  annotater%   r&   )r   r   r   r   r   rh  ri  rj  latest_requestrl  rm  r   r   rp   latest_leadsrk  rV  monthly_requestsrn  s                      r   rq   zAgencyDashboard.get-  s   X#G,, X X X3q66 2&:VWWWWWWWWWX (//Sx/PPVVXXK3;??AAGGIIN!7!?!F!FS^Sat~!F!!  "F  "F  "H  "H/7>>[fno>ppvvxxJ3;??AAJJ5QQRTSTRTUN%;%C%J%J:%V%V%_%_%a%a%g%g%i%i"2:AA^iqrAssyy{{M L* 	* 	*!$,$:#=$N$,$:%5  ##D))))19@@]hpq@rr{{  }B  C  C  DF  EF  DF  GLL)    	## %%!9#=#@% $I$>$L% !!;!F	%
 !!;!F% Y7>% (	(B(T% #9#=#J% ")"<"H% ))C)V% Y7>% #9#=#J% 'y'A'R% #9#=#J% ")"<"H%  +9+E+Z!%" +9+E+Z#%$ *3)C)V)2)C)V(1(B(T(1(B(T(9B(9B ) : D ) 3$>&/&?"+"7,;% % %    F '.77j>V>V7WWd44'""	  [ZIYZZZNN=MNNN J y.ev  EO  co  K  e{  LY  gq  r  r  s  s  ss    
A)AAANr   r   r   r   rX  rX  ,  s-        Ls Ls Ls Ls Lsr   rX  c                       e Zd Zd ZdS )AgencyCheckSubscriptionExiprec                    	 	 t          |          }nA# t          $ r4}t          dt          |          it          j                  cY d }~S d }~ww xY wt          j                            d          	                                }|D ]}t          j                            |j        d                              d          	                                }t          j                    }|j        |k    r6d|_        |                                 d|_        |                                 t          dd	i          S # t          $ r4}t          dt          |          it          j                  cY d }~S d }~ww xY w)
Nr<   r   r   )r1   Trc   rd   Fr   )r   r   r   r   r   r   r{   rv   rw   rx   r   r   r   r   todayr_   ri   r   r`   r   )r   r   r   r   r   rW   
agency_objry  s           r   rq   z!AgencyCheckSubscriptionExipre.get}  s   	aX#G,, X X X3q66 2&:VWWWWWWWWWX (//h/GGMMOOK' & &08??ae?ffoopuvv||~~

-6605H-MMOOO+0J(OO%%%Yy1222 	a 	a 	a3q66 2&:_`````````	asD    D; 
A)AAD; AC)D; ;
E9)E4.E94E9Nr   r   r   r   rw  rw  |  s(        a a a a ar   rw  c                       e Zd Zd ZdS )AgencyAddRatingReviewc                    	 	 t          |          }nA# t          $ r4}t          dt          |          it          j                  cY d }~S d }~ww xY wt          j                            |          	                                }|j
                            d          }|st          ddit          j                  S |j
                            d          }|st          ddit          j                  S |j
                            d          }|st          dd	it          j                  S t          j                            |
          	                                }t          j                            ||||           t          ddi          S # t          $ r4}t          dt          |          it          j                  cY d }~S d }~ww xY w)Nr<   r   r   rating_datarating_data is requiredreview_datareview_data is requiredreceive_customer_idzreceive_customer_id is requiredr   )user_send_customeragency_receive_customerratingreviewrn   )r   r   r   r   r   r   r{   rv   rw   rx   rp   rq   rr   AgencyRatingAndReviewr|   r   )	r   r   r   r   r   r~  r  r  receieve_customer_objs	            r   r   zAgencyAddRatingReview.post  s   	_Z#G,, Z Z ZCFF 3F<XYYYYYYYYYZ"*11s1;;AACCK!,**=99K j+D EVMhiiii!,**=99K j+D EVMhiiii"),"2"23H"I"I& r+L MU[Upqqqq$,$4$;$;AT$;$U$U$[$[$]$]!!)00Kh}  FQ  Yd0  e  e  eY	2333 	_ 	_ 	_YA/8]^^^^^^^^^	_sW    F 
A)AAF AA-F ?8F 88F 1A%F 
G!)G
GGNr   r   r   r   r|  r|    (        _ _ _ _ _r   r|  c                       e Zd Zd Zd ZdS )AgencyEditRatingReviewc                    	 	 t          |          }nA# t          $ r4}t          dt          |          it          j                  cY d }~S d }~ww xY wt          j                            |          	                                }|j
                            d          }|st          ddit          j                  S t          j                            |          	                                }|st          ddit          j                  S |j        |j        d}t          d	|d
          S # t          $ r4}t          dt          |          it          j                  cY d }~S d }~ww xY w)Nr<   r   r   	rating_idrating_id is requiredr   z No rating data found is requiredr  r  rn   ro   )r   r   r   r   r   r   r{   rv   rw   rx   query_paramsrq   rr   r  r  r  r   )r   r   r   r   r   r  
rating_objall_datas           r   rq   zAgencyEditRatingReview.get  s   	_Z#G,, Z Z ZCFF 3F<XYYYYYYYYYZ"*11s1;;AACCK -11+>>I h+B C6Kfgggg.6===KKQQSSJ s+M NV\Vqrrrr$+$+ H
 	BBCCC 	_ 	_ 	_YA/8]^^^^^^^^^	_sQ    D1 
A)AAD1 AA-D1 ?AD1  D1 1
E/;)E*$E/*E/c                 p   	 	 t          |          }nA# t          $ r4}t          dt          |          it          j                  cY d }~S d }~ww xY wt          j                            |          	                                }|j
                            d          }|st          ddit          j                  S |j
                            d          }|st          ddit          j                  S |j
                            d          }|st          dd	it          j                  S t          j                            |
                              ||           t          ddi          S # t          $ r4}t          dt          |          it          j                  cY d }~S d }~ww xY w)Nr<   r   r   r  r  r~  r  r  r  r   r  rn   )r   r   r   r   r   r   r{   rv   rw   rx   rp   rq   rr   r  r   r   )r   r   r   r   r   r  r~  r  s           r   r   zAgencyEditRatingReview.post  s   	_Z#G,, Z Z ZCFF 3F<XYYYYYYYYYZ"*11s1;;AACCK((55I h+B C6Kfgggg!,**=99K j+D EVMhiiii!,**=99K j+D EVMhiiii!)00I0>>EE[`kElllY	2333 	_ 	_ 	_YA/8]^^^^^^^^^	_sW    E7 
A)AAE7 AA-E7 ?8E7 88E7 1AE7 7
F5)F0*F50F5Nr   r   r   r   r  r    s:        _ _ _._ _ _ _ _r   r  c                       e Zd Zd ZdS )AgencyDeleteRatingReviewc                    	 	 t          |          }nA# t          $ r4}t          dt          |          it          j                  cY d }~S d }~ww xY wt          j                            |          	                                }|j
                            d          }|st          ddit          j                  S t          j                            |          	                                }|                                 t          ddi          S # t          $ r4}t          dt          |          it          j                  cY d }~S d }~ww xY w)Nr<   r   r   r  r  r   rn   )r   r   r   r   r   r   r{   rv   rw   rx   rp   rq   rr   r  deleter   )r   r   r   r   r   r  r  s          r   r   zAgencyDeleteRatingReview.post  sl   	_Z#G,, Z Z ZCFF 3F<XYYYYYYYYYZ"*11s1;;AACCK((55I h+B C6Kfgggg.6==9=MMSSUUJY	2333 	_ 	_ 	_YA/8]^^^^^^^^^	_sK    D 
A)AAD AA-D ?AD 
E )E	EENr   r   r   r   r  r    s(        _ _ _ _ _r   r  c                       e Zd Zd ZdS )AgencyGetMyRatingsc                    	 	 t          |          }nA# t          $ r4}t          dt          |          it          j                  cY d }~S d }~ww xY wt          j                            |          	                                }t          j                            |          }g }|D ]R}|j        j        dz   |j        j        z   |j        j        |j        |j        |j        d}|                    |           St          d|d          S # t          $ r4}t          dt          |          it          j                  cY d }~S d }~ww xY w)	Nr<   r   r   r   )customer_namecustomer_imager  reviewsrating_datern   ro   )r   r   r   r   r   r   r{   rv   rw   rx   r  r  rE   rF   r   r  r  r   r   r   )	r   r   r   r   r   r  all_Datar  r  s	            r   rq   zAgencyGetMyRatings.get  s   	_Z#G,, Z Z ZCFF 3F<XYYYYYYYYYZ"*11s1;;AACCK.6==Va=ccJH$ * *%+%>%H#%MvOhOq%q&,&?&L$m$m#)#4  ))))	BBCCC 	_ 	_ 	_YA/8]^^^^^^^^^	_sD    D 
A)AAD AB=D 
E)EEENr   r   r   r   r  r    r  r   r  c                       e Zd Zd ZdS )AgencyGetMyReviewsc                    	 	 t          |          }nA# t          $ r4}t          dt          |          it          j                  cY d }~S d }~ww xY wt          j                            |          	                                }t          j                            |          }g }|D ]L}|j        j        dz   |j        j        z   |j        j        |j        |j        d}|                    |           Mt          d|d          S # t          $ r4}t          dt          |          it          j                  cY d }~S d }~ww xY w)	Nr<   r   r   r  r  )r  r  r  review_datern   ro   )r   r   r   r   r   r   r{   rv   rw   rx   r  r  rE   rF   r   r  r   r   r   )	r   r   r   r   r   
review_objr  r  r  s	            r   rq   zAgencyGetMyReviews.get  s|   	_Z#G,, Z Z ZCFF 3F<XYYYYYYYYYZ"*11s1;;AACCK.6==Va=ccJH$ * *$*$=$G$KFLeLn$n%+%>%K$m"("3	  ))))	BBCCC 	_ 	_ 	_YA/8]^^^^^^^^^	_sD    D	 
A)AAD	 AB7D	 	
E)E<EENr   r   r   r   r  r     (        _ _ _ _ _r   r  c                       e Zd Zd ZdS )AgencyViewRatingReviewsc                 L   	 	 t          |          }nA# t          $ r4}t          dt          |          it          j                  cY d }~S d }~ww xY wt          j                            |          	                                }|j
                            d          }|st          ddit          j                  S t          j                            |          }|rt          j                            |                              t          d                    d         }t          j                            |                                          }g }	|D ]R}
|
j        j        d	z   |
j        j        z   |
j        j        |
j        |
j        |
j        d
}|	                    |           St          d|	t1          |          |d          S t          dd	d	d	d          S # t          $ r4}t          dt          |          it          j                  cY d }~S d }~ww xY w)Nr<   r   r   rh   customer_id is requiredr  r  rating__avgr  )r  r  r  r  rating_review_datern   )r<   rating_review_dataaverage_ratingtotal_reviews)r   r   r   r   r   r   r{   rv   rw   rx   r  rq   rr   r  	aggregater'   r  r  rE   r   r  r  r   r   roundr   )r   r   r   r   r   rh   r  r  r  r  r  r  s               r   rq   zAgencyViewRatingReviews.get  s   	_Z#G,, Z Z ZCFF 3F<XYYYYYYYYYZ"*11s1;;AACCK"/33MBBK j+D EVMhiiii.6==Xc=ddJ z!6!>!E!E^i!E!j!j!t!tux  zB  vC  vC  "D  "D  ER  "S 5 = D D_j D k k q q s s%'"( 	8 	8F(.(A(KC(OPVPiPs(s)/)B)O!'!'-3->   H '--h7777IK]ot  vD  pE  pE  Vc  !d  !d  e  e  eI3`ctw x xyyy 	_ 	_ 	_YA/8]^^^^^^^^^	_sQ    G% 
A)AAG% AA-G% ?DG% G% %
H#/)HH#H#Nr   r   r   r   r  r    s(        _ _ _ _ _r   r  c                       e Zd Zd ZdS )agentCustomerListingc           
      $   	 	 t          |          }nA# t          $ r4}t          dt          |          it          j                  cY d }~S d }~ww xY wt          j                            |          	                                }|j
                            d          }|st          ddit          j                  S t          j                            |j        d          }g }|D ]U}|                    |j        j        |j        j        |j        j        |j        j        |j        j        |j        d           Vt          d	|d
          S # t          $ r4}t          dt          |          it          j                  cY d }~S d }~ww xY w)Nr<   r   r   rh   r  rZ  r[  )rh   customer_firstnamecustomer_lastnamecustomer_emailr  r   rn   ro   )r   r   r   r   r   r   r{   rv   rw   rx   r  rq   rr   r   r   r   rW   rE   rF   r/   r   r   r   )	r   r   r   r   r   rh   requestsrp   request_objs	            r   rq   zagentCustomerListing.get<  s   	_Z#G,, Z Z ZCFF 3F<XYYYYYYYYYZ"*11s1;;AACCK"/33MBBK j+D EVMhiiii-5<<jt<uuHD'  #.#7#:*5*>*H)4)=)F%0%9%?&1&:&G$/$=      	>>??? 	_ 	_ 	_YA/8]^^^^^^^^^	_sK    E 
A)AAE AA-E ?BE 
F)F
F
FNr   r   r   r   r  r  ;  s(        _ _ _ _ _r   r  c                       e Zd Zd ZdS )createChatTokenAgencyc                 *   	 t          |          }|r[t          j        |t          j                  }|d         }t
          j                            |                                          }d S d}|j	        }t          t          t          t          |          }t          r*t          t                    }|                    |           t"          j        j                            t                    j                                                            ddd	          }||                                d
}	t3          t4          j        d|	d          S # t8          $ r4}
t3          dt;          |
          it4          j                  cY d }
~
S d }
~
ww xY w)Nr"  r   r   identityservice_sidTdefault5You have a new message in ${CONVERSATION}: ${MESSAGE}new_message_enablednew_message_soundnew_message_templater  r+  zToken Created Successfullyr%  r<   r   )r   r(  r)  r   r*  r{   rv   rw   rx   r   r#   account_sidapi_sid
api_secretchat_service_sidr    	add_grantclientconversationsv1servicesconfigurationnotificationsr   to_jwtr   r   r   r   r   r   r   r   r+  r,  r"  r   r  
chat_grantnotificationr   r   s              r   rq   zcreateChatTokenAgency.getY  s   !	_,W55E B*UH,?@@!),$,333AAGGII&>#K
HUUU# 0!*7G!H!H!HJOOJ///%3*++(,&/)`     $   0BTpx  "A  "A  B  B  B 	_ 	_ 	_YA/8]^^^^^^^^^	_s%   A*E .C%E 
F)FFFNr   r   r   r   r  r  X  s(        "_ "_ "_ "_ "_r   r  c                       e Zd Zd ZdS )agencyCustomerChatListingc                    	 	 t          |          }nA# t          $ r4}t          dt          |          it          j                  cY d }~S d }~ww xY wt          j                            |          	                                }|j
                            d          }|st          ddit          j                  S t          j                            |j                                      d          }g }|D ]}t           j        j                            |j                  j                            dd	
          }	d}
d}d}|	D ]V}|j        r&|j        }
t/          |j                  dz   }|j        }/|j        r d}
t/          |j                  dz   }|j        }W|j        |j        |j        j        |j        j        |j        j        |j        j        |j        j        |j        j        |
||d}|                    |           t          t          j        d|d          S # t          $ r4}t          dt          |          it          j                   cY d }~S d }~ww xY w)Nr<   r   r   rh   r  r  rd   descr   orderlimitrH    agofile)r   twilio_channel_sidrh   r  r  r   agency_nameagency_imagelast_messagetimemessage_dater   r%  )!r   r   r   r   r   r   r{   rv   rw   rx   r  rq   rr   ConversationAgencyr   r   r  r  r  r  messageslistrT   r$   date_createdmediarW   rb   imager   r   r   r   )r   r   r   r   r   rh   r  conversation_listconversationr  r  r  r  recordconversation_datas                  r   rq   zagencyCustomerChatListing.get  s   1	_Z#G,, Z Z ZCFF 3F<XYYYYYYYYYZ"*11s1;;AACCK"/33MBBK j+D EVMhiiii.6=={~=WW``afggM " - !< !<!/"]<#BCCTaT00	 
  "!& ; ;F{ ;'-{()<==fD'-': ;'-()<==fD'-': '/*6*I#/#8#;%1%:%?&2&;&A , 3 6#/#6#;$0$7$=#/#/% %! "(():;;;;F,>PYarssttt 	_ 	_ 	_YA/8]^^^^^^^^^	_sK    H( 
A)AAH( AA-H( ?E(H( (
I&2)I!I&!I&Nr   r   r   r   r  r    s(        2_ 2_ 2_ 2_ 2_r   r  c                       e Zd Zd ZdS )deleteCustomerAgencyChatc                 4   	 	 t          |          }nA# t          $ r4}t          dt          |          it          j                  cY d }~S d }~ww xY wt          j                            |          	                                }|j
                            d          }|st          ddit          j                  S |j                            d          }|st          t          j        dd          S t          j                            |	          	                                }|                                 t          t          j        d
d          S # t          $ r4}t          dt          |          it          j                  cY d }~S d }~ww xY w)Nr<   r   r   rh   r  converstation_idNo customer foundr   r   r   )r   r   r   r   r   r   r{   rv   rw   rx   r  rq   rr   rp   r  r  r   r   )r   r   r   r   r   rh   r  r  s           r   rq   zdeleteCustomerAgencyChat.get  s   	_Z#G,, Z Z ZCFF 3F<XYYYYYYYYYZ"*11s1;;AACCK"/33MBBK j+D EVMhiiii&|//0BCC# u0K_r s sttt.6==CS=UU[[]]M  """F,>PYZZ[[[ 	_ 	_ 	_YA/8]^^^^^^^^^	_sQ    E 
A)AAE AA-E ?7E 7A!E 
F#)FFFNr   r   r   r   r  r    s(        _ _ _ _ _r   r  c                       e Zd Zd ZdS )getPrivacyPolicyc                    	 	 t          |          }nA# t          $ r4}t          dt          |          it          j                  cY d }~S d }~ww xY wt          j                            |          	                                }|j
                            d          }|st          ddit          j                  S t          j                            d          	                                }|j        |j        |j        |j        |j        d}t          t          j        d	|d
          S # t          $ r4}t          dt          |          it          j                  cY d }~S d }~ww xY w)Nr<   r   r   rh   r  agency_privacypage_type_namer   r  
page_titlepage_contentr   r   r   r   r  )r   r   r   r   r   r   r{   rv   rw   rx   r  rq   rr   ContentPagesAdminobjectr   r  r  r  r   r   )r   r   r   r   r   rh   privacy_objr  s           r   rq   zgetPrivacyPolicy.get  s   	_Z#G,, Z Z ZCFF 3F<XYYYYYYYYYZ"*11s1;;AACCK"/33MBBK j+D EVMhiiii,3::L\:]]cceeK ^!,!;(3*7$+ H F,>PYemnnooo 	_ 	_ 	_YA/8]^^^^^^^^^	_sK    D/ 
A)AAD/ AA-D/ ?A/D/ /
E-9)E("E-(E-Nr   r   r   r   r  r    r  r   r  c                       e Zd Zd ZdS )getTermsConditionc                 n   	 	 t          |          }nA# t          $ r4}t          dt          |          it          j                  cY d }~S d }~ww xY wt          j                            |          	                                }t          j                            d          	                                }|j        |j        |j        |j        |j        d}t          t          j        d|d          S # t          $ r4}t          dt          |          it          j                  cY d }~S d }~ww xY w)	Nr<   r   r   agency_termsr  r  r   r  )r   r   r   r   r   r   r{   rv   rw   rx   r   r  r   r  r  r  r   r   )r   r   r   r   r   	terms_objr  s          r   rq   zgetTermsCondition.get  sU   	_Z#G,, Z Z ZCFF 3F<XYYYYYYYYYZ"*11s1;;AACCK*188.8YY__aaI\!*!9&1(5") H F,>PYemnnooo 	_ 	_ 	_YA/8]^^^^^^^^^	_sD    C6 
A)AAC6 AB$C6 6
D4 )D/)D4/D4Nr   r   r   r   r  r    s(        _ _ _ _ _r   r  c                       e Zd Zd ZdS )getFAQagencyc                    	 	 t          |          }nA# t          $ r4}t          dt          |          it          j                  cY d }~S d }~ww xY wt          j                            |          	                                }|j
                            d          }t          j                            d          }g }|D ]*}|                    |j        |j        |j        d           +t          t          j        d|d	          S # t          $ r4}t          dt          |          it          j                  cY d }~S d }~ww xY w)
Nr<   r   r   rh   T)r   )r   titlecontentr   )r   r   r  )r   r   r   r   r   r   r{   rv   rw   rx   r  rq   	AgencyFaqr   r   r  r  r   r   )	r   r   r   r   r   rh   faq_objr  faqs	            r   rq   zgetFAQagency.get  s~   	_Z#G,, Z Z ZCFF 3F<XYYYYYYYYYZ"*11s1;;AACCK"/33MBBK!)00D0IIGH  I!k! !     F,>PYemnnooo 	_ 	_ 	_YA/8]^^^^^^^^^	_sD    D 
A)AAD AB:D 
E
)E?E
E
Nr   r   r   r   r	  r	    r  r   r	  c                       e Zd Zd ZdS )addAgencyPropertyc                 ,   	 	 t          |          }d S # t          $ r4}t          dt          |          it          j                  cY d }~S d }~ww xY w# t          $ r4}t          dt          |          it          j                  cY d }~S d }~ww xY w)Nr<   r   )r   r   r   r   r   r   r   )r   r   r   r   s       r   rq   zaddAgencyProperty.get  s    	_Z#G,, Z Z ZCFF 3F<XYYYYYYYYYZ  	_ 	_ 	_YA/8]^^^^^^^^^	_s>    
A)AAA AA 
B)BBBNr   r   r   r   r  r    s(        _ _ _ _ _r   r  c                       e Zd Zd ZdS )DoItByAgencyTeamRequestListc           
         	 	 t          |          }nA# t          $ r4}t          dt          |          it          j                  cY d }~S d }~ww xY wt          j                            |          	                                }g }t          j                            dd                              d          }| j        j                            d          }|s(t          t          j        dd	t          j                  S | j        j                            d
          }|s(t          t          j        dd	t          j                  S t          j                            dd                                          }	t#          ||          }
	 |
                    |          }nJ# t&          $ r |
                    d          }Y n)t(          $ r |
                    |
j                  }Y nw xY wt          j                            d                              d          }t,          j                                        }|r|j        }nd}|D ]}i d|j        d|j        d|j        d|j        d|j        j        d|j        d|d|j        d|j        d|j         d|j!        d|j"        d|j#        d|j$        d |j%        rtM          j'        |j%                  nd d!|j(        rt          |j(                  nd d"|j)        rt          |j)                  nd |j*        |j#        d#}|+                    |           t          t          j,        d$||r|nd|
j        t[          |          |	d%          S # t          $ rN}t]          |           t          t          j/        t          |          d	t          j/                  cY d }~S d }~ww xY w)&Nr<   r   r   T)r   payment_statusrd   r  zPage Number id is requiredr   page_per_datazPage per data id is requiredr   )r   do_it_by_typer   )r  r   N/Ar   rb   r   r/   rh   r   pricesubmitted_dater   	is_viewedis_publishedis_contactedr   	signaturer	  r
  r  )r  r   r   )r   r   rp   r  
page_countper_pager  )0r   r   r   r   r   r   r{   rv   rw   rx   DoItByReeipoRequestsr   r   r  rq   rr   r  r   r  r   r   	num_pagesSetdoitbyReeipoPricelastr  r   rb   r   r/   rW   r   r   r  r  r  r   buyer_signaturer	  astliteral_evalr
  r  r  r   r   lenr~   r   )r   r   r   r   r   r   allrequests_objr  r  total_count	paginatorget_datar  all_requestr  s                  r   rq   zDoItByAgencyTeamRequestList.get"  s   9	XZ#G,, Z Z ZCFF 3F<XYYYYYYYYYZ"*11s1;;AACCKG2:AASWgkAlluuv{||O<,0088D ^v/J\x y y  BH  B]  ^  ^  ^  ^ L599/JJM  `v/J\z { {  DJ  D_  `  `  `  `/7>>RVem>nnttvvK!/=AAIF"+.."6"6# 4 4 4"+.."3"3 F F F"+..1D"E"EF ,3::$:OOXXYeffH'/4466E k. ) );+ $K$= K-	
 "+"6"9 $K$= E %[%; [/   5 #;#; #;#; "+"9   ; %U`Uo%yS%5k6P%Q%Q%Quy  %Ic&mc+*D&E&E&Eim!" #[E]$gC(@$A$A$Acg#$ %0$="-"9'  . x((((6+=y`gw{  pCosos  BC  R[  Re  ru  vE  rF  rF  OZ  [  [  \  \  \ 	X 	X 	X!HHH6+Pbefgbhbhiiqw  rW  X  X  X  X  X  X  X  X  X	Xs    N  
A)AAN  AB3N  AN  AN  F( 'N  (G/N  	#G/,N  .G//FN   
O
AOOONr   r   r   r   r  r  !  s(        :X :X :X :X :Xr   r  c                       e Zd Zd ZdS )DoItByAgencyTeamDetailc                    	 	 t          |          }nA# t          $ r4}t          dt          |          it          j                  cY d }~S d }~ww xY wt          j                            |          	                                }g }|j
                            d          }t          j                            |dd          }t          j                                        }|r|j        }nd}|D ]}	i d	|	j        d
|	j        d|	j        d|	j        d|	j        j        d|	j        d|d|	j        d|	j        d|	j        d|	j        d|	j        d|	j        d|	j        rt9          j        |	j                  nd d|	j        rt          |	j                  nd d|	j        rt          |	j                  nd d|	j         |	j        |	j!        d}
|"                    |
           t          t          j#        d|d         d          S # t          $ rN}tI          |           t          t          j%        t          |          dt          j%                  cY d }~S d }~ww xY w)Nr<   r   r   reeipo_form_idTr   )r   r   r  r  r   rb   r   r/   rh   r   r  r  r   r  r  r  r   r	  r
  r  r  )r   r  zFetched Successfullyr   r  r   )&r   r   r   r   r   r   r{   rv   rw   rx   r  rq   r"  r$  r%  r  r   rb   r   r/   rW   r   r   r  r  r  r   r	  r'  r(  r
  r  r  r&  r   r   r~   r   )r   r   r   r   r   r   r2  r*  r  r.  r  s              r   rq   zDoItByAgencyTeamDetail.get_  s6   )	XZ#G,, Z Z ZCFF 3F<XYYYYYYYYYZ"*11s1;;AACCKG";??+;<<N2:AA^ei  yAA  B  BO'/4466E k. ) );+ $K$= K-	
 "+"6"9 $K$= E %[%; [/   5 #;#; #;#; "+"9 %U`Uo%yS%5k6P%Q%Q%Quy %Ic&mc+*D&E&E&Eim  #[E]$gC(@$A$A$Acg!" $K$=#$ #."9 + ;'  , x((((6+=Oeqxyzq{||}}} 	X 	X 	X!HHH6+Pbefgbhbhiiqw  rW  X  X  X  X  X  X  X  X  X	XsE    H 
A)AAH AF9H 
I#AII#I#Nr   r   r   r   r0  r0  ^  s(        *X *X *X *X *Xr   r0  c                       e Zd Zd ZdS )ListingFinalizeAgencyc           
         	 t          |          }|rlt          j        |t          j        dg          }|d         }t
          j                            |                                          }t          |           nd}t          |           t          j                            |          }t          |j                            dd                    }t          |j                            d	d
                    }|dz
  |z  }	|	|z   }
g }d |D             }||	|
         D ]'}|                    i d|j        d|j        r|j        j        nd d|j        r|j        j        ndd|j        r|j        j        ndd|j        r|j        j        ndd|j        r|j        j        ndd|j        r|j        j        nd d|j        r|j        j        ndd|j        r|j        j        ndd|j        r|j        j        ndd|j        d|j        d|j        d|j        d|j        d|j        d|j        d|j        i           )t?          t@          j!        d|||tE          |          d t@          j!        !          S # tF          $ rN}t          |           t?          t@          j$        tK          |          d"t@          j$        !          cY d }~S d }~ww xY w)#NHS256
algorithmsr"  r   r   r  r  r   r  r  c                 (    g | ]}|j         d k    |S ) finalized by customer and agency)finalized_status)rc  fs     r   re  z-ListingFinalizeAgency.get.<locals>.<listcomp>  s&    qqq18JNp8p8pQ8p8p8pr   r   rh   customer_firstNamerH   customer_lastNamer  customer_phoneNumberr   rG   agency_emailagency_phoneNumberr   final_amountcustomer_signatureagency_signaturer;  
created_at
updated_atr   Listed Successfully)r   r<   r  r  r  r  r   r   )&r   r(  r)  r   r*  r{   rv   rw   rx   r~   r(   r  r  rq   r   r   rW   rE   rF   r/   r   r   rG   r   rB  rC  rD  r;  rE  rF  r   r   r   r   r)  r   r   r   )r   r   r+  r,  r"  r   get_finaliser  r  r  r  r  filtered_datafinaliser   s                  r   rq   zListingFinalizeAgency.get  s   B	=,W55E #*UH,?WIVVV!),&.5575CCIIKKk""""k""" /6==[=QQL w{vq1122DGKOOK<<==IAX*E)#CHqqqqqM(s3   !(+!!8;L#V8#4#7#7RV! )IZ*b(*;*E*E`b! (xGX)`):)C)C^`	!
 %AR&Zh&7&=&=XZ! +XM^,fH,=,I,Idf!  x!P!3!3D! %&_ho&D&D]_! #X_$THO$9$9RT! )*`(/*E*E^`! $X%;! #H$9! )(*E!  '(A!!" '(A#!$ !("5%!& !("5'!(  1)! !    . %10$&!$\!2!2  (* * * *  	= 	= 	=!HHH%D"%a&&  ;= = = = = = = = =	=s   JJ 
KAKKKNr   r   r   r   r4  r4    s(        C= C= C= C= C=r   r4  c                       e Zd Zd Zd ZdS )CompleteFinalizeAgencyc                    	 t          |          }|r]t          j        |t          j        dg          }|d         }t
          j                            |                                          }nd}g }|j	        
                    d          }|s(t          t          j        ddt          j        	          S t          j                            |
                                          }|s(t          t          j        ddt          j        	          S |                    i d|j        d|j        r|j        j        nd d|j        r|j        j        ndd|j        r|j        j        ndd|j        r|j        j        ndd|j        r|j        j        ndd|j        r|j        j        nd d|j        r|j        j        ndd|j        r|j        j        ndd|j        r|j        j        ndd|j        d|j        d|j        d|j        d|j        d|j        d|j        d|j        i           t          t          j         d|d         d t          j         	          S # tB          $ rN}	tE          |	           t          t          j#        tI          |	          dt          j#        	          cY d }	~	S d }	~	ww xY w)!Nr6  r7  r"  r   r   finalize_request_id finalize_request_id  is requiredr   r   r   finalise_table not foundr   rh   r=  rH   r>  r  r?  r   rG   r@  rA  r;  r   rB  rC  rD  rE  rF  r   rG  )r   r<   r  )%r   r(  r)  r   r*  r{   rv   rw   rx   r  rq   r   r   rr   r(   r   r   rW   rE   rF   r/   r   r   rG   r;  r   rB  rC  rD  rE  rF  r   r   r   r~   r   r   )
r   r   r+  r,  r"  r   r  rN  rJ  r   s
             r   rq   zCompleteFinalizeAgency.get  s   ,	X,W55E *UH,?G9UUU!),$,333AAGGIIH")+//2G"H"H& e 0K]  "A  "A  IO  Id  e  e  e  e(077;N7OOUUWWH \v/J\v w w  @F  @[  \  \  \  \OO (+!8;L#V8#4#7#7RV )IZ*b(*;*E*E`b (xGX)`):)C)C^`	
 %AR&Zh&7&=&=XZ +XM^,fH,=,I,Idf  x!P!3!3D %&_ho&D&D]_ #X_$THO$9$9RT )*`(/*E*E^` 'x'@ $X%; #H$9 )(*E  '(A!" !("5#$ !("5%&  1'    0 6+=H]iqrsituu  ~D  ~P  Q  Q  Q  Q 	X 	X 	X!HHH6+Pbefgbhbhiiqw  rW  X  X  X  X  X  X  X  X  X	Xs-   B5I' 8AI' EI' '
J?1AJ:4J?:J?c                 `   	 t          |          }|r]t          j        |t          j        dg          }|d         }t
          j                            |                                          }nd}g }|j	        
                    d          }|j	        
                    d          }|s(t          t          j        dd	t          j        
          S |s(t          t          j        dd	t          j        
          S t          j                            |                                          }	|	s(t          t          j        dd	t          j        
          S |	j        dk    r(t          t          j        dd	t          j        
          S ||	_        d|	_        |	                                 t          t          j        ddt          j        
          S # t&          $ rN}
t)          |
           t          t          j        t-          |
          d	t          j        
          cY d }
~
S d }
~
ww xY w)Nr6  r7  r"  r   r   rN  rD  rO  r   r   zagency_signature  is requiredr   rP  r:  zAlready finalizedzSignature added Successfullyr   r<   )r   r(  r)  r   r*  r{   rv   rw   rx   rp   rq   r   r   rr   r(   r;  rD  r   r   r   r~   r   r   )r   r   r+  r,  r"  r   r  rN  rD  rJ  r   s              r   r   zCompleteFinalizeAgency.post  s   !	X,W55E *UH,?G9UUU!),$,333AAGGIIH"),"2"23H"I"I&|//0BCC& e 0K]  "A  "A  IO  Id  e  e  e  e# b 0K]|!}!}  FL  Fa  b  b  b  b(077;N7OOUUWWH Uv/J\v w w  @F  @[  \  \  \  \*,NNNv/J\o p px~  yT  U  U  U  U&6H%&HH%MMOOO 6+=Hfggou  pB  C  C  C  C 	X 	X 	X!HHH6+Pbefgbhbhiiqw  rW  X  X  X  X  X  X  X  X  X	Xs9   CG )G <AG 2G A	G 
H-AH("H-(H-Nr   r   r   r   rL  rL    s;        -X -X -X\"X "X "X "X "Xr   rL  c                       e Zd Zd ZdS )addPropertyProjectc                 `   	 t          |          }|r]t          j        |t          j        dg          }|d         }t
          j                            |                                          }nd}|j	        }t          j                            |j        d                                          }|r|j        j        }nd}|j        dk    r(t          t           j        dd	t           j        
          S |                    d          }	|                    d          }
|                    d          }|                    d          }|                    d          }|                    d          }|                    d          }|                    d          }|                    d          }|                    d          }|                    d          }|                    d          }|                    d          }|                    d          }|                    d          }|                    d          }|                    d          }|                    d          }|                    d          }|                    d          }|                    d          }|                    d           }|                    d!          }|                    d"          } |                    d#          }!|                    d$          }"|                    d%          }#|                    d&          }$|                    d'          }%|                    d(          }&|                    d)          }'|                    d*          }(|                    d+          })|                    d,          }*|                    d-          }+|                    d.          },|                    d/          }-|                    d0          }.|                    d1          }/|                    d2          }0|                    d3          }1|                    d4          }2|                    d5          }3|                    d6          }4|4r3t
          j                            |47                                          }5nd }5|	s(t          t           j        d8d	t           j        
          S |
s(t          t           j        d9d	t           j        
          S |s(t          t           j        d:d	t           j        
          S |s(t          t           j        d;d	t           j        
          S |s(t          t           j        d<d	t           j        
          S |s(t          t           j        d=d	t           j        
          S |s(t          t           j        d>d	t           j        
          S |s(t          t           j        d?d	t           j        
          S |s(t          t           j        d@d	t           j        
          S |s(t          t           j        dAd	t           j        
          S |s(t          t           j        dBd	t           j        
          S |s(t          t           j        dCd	t           j        
          S |s(t          t           j        dDd	t           j        
          S |s(t          t           j        dEd	t           j        
          S |s(t          t           j        dFd	t           j        
          S |s(t          t           j        dGd	t           j        
          S |s(t          t           j        dHd	t           j        
          S |s(t          t           j        dId	t           j        
          S |s(t          t           j        dJd	t           j        
          S |s(t          t           j        dKd	t           j        
          S | s(t          t           j        dLd	t           j        
          S |!s(t          t           j        dMd	t           j        
          S |"s(t          t           j        dNd	t           j        
          S |#s(t          t           j        dOd	t           j        
          S |$s(t          t           j        dPd	t           j        
          S |%s(t          t           j        dQd	t           j        
          S |&s(t          t           j        dRd	t           j        
          S |'s(t          t           j        dSd	t           j        
          S |*s(t          t           j        dTd	t           j        
          S |+s(t          t           j        dUd	t           j        
          S |,s(t          t           j        dVd	t           j        
          S |-s(t          t           j        dWd	t           j        
          S |.s(t          t           j        dXd	t           j        
          S |/s(t          t           j        dYd	t           j        
          S |0s(t          t           j        dZd	t           j        
          S |1s(t          t           j        d[d	t           j        
          S t'          j        j        dli d\|d|	d|
d|d|d|d|d|d|d|d|d|d|d|d|d|d|d|d|d|d|d|d |d!|d"| d#|!d$|"d&|$d'|%d(|&d)|'d*|(d+|)d,|*d-|+d.|,d/|-d0|.d%|#d1|/d2|0d3|1d4|2d]t*          j                                        d5|3d^|d_|5d`dadbdc}6|                    dd          }7|xj        daz  c_        |                                 t0          j                            |77                                          }8|8r'de|8_        |6j        |8_        |8                                 t4          j                            df|j        z   dgz   |j        z   dhdij           t          t           j        dkd	t           j        
          S # t<          $ r?}9t          t           j        tA          |9          d	t           j        
          cY d }9~9S d }9~9ww xY w)mNr6  r7  r"  r   r   Trc   ,You have to buy subscription to add propertyrR  r   spend_too_much_timemost_useless_skillfun_act	biographyshort_titleproperty_overviewrC  r:  r;  videos_thumbnailr<  categoryr  r>  r9   r;   r7   r=  landmarkr4   rJ  r2   r3   facilitybenefitsrB  
finder_feegross_incomer  r@  total_termination_feer?  bill_utilitiespurchase_pricepotential_cashflow_pcminvestment_finder_fee#investment_return_on_investment_feerental
the_visioncost_to_considercapital_requiredrH  is_draftr   r   spend_too_much_time is requiredmost_useless_skill is requiredfun_act is requiredbiography is requiredshort_title is requiredproperty_overview is required property_description is requiredimage_data is requiredvideos is requiredproperty_document is requiredcategory is requiredproperty_name is requiredproperty_dimension is requiredcountry is requiredstate is requiredcity is requiredpostal_code is requiredlocation is requiredlatitude is requiredlongitude is requiredfacility is requiredbenefits is required return_on_investment is requiredfinder_fee is requiredgross_income is requiredprice is requiredcashflow_pcm is required!total_termination_fee is requiredpurchase_price is required"potential_cashflow_pcm is required!investment_finder_fee is required/investment_return_on_investment_fee is requiredrental is requiredthe_vision is requiredcost_to_consider is requiredcapital_required is required
customerIdr   subscription_typer   r   r   added_by	by_agencyform_id	Publishedz-A new property project has been added by the rH   FrR  rJ   Added successfullyr   )!r   r(  r)  r   r*  r{   rv   rw   rx   rp   r   r   r]   	tyre_typecan_add_property_countr   r   rr   rq   rD  r|   r
   r   r   r"  r   r}   rE   rF   r   r   r   r   ):r   r   r+  r,  r"  r   rp   plan_objsubscription_tyrerW  rX  rY  rZ  r[  r\  rC  r:  r;  r]  r<  r^  r  r>  r9   r;   r7   r=  r_  r4   rJ  r2   r3   r`  ra  rB  rb  rc  r  r@  rd  r?  re  rf  rg  rh  ri  rj  rk  rl  rm  rH  rn  r   rz  rR  r  get_formr   s:                                                             r   r   zaddPropertyProject.post(  s   j	Q,W55E *UH,?G9UUU!),$,333AAGGII<D-5<<cg<hhnnppH '%-]%<!!%&!1144v/J  VD  !E  !E  MS  Mh  i  i  i  i"&((+@"A"A!%*>!?!?hhy))G--I((=11K $)< = =#'88,B#C#C ((<00Jhhx((F $); < < $)< = =xx
++H!XXo66M!%*>!?!?hhy))GHHW%%E88F##D((=11Kxx
++H88N33Lxx
++Hxx
++H--Ixx
++Hxx
++H#'88,B#C#C ,//J88N33LHHW%%E88N33L$(HH-D$E$E!#xx(:;;!XX&677N!XX&677N%)XX.F%G%G"$(HH-D$E$E!26((;`2a2a/XXh''F,//J#xx(:;;#xx(:;; $)< = =xx
++H--I "%-44	4BBHHJJ

!
 '  shfFa  mN  8O  8O  W]  Wr  /s  /s  /s  (s%  qXVE`  lL  7M  7M  U[  Up  .q  .q  .q  'q  [(&:U`u+v+v  E  Z  #[  #[  #[  [  _HF<Wby-z-z  CI  C^  %_  %_  %_  _  chf>Yd}/~/~  GM  Gb  'c  'c  'c   c$  oHFD_  kJ  6K  6K  SY  Sn  -o  -o  -o  &o'  uxvGb  nP  9Q  9Q  Y_  Yt  0u  0u  0u  )u  aXV=Xc{.|.|  EK  E`  &a  &a  &a  a  Y9T_s*t*t  }C  }X  "Y  "Y  "Y  Y$  oHFD_  kJ  6K  6K  SY  Sn  -o  -o  -o  &o  ]86;Vaw,x,x  AG  A\  $]  $]  $]  ]   g@[  gB  2C  2C  KQ  Kf  )g  )g  )g  "g%  qXVE`  lL  7M  7M  U[  Up  .q  .q  .q  'q  [(&:U`u+v+v  E  Z  #[  #[  #[  [  W8S^q)r)r  {A  {V  !W  !W  !W  W  Uxv7R]o(p(px~  yT   U   U   U  U  chf>Yd}/~/~  GM  Gb  'c  'c  'c   c  ]86;Vaw,x,x  AG  A\  $]  $]  $]  ]  ]86;Vaw,x,x  AG  A\  $]  $]  $]  ]  _HF<Wby-z-z  CI  C^  %_  %_  %_  _  ]86;Vaw,x,x  AG  A\  $]  $]  $]  ]  ]86;Vaw,x,x  AG  A\  $]  $]  $]  ]'  uxvGb  nP  9Q  9Q  Y_  Yt  0u  0u  0u  )u  aXV=Xc{.|.|  EK  E`  &a  &a  &a  a  exv?Ze  1A  1A  IO  Id  (e  (e  (e  !e  W8S^q)r)r  {A  {V  !W  !W  !W  W  exv?Ze  1A  1A  IO  Id  (e  (e  (e  !e(  wHc  oR  :S  :S  [a  [v  1w  1w  1w  *w!  iA\  hD  3E  3E  MS  Mh  *i  *i  *i  #i)  yId  pT  ;U  ;U  ]c  ]x  2y  2y  2y  +y(  wHc  oR  :S  :S  [a  [v  1w  1w  1w  *w6  ShV\Vq  }n  Ho  Ho  w}  wR  ?S  ?S  ?S  8S  Y9T_s*t*t  }C  }X  "Y  "Y  "Y  Y  aXV=Xc{.|.|  EK  E`  &a  &a  &a  a#  m86C^  jH  5I  5I  QW  Ql  ,m  ,m  ,m  %m#  m86C^  jH  5I  5I  QW  Ql  ,m  ,m  ,m  %m.6= 2  2  2 &;2 $7$72  $6#52   	2 
 $)2  (K2  #4"32  &:%92  &:2  "2!12  v2  #4"32  "2  ,m2  $6#52    !2 " e#2 $ T%2 & (K'2 ( ")2 * *\+2 , "-2 . "/2 0 $)12 2 "32 4 "52 6 &:%972 8 *\92 : e;2 < *\=2 > '<&;?2 @ "2!1A2 B  .~C2 D  .~E2 F (>'=G2 H '<&;I2 J 5X4WK2 L vM2 N &:O2 P &:Q2 R "2!1S2 T "2!1U2 V #4"3W2 X $,00222Y2 Z "[2 \ #4"3]2 ^ "z_2 ` !a2 b %c2 f HHY''G..1..)188G8DDJJLLH   +%5%8$&--7fgrg|7|}7  BM  BV  8V  `e  xJ-  K  K  K6+=H\]]ekewxxxx 	Q 	Q 	Q6+P[^_`[a[abbjp  kP  Q  Q  Q  Q  Q  Q  Q  Q  Q	Qs   C2q$ 5O<q$ 2)q$ )q$ )q$ 0)q$ )q$ )q$ .)q$ )q$ )q$ ,)q$ )q$  )q$ *)q$ )q$ >)q$ ()q$ )q$ <)q$ &)q$ )q$ :)q$ $)q$ )q$ 8)q$ ")q$ )q$ 6)q$  )q$ 
)q$ 4)q$ )q$ )q$ 2)q$ )q$ )q$ 0F3q$ $
r-.4r("r-(r-Nr   r   r   r   rT  rT  '  s-        kQ kQ kQ kQ kQr   rT  c                       e Zd Zd ZdS )editPropertyProjectc                 ^   	 t          |          }|r]t          j        |t          j        dg          }|d         }t
          j                            |                                          }nd}|j	        }t
          j                            t                                                    }t          j                            |j        d                                          }|r|j        j        }nd}|                    d          }	|	s(t!          t"          j        d	d
t"          j                  S t&          j                            |	                                          }
|
s(t!          t"          j        dd
t"          j                  S |                    d          }|                    d          }|                    d          }|                    d          }|                    d          }|                    d          }|                    d          }|                    d          }|                    d          }|                    d          }|                    d          }|                    d          }|                    d          }|                    d          }|                    d          }|                    d          }|                    d          }|                    d          }|                    d           }|                    d!          }|                    d"          }|                    d#          } |                    d$          }!|                    d%          }"|                    d&          }#|                    d'          }$|                    d(          }%|                    d)          }&|                    d*          }'|                    d+          }(|                    d,          })|                    d-          }*|                    d.          }+|                    d/          },|                    d0          }-|                    d1          }.|                    d2          }/|                    d3          }0|                    d4          }1|                    d5          }2|                    d6          }3|                    d7          }4|                    d8          }5|s(t!          t"          j        d9d
t"          j                  S |s(t!          t"          j        d:d
t"          j                  S |s(t!          t"          j        d;d
t"          j                  S |s(t!          t"          j        d<d
t"          j                  S |s(t!          t"          j        d=d
t"          j                  S |s(t!          t"          j        d>d
t"          j                  S |s(t!          t"          j        d?d
t"          j                  S |s(t!          t"          j        d@d
t"          j                  S |s(t!          t"          j        dAd
t"          j                  S |s(t!          t"          j        dBd
t"          j                  S |s(t!          t"          j        dCd
t"          j                  S |s(t!          t"          j        dDd
t"          j                  S |s(t!          t"          j        dEd
t"          j                  S |s(t!          t"          j        dFd
t"          j                  S |s(t!          t"          j        dGd
t"          j                  S |s(t!          t"          j        dHd
t"          j                  S |s(t!          t"          j        dId
t"          j                  S |s(t!          t"          j        dJd
t"          j                  S | s(t!          t"          j        dKd
t"          j                  S |!s(t!          t"          j        dLd
t"          j                  S |"s(t!          t"          j        dMd
t"          j                  S |#s(t!          t"          j        dNd
t"          j                  S |$s(t!          t"          j        dOd
t"          j                  S |'s(t!          t"          j        dPd
t"          j                  S |(s(t!          t"          j        dQd
t"          j                  S |)s(t!          t"          j        dRd
t"          j                  S |*s(t!          t"          j        dSd
t"          j                  S |+s(t!          t"          j        dTd
t"          j                  S |,s(t!          t"          j        dUd
t"          j                  S |-s(t!          t"          j        dVd
t"          j                  S |.s(t!          t"          j        dWd
t"          j                  S |/s(t!          t"          j        dXd
t"          j                  S |0s(t!          t"          j        dYd
t"          j                  S |1s(t!          t"          j        dZd
t"          j                  S |2s(t!          t"          j        d[d
t"          j                  S |3s(t!          t"          j        d\d
t"          j                  S ||
_        ||
_        ||
_        ||
_        ||
_        ||
_        ||
_        ||
_        ||
_        ||
_        ||
_        ||
_        ||
_         ||
_!        ||
_"        ||
_#        ||
_$        ||
_%        ||
_&        ||
_'        ||
_(        | |
_)        |!|
_*        |"|
_+        |#|
_,        |$|
_-        |(|
_.        |)|
_/        |*|
_0        |+|
_1        |%|
_2        |&|
_3        |,|
_4        |-|
_5        |.|
_6        |/|
_7        |0|
_8        |1|
_9        |2|
_:        |3|
_;        |4|
_<        ||
_=        |5|
_>        d]|
_        |
?                                 |                    d^          }6t          j                            |6                                          }7|7r'd_|7_        |
j        |7_A        |7?                                 t!          t"          jB        d`d
t"          jB                  S # t          $ r?}8t!          t"          jD        t          |8          d
t"          jD                  cY d }8~8S d }8~8ww xY w)aNr6  r7  r"  r   r   Trc   r   r   rR  r   r   zNo property project foundrW  rX  rY  rZ  r[  r\  rC  r:  r;  r]  r<  r^  r  r>  r9   r;   r7   r=  r_  r4   rJ  r2   r3   r`  ra  rB  r?  re  rb  rc  r  r@  rd  rf  rg  rh  ri  rj  rk  rl  rm  rH  rn  ro  rp  rq  rr  rs  rt  ru  rv  rw  rx  ry  rz  r{  r|  r}  r~  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r   r  r  zUpdated Successfully)Fr   r(  r)  r   r*  r{   rv   rw   rx   rp   r   r   r   r]   r  rq   r   r   rr   rD  rW  rX  rY  rZ  r[  r\  rC  r:  r;  r]  r<  r^  r  r>  r9   r;   r7   r=  r_  r4   rJ  r2   r3   r`  ra  rB  rc  r  r@  rd  r?  re  rf  rg  rh  ri  rj  rk  rl  rm  rH  r  rn  r   r"  r   r   r   r   r   )9r   r   r+  r,  r"  r   rp   r  r  r   propertyProject_objrW  rX  rY  rZ  r[  r\  rC  r:  r;  r]  r<  r^  r  r>  r9   r;   r7   r=  r_  r4   rJ  r2   r3   r`  ra  rB  r?  re  rb  rc  r  r@  rd  rf  rg  rh  ri  rj  rk  rl  rm  rH  rn  r  r  r   s9                                                            r   r   zeditPropertyProject.post  s   a	U,W55E *UH,?G9UUU!),$,333AAGGII<D (//S/99??AAK-5<<cg<hhnnppH '%-]%<!!%&!((=11K  chf>Yd}/~/~  GM  Gb  'c  'c  'c   c"1"9"@"@K"@"P"P"V"V"X"X& Vv/JUp q qy  zU  V  V  V  V"&((+@"A"A!%*>!?!?hhy))G--I((=11K $)< = =#'88,B#C#C ((<00Jhhx((F $); < < $)< = =xx
++H!XXo66M!%*>!?!?hhy))GHHW%%E88F##D((=11Kxx
++H88N33Lxx
++Hxx
++H--Ixx
++Hxx
++H#'88,B#C#C #xx(:;;!XX&677N,//J88N33LHHW%%E88N33L$(HH-D$E$E!!XX&677N%)XX.F%G%G"$(HH-D$E$E!26((;`2a2a/XXh''F,//J#xx(:;;#xx(:;; $)< = =xx
++H '  shfFa  mN  8O  8O  W]  Wr  /s  /s  /s  (s%  qXVE`  lL  7M  7M  U[  Up  .q  .q  .q  'q  [(&:U`u+v+v  E  Z  #[  #[  #[  [  _HF<Wby-z-z  CI  C^  %_  %_  %_  _  chf>Yd}/~/~  GM  Gb  'c  'c  'c   c$  oHFD_  kJ  6K  6K  SY  Sn  -o  -o  -o  &o'  uxvGb  nP  9Q  9Q  Y_  Yt  0u  0u  0u  )u  aXV=Xc{.|.|  EK  E`  &a  &a  &a  a  Y9T_s*t*t  }C  }X  "Y  "Y  "Y  Y$  oHFD_  kJ  6K  6K  SY  Sn  -o  -o  -o  &o  ]86;Vaw,x,x  AG  A\  $]  $]  $]  ]   g@[  gB  2C  2C  KQ  Kf  )g  )g  )g  "g%  qXVE`  lL  7M  7M  U[  Up  .q  .q  .q  'q  [(&:U`u+v+v  E  Z  #[  #[  #[  [  W8S^q)r)r  {A  {V  !W  !W  !W  W  Uxv7R]o(p(px~  yT   U   U   U  U  chf>Yd}/~/~  GM  Gb  'c  'c  'c   c  ]86;Vaw,x,x  AG  A\  $]  $]  $]  ]  ]86;Vaw,x,x  AG  A\  $]  $]  $]  ]  _HF<Wby-z-z  CI  C^  %_  %_  %_  _  ]86;Vaw,x,x  AG  A\  $]  $]  $]  ]  ]86;Vaw,x,x  AG  A\  $]  $]  $]  ]'  uxvGb  nP  9Q  9Q  Y_  Yt  0u  0u  0u  )u  aXV=Xc{.|.|  EK  E`  &a  &a  &a  a  exv?Ze  1A  1A  IO  Id  (e  (e  (e  !e  W8S^q)r)r  {A  {V  !W  !W  !W  W  exv?Ze  1A  1A  IO  Id  (e  (e  (e  !e(  wHc  oR  :S  :S  [a  [v  1w  1w  1w  *w!  iA\  hD  3E  3E  MS  Mh  *i  *i  *i  #i)  yId  pT  ;U  ;U  ]c  ]x  2y  2y  2y  +y(  wHc  oR  :S  :S  [a  [v  1w  1w  1w  *w6  ShV\Vq  }n  Ho  Ho  w}  wR  ?S  ?S  ?S  8S  Y9T_s*t*t  }C  }X  "Y  "Y  "Y  Y  aXV=Xc{.|.|  EK  E`  &a  &a  &a  a#  m86C^  jH  5I  5I  QW  Ql  ,m  ,m  ,m  %m#  m86C^  jH  5I  5I  QW  Ql  ,m  ,m  ,m  %m 7J35G2*1',5).9+4E17K4-7*)/&3C04E1+3(0=-5G2*1'(-%'+$.9++3(/;,+3(+3(,5)+3(+3(7K4/;,(-%/;,8M53C01?.1?.9O68M5FiC)/&-7*3C03C04E14E1+3()*&$$&&&HHY''G)188G8DDJJLLH   +%8%;$6+=H^__gmgyzzzz 	U 	U 	Uv/T_bcd_e_e f fnt  oT  U  U  U  U  U  U  U  U  U	Us  D5s# 8As# N0s# )s# /)s# )s# )s# -)s# )s# )s# +)s# )s# ?)s# ))s# )s# =)s# ')s# )s# ;)s# %)s# )s# 9)s# #)s# )s# 7)s# !)s# )s# 5)s# )s# 	)s# 3)s# )s# )s# 1)s# )s# )s# /)s# )s# Gs# #
t,-4t'!t,'t,Nr   r   r   r   r  r    s-        bU bU bU bU bUr   r  c                       e Zd Zd ZdS )addSalePropertyc                    	 t          |          }|r]t          j        |t          j        dg          }|d         }t
          j                            |                                          }nd}|j	        dk    r(t          t          j        ddt          j                  S |j        }t          j                            |j        d	
                                          }|r|j        j        }nd}|                    d          }	|                    d          }
|                    d          }|                    d          }|                    d          }|                    d          }|                    d          }|                    d          }|                    d          }|                    d          }|                    d          }|                    d          }|                    d          }|                    d          }|                    d          }|                    d          }|                    d          }|                    d          }|                    d          }|                    d          }|                    d          }|                    d           }|                    d!          }|                    d"          } |                    d#          }!|                    d$          }"|                    d%          }#|                    d&          }$|                    d'          }%|                    d(          }&|                    d)          }'|                    d*          }(|                    d+          })|                    d,          }*|                    d-          }+|                    d.          },|                    d/          }-|                    d0          }.|                    d1          }/|                    d2          }0|	s(t          t          j        d3dt          j                  S |
s(t          t          j        d4dt          j                  S |s(t          t          j        d5dt          j                  S |s(t          t          j        d6dt          j                  S |s(t          t          j        d7dt          j                  S |s(t          t          j        d8dt          j                  S |s(t          t          j        d9dt          j                  S |s(t          t          j        d:dt          j                  S |s(t          t          j        d;dt          j                  S |s(t          t          j        d<dt          j                  S |s(t          t          j        d=dt          j                  S |s(t          t          j        d>dt          j                  S |s(t          t          j        d?dt          j                  S |s(t          t          j        d@dt          j                  S | s(t          t          j        dAdt          j                  S |!s(t          t          j        dBdt          j                  S |$s(t          t          j        dCdt          j                  S |%s(t          t          j        dDdt          j                  S |&s(t          t          j        dEdt          j                  S |'s(t          t          j        dFdt          j                  S |(s(t          t          j        dGdt          j                  S |)s(t          t          j        dHdt          j                  S |*s(t          t          j        dIdt          j                  S |+s(t          t          j        dJdt          j                  S |-s(t          t          j        dKdt          j                  S |#s(t          t          j        dLdt          j                  S |,s(t          t          j        dMdt          j                  S t&          j                            |dNO          }1|	|1_        |
|1_        ||1_        ||1_        ||1_        ||1_        ||1_        ||1_        ||1_        ||1_        ||1_        ||1_         ||1_!        ||1_"        ||1_#        ||1_$        ||1_%        ||1_&        ||1_'        ||1_(        ||1_)        ||1_*        ||1_+        | |1_,        |!|1_-        |"|1_.        |$|1_/        |%|1_0        |&|1_1        |'|1_2        |(|1_3        |)|1_4        |*|1_5        |+|1_6        |-|1_7        |.|1_8        |/|1_9        |#|1_:        |,|1_;        |0|1_<        ||1_=        dP|1_        |1>                                 |xj	        dPz  c_	        |>                                 dQ|1j        i}2|                    dR          }3t~          j                            |3S                                          }4|4r'dT|4_        |1j        |4_@        |4>                                 t          j                            dU|jB        z   dVz   |jC        z   d	dWX           t          t          jD        dY|2dZt          jD                  S # t          $ r?}5t          t          jF        t          |5          dt          jF                  cY d }5~5S d }5~5ww xY w)[Nr6  r7  r"  r   r   rV  rR  r   Trc   r  main_categorysub_categoryr:  videor]  r  r4   r=  r9   r;   r7   ra  
youtubeUrlr   r  property_demensionvisionrj  descriptioon
closingFeebedrooms	bathroomsreadyBypropertyReferenceIdmaintenanceFee
facilitiesfinance_rentalfinance_total_closing_feefinance_maintaince_feefinance_bill_utilitesrH  
disclaimerproperty_informationrequired_capitalresidental_property_detailsrJ  r2   r3   rn  title is requiredmain_category is requiredsub_category is requiredvideo is requiredrz  r  phoneNumber is requiredr  property_demension is requiredvision is requiredr  descriptioon is requiredbedrooms is requiredbathrooms is requiredreadyBy is requiredpropertyReferenceId is requiredfinance_rental is required%finance_total_closing_fee is required"finance_maintaince_fee is required!finance_bill_utilites is requiredcashflow_forecast is requireddisclaimer is required property_information is requiredrequired_capital is requiredr  facilities is required'residental_property_details is requiredr  r  r  r   r   r  r   r  z.A new property for sale has been added by the rH   sale_propertyrJ   r  r   r<   rp   )Hr   r(  r)  r   r*  r{   rv   rw   rx   r  r   r   rr   rp   r   r   r]   r  rq   SalePropertyr|   r  r  subCategoryr:  r  r]  r  r4   r9   r;   r7   benfitsr=  r  r   r  r  r  rj  r  r  r  r  r  r  r  r  r  r  r  rH  r  r  r  rJ  r2   r3   r  r  rn  r  r   r"  r   r}   rE   rF   r   r   r   r   )6r   r   r+  r,  r"  r   rp   r  r  r  r  r  r:  r  r]  r  r4   r=  r9   r;   r7   r  r  r   r  r  r  rj  r  r  r  r  r  r  r  r  r  r  r  r  rH  r  r  r  r  rJ  r2   r3   rn  sale_objr   r  r  r   s6                                                         r   r   zaddSaleProperty.post{  s   c	Q,W55E *UH,?G9UUU!),$,333AAGGII1144v/J  VD  !E  !E  MS  Mh  i  i  i  i<D-5<<cg<hhnnppH '%-]%<!!%&!HHW%%E HH_55M88N33L,//JHHW%%E#xx(:;; HH_55M88N33L((=11Khhy))GHHW%%E88F##Dhhz**G,//J((=11KHHW%%E!%*>!?!?XXh''FXXh''F88N33L,//Jxx
++H--Ihhy))G"&((+@"A"A!XX&677N,//J!XX&677N(,1L(M(M%%)XX.F%G%G"$(HH-D$E$E! $)< = =,//J#'88,B#C#C #xx(:;;*.((3P*Q*Q'xx
++Hxx
++H--Ixx
++H  W8S^q)r)r  {A  {V  !W  !W  !W  W   g@[  gB  2C  2C  KQ  Kf  )g  )g  )g  "g  exv?Ze  1A  1A  IO  Id  (e  (e  (e  !e  W8S^q)r)r  {A  {V  !W  !W  !W  W   g@[  gB  2C  2C  KQ  Kf  )g  )g  )g  "g  chf>Yd}/~/~  GM  Gb  'c  'c  'c   c  chf>Yd}/~/~  GM  Gb  'c  'c  'c   c  W8S^q)r)r  {A  {V  !W  !W  !W  W%  qXVE`  lL  7M  7M  U[  Up  .q  .q  .q  'q  Y9T_s*t*t  }C  }X  "Y  "Y  "Y  Y  Y9T_s*t*t  }C  }X  "Y  "Y  "Y  Y  exv?Ze  1A  1A  IO  Id  (e  (e  (e  !e  ]86;Vaw,x,x  AG  A\  $]  $]  $]  ]  _HF<Wby-z-z  CI  C^  %_  %_  %_  _  [(&:U`u+v+v  E  Z  #[  #[  #[  [&  shfFa  mN  8O  8O  W]  Wr  /s  /s  /s  (s "  iA\  hD  3E  3E  MS  Mh  *i  *i  *i  #i,  HFLg  sZ  >[  >[  ci  c~  5  5  5  .)  yId  pT  ;U  ;U  ]c  ]x  2y  2y  2y  +y(  wHc  oR  :S  :S  [a  [v  1w  1w  1w  *w %  oHFD_  kJ  6K  6K  SY  Sn  -o  -o  -o  &o  aXV=Xc{.|.|  EK  E`  &a  &a  &a  a'  uxvGb  nP  9Q  9Q  Y_  Yt  0u  0u  0u  )u#  m86C^  jH  5I  5I  QW  Ql  ,m  ,m  ,m  %m  ]86;Vaw,x,x  AG  A\  $]  $]  $]  ]  aXV=Xc{.|.|  EK  E`  &a  &a  &a  a.  ChfNi  u^  @_  @_  gm  gB  7C  7C  7C  0C $+22kS^2__H"HN%2H"#/H ",H"HN(8H%%2H"$0H!&H"HN HM&H#.H ",H#.H "HN*<H'$HO$HO$0H!",H (H!*H&H+>H(&4H#&4H#1JH..DH+-BH*
 *;H&",H,@H)(8H% (H (H!*H",H3NH0 (H):H&HOMMOOO..1..X[G HHY''G)188G8DDJJLLH   +%-[$&--7ghsh}7}  A  8A  CN  CW  8W  ae  xG-  H  H  H6+=H\dklltz  uG  H  H  H  H 	Q 	Q 	Q6+P[^_`[a[abbjp  kP  Q  Q  Q  Q  Q  Q  Q  Q  Q	Qs   B"l %Ol ')l )l ;)l %)l )l 9)l #)l )l 7)l !)l )l 5)l )l 	)l 3)l )l )l 1)l )l )l /)l )l )l -)l )l )l +Il 
m
4m?m
m
Nr   r   r   r   r  r  z  s-        dQ dQ dQ dQ dQr   r  c                       e Zd Zd ZdS )editSalePropertyc                 ~   	 t          |          }|r]t          j        |t          j        dg          }|d         }t
          j                            |                                          }nd}t          j                            |j
        d                                          }|r|j        j        }nd}|j        }|                    d          }	|                    d	          }
|                    d
          }|                    d          }|                    d          }|                    d          }|                    d          }|                    d          }|                    d          }|                    d          }|                    d          }|                    d          }|                    d          }|                    d          }|                    d          }|                    d          }|                    d          }|                    d          }|                    d          }|                    d          }|                    d          }|                    d          }|                    d          }|                    d          } |                    d           }!|                    d!          }"|                    d"          }#|                    d#          }$|                    d$          }%|                    d%          }&|                    d&          }'|                    d'          }(|                    d(          })|                    d)          }*|                    d*          }+|                    d+          },|                    d,          }-|                    d-          }.|                    d.          }/|                    d/          }0|	s(t          t           j        d0d1t           j        2          S |
s(t          t           j        d3d1t           j        2          S |s(t          t           j        d4d1t           j        2          S |s(t          t           j        d5d1t           j        2          S |s(t          t           j        d6d1t           j        2          S |s(t          t           j        d7d1t           j        2          S |s(t          t           j        d8d1t           j        2          S |s(t          t           j        d9d1t           j        2          S |s(t          t           j        d:d1t           j        2          S |s(t          t           j        d;d1t           j        2          S |s(t          t           j        d<d1t           j        2          S |s(t          t           j        d=d1t           j        2          S |s(t          t           j        d>d1t           j        2          S |s(t          t           j        d?d1t           j        2          S | s(t          t           j        d@d1t           j        2          S |!s(t          t           j        dAd1t           j        2          S |$s(t          t           j        dBd1t           j        2          S |%s(t          t           j        dCd1t           j        2          S |&s(t          t           j        dDd1t           j        2          S |'s(t          t           j        dEd1t           j        2          S |(s(t          t           j        dFd1t           j        2          S |)s(t          t           j        dGd1t           j        2          S |*s(t          t           j        dHd1t           j        2          S |+s(t          t           j        dId1t           j        2          S |-s(t          t           j        dJd1t           j        2          S |#s(t          t           j        dKd1t           j        2          S |,s(t          t           j        dLd1t           j        2          S t$          j                            t&          M                                          }1|	|1_        |
|1_        ||1_        ||1_        ||1_        ||1_        ||1_        ||1_        ||1_        ||1_        ||1_        ||1_        ||1_         ||1_!        ||1_"        ||1_#        ||1_$        ||1_%        ||1_&        ||1_'        ||1_(        ||1_)        ||1_*        | |1_+        |!|1_,        |"|1_-        |$|1_.        |%|1_/        |&|1_0        |'|1_1        |#|1_2        |(|1_3        |)|1_4        |*|1_5        |+|1_6        |-|1_7        |.|1_8        |/|1_9        |,|1_:        dN|1_        |1;                                 |                    dO          }2tx          j                            |2M                                          }3|3r'dP|3_        |1j
        |3_=        |3;                                 t          t           j>        dQd1t           j>        2          S # t~          $ r?}4t          t           j@        t          |4          d1t           j@        2          cY d }4~4S d }4~4ww xY w)RNr6  r7  r"  r   r   Trc   r  r  r  r:  r  r]  r  r4   r9   r;   r7   ra  r=  r  r   r  r  r  rj  r  r  r  r  r  r  r  r  r  r  r  r  rH  r  r  r  r  rJ  r2   r3   rn  r  rR  r   r  r  r  rz  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r   r   r  r  Updated successfully)Br   r(  r)  r   r*  r{   rv   rw   rx   r   r   r]   r  rp   rq   r   r   rr   r  sale_idr  r  r  r:  r  r]  r  r4   r9   r;   r7   r  r=  r  r   r  r  r  rj  r  r  r  r  r  r  r  r  r  r  r  r  rH  r  r  r  rJ  r2   r3   r  r   r"  r   r   r   r   r   )5r   r   r+  r,  r"  r   r  r  rp   r  r  r  r:  r  r]  r  r4   r9   r;   r7   r  r=  r  r   r  r  r  rj  r  r  r  r  r  r  r  r  r  r  r  r  rH  r  r  r  r  rJ  r2   r3   rn  r  r  r  r   s5                                                        r   r   zeditSaleProperty.post"  s   R	Q,W55E *UH,?G9UUU!),$,333AAGGII-5<<cg<hhnnppH '%-]%<!!%&!<DHHW%%E HH_55M88N33L,//JHHW%%E#xx(:;; HH_55M88N33Lhhy))GHHW%%E88F##Dhhz**G((=11K,//J((=11KHHW%%E!%*>!?!?XXh''FXXh''F88N33L,//Jxx
++H--Ihhy))G"&((+@"A"A!XX&677N,//J!XX&677N(,1L(M(M%%)XX.F%G%G"$(HH-D$E$E! $)< = =,//J#'88,B#C#C #xx(:;;*.((3P*Q*Q'xx
++Hxx
++H--Ixx
++H  W8S^q)r)r  {A  {V  !W  !W  !W  W   g@[  gB  2C  2C  KQ  Kf  )g  )g  )g  "g  exv?Ze  1A  1A  IO  Id  (e  (e  (e  !e  W8S^q)r)r  {A  {V  !W  !W  !W  W   g@[  gB  2C  2C  KQ  Kf  )g  )g  )g  "g  chf>Yd}/~/~  GM  Gb  'c  'c  'c   c  chf>Yd}/~/~  GM  Gb  'c  'c  'c   c  W8S^q)r)r  {A  {V  !W  !W  !W  W%  qXVE`  lL  7M  7M  U[  Up  .q  .q  .q  'q  Y9T_s*t*t  }C  }X  "Y  "Y  "Y  Y  Y9T_s*t*t  }C  }X  "Y  "Y  "Y  Y  exv?Ze  1A  1A  IO  Id  (e  (e  (e  !e  ]86;Vaw,x,x  AG  A\  $]  $]  $]  ]  _HF<Wby-z-z  CI  C^  %_  %_  %_  _  [(&:U`u+v+v  E  Z  #[  #[  #[  [&  shfFa  mN  8O  8O  W]  Wr  /s  /s  /s  (s "  iA\  hD  3E  3E  MS  Mh  *i  *i  *i  #i,  HFLg  sZ  >[  >[  ci  c~  5  5  5  .)  yId  pT  ;U  ;U  ]c  ]x  2y  2y  2y  +y(  wHc  oR  :S  :S  [a  [v  1w  1w  1w  *w %  oHFD_  kJ  6K  6K  SY  Sn  -o  -o  -o  &o  aXV=Xc{.|.|  EK  E`  &a  &a  &a  a'  uxvGb  nP  9Q  9Q  Y_  Yt  0u  0u  0u  )u#  m86C^  jH  5I  5I  QW  Ql  ,m  ,m  ,m  %m  ]86;Vaw,x,x  AG  A\  $]  $]  $]  ]  aXV=Xc{.|.|  EK  E`  &a  &a  &a  a.  ChfNi  u^  @_  @_  gm  gB  7C  7C  7C  0C $+22g2>>DDFFH"HN%2H"#/H ",H"HN(8H%%2H"$0H!&H"HN HM&H#.H ",H#.H "HN*<H'$HO$HO$0H!",H (H!*H&H+>H(&4H#&4H#1JH..DH+-BH* #-H):H&",H,@H)(8H% (H (H!*H3NH0HOMMOOOHHY''G)188G8DDJJLLH   +%-[$6+=H^__gmgyzzzz 	Q 	Q 	Q6+P[^_`[a[abbjp  kP  Q  Q  Q  Q  Q  Q  Q  Q  Q	Qs   P1i3 4)i3 )i3 )i3 2)i3 )i3 )i3 0)i3 )i3 )i3 .)i3 )i3 )i3 ,)i3 )i3  )i3 *)i3 )i3 >)i3 ()i3 )i3 <)i3 &)i3 )i3 :)i3 $)i3 )i3 8G:i3 3
j<=4j71j<7j<Nr   r   r   r   r  r  !  s-        SQ SQ SQ SQ SQr   r  c                       e Zd Zd ZdS )addPropertyRentc                    	 t          |          }|r]t          j        |t          j        dg          }|d         }t
          j                            |                                          }nd}t          j                            |j
        d                                          }|r|j        j        }nd}|j        dk    r(t          t          j        dd	t          j        
          S |j        }|                    d          }	|                    d          }
|                    d          }|                    d          }|                    d          }|                    d          }|                    d          }|                    d          }|                    d          }|                    d          }|                    d          }|                    d          }|                    d          }|                    d          }|                    d          }|                    d          }|                    d          }|                    d          }|                    d          }|                    d          }|                    d          }|                    d           }|                    d!          }|                    d"          } |                    d#          }!|                    d$          }"|                    d%          }#|                    d&          }$|                    d'          }%|                    d(          }&|                    d)          }'|                    d*          }(|                    d+          })|                    d,          }*|                    d-          }+|                    d.          },|                    d/          }-|                    d0          }.|                    d1          }/|                    d2          }0|                    d3          }1|                    d4          }2|                    d5          }3|                    d6          }4|                    d7          }5|	s(t          t          j        d8d	t          j        
          S |
s(t          t          j        d9d	t          j        
          S |s(t          t          j        d:d	t          j        
          S |s(t          t          j        d;d	t          j        
          S |s(t          t          j        d<d	t          j        
          S |s(t          t          j        d=d	t          j        
          S |(s(t          t          j        d>d	t          j        
          S |)s(t          t          j        d?d	t          j        
          S |s(t          t          j        d@d	t          j        
          S |s(t          t          j        dAd	t          j        
          S |s(t          t          j        dBd	t          j        
          S |s(t          t          j        dCd	t          j        
          S |s(t          t          j        dDd	t          j        
          S |s(t          t          j        dEd	t          j        
          S |s(t          t          j        dFd	t          j        
          S |s(t          t          j        dGd	t          j        
          S |s(t          t          j        dHd	t          j        
          S |'s(t          t          j        dId	t          j        
          S |s(t          t          j        dJd	t          j        
          S |s(t          t          j        dKd	t          j        
          S |s(t          t          j        dLd	t          j        
          S |s(t          t          j        dMd	t          j        
          S |+s(t          t          j        dNd	t          j        
          S |,s(t          t          j        dOd	t          j        
          S |-s(t          t          j        dPd	t          j        
          S |.s(t          t          j        dQd	t          j        
          S |/s(t          t          j        dRd	t          j        
          S |0s(t          t          j        dSd	t          j        
          S |1s(t          t          j        dTd	t          j        
          S |2s(t          t          j        dUd	t          j        
          S |3s(t          t          j        dVd	t          j        
          S |4s(t          t          j        dWd	t          j        
          S |5s(t          t          j        dXd	t          j        
          S |s(t          t          j        dYd	t          j        
          S t&          j                            |dZ[          }6|	|6_        |
|6_        ||6_        ||6_        ||6_        ||6_        ||6_        ||6_        ||6_        ||6_        ||6_        ||6_         ||6_!        |!|6_"        |"|6_#        |#|6_$        |$|6_%        |%|6_&        |&|6_'        ||6_(        ||6_)        ||6_*        ||6_+        ||6_,        ||6_-        ||6_.        ||6_/        ||6_0        ||6_1        | |6_2        |'|6_3        |(|6_4        |)|6_5        ||6_6        |*|6_7        |+|6_8        |,|6_9        |-|6_:        |.|6_;        |/|6_<        |0|6_=        |1|6_>        |2|6_?        |3|6_@        |4|6_A        |5|6_B        d\|6_        |6C                                 |xj        d\z  c_        |C                                 d]|6j
        i}7|                    d^          }8t          j                            |8_                                          }9|9r'd`|9_        |6j
        |9_E        |9C                                 t          j                            da|jG        z   dbz   |jH        z   ddcd           t          t          jI        de|7dft          jI        
          S # t          $ r?}:t          t          jK        t          |:          d	t          jK        
          cY d }:~:S d }:~:ww xY w)gNr6  r7  r"  r   r   Trc   rV  rR  r   r  r^  r  r:  r  r]  floorroomsr  sizer  depositra  rental_periodavailable_from_datemonthly_rentmonthly_rent_includessecuritysecurity_amountheadingdescriptiondisplay_information
name_of_ad	visibiltyr9   r;   r7   r=  r_  r4   rJ  r2   r3   rn  r\  type_propertydescription_home
spend_timeuseless_skillrY  rZ  primary_roomhousing_typekey_info_bedroomstoryr  ry  r  description is requiredr  image is requiredr  r  r  rooms is requiredsize is requiredmonthly_rent is requiredrental_period is requiredfacilites is requiredavaiable_from_date is required!monthly_rent_includes is requiredsecurity is requiredr  security_amount is requiredheading is requireddisplay_information is requiredname_of_ad is requiredrt  type_property is requireddescription_home is requiredspend_time is requireduseless_skill is requiredrq  rr  primary_room is requiredhousing_type is requiredkey_info_bedroom is requiredstory is requireddeposit is requiredr  r  r   r   r  r   r  z.A new property for rent has been added by the rH   rent_propertyrJ   r  r  )Mr   r(  r)  r   r*  r{   rv   rw   rx   r   r   r]   r  r  r   r   rr   rp   rq   RentPropertyr|   r  r^  r  r:  r  r]  r  r  r  r  	facilitesr  ra  r9   r;   r7   r=  r_  r4   r  avaiable_from_dater  r  r  r  r  r  r  r  r  rJ  r2   r3   r  rn  r\  r  r  r  r  rY  rZ  r  r  r  r  r   r"  r   r}   rE   rF   r   r   r   r   );r   r   r+  r,  r"  r   r  r  rp   r  r^  r  r  r  r]  r  r  r  r  r  r  ra  r  r  r  r  r  r  r  r  r  r  r  r9   r;   r7   r=  r_  r4   rJ  r2   r3   rn  r\  r  r  r  r  rY  rZ  r  r  r  r  rentpropr   r  r  r   s;                                                              r   r   zaddPropertyRent.post  s.   w	Q,W55E *UH,?G9UUU!),$,333AAGGII-5<<cg<hhnnppH '%-]%<!!%&!1144v/J  VD  !E  !E  MS  Mh  i  i  i  i<DHHW%%Exx
++H88N33LHH\**EHHW%%E#xx(:;;HHW%%EHHW%%Exx
++H88F##D..Ihhy))Gxx
++H HH_55M!%*?!@!@88N33L$(HH-D$E$E!xx
++H"hh'899Ohhy))G((=11K"&((+@"A"A,//J+..Ixx	**GXXg&&EHHV$$D88M22K,,H HH^44L,,H,,H+..Ixx
++H $)< = = HH_55M#xx(:;;,//J HH_55Mhhy))G--I88N33L88N33L#xx(:;;HHW%%E   W8S^q)r)r  {A  {V  !W  !W  !W  W  ]86;Vaw,x,x  AG  A\  $]  $]  $]  ]  exv?Ze  1A  1A  IO  Id  (e  (e  (e  !e  chf>Yd}/~/~  GM  Gb  'c  'c  'c   c  ]86;Vaw,x,x  AG  A\  $]  $]  $]  ]  W8S^q)r)r  {A  {V  !W  !W  !W  W  ]86;Vaw,x,x  AG  A\  $]  $]  $]  ]  _HF<Wby-z-z  CI  C^  %_  %_  %_  _  W8S^q)r)r  {A  {V  !W  !W  !W  W  W8S^q)r)r  {A  {V  !W  !W  !W  W  Uxv7R]o(p(px~  yT   U   U   U  U  exv?Ze  1A  1A  IO  Id  (e  (e  (e  !e   g@[  gB  2C  2C  KQ  Kf  )g  )g  )g  "g  _HF<Wby-z-z  CI  C^  %_  %_  %_  _%  qXVE`  lL  7M  7M  U[  Up  .q  .q  .q  'q(  wHc  oR  :S  :S  [a  [v  1w  1w  1w  *w  ]86;Vaw,x,x  AG  A\  $]  $]  $]  ]  ]86;Vaw,x,x  AG  A\  $]  $]  $]  ]"  k(&B]  iF  4G  4G  OU  Oj  +k  +k  +k  $k  [(&:U`u+v+v  E  Z  #[  #[  #[  [&  shfFa  mN  8O  8O  W]  Wr  /s  /s  /s  (s  aXV=Xc{.|.|  EK  E`  &a  &a  &a  a$  oHFD_  kJ  6K  6K  SY  Sn  -o  -o  -o  &o   g@[  gB  2C  2C  KQ  Kf  )g  )g  )g  "g#  m86C^  jH  5I  5I  QW  Ql  ,m  ,m  ,m  %m  aXV=Xc{.|.|  EK  E`  &a  &a  &a  a   g@[  gB  2C  2C  KQ  Kf  )g  )g  )g  "g  [(&:U`u+v+v  E  Z  #[  #[  #[  [  _HF<Wby-z-z  CI  C^  %_  %_  %_  _  exv?Ze  1A  1A  IO  Id  (e  (e  (e  !e  exv?Ze  1A  1A  IO  Id  (e  (e  (e  !e#  m86C^  jH  5I  5I  QW  Ql  ,m  ,m  ,m  %m  W8S^q)r)r  {A  {V  !W  !W  !W  W  [(&:U`u+v+v  E  Z  #[  #[  #[  [ $+22kS^2__H"HN (H#/H "'H"HN(8H%"HN"HN (H HM!*H&H (H  'H"HN HM#.H  (H$0H!%2H"*<H'$0H!-BH* (H'6H$&H#.H +>H(",H!*H (H (H!*H):H& (H):H&%2H"(8H%",H%2H"&H!*H$0H!$0H!(8H%"HNHO
 MMOOO..1..X[G HHY''G)188G8DDJJLLH   +%-[$&--7ghsh}7}  A  8A  CN  CW  8W  ae  xG-  H  H  H6+=H\dklltz  uG  H  H  H  H 	Q 	Q 	Q6+P[^_`[a[abbjp  kP  Q  Q  Q  Q  Q  Q  Q  Q  Q	Qs   C+r3 .O!r3 )r3 :)r3 $)r3 )r3 8)r3 ")r3 )r3 6)r3  )r3 
)r3 4)r3 )r3 )r3 2)r3 )r3 )r3 0)r3 )r3 )r3 .)r3 )r3 )r3 ,)r3 )r3  )r3 *)r3 )r3 >)r3 ()r3 )r3 <)r3 &)r3 )r3 :I8r3 3
s<=4s71s<7s<Nr   r   r   r   r  r    s-        xQ xQ xQ xQ xQr   r  c                       e Zd Zd ZdS )editPropertyRentc                    	 t          |          }|r]t          j        |t          j        dg          }|d         }t
          j                            |                                          }nd}t          j                            |j
        d                                          }|r|j        j        }nd}|j        }|                    d          }	|                    d	          }
|                    d
          }|                    d          }|                    d          }|                    d          }|                    d          }|                    d          }|                    d          }|                    d          }|                    d          }|                    d          }|                    d          }|                    d          }|                    d          }|                    d          }|                    d          }|                    d          }|                    d          }|                    d          }|                    d          }|                    d          }|                    d          }|                    d          } |                    d           }!|                    d!          }"|                    d"          }#|                    d#          }$|                    d$          }%|                    d%          }&|                    d&          }'|                    d'          }(|                    d(          })|                    d)          }*|                    d*          }+|                    d+          },|                    d,          }-|                    d-          }.|                    d.          }/|                    d/          }0|                    d0          }1|                    d1          }2|                    d2          }3|                    d3          }4|                    d4          }5|	s(t          t           j        d5d6t           j        7          S |
s(t          t           j        d8d6t           j        7          S |s(t          t           j        d9d6t           j        7          S |#s(t          t           j        d:d6t           j        7          S |s(t          t           j        d;d6t           j        7          S |s(t          t           j        d<d6t           j        7          S |(s(t          t           j        d=d6t           j        7          S |)s(t          t           j        d>d6t           j        7          S |s(t          t           j        d?d6t           j        7          S |s(t          t           j        d@d6t           j        7          S |s(t          t           j        dAd6t           j        7          S |s(t          t           j        dBd6t           j        7          S |s(t          t           j        dCd6t           j        7          S |s(t          t           j        dDd6t           j        7          S |s(t          t           j        dEd6t           j        7          S |s(t          t           j        dFd6t           j        7          S | s(t          t           j        dGd6t           j        7          S |'s(t          t           j        dHd6t           j        7          S |!s(t          t           j        dId6t           j        7          S |"s(t          t           j        dJd6t           j        7          S |$s(t          t           j        dKd6t           j        7          S |%s(t          t           j        dLd6t           j        7          S |+s(t          t           j        dMd6t           j        7          S |,s(t          t           j        dNd6t           j        7          S |-s(t          t           j        dOd6t           j        7          S |.s(t          t           j        dPd6t           j        7          S |/s(t          t           j        dQd6t           j        7          S |0s(t          t           j        dRd6t           j        7          S |1s(t          t           j        dSd6t           j        7          S |2s(t          t           j        dTd6t           j        7          S |3s(t          t           j        dUd6t           j        7          S |4s(t          t           j        dVd6t           j        7          S |5s(t          t           j        dWd6t           j        7          S |s(t          t           j        dXd6t           j        7          S t$          j                            t&          |Y                                          }6|	|6_        |
|6_        ||6_        ||6_        ||6_        ||6_        ||6_        ||6_        ||6_        ||6_        ||6_        ||6_        ||6_         ||6_!        ||6_"        ||6_#        ||6_$        ||6_%        ||6_&        ||6_'        ||6_(        ||6_)        | |6_*        |!|6_+        |"|6_,        |#|6_-        |$|6_.        |%|6_/        |&|6_0        |'|6_1        |(|6_2        |)|6_3        ||6_4        |*|6_5        |+|6_6        |,|6_7        |-|6_8        |.|6_9        |/|6_:        |0|6_;        |1|6_<        |2|6_=        |3|6_>        |4|6_?        |5|6_@        dZ|6_        |6A                                 |                    d[          }7t          j                            |7\                                          }8|8r'd]|8_        |6j
        |8_C        |8A                                 t          t           jD        d^d6t           jD        7          S # t          $ r?}9t          t           jF        t          |9          d6t           jF        7          cY d }9~9S d }9~9ww xY w)_Nr6  r7  r"  r   r   Trc   r  r^  r  r:  r  r]  r  r  r  r  r  r  ra  r9   r;   r7   r=  r_  r4   r  r  r  r  r  r  r  r  r  r  r  rJ  r2   r3   rn  r\  r  r  r  r  rY  rZ  r  r  r  r  r  rR  r   ry  r  r  r  r  r  r  r  r  r  r  r  r  r  r   r  r  r  r  r  r  rt  r  r  r  r	  rq  rr  r
  r  r  r  r  )r   r  r   r  r   r  r  )Hr   r(  r)  r   r*  r{   rv   rw   rx   r   r   r]   r  rp   rq   r   r   rr   r  rent_idr  r^  r  r:  r  r]  r  r  r  r  r  r  ra  r9   r;   r7   r=  r4   r  r  r  r  r  r  r  r  r  r  r  rJ  r2   r3   r  rn  r\  r  r  r  r  rY  rZ  r  r  r  r  r   r"  r   r   r   r   r   ):r   r   r+  r,  r"  r   r  r  rp   r  r^  r  r  r  r]  r  r  r  r  r  r  ra  r9   r;   r7   r=  r_  r4   r  r  r  r  r  r  r  r  r  r  r  rJ  r2   r3   rn  r\  r  r  r  r  rY  rZ  r  r  r  r  r  r  r  r   s:                                                             r   r   zeditPropertyRent.posts	  s;   e	Q,W55E *UH,?G9UUU!),$,333AAGGII-5<<cg<hhnnppH '%-]%<!!%&!<DHHW%%Exx
++H88N33LHH\**EHHW%%E#xx(:;;HHW%%EHHW%%Exx
++H88F##D..Ihhy))Gxx
++Hxx	**GXXg&&EHHV$$D88M22K,,H HH^44L HH_55M!%*?!@!@88N33L$(HH-D$E$E!xx
++H"hh'899Ohhy))G((=11K"&((+@"A"A,//J+..I,,H,,H+..Ixx
++H $)< = = HH_55M#xx(:;;,//J HH_55Mhhy))G--I88N33L88N33L#xx(:;;HHW%%E  W8S^q)r)r  {A  {V  !W  !W  !W  W  ]86;Vaw,x,x  AG  A\  $]  $]  $]  ]  exv?Ze  1A  1A  IO  Id  (e  (e  (e  !e  chf>Yd}/~/~  GM  Gb  'c  'c  'c   c  ]86;Vaw,x,x  AG  A\  $]  $]  $]  ]  W8S^q)r)r  {A  {V  !W  !W  !W  W  ]86;Vaw,x,x  AG  A\  $]  $]  $]  ]  _HF<Wby-z-z  CI  C^  %_  %_  %_  _  W8S^q)r)r  {A  {V  !W  !W  !W  W  W8S^q)r)r  {A  {V  !W  !W  !W  W  Uxv7R]o(p(px~  yT   U   U   U  U  exv?Ze  1A  1A  IO  Id  (e  (e  (e  !e   g@[  gB  2C  2C  KQ  Kf  )g  )g  )g  "g  _HF<Wby-z-z  CI  C^  %_  %_  %_  _%  qXVE`  lL  7M  7M  U[  Up  .q  .q  .q  'q(  wHc  oR  :S  :S  [a  [v  1w  1w  1w  *w  ]86;Vaw,x,x  AG  A\  $]  $]  $]  ]  ]86;Vaw,x,x  AG  A\  $]  $]  $]  ]"  k(&B]  iF  4G  4G  OU  Oj  +k  +k  +k  $k  [(&:U`u+v+v  E  Z  #[  #[  #[  [&  shfFa  mN  8O  8O  W]  Wr  /s  /s  /s  (s  aXV=Xc{.|.|  EK  E`  &a  &a  &a  a$  oHFD_  kJ  6K  6K  SY  Sn  -o  -o  -o  &o   g@[  gB  2C  2C  KQ  Kf  )g  )g  )g  "g#  m86C^  jH  5I  5I  QW  Ql  ,m  ,m  ,m  %m  aXV=Xc{.|.|  EK  E`  &a  &a  &a  a   g@[  gB  2C  2C  KQ  Kf  )g  )g  )g  "g  [(&:U`u+v+v  E  Z  #[  #[  #[  [  _HF<Wby-z-z  CI  C^  %_  %_  %_  _  exv?Ze  1A  1A  IO  Id  (e  (e  (e  !e  exv?Ze  1A  1A  IO  Id  (e  (e  (e  !e#  m86C^  jH  5I  5I  QW  Ql  ,m  ,m  ,m  %m  W8S^q)r)r  {A  {V  !W  !W  !W  W  [(&:U`u+v+v  E  Z  #[  #[  #[  [
 $+22g2UU[[]]H"HN (H#/H "'H"HN(8H%"HN"HN (H HM!*H&H (H  'H"HN HM#.H $0H! &3H"*<H'$0H!-BH* (H'6H$&H#.H +>H(",H!*H (H (H!*H):H& (H):H&%2H"(8H%",H%2H"&H!*H$0H!$0H!(8H%"HNHOMMOOOHHY''G)188G8DDJJLLH   +%-[$6+=H^__gmgyzzzz 	Q 	Q 	Q6+P[^_`[a[abbjp  kP  Q  Q  Q  Q  Q  Q  Q  Q  Q	Qs   Rp- )p- )p- 1)p- )p- )p- /)p- )p- )p- -)p- )p- )p- +)p- )p- ?)p- ))p- )p- =)p- ')p- )p- ;)p- %)p- )p- 9)p- #)p- )p- 7)p- !)p- )p- 5)p- )p- 	)p- 3)p- )p- H%p- -
q674q1+q61q6Nr   r   r   r   r  r  r	  s-        fQ fQ fQ fQ fQr   r  c                       e Zd Zd ZdS )bussinessForSalec                 @   	 t          |          }|r]t          j        |t          j        dg          }|d         }t
          j                            |                                          }nd}t          j                            |j
        d                                          }|r|j        j        }nd}|j        }|                    d          }	|                    d	          }
|                    d
          }|                    d          }|                    d          }|                    d          }|                    d          }|                    d          }|                    d          }|                    d          }|                    d          }|                    d          }|                    d          }|                    d          }|                    d          }|                    d          }|                    d          }|                    d          }|                    d          }|                    d          }|                    d          }|                    d          }|                    d          }|                    d          }|                    d          } |                    d           }!|                    d!          }"|                    d"          }#|                    d#          }$|                    d$          }%|                    d%          }&|                    d&          }'|                    d'          }(|                    d(          })|                    d)          }*|                    d*          }+|                    d+          },|                    d,          }-|                    d-          }.|                    d.          }/|                    d/          }0|                    d0          }1|                    d1          }2|                    d2          }3|                    d3          }4|                    d4          }5|                    d5          }6|                    d6          }7|                    d7          }8|                    d8          }9|                    d9          }:|	s(t          t           j        d:d;t           j        <          S |
s(t          t           j        d=d;t           j        <          S |s(t          t           j        d>d;t           j        <          S |s(t          t           j        d?d;t           j        <          S |s(t          t           j        d@d;t           j        <          S |s(t          t           j        dAd;t           j        <          S |s(t          t           j        dBd;t           j        <          S |s(t          t           j        dCd;t           j        <          S |s(t          t           j        dDd;t           j        <          S |s(t          t           j        dEd;t           j        <          S |s(t          t           j        dFd;t           j        <          S |s(t          t           j        dGd;t           j        <          S |s(t          t           j        dHd;t           j        <          S |s(t          t           j        dId;t           j        <          S |s(t          t           j        dJd;t           j        <          S |s(t          t           j        dEd;t           j        <          S |s(t          t           j        dKd;t           j        <          S |s(t          t           j        dFd;t           j        <          S |s(t          t           j        dLd;t           j        <          S |s(t          t           j        dMd;t           j        <          S |s(t          t           j        dNd;t           j        <          S |s(t          t           j        dOd;t           j        <          S |s(t          t           j        dPd;t           j        <          S |s(t          t           j        dQd;t           j        <          S | s(t          t           j        dRd;t           j        <          S |!s(t          t           j        dSd;t           j        <          S |"s(t          t           j        dTd;t           j        <          S |#s(t          t           j        dUd;t           j        <          S |$s(t          t           j        dVd;t           j        <          S |%s(t          t           j        dWd;t           j        <          S |&s(t          t           j        dXd;t           j        <          S |'s(t          t           j        dYd;t           j        <          S |(s(t          t           j        dZd;t           j        <          S |)s(t          t           j        d[d;t           j        <          S |*s(t          t           j        d\d;t           j        <          S |+s(t          t           j        d]d;t           j        <          S |1s(t          t           j        d^d;t           j        <          S |2s(t          t           j        d_d;t           j        <          S |3s(t          t           j        d`d;t           j        <          S |4s(t          t           j        dad;t           j        <          S |:s(t          t           j        dbd;t           j        <          S t%          j        j        dti dc|d|	d	|
d
|d9|:d|d|d|d|d|d|d|d|d|d|d|d|d|d|d|d|d|d|d|d|d| d |!d!|"d"|#d#|$d$|%d%|&d&|'d'|(d(|)d)|*d*|+d+|,d,|-d-|.ddt(          j                                        de|d/|0d0|1d1|2d2|3d3|4d4|5d5|6d6|7d7|8d8|9dfdgdhdi};dj|;j
        i}<|                    dk          }=t,          j                            |=l                                          }>|>r'dm|>_        |;j
        |>_        |>                                 t2          j                            dn|j        z   doz   |j        z   ddpq           t          t           j        dr|<dst           j        <          S # t:          $ r?}?t          t           j        t?          |?          d;t           j        <          cY d }?~?S d }?~?ww xY w)uNr6  r7  r"  r   r   Trc   r[  r:  r;  r,   r  total_turnoverrentestablished_yearpremisesyears_of_workoperation_conceptoperation_opening_hoursturnover_last_yearsalary_percentageother_operating_costcostreason_for_salewebsite_linknumber_of_employesareaterm_of_leasedocumentdetailsservice
operationsmarket_initativesadvantage_and_oppurtunity	valuation
owner_namephonerK  r/   re   public_orderavaiable_attachmentrJ  r2   r3   r   turnoverr9   r;   r7   r=  r_  r  shareholder_nameshareholder_shareshareholder_descriptionr]  rs  rR  r   image_data  is requiredrw  company_name is requiredr  ztotal_turnover is requiredzrent hours is requiredestablished_year is requiredyears_of_work  is requiredoperation_concept is requiredreason_for_sale is required$operation_opening_hours  is requiredturnover_last_year is requiredsalary_percentage is required other_operating_cost is requiredcost is requiredwebsite_link is requirednumber_of_employes is requiredarea is requiredrent is requiredterm_of_lease is requireddetails is requiredservice is requiredoperations is requiredmarket_initatives is required%advantage_and_oppurtunity is requiredvaluation is requiredowner_name is requiredzphone is requiredtelephone is requiredr?   r   public_order is requiredavaiable_attachment is requiredr|  r}  r~  r  zvideos_thumbnail is requiredr  r   r  r   r   r  r  r   r  r   r  z/A new bussiness for sale has been added by the rH   bussiness_salerJ   z4A new bussiness for sale has been Added successfullyr  r   ) r   r(  r)  r   r*  r{   rv   rw   rx   r   r   r]   r  rp   rq   r   r   rr   BussinessForSaler|   r
   r   r"  r   r   r}   rE   rF   r   r   r   r   )@r   r   r+  r,  r"  r   r  r  rp   r[  r:  r;  r,   r  r  r  r  r  r  r   r!  r"  r#  r$  r%  r&  r'  r(  r)  r*  r+  r,  r-  r.  r/  r0  r1  r2  r3  rK  r/   re   r4  r5  rJ  r2   r3   r   r6  r9   r;   r7   r=  r_  r  r7  r8  r9  r]  bussine_saler   r  r  r   s@                                                                   r   r   zbussinessForSale.post
  st   ~	Q,W55E *UH,?G9UUU!),$,333AAGGII-5<<cg<hhnnppH '%-]%<!!%&!<D((=11K,//JXXh''F88N33L((=11K!XX&677N88F##D"hh'9::hhz**H HH_55M#xx(;<<%)XX.G%H%H# $)= > >#xx(;<<#'88,B#C#C 88F##D"hh'899O((>22L $)= > >((6""D((6""D88O44Mhhz**HXXi((Ghhy))G,//J $)< = =(,1L(M(M%--I((<00JXXg&&E+..IXXg&&Exx	**G HH^44L#'88,A#B#B,,H,,H+..I+..I,,Hxx	**GXXg&&EHHV$$D88M22K,,HXXg&&E $); < <!%*=!>!>'+xx0I'J'J# $); < <   chf>Yd}/~/~  GM  Gb  'c  'c  'c   c  bXV=Xc|.}.}  FL  Fa  &b  &b  &b  b  Y9T_s*t*t  }C  }X  "Y  "Y  "Y  Y  exv?Ze  1A  1A  IO  Id  (e  (e  (e  !e  chf>Yd}/~/~  GM  Gb  'c  'c  'c   c!  iA\  hD  3E  3E  MS  Mh  *i  *i  *i  #i  [xv7R]u(v(v  E  Z   [   [   [  [#  m86C^  jH  5I  5I  QW  Ql  ,m  ,m  ,m  %m  c86;Va},~,~  GM  Gb  $c  $c  $c  c   k@[  gF  2G  2G  OU  Oj  )k  )k  )k  "k$  mHFD_  kH  6I  6I  QW  Ql  -m  -m  -m  &m*  |(&Je  qW  <X  <X  `f  `{  3|  3|  3|  ,|%  qXVE`  lL  7M  7M  U[  Up  .q  .q  .q  'q$  oHFD_  kJ  6K  6K  SY  Sn  -o  -o  -o  &o'  uxvGb  nP  9Q  9Q  Y_  Yt  0u  0u  0u  )u$  oHFD_  kJ  6K  6K  SY  Sn  -o  -o  -o  &o  Uxv7R]o(p(px~  yT   U   U   U  U"  k(&B]  iF  4G  4G  OU  Oj  +k  +k  +k  $k  exv?Ze  1A  1A  IO  Id  (e  (e  (e  !e%  qXVE`  lL  7M  7M  U[  Up  .q  .q  .q  'q  Uxv7R]o(p(px~  yT   U   U   U  U  Uxv7R]o(p(px~  yT   U   U   U  U   g@[  gB  2C  2C  KQ  Kf  )g  )g  )g  "g  [(&:U`u+v+v  E  Z  #[  #[  #[  [  [(&:U`u+v+v  E  Z  #[  #[  #[  [  aXV=Xc{.|.|  EK  E`  &a  &a  &a  a$  oHFD_  kJ  6K  6K  SY  Sn  -o  -o  -o  &o,  HFLg  sZ  >[  >[  ci  c~  5  5  5  .  _HF<Wby-z-z  CI  C^  %_  %_  %_  _  aXV=Xc{.|.|  EK  E`  &a  &a  &a  a  W8S^q)r)r  {A  {V  !W  !W  !W  W  _HF<Wby-z-z  CI  C^  %_  %_  %_  _  W8S^q)r)r  {A  {V  !W  !W  !W  W  [(&:U`u+v+v  E  Z  #[  #[  #[  [  exv?Ze  1A  1A  IO  Id  (e  (e  (e  !e&  shfFa  mN  8O  8O  W]  Wr  /s  /s  /s  (s  [(&:U`u+v+v  E  Z  #[  #[  #[  [  W8S^q)r)r  {A  {V  !W  !W  !W  W  Uxv7R]o(p(px~  yT   U   U   U  U  chf>Yd}/~/~  GM  Gb  'c  'c  'c   c#  m86C^  jH  5I  5I  QW  Ql  ,m  ,m  ,m  %m
 ,3: 9 9 9*{9 +9  *z9 "6	9
 &6%59 ".9 !,9 $2>9 9 &6%59 &X9 #0-9 '8&79 -D,C9 (:'99  '8&7!9" *>)=#9$ %9& %4O'9( ".)9* (:'9+9, -9. #0-/90 &X192 $G394 $G596  *z798 '8&799: /H.G;9< (i=9>  *z?9@  %A9B (iC9D  %E9F $GG9H ".I9J )<(;K9L &XM9N &XO9P (iQ9R  (044666S9T '8&7U9V &XW9X $GY9Z  %[9\ ]9^ !,_9` &Xa9b  %c9d &6%5e9f '8&7g9h -D,Ci9l Qm9n )[o9Lv \_G HHY''G)188G8DDJJLLH   +%1_$&--7hiti~7~  @B  8B  DO  DX  8X  bf  yI-  J  J  J6+=H~  GN  O  O  W]  Wi  j  j  j  j 	Q 	Q 	Q6+P[^_`[a[abbjp  kP  Q  Q  Q  Q  Q  Q  Q  Q  Q	Qs  Tu )u )u /)u )u )u -)u )u )u +)u )u ?)u ))u )u =)u ')u )u ;)u %)u )u 9)u #)u )u 7)u !)u )u 5)u )u 	)u 3)u )u )u 1)u )u )u /)u )u )u -)u )u )u +F(u 
v4vvvNr   r   r   r   r  r  
  s-        Q Q Q Q Qr   r  c                       e Zd Zd ZdS )editBussinessForSalec                    	 t          |          }|r]t          j        |t          j        dg          }|d         }t
          j                            |                                          }nd}t          j                            |j
        d                                          }|r|j        j        }nd}|                    d          }	|	s(t          t          j        d	d
t          j                  S |j        }t$          j                            |	                                          }
|                    d          }|                    d          }|                    d          }|                    d          }|                    d          }|                    d          }|                    d          }|                    d          }|                    d          }|                    d          }|                    d          }|                    d          }|                    d          }|                    d          }|                    d          }|                    d          }|                    d          }|                    d          }|                    d          }|                    d           }|                    d!          }|                    d          }|                    d"          } |                    d#          }!|                    d$          }"|                    d%          }#|                    d&          }$|                    d'          }%|                    d(          }&|                    d)          }'|                    d*          }(|                    d+          })|                    d,          }*|                    d-          }+|                    d.          },|                    d/          }-|                    d0          }.|                    d1          }/|                    d2          }0|                    d3          }1|                    d4          }2|                    d5          }3|                    d6          }4|                    d7          }5|s(t          t          j        d8d
t          j                  S |s(t          t          j        d9d
t          j                  S |s(t          t          j        d:d
t          j                  S |s(t          t          j        d;d
t          j                  S |s(t          t          j        d<d
t          j                  S |s(t          t          j        d=d
t          j                  S |s(t          t          j        d>d
t          j                  S |s(t          t          j        d?d
t          j                  S |s(t          t          j        d@d
t          j                  S |s(t          t          j        dAd
t          j                  S |s(t          t          j        dBd
t          j                  S |s(t          t          j        dCd
t          j                  S |s(t          t          j        dDd
t          j                  S |s(t          t          j        dEd
t          j                  S |s(t          t          j        d@d
t          j                  S |s(t          t          j        dFd
t          j                  S |s(t          t          j        dAd
t          j                  S |s(t          t          j        dGd
t          j                  S |s(t          t          j        dHd
t          j                  S |s(t          t          j        dId
t          j                  S |s(t          t          j        dJd
t          j                  S | s(t          t          j        dKd
t          j                  S |"s(t          t          j        dLd
t          j                  S |#s(t          t          j        dMd
t          j                  S |$s(t          t          j        dNd
t          j                  S |%s(t          t          j        dOd
t          j                  S |&s(t          t          j        dPd
t          j                  S |'s(t          t          j        dQd
t          j                  S |(s(t          t          j        dRd
t          j                  S |)s(t          t          j        dSd
t          j                  S |*s(t          t          j        dTd
t          j                  S |+s(t          t          j        dUd
t          j                  S |,s(t          t          j        dVd
t          j                  S |-s(t          t          j        dWd
t          j                  S |.s(t          t          j        dXd
t          j                  S ||
_        ||
_        ||
_        ||
_        ||
_        ||
_        ||
_        ||
_        ||
_        ||
_        ||
_        ||
_        ||
_        ||
_         ||
_!        ||
_"        ||
_#        ||
_$        ||
_%        ||
_&        ||
_'        ||
_        | |
_(        |!|
_)        |"|
_*        |#|
_+        |$|
_,        |%|
_-        |&|
_.        |'|
_/        |(|
_0        |)|
_1        |*|
_2        |+|
_3        |,|
_4        |-|
_5        |.|
_6        |/|
_7        |0|
_8        |1|
_9        |0|
_8        |1|
_9        tt          j:        ;                                |
_<        ||
_=        dY|
_        |3|
_>        |4|
_?        |5|
_@        |
A                                 |                    dZ          }6t          j                            |6                                          }7|7r'd[|7_        |
j
        |7_C        |7A                                 t          t          jD        d\d
t          jD                  S # t          $ r?}8t          t          jF        t          |8          d
t          jF                  cY d }8~8S d }8~8ww xY w)]Nr6  r7  r"  r   r   Trc   r   r   rR  r   r   r[  r:  r;  r]  r,   r  r  r  r  r  r  r   r!  r"  r#  r$  r%  r&  r'  r(  r)  r*  r+  r,  r-  r.  r/  r0  r1  r2  r3  rK  r/   re   r4  r5  rJ  r2   r3   r   r7  r8  r9  rs  r:  rw  r;  r  z$rentdatetime.now() hours is requiredr<  r=  r>  r?  r@  rA  rB  rC  rD  rE  rF  rG  rH  rI  rJ  rK  rL  rM  rN  rO  rP  rQ  zowner_mobile_number is requiredr?   r   rR  rS  r   r  r  z%Business for sale edited successfully)Hr   r(  r)  r   r*  r{   rv   rw   rx   r   r   r]   r  rq   r   r   rr   rp   rU  r[  r:  r;  r]  r,   r  r  r  r  r  r  r   r!  r"  r#  r$  r%  r&  r'  r(  r)  r*  r+  r,  r-  r.  r/  r0  r1  r2  r3  rK  r/   re   r4  r5  rJ  r2   r3   r
   r   r   r  r7  r8  r9  r   r"  r   r   r   r   r   )9r   r   r+  r,  r"  r   r  r  rp   r   businessSaler[  r:  r;  r]  r,   r  r  r  r  r  r  r   r!  r"  r#  r$  r%  r&  r'  r(  r)  r*  r+  r,  r-  r.  r/  r0  r1  r2  r3  rK  r/   re   r4  r5  rJ  r2   r3   r   r7  r8  r9  r  r  r   s9                                                            r   r   zeditBussinessForSale.post
  s-   ]	Q,W55E *UH,?G9UUU!),$,333AAGGII-5<<cg<hhnnppH '%-]%<!!%&!((=11K  chf>Yd}/~/~  GM  Gb  'c  'c  'c   c<D+3::k:JJPPRRL((=11K,//JXXh''F#xx(:;;88N33L((=11K!XX&677N88F##D"hh'9::hhz**H HH_55M#xx(;<<%)XX.G%H%H# $)= > >#xx(;<<#'88,B#C#C 88F##D"hh'899O((>22L $)= > >((6""D((6""D88O44Mhhz**HXXi((Ghhy))G,//J $)< = =(,1L(M(M%--I((<00JXXg&&E+..IXXg&&Exx	**G HH^44L#'88,A#B#B,,H,,H+..I+..I $); < <!%*=!>!>'+xx0I'J'J#  chf>Yd}/~/~  GM  Gb  'c  'c  'c   c  bXV=Xc|.}.}  FL  Fa  &b  &b  &b  b  Y9T_s*t*t  }C  }X  "Y  "Y  "Y  Y  exv?Ze  1A  1A  IO  Id  (e  (e  (e  !e  chf>Yd}/~/~  GM  Gb  'c  'c  'c   c  ixv7R  ^D  )E  )E  MS  Mh   i   i   i  i#  m86C^  jH  5I  5I  QW  Ql  ,m  ,m  ,m  %m  c86;Va},~,~  GM  Gb  $c  $c  $c  c   k@[  gF  2G  2G  OU  Oj  )k  )k  )k  "k$  mHFD_  kH  6I  6I  QW  Ql  -m  -m  -m  &m*  |(&Je  qW  <X  <X  `f  `{  3|  3|  3|  ,|%  qXVE`  lL  7M  7M  U[  Up  .q  .q  .q  'q$  oHFD_  kJ  6K  6K  SY  Sn  -o  -o  -o  &o'  uxvGb  nP  9Q  9Q  Y_  Yt  0u  0u  0u  )u$  oHFD_  kJ  6K  6K  SY  Sn  -o  -o  -o  &o  Uxv7R]o(p(px~  yT   U   U   U  U"  k(&B]  iF  4G  4G  OU  Oj  +k  +k  +k  $k  exv?Ze  1A  1A  IO  Id  (e  (e  (e  !e%  qXVE`  lL  7M  7M  U[  Up  .q  .q  .q  'q  Uxv7R]o(p(px~  yT   U   U   U  U  Uxv7R]o(p(px~  yT   U   U   U  U   g@[  gB  2C  2C  KQ  Kf  )g  )g  )g  "g  [(&:U`u+v+v  E  Z  #[  #[  #[  [  [(&:U`u+v+v  E  Z  #[  #[  #[  [  aXV=Xc{.|.|  EK  E`  &a  &a  &a  a$  oHFD_  kJ  6K  6K  SY  Sn  -o  -o  -o  &o,  HFLg  sZ  >[  >[  ci  c~  5  5  5  .  _HF<Wby-z-z  CI  C^  %_  %_  %_  _  aXV=Xc{.|.|  EK  E`  &a  &a  &a  a  [8S^u)v)v  E  Z  ![  ![  ![  [  iHF<W  cD  .E  .E  MS  Mh  %i  %i  %i  i  W8S^q)r)r  {A  {V  !W  !W  !W  W  [(&:U`u+v+v  E  Z  #[  #[  #[  [  exv?Ze  1A  1A  IO  Id  (e  (e  (e  !e&  shfFa  mN  8O  8O  W]  Wr  /s  /s  /s  (s (3L$&0L#"(L,<L)(4L%'2L$*8L' $L,<L)$,L!)6L&->L*3JL0.@L+->L*0DL- $L+:L((4L%.@L+ $L $L)6L&$,L!#*L #*L &0L#->L*5NL2%.L"&0L#!&L%.L"!&L#*L (4L%/BL,$,L!$,L!%.L"$,L!%.L"&.&7&;&;&=&=L#->L*"#L,<L)->L*3JL0HHY''G)188G8DDJJLLH   +%1_$6+=Hoppx~  yK  L  L  L  L 	Q 	Q 	Q6+P[^_`[a[abbjp  kP  Q  Q  Q  Q  Q  Q  Q  Q  Q	Qs   C7r% :O>r% 9)r% #)r% )r% 7)r% !)r% )r% 5)r% )r% 	)r% 3)r% )r% )r% 1)r% )r% )r% /)r% )r% )r% -)r% )r% )r% +)r% )r% ?)r% ))r% )r% =)r% ')r% )r% ;)r% %)r% )r% 9)r% #)r% Hr% %
s./4s)#s.)s.Nr   r   r   r   rX  rX  
  s-        ^Q ^Q ^Q ^Q ^Qr   rX  c                       e Zd Zd ZdS )addCompanySeekingEquityc                    	 	 t          |          }nL# t          $ r?}t          t          j        t          |          dt          j                  cY d }~S d }~ww xY w|j        }t          j        	                    |          
                                }t          j        	                    |j        d          
                                }|r|j        j        }nd}|j        dk    r(t          t          j        ddt          j                  S |                    d          }|                    d	          }	|                    d
          }
|                    d          }|                    d          }|                    d          }|                    d          }|                    d          }|                    d          }|                    d          }|                    d          }|                    d          }|                    d          }|                    d          }|                    d          }|                    d          }|                    d          }|                    d          }|                    d          }|                    d          }|                    d          }|                    d          }|                    d          }|                    d          }|                    d           } |                    d!          }!|                    d"          }"|                    d#          }#|                    d$          }$|                    d%          }%|                    d&          }&|                    d'          }'|                    d(          }(|                    d)          })|                    d*          }*|                    d+          }+|                    d,          },|                    d-          }-|                    d.          }.|                    d/          }/|                    d0          }0|                    d1          }1|                    d2          }2|                    d3          }3|                    d4          }4|                    d5          }5|                    d6          }6|                    d7          }7t%          j        j        dHi d8|d|d	|	d
|
d|d|d|d|d|d|d|d|d|d|d|d|d|d|d|d|d|d|d|d|d|d | d!|!d"|"d#|#d$|$d%|%d&|&d'|'d(|(d)|)d*|*d+|+d,|,d-|-d.|.d/|/d0|0d1|1d2|2d3|3d4|4d5|5d6|6d7|7d9|d:d;d<d=}8|8                                 d>|8j        i}9|                    d?          }:|xj        d;z  c_        |                                 t*          j        	                    |:@          
                                };|;r'dA|;_        |8j        |;_        |;                                 t.          j                            dB|j        z   dCz   |j        z   ddDE           t          t          j        dF|9dGt          j                  S # t          $ r?}t          t          j        t          |          dt          j                  cY d }~S d }~ww xY w)INrR  r   r   Trc   r   rV  r[  r  about_the_ownerr,   r	  r
  r]  company_logomaximum_drawingminimum_drawingshare_for_saleprice_per_sharenumber_of_shareself_reportnominal_share_pricee_postissue_account_numbershare_before_sharename_of_shareholderbeskrivelseestablish_yearpremises_frombackground_for_salecompany_websitenumber_of_employeecompany_emailcompany_telephoneyoutubeupload_team_dataupload_team_sizeupload_team_nameupload_board_dataupload_board_nameupload_board_sizeupload_partner_dataupload_partner_nameupload_partner_sizerJ  r9   r;   r7   zip_coder_  share_holder_imageenter_sharesr2   r3   rn  r  r  r   r   r  r  r   r  r   r  7A new company seeking for equity has been added by the rH   r  rJ   r  r  r   )r   r   r   r   r   r   rp   r{   rv   rw   rx   r   r   r]   r  r  rr   rq   CompanySeekingEquityr|   r   r"  r   r}   rE   rF   r   r   )<r   r   r   r   rp   r   r  r  r[  r  r^  r,   r	  r
  r]  r_  r`  ra  rb  rc  rd  re  rf  rg  rh  ri  rj  rk  rl  rm  rn  ro  rp  rq  rr  rs  rt  ru  rv  rw  rx  ry  rz  r{  r|  rJ  r9   r;   r7   r}  r_  r~  r  r2   r3   rn  r  r   r  r  s<                                                               r   r   zaddCompanySeekingEquity.post  s;	   T	QE#G,, E E Ev/KWZ[\W]W] ^ ^gm  hD  E  E  E  E  E  E  E  E  EE<D (//S/99??AAK-5<<cg<hhnnppH '%-]%<!!%&!1144v/J  VD  !E  !E  MS  Mh  i  i  i  i((=11K((=11K"hh'899O88N33L!XX&677N!XX&677N#xx(:;;88N33L"hh'899O"hh'899O!XX&677N"hh'899O"hh'899O((=11K"&((+@"A"AXXh''F#'88,B#C#C !%*>!?!?"&((+@"A"A((=11K!XX&677N HH_55M"&((+@"A"A"hh'899O!%*>!?!? HH_55M $)< = =hhy))G#xx(:;;#xx(:;;#xx(:;; !%)< = = $)< = = $)< = = #'((+@"A"A"&((+@"A"A"&((+@"A"Axx
++Hhhy))GHHW%%E88F##Dxx
++Hxx
++H!%*>!?!?88N33Lxx
++H--Ixx
++H ,3: 5 5 5&;5'K5 (K5 !0	5
 *\5  .~5  .~5 "2!15 *\5 !05 !05  .~5 !05 !05 (K5  %8$7!5" v#5$ &:%9%5& $6#5'5( %8$7)5* (K+5,  .~-5. ,m/50 %8$7152 !0354 $6#5556 ,m758 #4"395:  ;5< "2!1=5> "2!1?5@ "2!1A5B #4"3C5D #4"3E5F #4"3G5H %8$7I5J %8$7K5L %8$7M5N "O5P  Q5R eS5T TU5V "W5X "Y5Z $6#5[5\ *\]5^ "_5` $)a5b "c5d #4"3e5f g5h %i5Hr MMOOOX[G HHY''G..1..)188G8DDJJLLH   +%-[$&--7pq|  rG  8G  HJ  8J  LW  L`  8`  jn  AP-  Q  Q  Q6+=H\dklltz  uG  H  H  H  H 	Q 	Q 	Q6+P[^_`[a[abbjp  kP  Q  Q  Q  Q  Q  Q  Q  Q  Q	QsK    [ 
A4AA[ AB7[ V.[ 
\4\\\Nr   r   r   r   r\  r\    s-        UQ UQ UQ UQ UQr   r\  c                       e Zd Zd ZdS )updateCompanySeekingEquityc                 *   	 	 t          |          }nL# t          $ r?}t          t          j        t          |          dt          j                  cY d }~S d }~ww xY w|j        }t          j        	                    |          
                                }t          j        	                    |j        d          
                                }|                    d          }|                    d          }|                    d          }	|                    d	          }
|                    d
          }|                    d          }|                    d          }|                    d          }|                    d          }|                    d          }|                    d          }|                    d          }|                    d          }|                    d          }|                    d          }|                    d          }|                    d          }|                    d          }|                    d          }|                    d          }|                    d          }|                    d          }|                    d          }|                    d          }|                    d          }|                    d          } |                    d           }!|                    d!          }"|                    d"          }#|                    d#          }$|                    d$          }%|                    d%          }&|                    d&          }'|                    d'          }(|                    d(          })|                    d)          }*|                    d*          }+|                    d+          },|                    d,          }-|                    d-          }.|                    d.          }/|                    d/          }0|                    d0          }1|                    d1          }2|                    d2          }3|                    d3          }4|                    d4          }5|                    d5          }6|                    d6          }7t          j        	                    |7          
                                }8||8_        |	|8_        |
|8_        ||8_        ||8_        ||8_        ||8_        ||8_        ||8_        ||8_        ||8_        ||8_        ||8_        ||8_        ||8_        ||8_        ||8_        ||8_         ||8_!        ||8_"        ||8_#        ||8_$        ||8_%        ||8_&        | |8_'        |!|8_(        |"|8_)        |#|8_*        |$|8_+        |%|8_,        |&|8_-        |'|8_.        |(|8_/        |)|8_0        |*|8_1        |+|8_2        |,|8_3        |-|8_4        |.|8_5        |/|8_6        |0|8_7        |1|8_8        |2|8_9        |3|8_:        |4|8_;        |5|8_<        |6|8_=        |7|8_>        d8|8_        |8?                                 d9|8j        i}9|                    d:          }:t          j        	                    |:7          
                                };|;r'd;|;_        |8j        |;_A        |;?                                 t          j        C                    d<|jD        z   d=z   |jE        z   dd>?           t          t          jF        d@|9dAt          jF                  S # t          $ r?}t          t          jG        t          |          dt          jG                  cY d }~S d }~ww xY w)BNrR  r   r   Trc   r   r[  r  r^  r,   r	  r
  r]  r_  r`  ra  rb  rc  rd  re  rf  rg  rh  ri  rj  rk  rl  rm  rn  ro  rp  rq  rr  rs  rt  ru  rv  rw  rx  ry  rz  r{  r|  rJ  r9   r;   r7   r}  r_  r~  r  r2   r3   rn  r   r   r   r  r  r  rH   r  rJ   r  r  )Hr   r   r   r   r   r   rp   r{   rv   rw   rx   r   r   rq   r  r[  r  r^  r,   r	  r
  r]  r_  r`  ra  rb  rc  rd  re  rf  rg  rh  ri  rj  rk  rl  rm  rn  ro  rp  rq  rr  rs  rt  ru  rv  rw  rx  ry  rz  r{  r|  rJ  r9   r;   r7   r}  r_  r~  r  r2   r3   rn  r   r"  r   r}   r|   rE   rF   r   r   )<r   r   r   r   rp   r   r  r   r[  r  r^  r,   r	  r
  r]  r_  r`  ra  rb  rc  rd  re  rf  rg  rh  ri  rj  rk  rl  rm  rn  ro  rp  rq  rr  rs  rt  ru  rv  rw  rx  ry  rz  r{  r|  rJ  r9   r;   r7   r}  r_  r~  r  r2   r3   rn  r  r   r  r  s<                                                               r   r   zupdateCompanySeekingEquity.post  s   S	QE#G,, E E Ev/KWZ[\W]W] ^ ^gm  hD  E  E  E  E  E  E  E  E  EE<D (//S/99??AAK-5<<cg<hhnnppH((=11K((=11K((=11K"hh'899O88N33L!XX&677N!XX&677N#xx(:;;88N33L"hh'899O"hh'899O!XX&677N"hh'899O"hh'899O((=11K"&((+@"A"AXXh''F#'88,B#C#C !%*>!?!?"&((+@"A"A((=11K!XX&677N HH_55M"&((+@"A"A"hh'899O!%*>!?!? HH_55M $)< = =hhy))G#xx(:;;#xx(:;;#xx(:;; !%)< = = $)< = = $)< = = #'((+@"A"A"&((+@"A"A"&((+@"A"Axx
++Hhhy))GHHW%%E88F##Dxx
++Hxx
++H!%*>!?!?88N33Lxx
++H--Ixx
++H ,3::k:JJPPRRH#.H #.H '6H$$0H!&4H#&4H#(8H%$0H!'6H$'6H$&4H#'6H$'6H$#.H +>H( %HO,@H)*<H'+>H(#.H &4H#%2H"+>H('6H$*<H'%2H"):H&&H(8H%(8H%(8H% *;H&):H&):H&+>H(+>H(+>H( (H&H"HN HM
 !)H (H*<H'$0H! (H!*H (HHOMMOOO X[G HHY''G)188G8DDJJLLH   +%-[$&--7pq|  rG  8G  HJ  8J  LW  L`  8`  jn  AP-  Q  Q  Q6+=H^fmnnv|  wI  J  J  J  J 	Q 	Q 	Q6+P[^_`[a[abbjp  kP  Q  Q  Q  Q  Q  Q  Q  Q  Q	QsD    ]	 
A4AA]	 A[,]	 	
^4^^^Nr   r   r   r   r  r    s-        TQ TQ TQ TQ TQr   r  c                       e Zd Zd ZdS )addPropertyDevelopersc                 x   	 t          |          }|r]t          j        |t          j        dg          }|d         }t
          j                            |                                          }nd}t          j                            |j
        d                                          }|r|j        j        }nd}|j        dk    r(t          t          j        dd	t          j        
          S |j        }|                    d          }	|                    d          }
|                    d          }|                    d          }|                    d          }|                    d          }|                    d          }|                    d          }|                    d          }|                    d          }|                    d          }|                    d          }|                    d          }|                    d          }|                    d          }|                    d          }|                    d          }|                    d          }|                    d          }|                    d          }|                    d          }|                    d           }|                    d!          }|                    d"          } |                    d#          }!|                    d$          }"|                    d%          }#|                    d&          }$|                    d'          }%|                    d(          }&|                    d)          }'|                    d*          }(|                    d+          })|                    d,          }*|                    d-          }+|                    d.          },|                    d/          }-|                    d0          }.|                    d1          }/|                    d2          }0|                    d3          }1|                    d4          }2|                    d5          }3|                    d6          }4|                    d7          }5|                    d8          }6|                    d9          }7|                    d:          }8|                    d;          }9|                    d<          }:|                    d=          };|                    d>          }<|                    d?          }=|                    d@          }>|                    dA          }?|                    dB          }@|                    dC          }A|                    dD          }B|                    dE          }C|                    dF          }D|                    dG          }E|                    dH          }F|                    dI          }G|                    dJ          }H|                    dK          }I|                    dL          }J|                    dM          }K|                    dN          }L|                    dO          }M|                    dP          }N|                    dQ          }O|                    dR          }P|                    dS          }Q|                    dT          }R|                    dU          }S|                    dV          }T|                    dW          }U|                    dX          }V|                    dW          }U|                    dY          }W|                    dZ          }Xt'          j        j        dgi d[|dZ|Xd|	d|
d|d|d|d|d|d|d|d|d|d|d|d|d|d|d|d|d|d|d|d |d!|d"| d#|!d$|"d%|#d&|$d'|%d(|&d)|'d*|(d+|)d,|*d-|+d.|,d/|-d0|.d1|/d2|0d3|1d4|2d5|3d6|4d7|5d8|6d9|7d:|8d;|9d<|:d=|;d>|<d?|=d@|>dA|?dB|@dC|AdD|BdE|CdF|DdG|EdH|FdI|GdJ|HdK|IdL|JdM|KdN|LdO|MdP|NdQ|OdR|PdS|QdT|RdU|SdV|TdW|UdX|VdY|Wd\|d]d^d_d`}Yda|Yj
        i}Z|                    db          }[|xj        d^z  c_        |                                 t,          j                            |[c                                          }\|\r'dd|\_        |Yj
        |\_        |\                                 t          t          j        de|Zdft          j        
          S # t2          $ r?}]t          t          j        t7          |]          d	t          j        
          cY d }]~]S d }]~]ww xY w)hNr6  r7  r"  r   r   Trc   rV  rR  r   r	  r;  r]  r+  r   assest_equalityinvestment_highlightequity_pricelp_equity_percentgp_equity_percentdebt_percentr[  r  bussiness_planminimum_investmentinvestment_strategyexpected_periodfinancedtarget_return_on_cost
target_irr
offered_byestimated_first_distributiontype_of_investmentr   measure_of_multiplierr:   minimum_goalrf  the_valuationra  no_of_drawingsrb  remaining_sharer`  short_description
why_investproblem_to_be_solvedour_solutionstart_date_dataend_date_datard  price_of_shareissue_minimum_investmentissue_maximum_investmentvalue_before_issueraised_capital_minimum_limitraised_capital_maximum_limit#share_of_company_sold_minimum_limit#share_of_company_sold_maximum_limitre  discussion_descriptionnew_exisiting_detailsdrawing_on_behalf
foundationfoundation_namesatutessatutes_nameannual_accountannual_account_namer1  valuation_nameagreement_on_coagreement_on_co_nameconversion_of_debtconversion_of_debt_namebalance_sheetbalance_sheet_nameresult_reportresult_report_namer9   r;   r7   r=  r_  r4   rJ  r2   r3   rn  r  r  r  r   r   r  r  r   r  r   r  r  r  r   )r   r(  r)  r   r*  r{   rv   rw   rx   r   r   r]   r  r  r   r   rr   rp   rq   PropertyDevelopersr|   r   r"  r   r   r   r   r   )^r   r   r+  r,  r"  r   r  r  rp   r	  r;  r]  r+  r   r  r  r  r  r  r  r[  r  r  r  r  r  r  r  r  r  r  r  r   r  r:   r  rf  r  ra  r  rb  r  r`  r  r  r  r  r  r  rd  r  r  r  r  r  r  r  r  re  r  r  r  r  r  r  r  r  r  r1  r  r  r  r  r  r  r  r  r  r9   r;   r7   r=  r_  r4   rJ  r2   r3   rn  r  r  r   r  r  r   s^                                                                                                 r   r   zaddPropertyDevelopers.post  s   ]	Q,W55E *UH,?G9UUU!),$,333AAGGII-5<<cg<hhnnppH '%-]%<!!%&!1144v/J  VD  !E  !E  MS  Mh  i  i  i  i<D!XX&677NXXh''F#xx(:;;xx
++H HH_55M"hh'899O#'88,B#C#C 88N33L $)< = = $)< = =88N33L((=11K((=11K!XX&677N!%*>!?!?"&((+@"A"A"hh'899Oxx
++H$(HH-D$E$E!,//J,//J+/884R+S+S(!%*>!?!?88N33L$(HH-D$E$E!hhy))G88N33L"&((+@"A"A HH_55M"hh'899O "XX&677N!XX&677N"hh'899O #hh'899O $)< = =,//J#'88,B#C#C 88N33L"hh'899O HH_55M"hh'899O!XX&677N'+xx0J'K'K$'+xx0J'K'K$!%*>!?!?+/884R+S+S(+/884R+S+S(26((;`2a2a/26((;`2a2a/((=11K%)XX.F%G%G"$(HH-D$E$E! $)< = =,//J"hh'899Ohhy))G88N33L!XX&677N"&((+@"A"A--I!XX&677N"hh'899O#'88,B#C#C !%*>!?!?&*hh/H&I&I# HH_55M!%*>!?!? HH_55M!%*>!?!?hhy))GHHW%%E88F##D((=11Kxx
++H88N33Lxx
++Hxx
++H--Ixx
++Hxx
++H HH_55M *18 U U U&;U+mU  .~U v	U
 "2!1U "U ,mU !0U &:%9U *\U #4"3U #4"3U *\U (KU (KU   .~!U" $6#5#U$ %8$7%U& !0'U( ")U* '<&;+U, &:-U. &:/U0 .J-I1U2 $6#53U4 *\5U6 '<&;7U8  9U: *\;U< %8$7=U> ,m?U@ !0AUB  .~CUD  .~EUF !0GUH !0IUJ #4"3KUL &:MUN &:%9OUP *\QUR !0SUT ,mUUV !0WUX  .~YUZ *B)A[U\ *B)A]U^ $6#5_U` .J-IaUb .J-IcUd 5X4WeUf 5X4WgUh (KiUj (>'=kUl '<&;mUn #4"3oUp &:qUr !0sUt  uUv *\wUx  .~yUz %8$7{U| $)}U~  .~U@ !0AUB &:%9CUD $6#5EUF )@(?GUH ,mIUJ $6#5KUL ,mMUN $6#5OUP  QUR eSUT TUUV (KWUX "YUZ *\[U\ "]U^ "_U` $)aUb "cUd #4"3eUf qgUh %iUHp X[G HHY''G..1..)188G8DDJJLLH   +%-[$6+=H\dklltz  uG  H  H  H  H 	Q 	Q 	Q6+P[^_`[a[abbjp  kP  Q  Q  Q  Q  Q  Q  Q  Q  Q	Qs%   C+e0 .be0 0
f9:4f4.f94f9Nr   r   r   r   r  r    s-        ^Q ^Q ^Q ^Q ^Qr   r  c                       e Zd Zd ZdS )updatePropertyDevelopersc                    	 t          |          }|r]t          j        |t          j        dg          }|d         }t
          j                            |                                          }nd}|j	        }t          j                            |j        d                                          }|r|j        j        }nd}|                    d          }	|                    d	          }
|                    d
          }|                    d          }|                    d          }|                    d          }|                    d          }|                    d          }|                    d          }|                    d          }|                    d          }|                    d          }|                    d          }|                    d          }|                    d          }|                    d          }|                    d          }|                    d          }|                    d          }|                    d          }|                    d          }|                    d          }|                    d          }|                    d          } |                    d           }!|                    d!          }"|                    d"          }#|                    d#          }$|                    d$          }%|                    d%          }&|                    d&          }'|                    d'          }(|                    d(          })|                    d)          }*|                    d*          }+|                    d+          },|                    d,          }-|                    d-          }.|                    d.          }/|                    d/          }0|                    d0          }1|                    d1          }2|                    d2          }3|                    d3          }4|                    d4          }5|                    d5          }6|                    d6          }7|                    d7          }8|                    d8          }9|                    d9          }:|                    d:          };|                    d;          }<|                    d<          }=|                    d=          }>|                    d>          }?|                    d?          }@|                    d@          }A|                    dA          }B|                    dB          }C|                    dC          }D|                    dD          }E|                    dE          }F|                    dF          }G|                    dG          }H|                    dH          }I|                    dI          }J|                    dJ          }K|                    dK          }L|                    dL          }M|                    dM          }N|                    dN          }O|                    dO          }P|                    dP          }Q|                    dQ          }R|                    dR          }S|                    dS          }T|                    dT          }U|                    dU          }V|                    dV          }W|                    dU          }V|                    dW          }X|                    dX          }Yt          j                            |	Y                                          }Z|Y|Z_        |
|Z_        ||Z_        ||Z_        ||Z_        ||Z_        ||Z_        ||Z_        ||Z_        ||Z_        ||Z_        ||Z_        ||Z_        ||Z_        ||Z_        ||Z_        ||Z_         ||Z_!        ||Z_"        ||Z_#        ||Z_$        ||Z_%        ||Z_&        | |Z_'        |!|Z_(        |"|Z_)        |#|Z_*        |$|Z_+        |%|Z_,        |&|Z_-        |'|Z_.        |(|Z_/        |)|Z_0        |*|Z_1        |+|Z_2        |,|Z_3        |-|Z_4        |.|Z_5        |/|Z_6        |0|Z_7        |1|Z_8        |2|Z_9        |3|Z_:        |4|Z_;        |5|Z_<        |6|Z_=        |7|Z_>        |8|Z_?        |9|Z_@        |:|Z_A        |;|Z_B        |<|Z_C        |=|Z_D        |>|Z_E        |?|Z_F        |@|Z_G        |A|Z_H        |B|Z_I        |C|Z_J        |D|Z_K        |E|Z_L        |F|Z_M        |G|Z_N        |H|Z_O        |I|Z_P        |J|Z_Q        |K|Z_R        |L|Z_S        |M|Z_T        |N|Z_U        |O|Z_V        |P|Z_W        |Q|Z_X        |R|Z_Y        |S|Z_Z        |T|Z_[        |U|Z_\        |V|Z_]        |W|Z_^        |X|Z__        ||Z_`        dZ|Z_a        |Zb                                 d[|Zj        i}[|                    d\          }\t          j                            |\Y                                          }]|]r'd]|]_a        |Zj        |]_d        |]b                                 t          t          jf        d^|[d_t          jf        `          S # t          $ r?}^t          t          jh        t          |^          dat          jh        `          cY d }^~^S d }^~^ww xY w)bNr6  r7  r"  r   r   Trc   r   r	  r;  r]  r+  r   r  r  r  r  r  r  r[  r  r  r  r  r  r  r  r  r  r  r  r   r  r:   r  rf  r  ra  r  rb  r  r`  r  r  r  r  r  r  rd  r  r  r  r  r  r  r  r  re  r  r  r  r  r  r  r  r  r  r1  r  r  r  r  r  r  r  r  r  r9   r;   r7   r=  r_  r4   rJ  r2   r3   rn  r  r   r   r   r  r  r  r  r   rR  )jr   r(  r)  r   r*  r{   rv   rw   rx   rp   r   r   r]   r  rq   r  r  r	  r;  r]  r+  r   r  r  r  r  r  r  r[  r  r  r  r  r  r  r  r  r  r  r  r   r  r:   r  rf  r  ra  r  rb  r  r`  r  r  r  r  r  r  rd  r  r  r  r  r  r  r  r  re  r  r  r  r  r  r  r  r  r  r1  r  r  r  r  r  r  r  r  r  r9   r;   r7   r=  r_  r4   rJ  r2   r3   rn  r  r   r   r"  r   r   r   r   r   r   )_r   r   r+  r,  r"  r   rp   r  r  r   r	  r;  r]  r+  r   r  r  r  r  r  r  r[  r  r  r  r  r  r  r  r  r  r  r  r   r  r:   r  rf  r  ra  r  rb  r  r`  r  r  r  r  r  r  rd  r  r  r  r  r  r  r  r  re  r  r  r  r  r  r  r  r  r  r1  r  r  r  r  r  r  r  r  r  r9   r;   r7   r=  r_  r4   rJ  r2   r3   rn  r  r  r   r  r  r   s_                                                                                                  r   r   zupdatePropertyDevelopers.post  sa
   j	Q,W55E *UH,?G9UUU!),$,333AAGGII<D-5<<cg<hhnnppH '%-]%<!!%&!((=11K!XX&677NXXh''F#xx(:;;xx
++H HH_55M"hh'899O#'88,B#C#C 88N33L $)< = = $)< = =88N33L((=11K((=11K!XX&677N!%*>!?!?"&((+@"A"A"hh'899Oxx
++H$(HH-D$E$E!,//J,//J+/884R+S+S(!%*>!?!?88N33L$(HH-D$E$E!hhy))G88N33L"&((+@"A"A HH_55M"hh'899O "XX&677N!XX&677N"hh'899O #hh'899O $)< = =,//J#'88,B#C#C 88N33L"hh'899O HH_55M"hh'899O!XX&677N'+xx0J'K'K$'+xx0J'K'K$!%*>!?!?+/884R+S+S(+/884R+S+S(26((;`2a2a/26((;`2a2a/((=11K%)XX.F%G%G"$(HH-D$E$E! $)< = =,//J"hh'899Ohhy))G88N33L!XX&677N"&((+@"A"A--I!XX&677N"hh'899O#'88,B#C#C !%*>!?!?&*hh/H&I&I# HH_55M!%*>!?!? HH_55M!%*>!?!?hhy))GHHW%%E88F##D((=11Kxx
++H88N33Lxx
++Hxx
++H--Ixx
++Hxx
++H HH_55M *188[8IIOOQQH%2H"&4H#$HO(8H% (H%2H"'6H$,@H)$0H!):H&):H&$0H!#.H #.H &4H#*<H' ,?H('6H$ (H-BH*",H",H4PH1*<H'$0H!-BH*&H$0H!+>H(%2H"'6H$&4H# '5H#'6H$'6H$):H&",H,@H)$0H!'6H$%2H"'6H$
 '5H#0HH-0HH-*<H'4PH14PH1;^H8;^H8#.H .DH+-BH*):H&",H'6H$&H$0H!&4H#+>H(!*H&4H#'6H$,@H)*<H'/FH,%2H"*<H'%2H"*<H'&H"HN HM#.H  (H$0H! (H (H!*H (H):H&HOMMOOOX[G HHY''G)188G8DDJJLLH   +%-[$6+=H^fmnnv|  wI  J  J  J  J 	Q 	Q 	Q6+P[^_`[a[abbjp  kP  Q  Q  Q  Q  Q  Q  Q  Q  Q	Qs   jj" "
k+,4k& k+&k+Nr   r   r   r   r  r    s-        kQ kQ kQ kQ kQr   r  c                       e Zd Zd ZdS )houseWantedForRentc                    	 t          |          }|r]t          j        |t          j        dg          }|d         }t
          j                            |                                          }nd}|j	        }t          j                            |j        d                                          }|r|j        j        }nd}|                    d          }	|                    d	          }
|                    d
          }|                    d          }|                    d          }|                    d          }|                    d          }|                    d          }|                    d          }|                    d          }|                    d          }|                    d          }|                    d          }|                    d          }|                    d          }|                    d          }|                    d          }|                    d          }|                    d          }|                    d          }|                    d          }|                    d          }|                    d          }|                    d          } |                    d           }!|                    d!          }"|                    d"          }#|                    d#          }$|                    d$          }%|                    d%          }&|                    d&          }'|                    d'          }(|                    d(          })|                    d)          }*|                    d*          }+|                    d+          },|                    d,          }-|                    d-          }.|st          d.d/it           j        0          S |st          d.d1it           j        0          S |st          d.d2it           j        0          S |st          d.d3it           j        0          S |st          d.d4it           j        0          S |st          d.d5it           j        0          S |st          d.d6it           j        0          S |st          d.d7it           j        0          S |st          d.d8it           j        0          S |st          d.d9it           j        0          S |st          d.d:it           j        0          S |st          d.d;it           j        0          S |&st          d.d<it           j        0          S |(st          d.d=it           j        0          S |)st          d.d>it           j        0          S |*st          d.d?it           j        0          S |+st          d.d@it           j        0          S |,st          d.dAit           j        0          S |-st          d.dBit           j        0          S t%          j        j        dSi dC|d|	d	|
d
|d|d|d|d|d|d|d|d|d|d|d|d|d|d|d|d|d|d&|'d'|(d(|)d)|*d*|+d+|,d,|-dD|d|d|d|d| d |!d!|"d"|#d#|$d$|%d%|&d-|.dEddFdG}/dH|/j        i}0|                    dI          }1t(          j                            |1J                                          }2|2r'dK|2_        |/j        |2_        |2                                 t.          j                            dL|j        z   dMz   |j        z   ddNO           t          t           j        dP|0dQt           j        0          S # t6          $ r?}3t          t           j        t;          |3          dRt           j        0          cY d }3~3S d }3~3ww xY w)TNr6  r7  r"  r   r   Trc   r[  profile_visiblityprofile_hiddenr  r-   r.   genderdobnationalityr   r/   quantityr  max_rent	from_dater  number_of_peoplemax_month_pricedesired_start_datedesired_arear9   r;   r7   r=  r_  r  r  r2   r3   rJ  about	educationmartial_statuscleanlinessparty_habitsworkinterestrn  r<   r  r   r=   r>   gender is requireddob is requirednationality is requiredr   r?   r  r  number_of_people is requiredmax_month_price is requiredr  education is requiredmartial_status is requiredcleanliness is requiredparty_habits is requiredwork is requiredinterest is requiredr  r  r   r  r  r   r  r   r  z2A new house wanted for rent has been added by the rH   
house_rentrJ   r  r  rR  r   )r   r(  r)  r   r*  r{   rv   rw   rx   rp   r   r   r]   r  rq   r   r   rr   HouseWantedForRentr|   r"  r   r   r}   rE   rF   r   r   r   r   )4r   r   r+  r,  r"  r   rp   r  r  r[  r  r  r  r-   r.   r  r  r  r   r/   r  r  r  r  r  r  r  r  r  r9   r;   r7   r=  r_  r  r  r2   r3   rJ  r  r  r  r  r  r  r  rn  r  r   r  r  r   s4                                                       r   r   zhouseWantedForRent.post  s	   O	Q,W55E *UH,?G9UUU!),$,333AAGGII<D-5<<cg<hhnnppH '%-]%<!!%&! ((=11K $)< = =!XX&677NHHW%%E,//J--IXXh''F((5//C((=11K88N33LHHW%%Exx
++H HH_55Mxx
++H--I88N33L#xx(:;;"hh'899O!%*>!?!?88N33Lhhy))GHHW%%E88F##D((=11Kxx
++HHHW%%E((=11K xx
++H--Ixx
++HHHW%%E--I!XX&677N((=11K88N33L88F##Dxx
++Hxx
++H l)4G)HPVPk l l llvXy9Q.RZ`Zu%v%v%vvtHi8O-PX^Xs$t$t$ttn95I*JRXRm!n!n!nnhh	2C'DFLghhhhxh	:S/T\b\w&x&x&xxzx;U0V^d^y'z'z'z zl)4G)HPVPk l l ll |)<W1X`f`{(|(|(|!|zx;U0V^d^y'z'z'z z#  C8Y?]4^fl  gB  ,C  ,C  ,C  %C"  A(I>[3\djd  +A  +A  +A  $Ar8Y7M,NV\Vq#r#r#rrtHi8O-PX^Xs$t$t$tt!~9=Y2Zbhb})~)~)~"~xh	:S/T\b\w&x&x&xxzx;U0V^d^y'z'z'z zjx3E(FfNijjjjr8Y7M,NV\Vq#r#r#rr ,3: + + +&;+'K+ #4"3+  .~	+
 e+ &:+ $)+ v+ C+ (K+ *\+ e+ "+ ,m+ "+  $)!+" *\#+$ "2!1%+& !0'+( $6#5)+* *\++, e-+. $)/+0  .~1+2 (K3+4 *\5+6 T7+8 "9+: #4"3;+<  =+> e?+@ TA+B (KC+D "E+F eG+H (KI+J "K+L $)M+N "O+P "Q+R qS+T %U+J^ Z]G HHY''G)188G8DDJJLLH   +%/]$&--7klw  mB  8B  CE  8E  GR  G[  8[  ei  |H-  I  I  I6+=H\dklltz  uG  H  H  H  H 	Q 	Q 	Q6+P[^_`[a[abbjp  kP  Q  Q  Q  Q  Q  Q  Q  Q  Q	Qs   O<^ ?^ ^ =^ ^ ;^ ^ 9^ ^ 7^ ^ 5^ ^ 3^ ^ 1^ ^ /^ ^ -E(^ 
_ 4___Nr   r   r   r   r  r    s-        PQ PQ PQ PQ PQr   r  c                       e Zd Zd ZdS )edithouseWantedForRentc                    	 t          |          }|r]t          j        |t          j        dg          }|d         }t
          j                            |                                          }nd}|j	        }t          j                            |j        d                                          }|r|j        j        }nd}|                    d          }	|	s(t          t           j        d	d
t           j                  S t$          j                            |	                                          }
|                    d          }|                    d          }|                    d          }|                    d          }|                    d          }|                    d          }|                    d          }|                    d          }|                    d          }|                    d          }|                    d          }|                    d          }|                    d          }|                    d          }|                    d          }|                    d          }|                    d          }|                    d          }|                    d          }|                    d           }|                    d!          }|                    d"          } |                    d#          }!|                    d$          }"|                    d%          }#|                    d&          }$|                    d'          }%|                    d(          }&|                    d)          }'|                    d*          }(|                    d+          })|                    d,          }*|                    d-          }+|                    d.          },|                    d/          }-|                    d0          }.|                    d1          }/|                    d2          }0|st          d3d4it           j                  S |st          d3d5it           j                  S |st          d3d6it           j                  S |st          d3d7it           j                  S |st          d3d8it           j                  S |st          d3d9it           j                  S |st          d3d:it           j                  S |st          d3d;it           j                  S |st          d3d<it           j                  S |st          d3d=it           j                  S |st          d3d>it           j                  S |st          d3d?it           j                  S |st          d3d@it           j                  S |st          d3dAit           j                  S |(st          d3dBit           j                  S |*st          d3dCit           j                  S |+st          d3dDit           j                  S |,st          d3dEit           j                  S |-st          d3dFit           j                  S |.st          d3dGit           j                  S |/st          d3dHit           j                  S ||
_        ||
_        ||
_        ||
_        ||
_        ||
_        ||
_        ||
_        ||
_        ||
_        ||
_        ||
_        ||
_        ||
_         ||
_!        ||
_"        ||
_#        ||
_$        ||
_%        ||
_&        |)|
_'        |*|
_(        |+|
_)        |,|
_*        |-|
_+        |.|
_,        |/|
_-        ||
_.        |&|
_/        |'|
_0        |(|
_1        |0|
_2        ||
_3        | |
_4        |!|
_5        |"|
_6        |#|
_7        |$|
_8        |%|
_9        dI|
_        |
:                                 |                    dJ          }1tv          j                            |1                                          }2|2r'dK|2_        |
j        |2_<        |2:                                 t          t           j=        dLdMt           j=                  S # t|          $ r?}3t          t           j?        t          |3          dMt           j?                  cY d }3~3S d }3~3ww xY w)NNr6  r7  r"  r   r   Trc   r   r   r   r<   r   r   r[  r  r  r  r-   r.   r  r  r  r   r/   r  r  r  r  r  r  r  r  r  r9   r;   r7   r=  r_  r  r  r2   r3   rJ  r  r  r  r  r  r  r  rn  r<   rs  r  r=   r>   r  r  r  r   r?   r  r  r  r  zdesired_start_date is requiredr  r  r  r  r  r  r  r   r  r  r  rR  )Ar   r(  r)  r   r*  r{   rv   rw   rx   rp   r   r   r]   r  rq   r   r   rr   r  r[  r  r  r  r-   r.   r  r  r  r   r/   r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r2   r3   rJ  rn  r9   r;   r7   r=  r_  r  r  r   r"  r   r   r   r   r   )4r   r   r+  r,  r"  r   rp   r  r  r   r  r[  r  r  r  r-   r.   r  r  r  r   r/   r  r  r  r  r  r  r  r  r  r9   r;   r7   r=  r_  r  r  r2   r3   rJ  r  r  r  r  r  r  r  rn  r  r  r   s4                                                       r   r   zedithouseWantedForRent.post  s	   I	Q,W55E *UH,?G9UUU!),$,333AAGGII<D-5<<cg<hhnnppH '%-]%<!!%&!((=11K  ^h9T_x/y/y  BH  B]  '^  '^  '^   ^+3::k:JJPPRRJ((=11K $)< = =!XX&677NHHW%%E,//J--IXXh''F((5//C((=11K88N33LHHW%%Exx
++H HH_55Mxx
++H--I88N33L#xx(:;;"hh'899O!%*>!?!?88N33L hhy))GHHW%%E88F##D((=11Kxx
++HHHW%%E((=11K xx
++H--Ixx
++HHHW%%E--I!XX&677N((=11K88N33L88F##Dxx
++Hxx
++H xh	:S/T\b\w&x&x&xxl)4G)HPVPk l l llvXy9Q.RZ`Zu%v%v%vvtHi8O-PX^Xs$t$t$ttn95I*JRXRm!n!n!nnhh	2C'DFLghhhhxh	:S/T\b\w&x&x&xxzx;U0V^d^y'z'z'z zl)4G)HPVPk l l ll |)<W1X`f`{(|(|(|!|zx;U0V^d^y'z'z'z z#  C8Y?]4^fl  gB  ,C  ,C  ,C  %C"  A(I>[3\djd  +A  +A  +A  $A%  GXyAa6bjp  kF  .G  .G  .G  'Gr8Y7M,NV\Vq#r#r#rrtHi8O-PX^Xs$t$t$tt!~9=Y2Zbhb})~)~)~"~xh	:S/T\b\w&x&x&xxzx;U0V^d^y'z'z'z zjx3E(FfNijjjjr8Y7M,NV\Vq#r#r#rr &1J"+<J((6J%$J$.J!#,J  &J JN%0J"&2J#$J"*J'4J$"*J#,J &2J#*:J')8J&,>J)&2J#$J#,J (6J%%0J"&2J#"JO"*J+<J("*J#,J "*J"*J!(J$J"JO%0J""*J$J%0J" !JOOHHY''G)188G8DDJJLLH   +%/]$6+=H^__gmgyzzzz 	Q 	Q 	Q6+P[^_`[a[abbjp  kP  Q  Q  Q  Q  Q  Q  Q  Q  Q	Qs   C>b  M.b  0b  b  .b  b  ,b  b  *b  	b  (b  b  &b  b  $b  b  "b  b   b  ?b  b  =b  Gb   
c)*4c$c)$c)Nr   r   r   r   r  r    s-        JQ JQ JQ JQ JQr   r  c                       e Zd Zd ZdS )createConverstationCustomerc                    t          |          }|r]t          j        |t          j        dg          }|d         }t
          j                            |                                          }nd}|j	        
                    d          }|s(t          t          j        ddt          j        	          S t
          j                            |
                                          }|s(t          t          j        ddt          j        	          S t          j                            ||                                          }|rt          d           |j        }	nt          d           t#          |j                  t#          |j                  z   t#          |j                  z   t#          |j                  z   }
t)          |
          }t*                              |           d                    |          }t0          j        j        j                            |          }t          j                            t9          ||          t9          ||          z                                            }|s-t          j                            ||          }|j        |_        t=          j                    |_         |!                                 t#          |j                  t#          |j                  t#          |j"                  d}tG          j$        |          }t0          j        j                            |j                  j%                            t#          |j                  |          }t#          |j                  t#          |j                  t#          |j"                  d}tG          j$        |          }t0          j        j                            |j                  j%                            t#          |j                  |          }|j        |_&        |j        |_'        |!                                 |j        }	t          t          j(        d|	dt          j(        	          S )Nr6  r7  r"  r   r   chat_customerzchat_customer is required.r   r   r   r  )customer_twocustomer_onehererM   rH   )friendly_name)r  r  )r   rb   r  )r  
attributeszconversation Added successfully)r   r   r  ))r   r(  r)  r   r*  r{   rv   rw   rx   rp   rq   r   r   rr   ConversationCustomersr~   r  r   rE   r   r  randomshufflejoinr  r  r  r|   r   sidr
   r   r  r   r   jsondumpsparticipantscustomer_one_twilio_idcustomer_two_twilio_idr   )r   r   r+  r,  r"  r   r  chat_customer_objexisting_conversationr  concatinate_namessuffle_stringconversation_namer  conversation_objuser_attributesuser_json_attributeschat_user_participantuser_two_attributes#user_two_attributes_json_attributesuser_two_attributes_participants                        r   r   z createConverstationCustomer.post  s   (11 	j(;yQQQGi(G (//W/==CCEEKKK((99 	^F,G[wxx  BH  B]  ^  ^  ^  ^$,33}3EEKKMM  	UF,G[noox~  yT  U  U  U  U 5 = D DRcr} D ~ ~  !E  !E  !G  !G  3	E&MMM!6!I'NNN"#4#>??#kF[B\B\\_bctcw_x_xx{~  @K  @N  |O  |O   O !233MNN=))) " 6 6!/"V*;V<< 
  5<CCAS^l}D~D~D~  BC  Sd  r}  B~  B~  B~  E~         E   E   G   G# G#8#@#G#GU`n#G  $B  $B 6B6F 3,4LNN)!!####&{~#6#6c+BW>X>XK455 O $(:o#>#> $*$8|/00[^!4!4@TUU	 " (++<+?'@'@L]LgHhHh-:;;" " 37*=P2Q2Q/.4.B|/00%6%9!:!:Fijj	 , 7L6O36U6Y3!!###!1!D(:Lm  DV  W  W  `f  `r  s  s  s  	sr   Nr   r   r   r   r  r    s-        Es Es Es Es Esr   r  c                       e Zd Zd ZdS )createTokenc                 \   	 t          |          }|r]t          j        |t          j        dg          }|d         }t
          j                            |                                          }nd}|j	        }t          t          t          t          |          }t          r*t          t                    }|                    |           t"          j        j                            t                    j                                                            dd	d
          }||                                d}	t3          t4          j        d|	dt4          j                  S # t8          $ r?}
t3          t4          j        t=          |
          dt4          j                  cY d }
~
S d }
~
ww xY w)Nr6  r7  r"  r   r   r  r  Tr  r  r  r  zToken Added successfullyr%  r   r  )r   r(  r)  r   r*  r{   rv   rw   rx   r   r#   r  r  r  r  r    r  r  r  r  r  r  r  r   r  r   r   r   r   r   r   r  s              r   rq   zcreateToken.get  s   !	N,W55E *UH,?G9UUU!),$,333AAGGII"~HGJQQQE ,&3CDDD

+++!/X&'']__V$("+%\      LLNN G F,>Pjryzz  CI  CU  V  V  V  V 	N 	N 	Nf&KWZ[\W]W]^^gm  hM  N  N  N  N  N  N  N  N  N	Ns   EE" "
F+,4F& F+&F+Nr   r   r   r   r  r    s(        "N "N "N "N "Nr   r  c                       e Zd Zd ZdS )customerConverstationListingc                    	 t          |          }|r]t          j        |t          j        dg          }|d         }t
          j                            |                                          }nd}t          j                            t          |j        d          t          |j        d          z                                |	                              d
          }t          |           g }|D ]}t          j        j                            |j                  j                            dd          }	t          d           t          |	           d}
d}d}|	D ]}t          d           t          d|j                   t          d|j                   |j        rtt          d           t          |j                   |j        }
t          |
           t/          j        |
          }
|
d         }
t3          |j                  dz   }|j        }|j        sCt          d           t          |j                   d}
t3          |j                  dz   }|j        }t          |           |j        |j        |j        j        dz   |j        j        z   |j        j        |j        j        |j        j        |j         j        dz   |j         j        z   |j         j        |j         j        |j         j        |
||d}|!                    |           tE          tF          j$        d|dtF          j$                  S # tJ          $ r?}tE          tF          j&        tO          |          dtF          j&                  cY d }~S d }~ww xY w)Nr6  r7  r"  r   r   rW   r  customer_two__loginUserTyper  customer_one__loginUserTypecustomer_deletedrd   r  r   r  
messages:-rH   record:-record.bodyr<   r  record.media
Media filer  r   r  customer_one_namecustomer_one_imagecustomer_one_idcustomer_one_phone_numbercustomer_two_namecustomer_two_imagecustomer_two_idcustomer_two_phone_numberr  r  r  r   r%  r   r  (r   r(  r)  r   r*  r{   rv   rw   rx   r  r   r   excluder   r~   r  r  r  r  r  r  rT   r  r  loadsr$   r  r  rE   rF   r   r   r  r   r   r   r   r   r   r   r   r   r+  r,  r"  r   r  r  r  r  r  r  r  r  r  r   s                   r   rq   z customerConverstationListing.get  s   L	N,W55E *UH,?G9UUU!),$,333AAGGII19@@{~:VVV{~:VVVW  g!,   huoo  -    " - 5< 5<!/"]<#BCCTaT00	 
 l###h!!& ; ;F*%%%*V[111*V\222{ ;m,,,fk***'-{l+++'+z,'?'?'3I'>  ))<==fD'-':#\ ;n---fl+++'3()<==fD'-':l###&/*6*I)5)B)Lc)QR^RkRt)t*6*C*P&2&?&B0<0I0U)5)B)Lc)QR^RkRt)t*6*C*P'3'@'C0<0I0U#/#/% %! "(():;;;;F,>PYarss  |B  |N  O  O  O  O 	N 	N 	Nf&KWZ[\W]W]^^gm  hM  N  N  N  N  N  N  N  N  N	N   L;L> >
N4N<NNNr   r   r   r   r  r    -        MN MN MN MN MNr   r  c                       e Zd Zd ZdS )AgencyConverstationListingc                    	 t          |          }|r]t          j        |t          j        dg          }|d         }t
          j                            |                                          }nd}t          j                            t          |j        d          t          |j        d          z                                |	                              d
          }t          |           g }|D ]}t          j        j                            |j                  j                            dd          }	t          d           t          |	           d}
d}d}|	D ]}t          d           t          d|j                   t          d|j                   |j        rtt          d           t          |j                   |j        }
t          |
           t/          j        |
          }
|
d         }
t3          |j                  dz   }|j        }|j        sCt          d           t          |j                   d}
t3          |j                  dz   }|j        }t          |           |j        |j        |j        j        dz   |j        j        z   |j        j        |j        j        |j        j        |j         j        dz   |j         j        z   |j         j        |j         j        |j         j        |
||d}|!                    |           tE          tF          j$        d|dtF          j$                  S # tJ          $ r?}tE          tF          j&        tO          |          dtF          j&                  cY d }~S d }~ww xY w)Nr6  r7  r"  r   r   r   r  r  r  rd   r  r   r  r  rH   r  r  r<   r  r  r  r  r  r   r%  r   r  r!  r$  s                   r   rq   zAgencyConverstationListing.getg     L	N,W55E *UH,?G9UUU!),$,333AAGGII19@@{~8TTT{~8TTTU  g!,   huoo  -    " - 5< 5<!/"]<#BCCTaT00	 
 l###h!!& ; ;F*%%%*V[111*V\222{ ;m,,,fk***'-{l+++'+z,'?'?'3I'>  ))<==fD'-':#\ ;n---fl+++'3()<==fD'-':l###&/*6*I)5)B)Lc)QR^RkRt)t*6*C*P&2&?&B0<0I0U)5)B)Lc)QR^RkRt)t*6*C*P'3'@'C0<0I0U#/#/% %! "(():;;;;F,>PYarss  |B  |N  O  O  O  O 	N 	N 	Nf&KWZ[\W]W]^^gm  hM  N  N  N  N  N  N  N  N  N	Nr%  Nr   r   r   r   r(  r(  f  r&  r   r(  c                       e Zd Zd ZdS )LawyerConverstationListingc                    	 t          |          }|r]t          j        |t          j        dg          }|d         }t
          j                            |                                          }nd}t          j                            t          |j        d          t          |j        d          z                                |	                              d
          }t          |           g }|D ]}t          j        j                            |j                  j                            dd          }	t          d           t          |	           d}
d}d}|	D ]}t          d           t          d|j                   t          d|j                   |j        rtt          d           t          |j                   |j        }
t          |
           t/          j        |
          }
|
d         }
t3          |j                  dz   }|j        }|j        sCt          d           t          |j                   d}
t3          |j                  dz   }|j        }t          |           |j        |j        |j        j        dz   |j        j        z   |j        j        |j        j        |j        j        |j         j        dz   |j         j        z   |j         j        |j         j        |j         j        |
||d}|!                    |           tE          tF          j$        d|dtF          j$                  S # tJ          $ r?}tE          tF          j&        tO          |          dtF          j&                  cY d }~S d }~ww xY w)Nr6  r7  r"  r   r   lawyerr  r  r  rd   r  r   r  r  rH   r  r  r<   r  r  r  r  r  r   r%  r   r  r!  r$  s                   r   rq   zLawyerConverstationListing.get  r*  r%  Nr   r   r   r   r,  r,    r&  r   r,  )django.shortcutsr   rest_framework.viewsr   rest_framework.responser   rest_frameworkr   r
   r   django.utilsr	   django.confr   rest_framework_simplejwt.tokensr   !rest_framework_simplejwt.backendsr   rest_framework.authenticationr   r(  r   modelsdjango.core.paginatorr   r   r   django.db.modelsr   r   django.template.loaderr   django.http.responser   r  django.httpr   r   customer_api.authenticationr   customer_api.modelsrs   admin_api.modelscustomer_api.functionsdjango.corer   django.core.mailr   django.contrib.authr   r'  r  twilio.jwt.access_token.grantsr   r    r!   twilio.restr"   twilio.jwt.access_tokenr#   django.utils.timesincer$   django.db.models.functionsr%   r&   r'   r(   TWILIO_ACCOUNT_SIDr  TWILIO_AUTH_TOKEN
auth_tokenTWILIO_CHAT_SIDr  TWILIO_SYNC_SIDsync_service_sidTWILIO_API_SIDr  TWILIO_API_SECRETr  r  r*   r   r   r   r   r   r   r   r   r   r   r  r  r  r/  r6  rX  rw  r|  r  r  r  r  r  r  r  r  r  r  r  r	  r  r  r0  r4  rL  rT  r  r  r  r  r  r  rX  r\  r  r  r  r  r  r  r  r  r(  r,  r   r   r   <module>rR     s   # # # # # # ( ( ( ( ( ( , , , , , , ! ! ! ! ! !       ! ! ! ! ! !                   8 8 8 8 8 8 : : : : : : B B B B B B 



 % % % % % %     H H H H H H H H H H              3 3 3 3 3 3 - - - - - -  $ $ $ $ $ $ % % % % % % 5 5 5 5 5 5 ! ! ! ! 				     $ $ $ $       3 3 3 3 3 3 , , , , , , 



          
       / / / / / / , , , , , , 1 1 1 1 1 1 & & & & & & & & 4 4 4 4 4 4('
+ + 

!&
	Z	(	(g] g] g] g] g]G g] g] g]R+] +] +] +] +]7 +] +] +]Z] ] ] ] ]g ] ] ](9] 9] 9] 9] 9]' 9] 9] 9]xU] U] U] U] U]G U] U] U]n] ] ] ] ]G ] ] ]B] ] ] ] ]W ] ] ].] ] ] ] ] ] ] ]4] ] ] ] ] ] ] ](] ] ] ] ]g ] ] ]24_ 4_ 4_ 4_ 4_G 4_ 4_ 4_l5_ 5_ 5_ 5_ 5_' 5_ 5_ 5_p] ] ] ] ] ] ] ]2] ] ] ] ] ] ] ]2X X X X X7 X X X<6a 6a 6a 6a 6a' 6a 6a 6atMs Ms Ms Ms Msg Ms Ms Ms`a a a a aG a a a._ _ _ _ _G _ _ _.+_ +_ +_ +_ +_W +_ +_ +_Z_ _ _ _ _w _ _ _$_ _ _ _ _ _ _ _._ _ _ _ _ _ _ _0_ _ _ _ _g _ _ _F_ _ _ _ _7 _ _ _:#_ #_ #_ #_ #_G #_ #_ #_N3_ 3_ 3_ 3_ 3_ 3_ 3_ 3_n_ _ _ _ _w _ _ _*_ _ _ _ _w _ _ _0_ _ _ _ _ _ _ _,_ _ _ _ _7 _ _ _0_ _ _ _ _ _ _ _ ;X ;X ;X ;X ;X' ;X ;X ;Xz+X +X +X +X +XW +X +X +X^D= D= D= D= D=G D= D= D=NQX QX QX QX QXW QX QX QXflQ lQ lQ lQ lQ lQ lQ lQ\cU cU cU cU cU' cU cU cUJeQ eQ eQ eQ eQg eQ eQ eQNTQ TQ TQ TQ TQw TQ TQ TQlyQ yQ yQ yQ yQg yQ yQ yQvgQ gQ gQ gQ gQw gQ gQ gQT@Q @Q @Q @Q @Qw @Q @Q @QD_Q _Q _Q _Q _Q7 _Q _Q _QDVQ VQ VQ VQ VQg VQ VQ VQtUQ UQ UQ UQ UQ UQ UQ UQp_Q _Q _Q _Q _QG _Q _Q _QBlQ lQ lQ lQ lQw lQ lQ lQ^QQ QQ QQ QQ QQ QQ QQ QQfKQ KQ KQ KQ KQW KQ KQ KQ\Fs Fs Fs Fs Fs' Fs Fs FsV#N #N #N #N #N' #N #N #NNNN NN NN NN NN7 NN NN NNbNN NN NN NN NN NN NN NNbNN NN NN NN NN NN NN NN NN NNr   