application: channels bounded context
CQRS use cases (create/update/delete/get/list/list_by_owner), ownership checks, auto-snapshot on config change. Channel setters added to domain model.
This commit is contained in:
16
crates/application/src/channels/get.rs
Normal file
16
crates/application/src/channels/get.rs
Normal file
@@ -0,0 +1,16 @@
|
||||
use domain::models::Channel;
|
||||
use domain::value_objects::ChannelId;
|
||||
use domain::DomainResult;
|
||||
|
||||
use super::deps::ChannelQueryDeps;
|
||||
use super::queries::GetChannelQuery;
|
||||
|
||||
/// Get a single channel by ID.
|
||||
pub async fn execute(deps: &ChannelQueryDeps, query: GetChannelQuery) -> DomainResult<Option<Channel>> {
|
||||
let channel_id = ChannelId::from(query.channel_id);
|
||||
deps.channel_query.find_by_id(channel_id).await
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
#[path = "tests/get.rs"]
|
||||
mod tests;
|
||||
Reference in New Issue
Block a user