refactor: DDD/CQRS architecture, unified crate layout
- crates: common→application, api→presentation, infrastructure/*→adapters/* - new crates: api-types, infra-wiring - domain: errors/, models/, value_objects/, ports/, services/ - application: CQRS use cases (songs/, tabs/) w/ commands, queries, deps - unified DomainError replaces RepositoryError - workspace deps, unused dep cleanup - fix: parse plain-text chord lines (UG drops spans mid-song) - tests extracted to separate modules (tests/ dirs)
This commit is contained in:
19
crates/application/src/songs/update_meta.rs
Normal file
19
crates/application/src/songs/update_meta.rs
Normal file
@@ -0,0 +1,19 @@
|
||||
use domain::errors::DomainError;
|
||||
use domain::models::SongSummary;
|
||||
|
||||
use super::commands::UpdateSongMetaCommand;
|
||||
use super::deps::SongCommandDeps;
|
||||
|
||||
pub async fn execute(
|
||||
deps: &SongCommandDeps,
|
||||
cmd: UpdateSongMetaCommand,
|
||||
) -> Result<SongSummary, DomainError> {
|
||||
deps.repo
|
||||
.update_meta(
|
||||
cmd.id,
|
||||
cmd.title.as_deref(),
|
||||
cmd.artist.as_deref(),
|
||||
cmd.original_key.as_deref(),
|
||||
)
|
||||
.await
|
||||
}
|
||||
Reference in New Issue
Block a user