Skip to main content

alibi_sqlx/store/entities/
account.rs

1use crate::AuthEntity;
2use chrono::{DateTime, Utc};
3use serde::Serialize;
4
5#[derive(AuthEntity, Clone, Debug, PartialEq, Eq, Serialize, sqlx::FromRow)]
6#[auth(role = "account", table = "account")]
7pub struct Model {
8    pub id: String,
9    #[sqlx(rename = "accountId")]
10    pub account_id: String,
11    #[sqlx(rename = "providerId")]
12    pub provider_id: String,
13    #[sqlx(rename = "userId")]
14    pub user_id: String,
15    #[sqlx(rename = "accessToken")]
16    pub access_token: Option<String>,
17    #[sqlx(rename = "refreshToken")]
18    pub refresh_token: Option<String>,
19    #[sqlx(rename = "idToken")]
20    pub id_token: Option<String>,
21    #[sqlx(rename = "accessTokenExpiresAt")]
22    pub access_token_expires_at: Option<DateTime<Utc>>,
23    #[sqlx(rename = "refreshTokenExpiresAt")]
24    pub refresh_token_expires_at: Option<DateTime<Utc>>,
25    pub scope: Option<String>,
26    pub password: Option<String>,
27    #[sqlx(rename = "createdAt")]
28    pub created_at: DateTime<Utc>,
29    #[sqlx(rename = "updatedAt")]
30    pub updated_at: DateTime<Utc>,
31}