
    7>h                     v    d dl mZ d dlmZ d dlmZmZ d dlmZmZm	Z	 d dl
mZ d dlmZmZmZ  G d de      Zy	)
    )BaseRepo)HTTPException)datetimetimezone)AdvisorNotificationsCallsLog)create_offline_message)AuthorizationExceptionNotFoundExceptionUnauthorizedExceptionc                   .     e Zd Z fdZdedefdZ xZS )NotificationsRepoc                 $    t         |   |       y )N)super__init__)selfdb	__class__s     E/var/www/html/DP/alpha_backend/app/repositories/notifications_repo.pyr   zNotificationsRepo.__init__
   s        notification_idreturnc                    | j                  t        |      }|st        d|      d|_        t	        j
                  t        j                        |_        | j                  j                          | j                  j                  |       |S )z,
        Read a single notification
        Notification)
class_name	entity_idT)	get_by_idr   r   is_readr   nowr   utcread_atr   commitrefresh)r   r   notifications      r   read_single_notificationz*NotificationsRepo.read_single_notification   sg     ~~m_E#~YY
  $'||HLL9%r   )__name__
__module____qualname__r   intdictr&   __classcell__)r   s   @r   r   r   	   s      r   r   N)app.repositories.base_repor   fastapir   r   r   app.common.modelsr   r   r	   *app.retell_service.services.retell_servicer
   app.utils.exceptionsr   r   r   r    r   r   <module>r3      s)    / ! ' > > M a a r   