Skip to main content

authx_core/models/
user.rs

1use chrono::{DateTime, Utc};
2use serde::{Deserialize, Serialize};
3use uuid::Uuid;
4
5#[derive(Debug, Clone, Serialize, Deserialize)]
6pub struct User {
7    pub id: Uuid,
8    pub email: String,
9    pub email_verified: bool,
10    pub username: Option<String>,
11    pub created_at: DateTime<Utc>,
12    pub updated_at: DateTime<Utc>,
13    pub metadata: serde_json::Value,
14}
15
16#[derive(Debug, Clone)]
17pub struct CreateUser {
18    pub email: String,
19    pub username: Option<String>,
20    pub metadata: Option<serde_json::Value>,
21}
22
23#[derive(Debug, Clone, Default)]
24pub struct UpdateUser {
25    pub email: Option<String>,
26    pub email_verified: Option<bool>,
27    pub username: Option<String>,
28    pub metadata: Option<serde_json::Value>,
29}