Files
movies-diary/crates/application/src/ports.rs
Gabriel Kaszewski 70b3ca0f5c
Some checks failed
CI / Check / Test (push) Failing after 47s
refactor: split domain models, move presentation logic out of app layer
Split domain/models/mod.rs (630 lines) into focused files:
movie.rs, review.rs, user.rs, stats.rs, enrichment.rs, feed.rs.

Move URL/date formatting from application use cases to
presentation mappers — use cases now return raw domain data.

Delete watchlist/get_page.rs (was pure presentation logic),
replace with presentation/mappers/watchlist.rs.

Document signature conventions in CONTRIBUTING.md.
2026-06-09 02:29:11 +02:00

35 lines
855 B
Rust

use async_trait::async_trait;
use uuid::Uuid;
use domain::errors::DomainError;
use domain::models::DiaryEntry;
use crate::diary::commands::LogReviewCommand;
#[async_trait]
pub trait ReviewLogger: Send + Sync {
async fn log_review(&self, cmd: LogReviewCommand) -> Result<(), DomainError>;
}
pub struct HtmlPageContext {
pub user_email: Option<String>,
pub user_id: Option<Uuid>,
pub is_admin: bool,
pub register_enabled: bool,
pub rss_url: String,
pub page_title: String,
pub canonical_url: String,
pub csrf_token: String,
pub page_rss_url: Option<String>,
}
impl HtmlPageContext {
pub fn is_current_user(&self, id: Uuid) -> bool {
self.user_id == Some(id)
}
}
pub trait RssFeedRenderer: Send + Sync {
fn render_feed(&self, entries: &[DiaryEntry], title: &str) -> Result<String, String>;
}