refactor: move AppContext to presentation crate, structurally enforce boundary
All checks were successful
CI / Check / Test (push) Successful in 39m33s

This commit is contained in:
2026-06-11 23:18:28 +02:00
parent b5cc7f8371
commit 57520c00f3
51 changed files with 268 additions and 377 deletions

View File

@@ -1,6 +1,8 @@
use std::sync::Arc;
use domain::{errors::DomainError, models::WebhookToken, ports::WebhookTokenRepository, value_objects::UserId};
use domain::{
errors::DomainError, models::WebhookToken, ports::WebhookTokenRepository, value_objects::UserId,
};
use sha2::{Digest, Sha256};
use crate::integrations::commands::GenerateWebhookTokenCommand;

View File

@@ -1,6 +1,8 @@
use std::sync::Arc;
use domain::{errors::DomainError, models::WatchEvent, ports::WatchEventRepository, value_objects::UserId};
use domain::{
errors::DomainError, models::WatchEvent, ports::WatchEventRepository, value_objects::UserId,
};
use crate::integrations::queries::GetWatchQueueQuery;

View File

@@ -1,6 +1,8 @@
use std::sync::Arc;
use domain::{errors::DomainError, models::WebhookToken, ports::WebhookTokenRepository, value_objects::UserId};
use domain::{
errors::DomainError, models::WebhookToken, ports::WebhookTokenRepository, value_objects::UserId,
};
use crate::integrations::queries::GetWebhookTokensQuery;

View File

@@ -17,10 +17,7 @@ pub async fn execute(
.await?
.ok_or_else(|| DomainError::Unauthorized("invalid webhook token".into()))?;
let _ = deps
.webhook_token
.touch_last_used(webhook_token.id())
.await;
let _ = deps.webhook_token.touch_last_used(webhook_token.id()).await;
let parsed = match parser.parse_playback_event(&cmd.raw_payload)? {
Some(event) => event,

View File

@@ -2,7 +2,9 @@ use std::sync::Arc;
use domain::models::WatchEventSource;
use domain::ports::{EventPublisher, WatchEventRepository, WebhookTokenRepository};
use domain::testing::{InMemoryWebhookTokenRepository, InMemoryWatchEventRepository, NoopEventPublisher};
use domain::testing::{
InMemoryWatchEventRepository, InMemoryWebhookTokenRepository, NoopEventPublisher,
};
use uuid::Uuid;
use crate::integrations::commands::{GenerateWebhookTokenCommand, IngestWatchEventCommand};