Ë
    Ð÷'j†  ã                   óÌ  — d dl mZmZmZ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mZmZmZ d dlmZmZmZmZmZmZmZ  edg¬	«      Zej7                  d
ed¬«       ee«       ee
«      fdedefd„«       Zej7                  ded¬«       ee«       ee
«      fdedefd„«       Zej=                  ded¬«       ee«       ee
«      fdededefd„«       Zej=                  ded¬«       ee«       ee
«      fdedefd„«       Z ej=                  ded¬«       ee«       ee
«      fdededefd„«       Z!ej=                  ded¬«       ee«       ee
«      fdedefd„«       Z"y )!é    )Ú	APIRouterÚDependsÚHTTPExceptionÚstatus)ÚSession)Úget_db)Úrequire_admin_token)ÚUser)ÚAdminNotificationIdRequestÚAdminNotificationListResponseÚ$AdminNotificationUnreadCountResponseÚMessage)Úclear_all_admin_notificationsÚ count_unread_admin_notificationsÚdelete_admin_notificationÚlist_admin_notificationsÚmark_admin_notification_readÚ!mark_all_admin_notifications_readÚserialize_admin_notificationzadmin-activity-notifications)Útagsz/list-admin-notificationszQList admin inbox notifications (reward claims, track submits, community activity))Úresponse_modelÚsummaryÚdbÚ_c                 ó~   — t        | «      }|D �cg c]  }t        |«      ‘Œ }}t        t        |«      |¬«      S c c}w )N)ÚtotalÚnotifications)r   r   r   Úlen)r   r   ÚrowsÚnÚ
serializeds        úS/var/www/html/kelly/kelly-backend/app/routers/admin/admin_activity_notifications.pyÚlist_admin_notifications_router#      s?   € ô $ BÓ'€DÙ;?Ó@¹4°aÔ.¨qÕ1¸4€JÐ@Ü(¬s°:«ÈjÔYÐYùò As   �:z!/admin-notifications-unread-countz2Unread count for admin activity notifications bellc                 ó,   — t        t        | «      ¬«      S )N)Úunread_count)r   r   )r   r   s     r"   Ú admin_notifications_unread_countr&   (   s   € ô 0Ô=]Ð^`Ó=aÔbÐbó    z/mark-admin-notification-readz,Mark one admin activity notification as readÚbodyc                 ó€   — t        || j                  «      }|st        t        j                  d¬«      ‚t        d¬«      S )NúNotification not found©Ústatus_codeÚdetailzNotification marked as read©Úmessage)r   Únotification_idr   r   ÚHTTP_404_NOT_FOUNDr   )r(   r   r   Úrows       r"   Ú"mark_admin_notification_read_router3   4   s9   € ô ' r¨4×+?Ñ+?Ó
@€CÙÜ¬×(AÑ(AÐJbÔcÐcÜÐ8Ô9Ð9r'   z"/mark-all-admin-notifications-readz-Mark all admin activity notifications as readc                 ó8   — t        | «      }t        d|› d�¬«      S )NzMarked z notification(s) as readr.   )r   r   ©r   r   Úcounts      r"   Ú'mark_all_admin_notifications_read_router7   D   s#   € ô .¨bÓ1€EÜ˜W U GÐ+CÐDÔEÐEr'   z/delete-admin-notificationz2Permanently delete one admin activity notificationc                 ó|   — t        || j                  «      st        t        j                  d¬«      ‚t        d¬«      S )Nr*   r+   zNotification deletedr.   )r   r0   r   r   r1   r   )r(   r   r   s      r"   Údelete_admin_notification_router9   Q   s4   € ô % R¨×)=Ñ)=Ô>Ü¬×(AÑ(AÐJbÔcÐcÜÐ1Ô2Ð2r'   z/clear-all-admin-notificationsz3Permanently delete all admin activity notificationsc                 ó8   — t        | «      }t        d|› d�¬«      S )NzCleared z notification(s)r.   )r   r   r5   s      r"   Ú#clear_all_admin_notifications_router;   `   s#   € ô *¨"Ó-€EÜ˜X e WÐ,<Ð=Ô>Ð>r'   N)#Úfastapir   r   r   r   Úsqlalchemy.ormr   Úapp.databaser   Úapp.dependenciesr	   Ú
app.modelsr
   Úapp.schemasr   r   r   r   Ú'app.services.admin_notification_servicer   r   r   r   r   r   r   ÚrouterÚgetr#   r&   Úpostr3   r7   r9   r;   © r'   r"   Ú<module>rG      s.  ðß =Ó =Ý "å Ý 0Ý ÷ó ÷÷ ñ ñ 
Ð7Ð8Ô	9€ð ‡�ØØ0Ø_ð ó ñ ˜&“/ÙÐ)Ó*ñZØðZàòZóð
Zð ‡�Ø'Ø7Ø@ð ó ñ ˜&“/ÙÐ)Ó*ñcØðcàòcóð
cð ‡�Ø#ØØ:ð ó ñ ˜&“/ÙÐ)Ó*ñ:Ø
$ð:àð:ð ò:óð
:ð ‡�Ø(ØØ;ð ó ñ ˜&“/ÙÐ)Ó*ñFØðFàòFóð
Fð ‡�Ø ØØ@ð ó ñ ˜&“/ÙÐ)Ó*ñ3Ø
$ð3àð3ð ò3óð
3ð ‡�Ø$ØØAð ó ñ ˜&“/ÙÐ)Ó*ñ?Øð?àò?óñ
?r'   