collab: Clean up LLM token creation (#26955)

This PR cleans up the LLM token creation a bit.

We now pass in the entire list of feature flags to the
`LlmTokenClaims::create` method to prevent having a bunch of confusable
`bool` parameters.

Release Notes:

- N/A
This commit is contained in:
Marshall Bowers 2025-03-17 18:25:43 -04:00 committed by GitHub
parent 2b2b9c1624
commit 1397e01735
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 26 additions and 14 deletions

View file

@ -43,6 +43,20 @@ pub enum Relation {
Contributor,
}
impl Model {
/// Returns the timestamp of when the user's account was created.
///
/// This will be the earlier of the `created_at` and `github_user_created_at` timestamps.
pub fn account_created_at(&self) -> NaiveDateTime {
let mut account_created_at = self.created_at;
if let Some(github_created_at) = self.github_user_created_at {
account_created_at = account_created_at.min(github_created_at);
}
account_created_at
}
}
impl Related<super::access_token::Entity> for Entity {
fn to() -> RelationDef {
Relation::AccessToken.def()