collapse 20 pass-through use cases; handlers call ports directly

delete get/list/list_by_owner channels, get_settings/activity_log admin,
get_item/get_sync_status/list_collections/list_seasons/list_shows/list_genres library,
get/list/delete providers, get/list/patch_label config_snapshots,
get_active/list_history/delete_after schedule — all single-delegation.

remove ChannelQueryDeps, LibraryQueryDeps, deleted query/command structs.
add direct port fields to AppState. update MCP crate accordingly.
This commit is contained in:
2026-07-12 07:18:26 +02:00
parent a6558e15b2
commit e2393be635
68 changed files with 191 additions and 1589 deletions

View File

@@ -2,14 +2,15 @@ use axum::Json;
use axum::extract::{Path, State};
use axum::http::StatusCode;
use axum::response::IntoResponse;
use chrono::Utc;
use api_types::{
CurrentBroadcastResponse, ScheduleHistoryEntry, ScheduleResponse, SlotResponse,
};
use application::schedule::{
GenerateScheduleCommand, GetActiveScheduleQuery, GetCurrentBroadcastQuery, GetEpgQuery,
GetStreamUrlQuery, ListHistoryQuery,
GenerateScheduleCommand, GetCurrentBroadcastQuery, GetEpgQuery, GetStreamUrlQuery,
};
use domain::value_objects::ChannelId;
use crate::errors::AppError;
use crate::extractors::CurrentUser;
@@ -30,8 +31,8 @@ pub async fn get_active_schedule(
CurrentUser(_user): CurrentUser,
Path(id): Path<uuid::Uuid>,
) -> Result<axum::response::Response, AppError> {
let query = GetActiveScheduleQuery { channel_id: id };
match application::schedule::get_active::execute(&state.schedule_deps, query).await? {
let channel_id = ChannelId::from(id);
match state.schedule_query.find_active(channel_id, Utc::now()).await? {
Some(schedule) => Ok(Json(ScheduleResponse::from(schedule)).into_response()),
None => Ok(StatusCode::NO_CONTENT.into_response()),
}
@@ -85,9 +86,8 @@ pub async fn list_schedule_history(
CurrentUser(_user): CurrentUser,
Path(id): Path<uuid::Uuid>,
) -> Result<Json<Vec<ScheduleHistoryEntry>>, AppError> {
let query = ListHistoryQuery { channel_id: id };
let history =
application::schedule::list_history::execute(&state.schedule_deps, query).await?;
let channel_id = ChannelId::from(id);
let history = state.schedule_query.list_schedule_history(channel_id).await?;
Ok(Json(
history
.into_iter()