This commit is contained in:
2026-06-11 13:51:33 +02:00
parent 0fdc79af23
commit c05087a6c7
9 changed files with 76 additions and 36 deletions

View File

@@ -9,5 +9,8 @@ pub async fn execute(
person_id: PersonId,
data: PersonEnrichmentData,
) -> Result<(), DomainError> {
ctx.repos.person_command.update_enrichment(&person_id, &data).await
ctx.repos
.person_command
.update_enrichment(&person_id, &data)
.await
}

View File

@@ -11,12 +11,14 @@ const ENRICHMENT_TTL_DAYS: i64 = 90;
pub async fn execute(ctx: &AppContext, id: PersonId) -> Result<PersonCredits, DomainError> {
let credits = ctx.repos.person_query.get_credits(&id).await?;
if should_enrich(&credits.person) {
let _ = ctx.services.event_publisher.publish(
&DomainEvent::PersonEnrichmentRequested {
let _ = ctx
.services
.event_publisher
.publish(&DomainEvent::PersonEnrichmentRequested {
person_id: id,
external_person_id: credits.person.external_id().value().to_string(),
},
).await;
})
.await;
}
Ok(credits)
}