refactor: LOW cleanups — dedup secure_flag, remove vestigial social_query,

drop PersistedImportSession, rename LoginQuery→LoginCommand, own
DeleteAccountDeps, PersonId via uuid_id! macro, rename SortDirection→
ReviewSortBy, TUI fs::read→Command, generic PaginatedResponse<T>
This commit is contained in:
2026-07-10 05:04:35 +02:00
parent 5266646b0b
commit 5e0dde656c
37 changed files with 167 additions and 218 deletions

View File

@@ -15,16 +15,6 @@ pub struct ImportSession {
pub expires_at: NaiveDateTime,
}
pub struct PersistedImportSession {
pub id: ImportSessionId,
pub user_id: UserId,
pub parsed_file: Option<ParsedFile>,
pub field_mappings: Option<Vec<FieldMapping>>,
pub row_results: Option<Vec<AnnotatedRow>>,
pub created_at: NaiveDateTime,
pub expires_at: NaiveDateTime,
}
impl ImportSession {
pub fn new(user_id: UserId) -> Self {
let created_at = chrono::Utc::now().naive_utc();
@@ -39,16 +29,4 @@ impl ImportSession {
expires_at,
}
}
pub fn from_persistence(p: PersistedImportSession) -> Self {
Self {
id: p.id,
user_id: p.user_id,
parsed_file: p.parsed_file,
field_mappings: p.field_mappings,
row_results: p.row_results,
created_at: p.created_at,
expires_at: p.expires_at,
}
}
}

View File

@@ -47,8 +47,9 @@ pub use import::{
pub use import_profile::ImportProfile;
pub use import_session::ImportSession;
pub use person::{
CastCredit, CrewCredit, ExternalPersonId, Person, PersonCredits, PersonEnrichmentData, PersonId,
CastCredit, CrewCredit, ExternalPersonId, Person, PersonCredits, PersonEnrichmentData,
};
pub use crate::value_objects::PersonId;
pub use refresh_session::{GeneratedToken, RefreshSession};
pub use search::{
EntityType, IndexableDocument, MovieSearchHit, PersonSearchHit, SearchFilters, SearchQuery,
@@ -85,7 +86,7 @@ impl std::str::FromStr for GoalType {
}
#[derive(Clone, Debug, Default)]
pub enum SortDirection {
pub enum ReviewSortBy {
#[default]
Descending,
Ascending,

View File

@@ -1,25 +1,4 @@
use uuid::Uuid;
use crate::value_objects::MovieId;
#[derive(Clone, Debug, PartialEq)]
pub struct PersonId(Uuid);
impl PersonId {
pub fn from_uuid(uuid: Uuid) -> Self {
Self(uuid)
}
/// Deterministic UUIDv5 from an external person ID string.
/// "tmdb:12345" always maps to the same PersonId.
pub fn from_external(external_id: &ExternalPersonId) -> Self {
Self(Uuid::new_v5(&Uuid::NAMESPACE_URL, external_id.0.as_bytes()))
}
pub fn value(&self) -> Uuid {
self.0
}
}
use crate::value_objects::{MovieId, PersonId};
#[derive(Clone, Debug, PartialEq)]
pub struct ExternalPersonId(String);

View File

@@ -165,7 +165,7 @@ impl DiaryEntry {
#[derive(Clone, Debug, Default)]
pub struct DiaryFilter {
pub sort_by: super::SortDirection,
pub sort_by: super::ReviewSortBy,
pub page: crate::models::collections::PageParams,
pub movie_id: Option<MovieId>,
pub user_id: Option<UserId>,