Skip to main content

web/
model.rs

1use chrono::prelude::*;
2use serde::{Deserialize, Serialize};
3
4#[derive(Debug, Deserialize, Serialize, Clone)]
5/// The authenticated principal. Deliberately carries neither the password hash
6/// nor the tenant database name.
7pub struct User {
8    pub id: uuid::Uuid,
9    pub name: String,
10    pub email: String,
11    pub role: String,
12    pub photo: String,
13    pub verified: bool,
14    #[serde(rename = "createdAt")]
15    pub created_at: Option<DateTime<Utc>>,
16    #[serde(rename = "updatedAt")]
17    pub updated_at: Option<DateTime<Utc>>,
18}
19
20#[derive(Debug, Deserialize)]
21pub struct RegisterUserSchema {
22    pub name: String,
23    pub email: String,
24    pub password: String,
25}
26
27#[derive(Debug, Deserialize)]
28pub struct LoginUserSchema {
29    pub email: String,
30    pub password: String,
31}