yauth_entity/
account_lockout.rs1use chrono::NaiveDateTime;
2use serde::{Deserialize, Serialize};
3use uuid::Uuid;
4
5#[derive(Debug, Clone, Serialize, Deserialize)]
6pub struct AccountLock {
7 pub id: Uuid,
8 pub user_id: Uuid,
9 pub failed_count: i32,
10 pub locked_until: Option<NaiveDateTime>,
11 pub lock_count: i32,
12 pub locked_reason: Option<String>,
13 pub created_at: NaiveDateTime,
14 pub updated_at: NaiveDateTime,
15}
16
17#[derive(Debug, Clone, Serialize, Deserialize)]
18pub struct NewAccountLock {
19 pub id: Uuid,
20 pub user_id: Uuid,
21 pub failed_count: i32,
22 pub locked_until: Option<NaiveDateTime>,
23 pub lock_count: i32,
24 pub locked_reason: Option<String>,
25 pub created_at: NaiveDateTime,
26 pub updated_at: NaiveDateTime,
27}
28
29#[derive(Debug, Clone, Serialize, Deserialize)]
30pub struct UnlockToken {
31 pub id: Uuid,
32 pub user_id: Uuid,
33 pub token_hash: String,
34 pub expires_at: NaiveDateTime,
35 pub created_at: NaiveDateTime,
36}
37
38#[derive(Debug, Clone, Serialize, Deserialize)]
39pub struct NewUnlockToken {
40 pub id: Uuid,
41 pub user_id: Uuid,
42 pub token_hash: String,
43 pub expires_at: NaiveDateTime,
44 pub created_at: NaiveDateTime,
45}