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.rs16
1 files changed, 16 insertions, 0 deletions
diff --git a/makima/src/db/models.rs b/makima/src/db/models.rs
index 97657dc..1fe6e35 100644
--- a/makima/src/db/models.rs
+++ b/makima/src/db/models.rs
@@ -2733,6 +2733,22 @@ pub struct DirectiveGoalHistory {
pub created_at: DateTime<Utc>,
}
+/// Per-PR snapshot of a directive's goal — the immutable record of what the
+/// contract said at the moment a PR was raised. Frozen at PR-creation time;
+/// `pr_state` mirrors the PR's GitHub lifecycle ('open' | 'merged' | 'closed').
+#[derive(Debug, Clone, FromRow, Serialize, Deserialize, ToSchema)]
+#[serde(rename_all = "camelCase")]
+pub struct DirectiveRevision {
+ pub id: Uuid,
+ pub directive_id: Uuid,
+ pub content: String,
+ pub pr_url: String,
+ pub pr_branch: Option<String>,
+ pub pr_state: String,
+ pub version: i32,
+ pub frozen_at: DateTime<Utc>,
+}
+
/// A step in a directive's DAG.
#[derive(Debug, Clone, FromRow, Serialize, Deserialize, ToSchema)]
#[serde(rename_all = "camelCase")]