use crate::dto::notification::NotificationSummaryDTO;
use crate::{Error, PickcatAccound};
pub trait NotificationBehavior {
fn get_notification_summary(
&self,
) -> impl std::future::Future<Output = Result<NotificationSummaryDTO, Error>> + Send;
}
impl NotificationBehavior for PickcatAccound {
async fn get_notification_summary(&self) -> Result<NotificationSummaryDTO, Error> {
Ok(self
.client
.get(format!("{}/api/v1/notification-summary", self.base_url))
.send()
.await?
.json::<NotificationSummaryDTO>()
.await?)
}
}