use sea_orm::entity::prelude::*;
use serde::{Deserialize, Serialize};
#[sea_orm::model]
#[derive(Clone, Debug, PartialEq, Eq, DeriveEntityModel, Serialize, Deserialize)]
#[sea_orm(table_name = "user")]
pub struct Model {
#[sea_orm(primary_key, auto_increment = false)]
pub id: Uuid,
pub name: String,
#[sea_orm(unique)]
pub email: String,
pub password: String,
pub salt: String,
pub oidc_user: bool,
#[sea_orm(unique)]
pub oidc_subject: Option<String>,
#[cfg(feature = "avatar")]
#[sea_orm(has_one)]
pub user_avatar: HasOne<super::user_avatar::Entity>,
#[sea_orm(has_many, via = "group_user")]
pub groups: HasMany<super::group::Entity>,
}
impl ActiveModelBehavior for ActiveModel {}