feat: implement TMDb enrichment for movie profiles

- Add SqliteMovieProfileRepository for managing movie profiles in SQLite.
- Create TmdbEnrichmentClient to fetch movie details from TMDb API.
- Implement enrichment event handling with EnrichmentHandler.
- Introduce periodic jobs for cleaning up expired import sessions and checking for stale movie profiles.
- Update application context to include movie profile repository.
- Add API endpoint to retrieve movie profiles.
- Extend domain models with new structures for movie enrichment (Genre, Keyword, CastMember, CrewMember, MovieProfile).
- Modify event system to include MovieEnrichmentRequested event.
- Enhance tests to cover new functionality and ensure stability.
This commit is contained in:
2026-05-12 13:23:41 +02:00
parent c696a3b780
commit 38d13fbff1
30 changed files with 1193 additions and 30 deletions

View File

@@ -1,6 +1,58 @@
use serde::{Deserialize, Serialize};
use uuid::Uuid;
// ── Movie profile (enrichment) ────────────────────────────────────────────────
#[derive(Debug, Clone, Serialize, Deserialize, utoipa::ToSchema)]
pub struct GenreDto {
pub tmdb_id: u32,
pub name: String,
}
#[derive(Debug, Clone, Serialize, Deserialize, utoipa::ToSchema)]
pub struct KeywordDto {
pub tmdb_id: u32,
pub name: String,
}
#[derive(Debug, Clone, Serialize, Deserialize, utoipa::ToSchema)]
pub struct CastMemberDto {
pub tmdb_person_id: u64,
pub name: String,
pub character: String,
pub billing_order: u32,
pub profile_path: Option<String>,
}
#[derive(Debug, Clone, Serialize, Deserialize, utoipa::ToSchema)]
pub struct CrewMemberDto {
pub tmdb_person_id: u64,
pub name: String,
pub job: String,
pub department: String,
pub profile_path: Option<String>,
}
#[derive(Debug, Clone, Serialize, Deserialize, utoipa::ToSchema)]
pub struct MovieProfileResponse {
pub tmdb_id: u64,
pub imdb_id: Option<String>,
pub overview: Option<String>,
pub tagline: Option<String>,
pub runtime_minutes: Option<u32>,
pub budget_usd: Option<i64>,
pub revenue_usd: Option<i64>,
pub vote_average: Option<f64>,
pub vote_count: Option<u32>,
pub original_language: Option<String>,
pub collection_name: Option<String>,
pub genres: Vec<GenreDto>,
pub keywords: Vec<KeywordDto>,
pub cast: Vec<CastMemberDto>,
pub crew: Vec<CrewMemberDto>,
pub enriched_at: String,
}
#[derive(Debug, Clone, Serialize, Deserialize, utoipa::ToSchema)]
pub struct MovieDto {
pub id: Uuid,