2025-03-24 16:47:42 +01:00
|
|
|
use chrono::{DateTime, Utc};
|
|
|
|
|
use serde::{Deserialize, Serialize};
|
2026-03-29 18:49:10 +02:00
|
|
|
use utoipa::ToSchema;
|
2025-03-24 16:47:42 +01:00
|
|
|
|
|
|
|
|
/// DTO representing an item in the trash
|
2026-03-29 18:49:10 +02:00
|
|
|
#[derive(Debug, Serialize, Deserialize, ToSchema)]
|
2025-03-24 16:47:42 +01:00
|
|
|
pub struct TrashedItemDto {
|
|
|
|
|
pub id: String,
|
|
|
|
|
pub original_id: String,
|
|
|
|
|
pub item_type: String, // "file" o "folder"
|
|
|
|
|
pub name: String,
|
|
|
|
|
pub original_path: String,
|
|
|
|
|
pub trashed_at: DateTime<Utc>,
|
|
|
|
|
pub days_until_deletion: i64,
|
2026-03-17 16:08:12 +08:00
|
|
|
/// Human-readable category (e.g., "Image", "Folder", "Document")
|
|
|
|
|
pub category: String,
|
|
|
|
|
/// FontAwesome icon class for the file type
|
|
|
|
|
pub icon_class: String,
|
|
|
|
|
/// Special CSS class for icon styling (e.g., "image-icon", "pdf-icon")
|
|
|
|
|
pub icon_special_class: String,
|
2025-03-24 16:47:42 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// Request to move an item to trash
|
2026-03-29 18:49:10 +02:00
|
|
|
#[derive(Debug, Deserialize, ToSchema)]
|
2025-03-24 16:47:42 +01:00
|
|
|
pub struct MoveToTrashRequest {
|
|
|
|
|
pub item_id: String,
|
|
|
|
|
pub item_type: String, // "file" o "folder"
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// Request to restore an item from trash
|
2026-03-29 18:49:10 +02:00
|
|
|
#[derive(Debug, Deserialize, ToSchema)]
|
2025-03-24 16:47:42 +01:00
|
|
|
pub struct RestoreFromTrashRequest {
|
|
|
|
|
pub trash_id: String,
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// Request to permanently delete an item from trash
|
2026-03-29 18:49:10 +02:00
|
|
|
#[derive(Debug, Deserialize, ToSchema)]
|
2025-03-24 16:47:42 +01:00
|
|
|
pub struct DeletePermanentlyRequest {
|
|
|
|
|
pub trash_id: String,
|
2026-02-14 01:29:34 +01:00
|
|
|
}
|