paperless_api/note.rs
1//! Types related to notes.
2
3use chrono::{DateTime, Utc};
4use serde::Deserialize;
5
6use crate::id::{NoteId, UserId};
7
8/// A note associated with a document.
9#[derive(Debug, Clone, Deserialize)]
10pub struct Note {
11 /// Unique identifier for the note.
12 pub id: NoteId,
13
14 /// When the note was created.
15 pub created: DateTime<Utc>,
16
17 /// The user who created the note.
18 pub user: NoteUser,
19
20 /// The content of the note.
21 #[serde(rename = "note")]
22 pub content: String,
23}
24
25/// The user who created the note.
26#[derive(Debug, Clone, Deserialize)]
27pub struct NoteUser {
28 /// Unique identifier for the user.
29 pub id: UserId,
30
31 /// The username of the user.
32 pub username: String,
33
34 /// The first name of the user.
35 pub first_name: String,
36
37 /// The last name of the user.
38 pub last_name: String,
39}