use super::task_repository::RepositoryError;
use crate::domain::models::WebhookEvent;
use async_trait::async_trait;
#[async_trait]
pub trait WebhookEventRepository: Send + Sync {
async fn create(&self, event: &WebhookEvent) -> Result<WebhookEvent, RepositoryError>;
async fn find_by_id(
&self,
id: crate::domain::id::Id,
) -> Result<Option<WebhookEvent>, RepositoryError>;
async fn find_pending(&self, limit: u64) -> Result<Vec<WebhookEvent>, RepositoryError>;
async fn claim_pending(&self, limit: u64) -> Result<Vec<WebhookEvent>, RepositoryError>;
async fn find_by_team_id_paginated(
&self,
team_id: crate::domain::id::Id,
limit: u32,
offset: u32,
) -> Result<Vec<WebhookEvent>, RepositoryError>;
async fn count_by_team_id(
&self,
team_id: crate::domain::id::Id,
) -> Result<u64, RepositoryError>;
async fn update(&self, event: &WebhookEvent) -> Result<WebhookEvent, RepositoryError>;
}