test_support/test_helpers -> tests/support; watched_at unified w/ domain test_watched_at (2024-03-15). Kept inline: users::diary_filter tests (feed_sort_to_direction_all_variants, paged_user_filter_builds_correctly) - pub(super) helpers in private module. Dropped stale never-compiled users/tests/get_users.rs (old execute signature).
22 lines
582 B
Rust
22 lines
582 B
Rust
use std::sync::Arc;
|
|
|
|
use crate::wrapup::queries::ComputeWrapUpQuery;
|
|
use domain::errors::DomainError;
|
|
use domain::models::wrapup::WrapUpReport;
|
|
use domain::ports::WrapUpStatsQuery;
|
|
use domain::services::wrapup_analyzer;
|
|
|
|
pub async fn execute(
|
|
wrapup_stats: Arc<dyn WrapUpStatsQuery>,
|
|
query: ComputeWrapUpQuery,
|
|
) -> Result<WrapUpReport, DomainError> {
|
|
let rows = wrapup_stats
|
|
.get_reviews_with_profiles(&query.scope, &query.date_range)
|
|
.await?;
|
|
Ok(wrapup_analyzer::build_report(
|
|
query.scope,
|
|
query.date_range,
|
|
&rows,
|
|
))
|
|
}
|