diff options
Diffstat (limited to 'makima/src/db/models.rs')
| -rw-r--r-- | makima/src/db/models.rs | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/makima/src/db/models.rs b/makima/src/db/models.rs index 18f3435..fcccd05 100644 --- a/makima/src/db/models.rs +++ b/makima/src/db/models.rs @@ -2938,10 +2938,16 @@ pub struct UpdateDirectiveStepRequest { // Directive Document Types // ============================================================================= -/// A directive document — one of N markdown documents owned by a directive. -/// The user calls these "directive contracts". Each document has its own -/// lifecycle (draft → active → shipped → archived) and may be attached to a -/// PR. Multiple documents can be active under the same directive at once. +/// A directive document — the user-facing "contract" in the unified +/// directive UI. One of N specs owned by a directive. Each runs +/// sequentially in the directive's shared worktree (or, when +/// `merge_mode = 'own_pr'`, on its own branch). `position` defines +/// queue order. +/// +/// Naming note: this struct stays `DirectiveDocument` internally because +/// a legacy `Contract` struct (from the pre-directive contracts system) +/// still exists. The API and frontend expose this as "Contract"; the +/// table/struct rename lands once legacy contracts are dropped (Phase 5). #[derive(Debug, Clone, FromRow, Serialize, Deserialize, ToSchema)] #[serde(rename_all = "camelCase")] pub struct DirectiveDocument { @@ -2956,6 +2962,12 @@ pub struct DirectiveDocument { pub shipped_at: Option<DateTime<Utc>>, pub archived_at: Option<DateTime<Utc>>, pub version: i32, + /// Queue position within the parent directive (0-indexed). Lower + /// numbers run earlier; only one contract is active at a time. + pub position: i32, + /// Where this contract's commits land. `shared` (default): the + /// directive's branch. `own_pr`: a contract-specific branch + PR. + pub merge_mode: String, pub created_at: DateTime<Utc>, pub updated_at: DateTime<Utc>, } |
