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:
2026-07-12 01:57:38 +02:00
parent 2976600d12
commit 6fd47f2d93
18 changed files with 909 additions and 0 deletions

View 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,
}