paperless_api/
document_type.rs1use serde::{Deserialize, Serialize};
2
3use crate::user::UserId;
4
5#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Deserialize, Serialize)]
6#[repr(transparent)]
7pub struct DocumentTypeId(pub i32);
8
9#[derive(Debug, Clone, Deserialize)]
10pub struct DocumentType {
11 pub id: DocumentTypeId,
12 pub slug: String,
13 pub name: String,
14
15 pub is_insensitive: Option<bool>,
16 pub document_count: u32,
17 pub owner: Option<UserId>,
18 pub user_can_change: bool,
19}
20
21impl std::fmt::Display for DocumentTypeId {
22 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
23 write!(f, "{}", self.0)
24 }
25}