
    |h8
                        S SK JrJrJrJrJr  S SKJr  S SKJ	r	  S SK
Jr  SSKJrJrJrJrJr  SSKJr  SSKJrJrJrJrJr  \" 5       r\R7                  S	\S
9\" \R8                  5      4S\S\S\R:                  4S jj5       r\R?                  S\S
9S SSS\" \R8                  5      \" \5      4S\ S\ S\	\!   S\	\    S\R:                  S\"4S jj5       r#\R?                  S\S
9\" \R8                  5      4S\!S\R:                  4S jj5       r$\RK                  S\S
9\" \R8                  5      4S\!S\S\R:                  4S jj5       r&\RO                  S\S
9\" SSS9\" \R8                  5      4S\!S\R:                  4S  jj5       r(\R?                  S!5      \" \R8                  5      \" \5      4S\R:                  S\"4S" jj5       r)g)#    )	APIRouterDependsHTTPExceptionBackgroundTasksPath)JSONResponse)Optional)database   )CommunicationEmailCommunicationEmailCreateCommunicationEmailUpdateCommunicationEmailResponseListCommunicationEmailResponse)get_current_userdetails)"create_communication_email_service get_communication_emails_service read_communication_email_service"update_communication_email_service"delete_communication_email_service/)response_modelpayloadbackground_tasksdbc                     [        XU5      $ N)r   )r   r   r   s      UC:\Suresh\moveshuttle\MDcreated\moveengine\app\v1\routers\saas\communication_email.pycreate_emailr      s     .gLL    z/list/
   Nskiplimitqaccount_viewcurrent_userc           	      @    UR                  S5      n[        X`XX4U5      $ )N
account_id)getr   )r"   r#   r$   r%   r   r&   r(   s          r   list_emailsr*      s&     !!,/J+JeYeffr    z/{email_id}email_idc                 >    [        X5      nU(       d
  [        SSS9eU$ )Ni  zEmail record not found)status_codedetail)r   r   )r+   r   emails      r   
read_emailr0   )   s$    
 -X:E4LMMLr    updatec                     [        XU5      $ r   )r   )r+   r1   r   s      r   update_emailr3   3   s     .hCCr    .zThe ID of the email record)descriptionc                     [        X5      $ r   )r   )r+   r   s     r   delete_emailr6   ;   s    
 .h;;r    z/status-countsc                     [        U 5      $ r   )get_email_status_counts)r   r&   s     r   get_email_countsr9   B   s    
 #2&&r    )*fastapir   r   r   r   r   fastapi.responsesr   typingr	   app.dbr
   models.saas.communication_emailr   r   r   r   r   dependencies.authr   !services.saas.communication_emailr   r   r   r   r   routerpostget_mongo_dbMongoDBr   r)   intstrdictr*   r0   putr3   deleter6   r9    r    r   <module>rK      s\   L L *    9  
S!34 #8#8#89M%M%M 	M 5M H%CD"&"8#8#89 !89	g
	g	g }	g 3-		g
 		g 	g E	g M*DE #8#8#89 F M*<= #8#8#89DD$D 	D >D }-?@*FG"8#8#89<<< A< "8#8#89 !89''' 'r    