diff --git a/src/types/events/events.rs b/src/types/events/events.rs index 4aaaa8fd9..a28dd1911 100644 --- a/src/types/events/events.rs +++ b/src/types/events/events.rs @@ -1,3 +1,4 @@ +use chrono::{DateTime, Utc, Local}; use serde::Serialize; use crate::{ @@ -5,8 +6,24 @@ use crate::{ types::api::{GetModalResponse, GetNotificationResponse}, }; -#[derive(Default, PartialEq, Eq, Serialize, Clone, Debug)] +#[derive(PartialEq, Eq, Serialize, Clone, Debug)] pub struct Events { - pub modal: Loadable, CtxError>, - pub notification: Loadable, 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, Option), CtxError>, + pub last_updated: Option>, + 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, Option), CtxError>, + pub last_updated: Option>, + pub dismissed: bool, +} \ No newline at end of file