
    lhO'                        d dl mZ d dlmZmZmZmZ d dlmZmZm	Z	m
Z
mZmZmZmZmZmZmZmZmZ d dlmZ d dlmZmZ d dlmZ d dlmZ d dlmZmZ  G d	 d
e      Z  G d de      Z! G d de      Z" G d de      Z# G d de      Z$ G d de      Z% G d de      Z& G d de      Z' G d de      Z( G d de      Z) G d de      Z* G d d e      Z+y!)"    )Base)datetimetimezone	timedeltadate)ColumnIntegerStringDATETIMEDateTimeSmallInteger
ForeignKeyTimeBooleanDateTextJSON
BigInteger)TINYINT)functext)declarative_base)relationship)WeeklyScheduleStatusEmailVerificationStatusc                   T   e Zd ZdZ eeddd      Z e ed      dd      Z e ed      d      Z	 e ed      d      Z
 ee ed	      d
dd      Z ee ed	      d
dd      Z ee ed      d      Z ee ed      ddd      Z e ed      d      Z e ed       ej,                          ej,                  ej2                        d      Z e ed       ej,                          ej,                  ej2                        d      Z e ed      dd      Zy)UsersusersTprimary_keyindexautoincrement   Funiquenullable   r&   1   z!1: active, 2: inactive, 3:deletedserver_defaultdefaultr&   commentzb1: Setup your business, 2: Setup phone number, 3: Setup services, 4: Setup assistant, 5: Dashboardcompanies.id0r   z1: Verified, 0: Not verifiedr   )r,   r-   r&   Nr&   r-   )__name__
__module____qualname____tablename__r   r	   idr
   emailnamepasswordr   r   statusr   stepr   default_companyis_email_verifiedr   email_verified_atr   nowr   r   utc
created_at
updated_at
deleted_at     4/var/www/html/phonemate/phone_mate_backend/models.pyr   r      sG   M	TT	JB6#;te<E&+.DfSkE2HCy3F CytD Wj&@4POCy. x6F$txxzX\\*	J $txxzX\\*	J $/$MJrF   r   c                       e Zd ZdZ eedd      Z e ed      d      Z e ed      d      Z	 ee
dd	      Z e ed
      dd       Z e ed
      dd       Z e ed
      d      Zy)OTPLogotp_logsTr    r!   r#   Fr(      z*1: Signup confirmation, 2: Forgot passwordr&   r.   r1   c                  H    t        j                  t        j                        S )N)r   r@   r   rA   rE   rF   rG   <lambda>zOTPLog.<lambda>U   s    X\\2rF   r2   c                  b    t        j                  t        j                        t	        d      z   S )N   )minutes)r   r@   r   rA   r   rE   rF   rG   rO   zOTPLog.<lambda>Z   s    X\\2Yr5JJrF   N)r3   r4   r5   r6   r   r	   r7   r
   r8   otpr   typer   rB   
expired_atused_atrE   rF   rG   rI   rI   G   s    M	T	6B6#;/E
U
+C<D
 $2J
 $JJ
 Xt,t<GrF   rI   c                      e Zd ZdZ eedd      Z e ed      d      Z ee e	d      d      Z
 eedd	      Z e ed      d      Z e ed      d      Z e ed
      d      Z e ed
      d      Z e ed      d ej&                  ej*                              Z e ed      d ej&                  ej*                              Z edd      Zy)Company	companiesTrK   r#   Fr(   zusers.idz~1: Garage and Workshop, 2: Pet Care, 3: Pest Control, 4: Handyman, 5: Electricians, 6: Gardening Services, 7: Cleaning ServicerM      r1   r2   Agentcompanyback_populatesN)r3   r4   r5   r6   r   r	   r7   r
   r9   r   user_idr   business_typeaddress1address2zip_codeofficial_phoner   r   r@   r   rA   rB   rC   r   agentsrE   rF   rG   rX   rX   _   s    M	T	6B&+.DWj4uEG QM
 fSkE2HfSkD1HfRj51HF2J7N$%hll9SJ $%hll9SJ ')<FrF   rX   c                   ,   e Zd ZdZ eedd      Z ee ed      d      Z e e	d      d      Z
 eed      Z e ed      d ej                  ej                         	      Z e ed      d ej                  ej                         	      Zy
)ServiceservicesTrK   r/   Fr(   r#   r1   r2   N)r3   r4   r5   r6   r   r	   r7   r   
company_idr
   r9   pricer   r   r@   r   rA   rB   rC   rE   rF   rG   rg   rg   w   s    M	T	6BN!;eLJ&+.D7U+E$%hll9SJ $%hll9SJrF   rg   c                   b   e Zd ZdZ eedd      Z ee ed      d      Z ee	dd      Z
 eed      Z eed      Z ee	ej                  dd	
      Z e ed      d ej&                  ej*                              Z e ed      d ej&                  ej*                              Zy)WeeklyScheduleweekly_schedulesTrK   r/   Fr(   z0 = Monday, 6 = SundayrM   z1: Day off, 0: Not off)r-   r&   r.   r1   r2   N)r3   r4   r5   r6   r   r	   r7   r   ri   r   day_of_weekr   
