From 389b72e55b04ccfc02b04eb81cb8f7bb7a5c8b59 Mon Sep 17 00:00:00 2001
From: T <t@tjp.lol>
Date: Wed, 13 Aug 2025 13:04:05 -0600
Subject: history filtering

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

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

diff --git a/internal/database/queries.sql b/internal/database/queries.sql
index 6d1108f..1ab9f44 100644
--- a/internal/database/queries.sql
+++ b/internal/database/queries.sql
@@ -294,9 +294,12 @@ select
 from time_entry te
 where date(te.start_time, 'localtime') = date('now', 'localtime');
 
--- name: GetRecentTimeEntries :many
+-- name: GetFilteredTimeEntries :many
 select * from time_entry 
 where start_time >= @start_time
+  and (@end_time is null or start_time <= @end_time)
+  and (@client_id is null or client_id = @client_id)
+  and (@project_id is null or project_id = @project_id)
 order by start_time desc;
 
 -- name: UpdateActiveTimerDescription :exec
-- 
cgit v1.2.3

