From aee6cda5fc8c44ebc45b274d07a1ed64052e3699 Mon Sep 17 00:00:00 2001 From: soryu Date: Tue, 17 Feb 2026 16:48:39 +0000 Subject: feat: smart cleanup, order linking, and improved PR titles (#69) * feat: soryu-co/soryu: Reorder navigation: move Orders before Contracts * feat: soryu-co/soryu: Generate PR titles from step content instead of directive title * feat: soryu-co/soryu: Add orderId field to step creation and link orders to steps * feat: soryu-co/soryu: Handle completed orders during plan-orders flow * WIP: heartbeat checkpoint * Merge origin/makima/soryu-co-soryu--handle-completed-orders-during-pla-5aa9a15b (resolved conflicts) --- makima/src/db/models.rs | 10 +++++++++- makima/src/db/repository.rs | 3 ++- 2 files changed, 11 insertions(+), 2 deletions(-) (limited to 'makima/src/db') diff --git a/makima/src/db/models.rs b/makima/src/db/models.rs index f9a34b8..6b77563 100644 --- a/makima/src/db/models.rs +++ b/makima/src/db/models.rs @@ -2832,13 +2832,21 @@ pub struct UpdateGoalRequest { pub goal: String, } -/// Response for cleanup_directive_tasks. +/// Response for cleanup_directive_tasks (legacy). #[derive(Debug, Serialize, ToSchema)] #[serde(rename_all = "camelCase")] pub struct CleanupTasksResponse { pub deleted: i64, } +/// Response for cleanup_directive endpoint. +#[derive(Debug, Serialize, Deserialize, ToSchema)] +#[serde(rename_all = "camelCase")] +pub struct CleanupResponse { + pub message: String, + pub task_id: Option, +} + /// Response for pick_up_orders endpoint. #[derive(Debug, Serialize, ToSchema)] #[serde(rename_all = "camelCase")] diff --git a/makima/src/db/repository.rs b/makima/src/db/repository.rs index c7b0a1f..8d7a70c 100644 --- a/makima/src/db/repository.rs +++ b/makima/src/db/repository.rs @@ -5188,6 +5188,7 @@ pub async fn cleanup_directive_tasks( /// Row type for completed step tasks. #[derive(Debug, Clone, sqlx::FromRow)] pub struct CompletedStepTask { + pub step_id: Uuid, pub step_name: String, pub task_id: Uuid, pub task_name: String, @@ -5321,7 +5322,7 @@ pub async fn get_completed_step_tasks( ) -> Result, sqlx::Error> { sqlx::query_as::<_, CompletedStepTask>( r#" - SELECT ds.name as step_name, ds.task_id, t.name as task_name + SELECT ds.id as step_id, ds.name as step_name, ds.task_id, t.name as task_name FROM directive_steps ds JOIN tasks t ON t.id = ds.task_id WHERE ds.directive_id = $1 -- cgit v1.2.3