start_timeend_timer   NOT_OFF
is_day_offr   r   r@   r   rA   rB   rC   rE   rF   rG   rl   rl      s    &M	T	6BN!;eLJ?WXKu-JdU+H$,,(	J $%hll9SJ $%hll9SJrF   rl   c                   ,   e Zd ZdZ eedd      Z ee ed      d      Z ee	d      Z
 e ed      d      Z e ed      d ej                  ej"                        	      Z e ed      d ej                  ej"                        	      Zy
)SpecialHolidayspecial_holidaysTrK   r/   Fr(   r#   r1   r2   N)r3   r4   r5   r6   r   r	   r7   r   ri   r   r   r
   r9   r   r   r@   r   rA   rB   rC   rE   rF   rG   rt   rt      s    &M	T	6BN!;eLJ$'D&+.D$%hll9SJ $%hll9SJrF   rt   c                      e Zd ZdZ eedd      Z ee ed      d      Z e e	d      d      Z
 e e	d      d      Z e e	d      d      Z e ed	      d      Z e ed	      d      Z eed      Z ee ed
      d      Z ee ed      ddd      Z e ed	      d ej.                  ej2                              Z e ed	      d ej.                  ej2                              Zy)AppointmentappointmentsTrK   r/   Fr(   r#   rZ   r1   zservices.idr)   r*   z#1: active, 2: cancelled, 3: deletedr+   r2   N)r3   r4   r5   r6   r   r	   r7   r   ri   r
   appointment_nor9   phoner   start_datetimeend_datetimer   summary
service_idr   r   r;   r   r@   r   rA   rB   rC   rE   rF   rG   rw   rw      s   "M	T	6BN!;eLJF3K%8N&+.D6":.EHd3eDN(D1EBLTD)GM!:UKJCy5F $%hll9SJ $%hll9SJrF   rw   c                      e Zd ZdZ eedd      Z e ed      d      Z e ed      d      Z	 e ed      d      Z
 e ed      d      Z e ed      d      Z e ed      d      Z e ed      d      Z eed      Z eed      Z e ed	       ej*                         d
      Z e ed	       ej*                          ej*                         d      Zy)AIAssistantai_assistantsTrK   r#   r(   F2   d   r1   )r,   r&   )onupdater,   r&   N)r3   r4   r5   r6   r   r	   r7   r
   retell_agent_idr9   genderaccentpersonalityvoice_idvoice_modelr   system_promptr   conversation_flowr   r   r@   rB   rC   rE   rF   rG   r   r      s    #M	T	6BVC[48O&+.DF2J/FF3K%0Fu5KfSkE2Ht4K4%0Mte4$
UJ $txxz	JrF   r   c                      e Zd ZdZ eeddd      Z e ed      d      Z e ed      d      Z	 ee
d      Z e ed            Z e ed      d      Z e ed      d      Z ee      Z ee      Z ee      Zy)SampleAgentsample_agentsTr   r#   Fr(   N)r3   r4   r5   r6   r   r	   r7   r
   r9   r   r   aboutr   webhook_urllanguager   response_enginevoicemail_option	llmCreaterE   rF   rG   r   r      s    #M	TT	JB&+.DF3K%0F4%(EfSk"Hu5KfSkE2HTlOd|d|IrF   r   c                   8   e Zd ZdZ eeddd      Z ee ed      d      Z e e	d      dd      Z
 e e	d      d      Z e e	d            Z e e	d            Z ee      Z ee      Z ee      Z ee      Z ee      Z ee      Z ed	d
      Zy)r[   re   Tr   r/   Fr(   r#   r$   rX   r]   N)r3   r4   r5   r6   r   r	   r7   r   ri   r
   bot_idr9   r   modelr   r   first_messagevoicemail_messageend_call_message	serverUrlr   raw_responser   r\   rE   rF   rG   r[   r[      s    M	TT	JBN!;eLJF3Ku=F&+.DfSk"H6#;E4LM4LMtd|tI$<L9X>GrF   r[   c                      e Zd ZdZ eedd      Z eed      Z e ed      d      Z	 e ed      d      Z
 e ed      d      Z e ed      d      Z e ed      d      Z e ed      d      Z eed      Z e ed	      d      Z eed      Z eed
      Z e ed      d      Z eed
      Zy)PhoneNumberphone_numbersTrK   Fr(   rZ   r   r   r#   )r-      N)r3   r4   r5   r6   r   r	   r7   agent_idr
   phone_numberphone_number_typephone_number_prettynicknameinbound_agent_idinbound_agent_version	area_codeinbound_webhook_urlr   last_modification_timestampr   	toll_freecountry_codecustom_sms_enabledrE   rF   rG   r   r      s    #M	T	6Bg.H&*u5LvbzD9 d;fSkD1HfSkE:"6":=w.I t<"(d"Cw.I&)d3L7rF   r   c                   \   e Zd ZdZ eedd      Z e ed      d      Z e ed      d      Z	 ee
d      Z e ed      d      Z e ed      d      Z ee ed      d      Z e e
d	       ej"                         
      Z e e
d	       ej"                               Zy)BookingbookingsTrK   r#   Fr(   r   r/   r1   )r,   )r   N)r3   r4   r5   r6   r   r	   r7   r
   customer_namerz   r   appointment_timeservicer   r   ri   r   r@   rB   rC   rE   rF   rG   r   r     s    M	T	6B6#;7M6":.Eh7VC[40GF3K%0FN!;dKJ$/
KJ$/($((*EJrF   r   N),utils.databaser   r   r   r   r   
sqlalchemyr   r	   r
   r   r   r   r   r   r   r   r   r   r   sqlalchemy.dialects.mysqlr   sqlalchemy.sqlr   r   sqlalchemy.ext.declarativer   sqlalchemy.ormr   utils.constantsr   r   r   rI   rX   rg   rl   rt   rw   r   r   r[   r   r   rE   rF   rG   <module>r      s     8 8    . % 7 ' I*ND *NZ=T =0=d =0d T ,T $ 6$ 2$ ?D ?$8$ 8$Fd FrF   