| 1 | use super::RepositoryResult; |
| 2 | use crate::domain::{WebhookDelivery, WebhookId}; |
| 3 | |
| 4 | |
| 5 | |
| 6 | |
| 7 | |
| 8 | pub trait WebhookDeliveryRepository: Send + Sync { |
| 9 | |
| 10 | |
| 11 | |
| 12 | |
| 13 | |
| 14 | fn list_by_webhook( |
| 15 | &self, |
| 16 | webhook_id: &WebhookId, |
| 17 | offset: usize, |
| 18 | limit: usize, |
| 19 | ) -> impl Future<Output = RepositoryResult<Vec<WebhookDelivery>>> + Send; |
| 20 | |
| 21 | |
| 22 | fn count_by_webhook( |
| 23 | &self, |
| 24 | webhook_id: &WebhookId, |
| 25 | ) -> impl Future<Output = RepositoryResult<usize>> + Send; |
| 26 | |
| 27 | |
| 28 | |
| 29 | |
| 30 | |
| 31 | fn latest_by_webhook( |
| 32 | &self, |
| 33 | webhook_id: &WebhookId, |
| 34 | ) -> impl Future<Output = RepositoryResult<Option<WebhookDelivery>>> + Send; |
| 35 | |
| 36 | fn save(&self, delivery: &WebhookDelivery) |
| 37 | -> impl Future<Output = RepositoryResult<()>> + Send; |
| 38 | } |