1use async_graphql::{InputObject, SimpleObject};
2use chrono::{DateTime, Utc};
3use qm_mongodb::bson::Uuid;
4use serde::{Deserialize, Serialize};
5
6#[derive(Default, Debug, Clone, SimpleObject, Serialize, Deserialize)]
7#[serde(rename_all = "camelCase")]
8pub struct Modification {
10 #[graphql(skip)]
12 pub user_id: Option<Uuid>,
13 pub at: DateTime<Utc>,
15}
16
17impl Modification {
18 pub fn new(user_id: Uuid) -> Self {
20 Self {
21 user_id: Some(user_id),
22 at: Utc::now(),
23 }
24 }
25}
26
27#[derive(
29 Default, Debug, Clone, InputObject, Serialize, Deserialize, Eq, PartialEq, Hash, PartialOrd, Ord,
30)]
31pub struct ListFilter {
32 pub page: Option<usize>,
34 pub limit: Option<usize>,
36}
37
38pub struct ListResult<T> {
40 pub items: Vec<T>,
42 pub limit: Option<i64>,
44 pub total: Option<i64>,
46 pub page: Option<i64>,
48}