diff options
| author | soryu <soryu@soryu.co> | 2026-01-17 05:37:47 +0000 |
|---|---|---|
| committer | soryu <soryu@soryu.co> | 2026-01-17 05:38:07 +0000 |
| commit | 2f62df1cc89a23a5bd30e1a3f68a39bcfce9665c (patch) | |
| tree | c658378488cf6db293f7ca71d3ca957249a6309e /makima/src/server/handlers/contracts.rs | |
| parent | 75d9644d44ba998a32ed14c072e883a75145ab72 (diff) | |
| download | soryu-2f62df1cc89a23a5bd30e1a3f68a39bcfce9665c.tar.gz soryu-2f62df1cc89a23a5bd30e1a3f68a39bcfce9665c.zip | |
Add heartbeat commits
Diffstat (limited to 'makima/src/server/handlers/contracts.rs')
| -rw-r--r-- | makima/src/server/handlers/contracts.rs | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/makima/src/server/handlers/contracts.rs b/makima/src/server/handlers/contracts.rs index afca3d7..684ab2b 100644 --- a/makima/src/server/handlers/contracts.rs +++ b/makima/src/server/handlers/contracts.rs @@ -340,6 +340,22 @@ pub async fn create_contract( ); } + // Record history event for contract creation + let _ = repository::record_history_event( + pool, + auth.owner_id, + Some(contract.id), + None, + "contract", + Some("created"), + Some(&contract.phase), + serde_json::json!({ + "name": &contract.name, + "type": &contract.contract_type, + "description": &contract.description, + }), + ).await; + // Get the summary version with counts match repository::get_contract_summary_for_owner(pool, contract.id, auth.owner_id).await { @@ -474,6 +490,21 @@ pub async fn update_contract( tokio::spawn(async move { cleanup_contract_worktrees(&pool_clone, &state_clone, contract_id).await; }); + + // Record history event for contract completion + let _ = repository::record_history_event( + pool, + auth.owner_id, + Some(contract.id), + None, + "contract", + Some("completed"), + Some(&contract.phase), + serde_json::json!({ + "name": &contract.name, + "status": &contract.status, + }), + ).await; } // Get summary with counts @@ -1255,6 +1286,21 @@ pub async fn change_phase( } } + // Record history event for phase change + let _ = repository::record_history_event( + pool, + auth.owner_id, + Some(contract.id), + None, + "phase", + Some("changed"), + Some(&contract.phase), + serde_json::json!({ + "contractName": &contract.name, + "newPhase": &contract.phase, + }), + ).await; + // Get summary with counts match repository::get_contract_summary_for_owner(pool, contract.id, auth.owner_id).await { |
