Files
movies-diary/crates/application/src/import/deps.rs
Gabriel Kaszewski 020fbb891e
Some checks failed
CI / Check / Test (push) Failing after 9m16s
feat: always-on Insights — correlation analysis over viewing habits
Conservative, live insights (ADR-0010) derived from each user's diary:
rating lift by genre (first-time watches only), genre seasonality vs a
uniform 1/12 month baseline, medium weekend-lift, and watch-time rhythm.

- domain: WatchRow model, InsightsQuery port, pure insights_analyzer with
  all honesty thresholds (sample minimums, strength cutoffs, suppressions
  for import noise), unit-tested
- adapters: thin Sqlite/Postgres fetch twins, reusing WrapUp's genre fetch
- application: get_insights use case, InsightsGroup in Deps
- composition/server: wiring through Repositories/DatabaseOutput
- presentation: GET /api/v1/insights handler, typed serde-tagged DTOs,
  openapi doc
- spa: /insights route (shadcn cards), insights feature hook, profile
  entry link, en locale strings
- server test: end-to-end seed sqlite → HTTP → rating lift + rhythm

Also records ADR-0010, defines "Insight" in the glossary, and includes
pre-existing worktree comment-stripping cleanups.
2026-10-12 19:29:54 +02:00

59 lines
1.6 KiB
Rust

use std::sync::Arc;
use domain::ports::{DocumentParser, ImportProfileRepository, ImportSessionRepository, MovieQuery};
use crate::ports::ReviewLogger;
pub struct CreateSessionDeps {
pub import_session: Arc<dyn ImportSessionRepository>,
pub document_parser: Arc<dyn DocumentParser>,
}
pub struct ApplyMappingDeps {
pub import_session: Arc<dyn ImportSessionRepository>,
pub document_parser: Arc<dyn DocumentParser>,
pub movie_query: Arc<dyn MovieQuery>,
}
pub struct ApplyProfileDeps {
pub import_profile: Arc<dyn ImportProfileRepository>,
pub import_session: Arc<dyn ImportSessionRepository>,
}
pub struct ExecuteImportDeps {
pub import_session: Arc<dyn ImportSessionRepository>,
pub review_logger: Arc<dyn ReviewLogger>,
}
pub struct SaveProfileDeps {
pub import_session: Arc<dyn ImportSessionRepository>,
pub import_profile: Arc<dyn ImportProfileRepository>,
}
pub struct GetMappingStageDeps {
pub import_session: Arc<dyn ImportSessionRepository>,
}
pub struct GetPreviewStageDeps {
pub import_session: Arc<dyn ImportSessionRepository>,
}
pub struct GetSessionStateDeps {
pub import_session: Arc<dyn ImportSessionRepository>,
}
pub struct DeleteImportProfileDeps {
pub import_profile: Arc<dyn ImportProfileRepository>,
}
pub struct ListImportProfilesDeps {
pub import_profile: Arc<dyn ImportProfileRepository>,
}
pub struct ApplyProfileAndMapDeps {
pub import_profile: Arc<dyn ImportProfileRepository>,
pub import_session: Arc<dyn ImportSessionRepository>,
pub document_parser: Arc<dyn DocumentParser>,
pub movie_query: Arc<dyn MovieQuery>,
}