Files
movies-diary/crates/application/src/wrapup/compute.rs
Gabriel Kaszewski 8526b77f18 test: move application tests to tests/
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).
2026-10-25 22:36:52 +01:00

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,
))
}