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:
32
crates/application/src/channels/commands.rs
Normal file
32
crates/application/src/channels/commands.rs
Normal file
@@ -0,0 +1,32 @@
|
||||
use uuid::Uuid;
|
||||
|
||||
use domain::models::ScheduleConfig;
|
||||
use domain::value_objects::RecyclePolicy;
|
||||
|
||||
/// Create a new channel.
|
||||
pub struct CreateChannelCommand {
|
||||
pub owner_id: Uuid,
|
||||
pub name: String,
|
||||
pub timezone: String,
|
||||
}
|
||||
|
||||
/// Update an existing channel (partial — only `Some` fields are applied).
|
||||
pub struct UpdateChannelCommand {
|
||||
pub channel_id: Uuid,
|
||||
/// Used for ownership check.
|
||||
pub owner_id: Uuid,
|
||||
pub name: Option<String>,
|
||||
/// `Some(None)` clears the description; `None` leaves it unchanged.
|
||||
pub description: Option<Option<String>>,
|
||||
pub timezone: Option<String>,
|
||||
pub schedule_config: Option<ScheduleConfig>,
|
||||
pub recycle_policy: Option<RecyclePolicy>,
|
||||
pub auto_schedule: Option<bool>,
|
||||
}
|
||||
|
||||
/// Delete a channel.
|
||||
pub struct DeleteChannelCommand {
|
||||
pub channel_id: Uuid,
|
||||
/// Used for ownership check.
|
||||
pub owner_id: Uuid,
|
||||
}
|
||||
Reference in New Issue
Block a user