From a7ee7f7280d593481501446008acc05e32abcd22 Mon Sep 17 00:00:00 2001
From: T <t@tjp.lol>
Date: Thu, 7 Aug 2025 13:11:24 -0600
Subject: entry edit and delete

---
 internal/database/queries.sql | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

(limited to 'internal/database/queries.sql')

diff --git a/internal/database/queries.sql b/internal/database/queries.sql
index f46f426..8eda5f4 100644
--- a/internal/database/queries.sql
+++ b/internal/database/queries.sql
@@ -39,6 +39,10 @@ where end_time is null
 order by start_time desc
 limit 1;
 
+-- name: GetTimeEntryById :one
+select * from time_entry
+where id = @entry_id;
+
 -- name: StopTimeEntry :one
 update time_entry 
 set end_time = datetime('now', 'utc')
@@ -314,6 +318,17 @@ where id = (
 	limit 1
 );
 
+-- name: EditTimeEntry :exec
+update time_entry
+set
+	start_time = @start_time,
+	end_time = @end_time,
+	description = @description,
+	client_id = @client_id,
+	project_id = @project_id,
+	billable_rate = @hourly_rate
+where id = @entry_id;
+
 -- name: RemoveTimeEntry :exec
 delete from time_entry
 where id = @entry_id;
-- 
cgit v1.2.3

