-
Notifications
You must be signed in to change notification settings - Fork 75
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: notification/models dismissing
Signed-off-by: Lachezar Lechev <[email protected]>
- Loading branch information
Showing
1 changed file
with
20 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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, | ||
} |