refactor(integrations): IngestWatchEventDeps, scoped Arc deps, WatchEventCleanupJob
This commit is contained in:
@@ -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)]
|
||||
|
||||
Reference in New Issue
Block a user