Skip to main content

yauth_entity/
password.rs

1use chrono::NaiveDateTime;
2use serde::{Deserialize, Serialize};
3use uuid::Uuid;
4
5#[derive(Debug, Clone, Serialize, Deserialize)]
6pub struct Password {
7    pub user_id: Uuid,
8    pub password_hash: String,
9}
10
11#[derive(Debug, Clone, Serialize, Deserialize)]
12pub struct NewPassword {
13    pub user_id: Uuid,
14    pub password_hash: String,
15}
16
17#[derive(Debug, Clone, Serialize, Deserialize)]
18pub struct EmailVerification {
19    pub id: Uuid,
20    pub user_id: Uuid,
21    pub token_hash: String,
22    pub expires_at: NaiveDateTime,
23    pub created_at: NaiveDateTime,
24}
25
26#[derive(Debug, Clone, Serialize, Deserialize)]
27pub struct NewEmailVerification {
28    pub id: Uuid,
29    pub user_id: Uuid,
30    pub token_hash: String,
31    pub expires_at: NaiveDateTime,
32    pub created_at: NaiveDateTime,
33}
34
35#[derive(Debug, Clone, Serialize, Deserialize)]
36pub struct PasswordReset {
37    pub id: Uuid,
38    pub user_id: Uuid,
39    pub token_hash: String,
40    pub expires_at: NaiveDateTime,
41    pub used_at: Option<NaiveDateTime>,
42    pub created_at: NaiveDateTime,
43}
44
45#[derive(Debug, Clone, Serialize, Deserialize)]
46pub struct NewPasswordReset {
47    pub id: Uuid,
48    pub user_id: Uuid,
49    pub token_hash: String,
50    pub expires_at: NaiveDateTime,
51    pub created_at: NaiveDateTime,
52}