chore: add audit log entry when ai seat is consumed (#22683)

When an ai seat is consumed, an audit log entry is made. This only happens the first time a seat is used.
This commit is contained in:
Steven Masley
2026-03-16 15:30:25 -05:00
committed by GitHub
parent 6972d073a2
commit 93b9d70a9b
26 changed files with 167 additions and 46 deletions
+5 -2
View File
@@ -1,4 +1,5 @@
-- name: UpsertAISeatState :exec
-- name: UpsertAISeatState :one
-- Returns true if a new rows was inserted, false otherwise.
INSERT INTO ai_seat_state (
user_id,
first_used_at,
@@ -15,7 +16,9 @@ SET
last_event_type = EXCLUDED.last_event_type,
last_event_description = EXCLUDED.last_event_description,
updated_at = EXCLUDED.updated_at
;
RETURNING
-- Postgres vodoo to know if a row was inserted.
(xmax = 0)::boolean AS is_new;
-- name: GetActiveAISeatCount :one
SELECT