diff options
| author | soryu <soryu@soryu.co> | 2026-02-14 21:29:26 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-02-14 21:29:26 +0000 |
| commit | 9aadbc7958d39d181c0dd0600e2b7c30bb6c391a (patch) | |
| tree | ef8bed9718c39041191b58a284ee31f5d8d32521 /makima/src/db/models.rs | |
| parent | c1e55ce4fec79f9909b957f86bd7fa8b76939746 (diff) | |
| download | soryu-9aadbc7958d39d181c0dd0600e2b7c30bb6c391a.tar.gz soryu-9aadbc7958d39d181c0dd0600e2b7c30bb6c391a.zip | |
Makima system improvements: Orders, directive questions, PR creation fix, bug fixes (#62)
* feat: soryu-co/soryu - makima: Fix directive goal update bug - stale closure issue
* WIP: heartbeat checkpoint
* WIP: heartbeat checkpoint
* feat: soryu-co/soryu - makima: Create Orders database schema and backend API
* feat: soryu-co/soryu - makima: Fix task Claude instance not receiving user inputs from input box
* WIP: heartbeat checkpoint
* feat: soryu-co/soryu - makima: Build Orders frontend page replacing the Board page
* WIP: heartbeat checkpoint
* WIP: heartbeat checkpoint
* feat: soryu-co/soryu - makima: Fix directive PR creation system
Diffstat (limited to 'makima/src/db/models.rs')
| -rw-r--r-- | makima/src/db/models.rs | 125 |
1 files changed, 125 insertions, 0 deletions
diff --git a/makima/src/db/models.rs b/makima/src/db/models.rs index 131dffc..6ec6cf4 100644 --- a/makima/src/db/models.rs +++ b/makima/src/db/models.rs @@ -2714,6 +2714,8 @@ pub struct Directive { pub pr_url: Option<String>, pub pr_branch: Option<String>, pub completion_task_id: Option<Uuid>, + /// Whether questions pause execution indefinitely until answered + pub reconcile_mode: bool, pub goal_updated_at: DateTime<Utc>, pub started_at: Option<DateTime<Utc>>, pub version: i32, @@ -2763,6 +2765,8 @@ pub struct DirectiveSummary { pub orchestrator_task_id: Option<Uuid>, pub pr_url: Option<String>, pub completion_task_id: Option<Uuid>, + /// Whether questions pause execution indefinitely until answered + pub reconcile_mode: bool, pub version: i32, pub created_at: DateTime<Utc>, pub updated_at: DateTime<Utc>, @@ -2789,6 +2793,8 @@ pub struct CreateDirectiveRequest { pub repository_url: Option<String>, pub local_path: Option<String>, pub base_branch: Option<String>, + /// Whether questions pause execution indefinitely until answered + pub reconcile_mode: Option<bool>, } /// Request to update a directive. @@ -2804,6 +2810,8 @@ pub struct UpdateDirectiveRequest { pub orchestrator_task_id: Option<Uuid>, pub pr_url: Option<String>, pub pr_branch: Option<String>, + /// Whether questions pause execution indefinitely until answered + pub reconcile_mode: Option<bool>, pub version: Option<i32>, } @@ -2848,3 +2856,120 @@ pub struct UpdateDirectiveStepRequest { pub order_index: Option<i32>, } +// ============================================================================= +// Order Types +// ============================================================================= + +/// An order — a card-based work item (feature, bug, spike, chore, improvement) +/// similar to GitHub Issues or Linear cards. Orders can be linked to directives +/// or contracts for execution. +#[derive(Debug, Clone, FromRow, Serialize, Deserialize, ToSchema)] +#[serde(rename_all = "camelCase")] +pub struct Order { + pub id: Uuid, + pub owner_id: Uuid, + pub title: String, + pub description: Option<String>, + /// Priority: critical, high, medium, low, none + pub priority: String, + /// Status: open, in_progress, done, archived + pub status: String, + /// Type of work: feature, bug, spike, chore, improvement + pub order_type: String, + /// Flexible labels as JSON array of strings + pub labels: serde_json::Value, + /// Linked directive (optional) + pub directive_id: Option<Uuid>, + /// Linked directive step (optional) + pub directive_step_id: Option<Uuid>, + /// Linked contract (optional) + pub contract_id: Option<Uuid>, + /// Repository context + pub repository_url: Option<String>, + pub created_at: DateTime<Utc>, + pub updated_at: DateTime<Utc>, +} + +/// Request to create a new order. +#[derive(Debug, Deserialize, ToSchema)] +#[serde(rename_all = "camelCase")] +pub struct CreateOrderRequest { + pub title: String, + pub description: Option<String>, + pub priority: Option<String>, + pub status: Option<String>, + pub order_type: Option<String>, + #[serde(default = "default_empty_labels")] + pub labels: serde_json::Value, + pub directive_id: Option<Uuid>, + pub contract_id: Option<Uuid>, + pub repository_url: Option<String>, +} + +/// Default empty JSON array for labels. +fn default_empty_labels() -> serde_json::Value { + serde_json::json!([]) +} + +/// Request to update an existing order. +#[derive(Debug, Default, Deserialize, ToSchema)] +#[serde(rename_all = "camelCase")] +pub struct UpdateOrderRequest { + pub title: Option<String>, + pub description: Option<String>, + pub priority: Option<String>, + pub status: Option<String>, + pub order_type: Option<String>, + pub labels: Option<serde_json::Value>, + pub directive_id: Option<Uuid>, + pub directive_step_id: Option<Uuid>, + pub contract_id: Option<Uuid>, + pub repository_url: Option<String>, +} + +/// Response for order list endpoint. +#[derive(Debug, Serialize, ToSchema)] +#[serde(rename_all = "camelCase")] +pub struct OrderListResponse { + pub orders: Vec<Order>, + pub total: i64, +} + +/// Query parameters for listing orders. +#[derive(Debug, Deserialize, ToSchema)] +#[serde(rename_all = "camelCase")] +pub struct OrderListQuery { + /// Filter by status (e.g., "open", "in_progress", "done", "archived") + pub status: Option<String>, + /// Filter by order type (e.g., "feature", "bug", "spike", "chore", "improvement") + #[serde(rename = "type")] + pub order_type: Option<String>, + /// Filter by priority (e.g., "critical", "high", "medium", "low", "none") + pub priority: Option<String>, + /// Filter by linked directive ID + pub directive_id: Option<Uuid>, + /// Filter by linked contract ID + pub contract_id: Option<Uuid>, +} + +/// Request body for linking an order to a directive. +#[derive(Debug, Deserialize, ToSchema)] +#[serde(rename_all = "camelCase")] +pub struct LinkDirectiveRequest { + pub directive_id: Uuid, +} + +/// Request body for linking an order to a contract. +#[derive(Debug, Deserialize, ToSchema)] +#[serde(rename_all = "camelCase")] +pub struct LinkContractRequest { + pub contract_id: Uuid, +} + +/// Request body for converting an order to a directive step. +#[derive(Debug, Deserialize, ToSchema)] +#[serde(rename_all = "camelCase")] +pub struct ConvertToStepRequest { + pub directive_id: Uuid, +} + |
