Skip to content

Commit

Permalink
feat: notification/models dismissing
Browse files Browse the repository at this point in the history
Signed-off-by: Lachezar Lechev <[email protected]>
  • Loading branch information
elpiel committed Dec 13, 2023
1 parent 710e5c9 commit 7fd29b1
Showing 1 changed file with 20 additions and 3 deletions.
23 changes: 20 additions & 3 deletions src/types/events/events.rs
Original file line number Diff line number Diff line change
@@ -1,12 +1,29 @@
use chrono::{DateTime, Utc, Local};
use serde::Serialize;

use crate::{
models::{common::Loadable, ctx::CtxError},
types::api::{GetModalResponse, GetNotificationResponse},
};

#[derive(Default, PartialEq, Eq, Serialize, Clone, Debug)]
#[derive(PartialEq, Eq, Serialize, Clone, Debug)]
pub struct Events {
pub modal: Loadable<Option<GetModalResponse>, CtxError>,
pub notification: Loadable<Option<GetNotificationResponse>, CtxError>,
pub modal: ModalEvent,
pub notification: NotificationEvent,
}

#[derive(PartialEq, Eq, Serialize, Clone, Debug)]
pub struct NotificationEvent {
/// the notification contains the date that was sent with the request to retrieve the latest Notification
pub notification: Loadable<(DateTime<Local>, Option<GetNotificationResponse>), CtxError>,
pub last_updated: Option<DateTime<Utc>>,
pub dismissed: bool,
}

#[derive(PartialEq, Eq, Serialize, Clone, Debug)]
pub struct ModalEvent {
/// the modal contains the date that was sent with the request to retrieve the latest Modal
pub modal: Loadable<(DateTime<Local>, Option<GetModalResponse>), CtxError>,
pub last_updated: Option<DateTime<Utc>>,
pub dismissed: bool,
}

0 comments on commit 7fd29b1

Please sign in to comment.