refactor(domain): Row structs for from_persistence, ID newtypes, kill clippy.toml

- delete clippy.toml (too-many-arguments-threshold=20 hack)
- ChannelRow/MediaItemRow/LibraryItemRow structs for from_persistence
- SnapshotId/ActivityEventId/PlaybackRecordId newtypes
- DomainError variants use ChannelId/UserId instead of Uuid
- ActivityEvent.channel_id: Option<ChannelId> not Option<Uuid>
- InMemory repos key on newtype IDs
- AlgorithmicParams struct for schedule engine
- update all adapters/application/presentation callers
This commit is contained in:
2026-07-12 05:00:49 +02:00
parent 031cba5cfb
commit c0e685a4ee
65 changed files with 684 additions and 695 deletions

View File

@@ -1,7 +1,7 @@
use std::sync::Arc;
use domain::testing::{InMemoryChannelRepository, NoopEventPublisher};
use domain::value_objects::UserId;
use domain::value_objects::{ChannelId, UserId};
use crate::channels::commands::CreateChannelCommand;
use crate::channels::deps::{ChannelCommandDeps, ChannelQueryDeps};
@@ -28,7 +28,7 @@ async fn get_existing_channel() {
let channel = create::execute(
&cmd_deps,
CreateChannelCommand {
owner_id: UserId::generate().value(),
owner_id: UserId::generate(),
name: "Findable".into(),
timezone: "UTC".into(),
},
@@ -39,7 +39,7 @@ async fn get_existing_channel() {
let found = get::execute(
&query_deps,
GetChannelQuery {
channel_id: channel.id().value(),
channel_id: channel.id(),
},
)
.await
@@ -56,7 +56,7 @@ async fn get_nonexistent_returns_none() {
let found = get::execute(
&query_deps,
GetChannelQuery {
channel_id: uuid::Uuid::new_v4(),
channel_id: ChannelId::generate(),
},
)
.await