feat: wrapup date validation, delete endpoint, failed record cleanup
Some checks failed
CI / Check / Test (push) Failing after 41s

This commit is contained in:
2026-06-03 00:54:08 +02:00
parent 3f483f8f81
commit 241063c914
13 changed files with 194 additions and 7 deletions

View File

@@ -9,7 +9,7 @@ use uuid::Uuid;
use application::wrapup::{
commands::RequestWrapUpCommand,
generate, get_wrapup,
delete as delete_wrapup, generate, get_wrapup,
list_wrapups::{self, ListWrapUpsQuery},
};
use domain::errors::DomainError;
@@ -194,6 +194,26 @@ pub async fn get_video(State(state): State<AppState>, Path(id): Path<Uuid>) -> i
}
}
#[utoipa::path(
delete, path = "/api/v1/wrapups/{id}",
params(("id" = Uuid, Path, description = "Wrap-up ID")),
responses(
(status = 204, description = "Deleted"),
(status = 401, description = "Unauthorized"),
(status = 403, description = "Forbidden — admin only"),
(status = 404, description = "Not found"),
),
security(("bearer_auth" = []))
)]
pub async fn delete_wrapup_handler(
State(state): State<AppState>,
_admin: AdminApiUser,
Path(id): Path<Uuid>,
) -> Result<StatusCode, ApiError> {
delete_wrapup::execute(&state.app_ctx, WrapUpId::from_uuid(id)).await?;
Ok(StatusCode::NO_CONTENT)
}
// ── HTML handlers ───────────────────────────────────────────────────────────
fn format_watch_time(minutes: u32) -> String {