Skip to main content

docbox_http/models/
admin.rs

1use docbox_core::database::models::document_box::DocumentBox;
2use garde::Validate;
3use serde::{Deserialize, Serialize};
4use utoipa::ToSchema;
5
6#[derive(Default, Debug, Validate, Deserialize, Serialize, ToSchema)]
7#[serde(default)]
8pub struct TenantDocumentBoxesRequest {
9    /// Optional query to search document boxes by
10    #[garde(skip)]
11    pub query: Option<String>,
12
13    /// Number of items to include in the response
14    #[garde(skip)]
15    pub size: Option<u16>,
16
17    /// Offset to start results from
18    #[garde(skip)]
19    pub offset: Option<u64>,
20}
21
22#[derive(Debug, Serialize, ToSchema)]
23pub struct TenantDocumentBoxesResponse {
24    /// The document boxes
25    pub results: Vec<DocumentBox>,
26    /// The total number of document boxes available to query
27    pub total: i64,
28}
29
30#[derive(Debug, Serialize, ToSchema)]
31pub struct TenantStatsResponse {
32    /// Total number of files within the document box
33    pub total_files: i64,
34    /// Total number of links within the document box
35    pub total_links: i64,
36    /// Total number of folders within the document box
37    pub total_folders: i64,
38    /// Total size of all files within the tenant
39    pub file_size: i64,
40}