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.rs39
1 files changed, 39 insertions, 0 deletions
diff --git a/makima/src/db/models.rs b/makima/src/db/models.rs
index ca12eb2..8ab3a10 100644
--- a/makima/src/db/models.rs
+++ b/makima/src/db/models.rs
@@ -1507,3 +1507,42 @@ pub struct DaemonWithCapacity {
pub last_heartbeat_at: DateTime<Utc>,
pub connected_at: DateTime<Utc>,
}
+
+// ============================================================================
+// Repository History (for storing and suggesting previously used repositories)
+// ============================================================================
+
+/// Repository history entry - tracks previously used repositories for suggestions
+#[derive(Debug, Clone, FromRow, Serialize, ToSchema)]
+#[serde(rename_all = "camelCase")]
+pub struct RepositoryHistoryEntry {
+ pub id: Uuid,
+ pub owner_id: Uuid,
+ pub name: String,
+ pub repository_url: Option<String>,
+ pub local_path: Option<String>,
+ pub source_type: String,
+ pub use_count: i32,
+ pub last_used_at: DateTime<Utc>,
+ pub created_at: DateTime<Utc>,
+}
+
+/// Response for repository history list endpoint
+#[derive(Debug, Serialize, ToSchema)]
+#[serde(rename_all = "camelCase")]
+pub struct RepositoryHistoryListResponse {
+ pub entries: Vec<RepositoryHistoryEntry>,
+ pub total: i64,
+}
+
+/// Request for getting repository suggestions
+#[derive(Debug, Deserialize, ToSchema)]
+#[serde(rename_all = "camelCase")]
+pub struct RepositorySuggestionsQuery {
+ /// Filter by source type: 'remote' or 'local'
+ pub source_type: Option<String>,
+ /// Optional search query to filter by name or URL/path
+ pub query: Option<String>,
+ /// Limit results (default: 10)
+ pub limit: Option<i32>,
+}