refactor: split domain models, move presentation logic out of app layer
Some checks failed
CI / Check / Test (push) Failing after 47s
Some checks failed
CI / Check / Test (push) Failing after 47s
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.
This commit is contained in:
28
crates/domain/src/models/feed.rs
Normal file
28
crates/domain/src/models/feed.rs
Normal file
@@ -0,0 +1,28 @@
|
||||
use super::{movie::Movie, review::{DiaryEntry, Review}};
|
||||
|
||||
#[derive(Clone, Debug)]
|
||||
pub struct FeedEntry {
|
||||
entry: DiaryEntry,
|
||||
user_email: String,
|
||||
}
|
||||
|
||||
impl FeedEntry {
|
||||
pub fn new(entry: DiaryEntry, user_email: String) -> Self {
|
||||
Self { entry, user_email }
|
||||
}
|
||||
pub fn movie(&self) -> &Movie {
|
||||
self.entry.movie()
|
||||
}
|
||||
pub fn review(&self) -> &Review {
|
||||
self.entry.review()
|
||||
}
|
||||
pub fn user_email(&self) -> &str {
|
||||
&self.user_email
|
||||
}
|
||||
pub fn user_display_name(&self) -> &str {
|
||||
self.user_email
|
||||
.split('@')
|
||||
.next()
|
||||
.unwrap_or(&self.user_email)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user