summaryrefslogtreecommitdiff
path: root/makima/src/db/models.rs
diff options
context:
space:
mode:
Diffstat (limited to 'makima/src/db/models.rs')
-rw-r--r--makima/src/db/models.rs30
1 files changed, 8 insertions, 22 deletions
diff --git a/makima/src/db/models.rs b/makima/src/db/models.rs
index bfed942..2951159 100644
--- a/makima/src/db/models.rs
+++ b/makima/src/db/models.rs
@@ -2880,8 +2880,8 @@ pub struct UpdateDirectiveStepRequest {
// =============================================================================
/// 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.
+/// similar to GitHub Issues or Linear cards. Orders are linked to directives
+/// for execution.
#[derive(Debug, Clone, FromRow, Serialize, Deserialize, ToSchema)]
#[serde(rename_all = "camelCase")]
pub struct Order {
@@ -2901,8 +2901,8 @@ pub struct Order {
pub directive_id: Option<Uuid>,
/// Linked directive step (optional)
pub directive_step_id: Option<Uuid>,
- /// Linked contract (optional)
- pub contract_id: Option<Uuid>,
+ /// Denormalized directive name for searchability (auto-populated by DB trigger)
+ pub directive_name: Option<String>,
/// Repository context
pub repository_url: Option<String>,
pub created_at: DateTime<Utc>,
@@ -2920,8 +2920,8 @@ pub struct CreateOrderRequest {
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>,
+ /// Directive ID is required for new orders.
+ pub directive_id: Uuid,
pub repository_url: Option<String>,
}
@@ -2942,7 +2942,6 @@ pub struct UpdateOrderRequest {
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>,
}
@@ -2967,8 +2966,8 @@ pub struct OrderListQuery {
pub priority: Option<String>,
/// Filter by linked directive ID
pub directive_id: Option<Uuid>,
- /// Filter by linked contract ID
- pub contract_id: Option<Uuid>,
+ /// Text search across title, description, and directive_name (case-insensitive)
+ pub search: Option<String>,
}
/// Request body for linking an order to a directive.
@@ -2978,17 +2977,4 @@ 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,
-}