chore: implement database crud for AI seat usage#22681
Conversation
This stack of pull requests is managed by Graphite. Learn more about stacking. |
c6a32c9 to
23f2238
Compare
a5a74c3 to
e563220
Compare
4b4cd29 to
dd4605d
Compare
844f670 to
fe47143
Compare
| last_used_at timestamptz NOT NULL, | ||
| last_event_type ai_seat_usage_reason NOT NULL, | ||
| last_event_description text NOT NULL, |
There was a problem hiding this comment.
What's the goal of all of these last_* columns? I could see the use for last_used_at for determining if a seat is still in use, but the last_event_* columns seem a bit superfluous and would be better suited by an audit log entry.
There was a problem hiding this comment.
The audit log only records when a user first consumes an AI seat. Not subsequent AI event usage. These last* columns are just visibility and lightweight activity tracking.
There was some UX conversations on how to show what users are consuming the AI seats. In that view, it would be beneficial to show how recently, or how long ago, the user used an AI feature. "User last used an AI feature [3 weeks ago / Today]".
When implementing that "activity" request, it felt only natural to also indicate what the event was.
There was a problem hiding this comment.
I think it's fine for now if that's the case
fe47143 to
9e07704
Compare
9e07704 to
c3ce378
Compare

Creates a new table
ai_seat_stateto keep track of when users consume an ai_seat. Once a user consumes an AI seat, they will forever in this table (as it stands today).