domain: add person enrichment fields, event, port

This commit is contained in:
2026-06-11 13:30:19 +02:00
parent 549923b92e
commit 7df24a19ee
15 changed files with 198 additions and 19 deletions

View File

@@ -1,7 +1,10 @@
use async_trait::async_trait;
use domain::{
errors::DomainError,
models::{CastCredit, CrewCredit, ExternalPersonId, Person, PersonCredits, PersonId},
models::{
CastCredit, CrewCredit, ExternalPersonId, Person, PersonCredits, PersonEnrichmentData,
PersonId,
},
ports::{PersonCommand, PersonQuery},
value_objects::MovieId,
};
@@ -111,6 +114,14 @@ impl PersonCommand for SqlitePersonAdapter {
}
Ok((count, has_more))
}
async fn update_enrichment(
&self,
_id: &PersonId,
_data: &PersonEnrichmentData,
) -> Result<(), DomainError> {
todo!("person enrichment persistence")
}
}
#[async_trait]
@@ -259,7 +270,7 @@ struct PersonRow {
impl PersonRow {
fn into_person(self) -> Person {
let ext = ExternalPersonId::new(self.external_id);
Person::new(
Person::basic(
PersonId::from_uuid(uuid::Uuid::parse_str(&self.id).unwrap_or_default()),
ext,
self.name,

View File

@@ -46,7 +46,7 @@ async fn pool_with_schema() -> SqlitePool {
fn make_person(tmdb_id: i64, name: &str, dept: Option<&str>) -> Person {
let ext = ExternalPersonId::new(format!("tmdb:{tmdb_id}"));
Person::new(
Person::basic(
PersonId::from_external(&ext),
ext,
name.to_string(),