2024-10-21 00:05:20 +02:00
|
|
|
use fully_pub::fully_pub;
|
|
|
|
|
use chrono::{DateTime, Utc};
|
|
|
|
|
use serde::{Deserialize, Serialize};
|
|
|
|
|
|
|
|
|
|
#[derive(sqlx::Type, Clone, Debug, Serialize, Deserialize, PartialEq)]
|
|
|
|
|
#[derive(strum_macros::Display)]
|
|
|
|
|
#[fully_pub]
|
|
|
|
|
enum UserStatus {
|
|
|
|
|
Active,
|
|
|
|
|
Disabled
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#[derive(sqlx::FromRow, Deserialize, Serialize, Debug)]
|
|
|
|
|
#[fully_pub]
|
|
|
|
|
struct User {
|
|
|
|
|
/// uuid
|
|
|
|
|
id: String,
|
|
|
|
|
handle: String,
|
|
|
|
|
full_name: Option<String>,
|
|
|
|
|
email: Option<String>,
|
|
|
|
|
website: Option<String>,
|
2024-11-02 17:37:57 +01:00
|
|
|
picture: Option<Vec<u8>>, // embeded blob to store profile pic
|
2024-10-21 00:05:20 +02:00
|
|
|
password_hash: Option<String>, // argon2 password hash
|
|
|
|
|
status: UserStatus,
|
|
|
|
|
activation_token: Option<String>,
|
|
|
|
|
|
|
|
|
|
last_login_at: Option<DateTime<Utc>>,
|
|
|
|
|
created_at: DateTime<Utc>
|
|
|
|
|
}
|
|
|
|
|
|