movie detail page + importer architecture fix

This commit is contained in:
2026-05-10 23:59:26 +02:00
parent f2f1317660
commit b2a2aa4262
49 changed files with 1670 additions and 264 deletions

View File

@@ -5,7 +5,8 @@ use crate::{
errors::DomainError,
events::{DomainEvent, EventEnvelope},
models::{
DiaryEntry, DiaryFilter, ExportFormat, FeedEntry, ImportProfile, ImportSession, Movie,
AnnotatedRow, DiaryEntry, DiaryFilter, ExportFormat, FeedEntry, FieldMapping,
FileFormat, ImportError, ImportProfile, ImportSession, Movie, MovieStats, ParsedFile,
Review, ReviewHistory, User, UserStats, UserSummary, UserTrends,
collections::{PageParams, Paginated},
},
@@ -15,6 +16,11 @@ use crate::{
},
};
pub trait DocumentParser: Send + Sync {
fn parse(&self, bytes: &[u8], format: FileFormat) -> Result<ParsedFile, ImportError>;
fn apply_mapping(&self, file: &ParsedFile, mappings: &[FieldMapping]) -> Vec<AnnotatedRow>;
}
#[derive(Debug, Clone, Default, PartialEq)]
pub enum FeedSortBy {
#[default]
@@ -104,6 +110,12 @@ pub trait DiaryRepository: Send + Sync {
) -> Result<Paginated<FeedEntry>, DomainError>;
async fn get_review_history(&self, movie_id: &MovieId) -> Result<ReviewHistory, DomainError>;
async fn get_user_history(&self, user_id: &UserId) -> Result<Vec<DiaryEntry>, DomainError>;
async fn get_movie_stats(&self, movie_id: &MovieId) -> Result<MovieStats, DomainError>;
async fn get_movie_social_feed(
&self,
movie_id: &MovieId,
page: &PageParams,
) -> Result<Paginated<FeedEntry>, DomainError>;
}
#[async_trait]