smbcloud_model/
forgot.rs

1use serde::Serialize;
2
3#[derive(Debug, Serialize)]
4pub struct Args {
5    pub user: Email,
6}
7
8#[derive(Debug, Serialize)]
9pub struct Email {
10    pub email: String,
11}
12
13#[derive(Debug, Serialize)]
14pub struct Param {
15    pub user: UserUpdatePassword,
16}
17
18#[derive(Debug, Serialize)]
19pub struct UserUpdatePassword {
20    pub reset_password_token: String,
21    pub password: String,
22    pub password_confirmation: String,
23}
24
25#[cfg(test)]
26mod tests {
27    use super::*;
28    use serde_json::json;
29    #[test]
30    fn test_update_password() {
31        let args = Args {
32            user: Email {
33                email: "test".to_owned(),
34            },
35        };
36        let json = json!({
37            "user": {
38                "email": "test",
39            },
40        });
41        assert_eq!(serde_json::to_value(args).unwrap(), json);
42    }
43}