use crate::dto::AFRole; use chrono::{DateTime, Utc}; use serde::{Deserialize, Serialize}; use sqlx::FromRow; use uuid::Uuid; /// Represent the row of the af_workspace table #[derive(Debug, Clone, FromRow, Serialize, Deserialize)] pub struct AFWorkspaceRow { pub workspace_id: Uuid, pub database_storage_id: Option, pub owner_uid: Option, pub created_at: Option>, pub workspace_type: i32, pub deleted_at: Option>, pub workspace_name: Option, } /// Represent the row of the af_user table #[derive(Debug, FromRow, Deserialize, Serialize, Clone)] pub struct AFUserRow { pub uid: i64, pub uuid: Option, pub email: Option, pub password: Option, pub name: Option, pub metadata: Option, pub encryption_sign: Option, pub deleted_at: Option>, pub updated_at: Option>, pub created_at: Option>, } /// Represent the row of the af_user_profile_view #[derive(Debug, FromRow, Deserialize, Serialize)] pub struct AFUserProfileRow { pub uid: Option, pub uuid: Option, pub email: Option, pub password: Option, pub name: Option, pub metadata: Option, pub encryption_sign: Option, pub deleted_at: Option>, pub updated_at: Option>, pub created_at: Option>, pub latest_workspace_id: Option, } #[derive(FromRow, Serialize, Deserialize)] pub struct AFWorkspaceMemberRow { pub name: String, pub email: String, pub role: AFRole, } #[derive(FromRow, Clone, Debug, Serialize, Deserialize)] pub struct AFCollabMemberRow { pub uid: i64, pub oid: String, pub permission_id: i64, } #[derive(FromRow, Serialize, Deserialize)] pub struct AFBlobMetadataRow { pub workspace_id: Uuid, pub file_id: String, pub file_type: String, pub file_size: i64, pub modified_at: DateTime, } #[derive(Debug, Deserialize, Serialize, Clone)] pub struct AFUserNotification { pub payload: Option, }