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:
@@ -1,6 +1,5 @@
|
||||
use domain::events::DomainEvent;
|
||||
use domain::models::Channel;
|
||||
use domain::value_objects::{ChannelId, UserId};
|
||||
use domain::DomainResult;
|
||||
|
||||
use super::commands::UpdateChannelCommand;
|
||||
@@ -8,16 +7,13 @@ use super::deps::ChannelCommandDeps;
|
||||
use super::find_owned_channel;
|
||||
|
||||
pub async fn execute(deps: &ChannelCommandDeps, cmd: UpdateChannelCommand) -> DomainResult<Channel> {
|
||||
let channel_id = ChannelId::from(cmd.channel_id);
|
||||
let owner_id = UserId::from(cmd.owner_id);
|
||||
|
||||
let mut channel =
|
||||
find_owned_channel(deps.channel_query.as_ref(), channel_id, owner_id, cmd.channel_id)
|
||||
find_owned_channel(deps.channel_query.as_ref(), cmd.channel_id, cmd.owner_id)
|
||||
.await?;
|
||||
|
||||
if cmd.schedule_config.is_some() {
|
||||
deps.channel_command
|
||||
.save_config_snapshot(channel_id, channel.schedule_config(), None)
|
||||
.save_config_snapshot(cmd.channel_id, channel.schedule_config(), None)
|
||||
.await?;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user