30 lines
983 B
Rust
30 lines
983 B
Rust
use sea_orm::entity::prelude::*;
|
|
use serde::{Deserialize, Serialize};
|
|
|
|
#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Serialize, Deserialize)]
|
|
#[sea_orm(table_name = "api_clients")]
|
|
pub struct Model {
|
|
#[sea_orm(primary_key, auto_increment = false)]
|
|
pub id: Uuid,
|
|
pub tenant_id: Uuid,
|
|
pub client_id: String,
|
|
pub client_secret_hash: String,
|
|
pub client_name: String,
|
|
pub scopes: serde_json::Value,
|
|
pub allowed_patient_ids: Option<serde_json::Value>,
|
|
pub rate_limit_per_minute: i32,
|
|
pub is_active: bool,
|
|
pub token_lifetime_seconds: i32,
|
|
pub created_at: chrono::DateTime<chrono::FixedOffset>,
|
|
pub updated_at: chrono::DateTime<chrono::FixedOffset>,
|
|
pub created_by: Option<Uuid>,
|
|
pub updated_by: Option<Uuid>,
|
|
pub deleted_at: Option<chrono::DateTime<chrono::FixedOffset>>,
|
|
pub version: i32,
|
|
}
|
|
|
|
#[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)]
|
|
pub enum Relation {}
|
|
|
|
impl ActiveModelBehavior for ActiveModel {}
|