collaboflow_rs/record/
user.rs

1use serde::{Deserialize, Serialize};
2
3#[derive(Debug, Deserialize, Clone, Serialize)]
4pub struct UserRecord {
5    pub id: String,
6    pub userid: String,
7    pub name: String,
8    pub name_reading: String,
9    pub employee_code: String,
10    pub phone: String,
11    pub phone_mobile: String,
12    pub fax: String,
13    pub email: String,
14    pub email_mobile: String,
15    pub password_change_required: String,
16    pub lockout: String,
17    pub order: i32,
18    pub admin: String,
19    pub groups: Vec<String>,
20    pub titles: Vec<String>,
21    pub extra1: String,
22    pub extra2: String,
23    pub extra3: String,
24    pub extra4: String,
25    pub extra5: String,
26}
27
28#[derive(Debug, Clone, Deserialize, Serialize)]
29pub struct NewUserRecord {
30    pub userid: String,
31    pub name: String,
32    pub name_reading: String,
33    pub employee_code: String,
34    pub phone: String,
35    pub phone_mobile: String,
36    pub fax: String,
37    pub email: String,
38    pub email_mobile: String,
39    pub password_change_required: bool,
40    pub lockout: bool,
41    pub order: i32,
42    pub admin: bool,
43    pub groups: Vec<String>,
44    pub titles: Vec<String>,
45    pub extra1: String,
46    pub extra2: String,
47    pub extra3: String,
48    pub extra4: String,
49    pub extra5: String,
50    pub password: String,
51}
52
53impl NewUserRecord {
54    pub fn new(
55        userid: &str,
56        name: &str,
57        name_reading: &str,
58        employee_code: &str,
59        phone: &str,
60        phone_mobile: &str,
61        fax: &str,
62        email: &str,
63        email_mobile: &str,
64        password_change_required: bool,
65        lockout: bool,
66        order: i32,
67        admin: bool,
68        groups: Vec<String>,
69        titles: Vec<String>,
70        extra1: &str,
71        extra2: &str,
72        extra3: &str,
73        extra4: &str,
74        extra5: &str,
75        password: &str,
76    ) -> Self {
77        Self {
78            userid: userid.to_string(),
79            name: name.to_string(),
80            name_reading: name_reading.to_string(),
81            employee_code: employee_code.to_string(),
82            phone: phone.to_string(),
83            phone_mobile: phone_mobile.to_string(),
84            fax: fax.to_string(),
85            email: email.to_string(),
86            email_mobile: email_mobile.to_string(),
87            password_change_required,
88            lockout,
89            order,
90            admin,
91            groups,
92            titles,
93            extra1: extra1.to_string(),
94            extra2: extra2.to_string(),
95            extra3: extra3.to_string(),
96            extra4: extra4.to_string(),
97            extra5: extra5.to_string(),
98            password: password.to_string(),
99        }
100    }
101}
102
103#[derive(Debug, Deserialize, Clone, Serialize)]
104pub struct CreateUser {
105    pub id: String,
106    pub loginid: String,
107    pub name: String,
108}
109
110#[derive(Debug, Deserialize, Clone, Serialize)]
111pub struct RequestUser {
112    pub id: String,
113    pub loginid: String,
114    pub name: String,
115}
116
117#[derive(Debug, Deserialize, Clone, Serialize, PartialEq, Eq)]
118pub struct RepresentUser {
119    pub id: String,
120    pub loginid: String,
121    pub name: String,
122}
123
124#[derive(Debug, Deserialize, Clone, Serialize, PartialEq, Eq)]
125pub struct EmptyRepresentUser {}