todo: exporter

This commit is contained in:
2026-05-09 14:30:11 +02:00
parent ebab30b1ea
commit 6cd332f758
6 changed files with 96 additions and 16 deletions

View File

@@ -1,4 +1,5 @@
use chrono::NaiveDateTime;
use domain::models::ExportFormat;
use uuid::Uuid;
pub struct LogReviewCommand {
@@ -35,3 +36,8 @@ pub struct DeleteReviewCommand {
pub review_id: Uuid,
pub requesting_user_id: Uuid,
}
pub struct ExportCommand {
pub user_id: Uuid,
pub format: ExportFormat,
}

View File

@@ -0,0 +1,23 @@
use std::sync::Arc;
use domain::{
errors::DomainError,
ports::{DiaryExporter, MovieRepository},
};
use crate::commands::ExportCommand;
pub struct ExportDiary {
repository: Arc<dyn MovieRepository>,
exporter: Arc<dyn DiaryExporter>,
}
impl ExportDiary {
pub async fn execute(&self, req: ExportCommand) -> Result<Vec<u8>, DomainError> {
// 1. fetch all diary entries for the user
// 2. delegate serialization to the port (exporter)
// Return bytes of the exported diary, which can be written to a file or returned in an HTTP response
Ok(vec![])
}
}

View File

@@ -1,4 +1,5 @@
pub mod delete_review;
pub mod export_diary;
pub mod get_activity_feed;
pub mod get_diary;
pub mod get_review_history;