refactor(integrations): IngestWatchEventDeps, scoped Arc deps, WatchEventCleanupJob

This commit is contained in:
2026-06-11 22:01:15 +02:00
parent 76edd52bb0
commit b29f3020e6
22 changed files with 216 additions and 216 deletions

View File

@@ -1,14 +1,20 @@
use std::sync::Arc;
use domain::{
errors::DomainError,
ports::WebhookTokenRepository,
value_objects::{UserId, WebhookTokenId},
};
use crate::{context::AppContext, integrations::commands::RevokeWebhookTokenCommand};
use crate::integrations::commands::RevokeWebhookTokenCommand;
pub async fn execute(ctx: &AppContext, cmd: RevokeWebhookTokenCommand) -> Result<(), DomainError> {
pub async fn execute(
webhook_token: Arc<dyn WebhookTokenRepository>,
cmd: RevokeWebhookTokenCommand,
) -> Result<(), DomainError> {
let user_id = UserId::from_uuid(cmd.user_id);
let token_id = WebhookTokenId::from_uuid(cmd.token_id);
ctx.repos.webhook_token.delete(&token_id, &user_id).await
webhook_token.delete(&token_id, &user_id).await
}
#[cfg(test)]