@@ -46,6 +46,9 @@ pub struct AdminUserModel {
4646
4747 /// The roles assigned to the admin user.
4848 pub roles : Vec < RoleModel > ,
49+
50+ /// The preferred locale/language for the admin user.
51+ pub locale : String ,
4952}
5053
5154// region: impl try_from AdminUserModel
@@ -99,6 +102,7 @@ impl TryFrom<AdminUserModel> for GrpcAdminUserModel {
99102 created_by : val. created_by ,
100103 updated_by : val. updated_by ,
101104 roles : grpc_roles,
105+ locale : val. locale ,
102106 } ;
103107
104108 Ok ( model)
@@ -148,6 +152,7 @@ impl TryFrom<Object> for AdminUserModel {
148152 let updated_at = val. get ( "updated_at" ) . get_datetime ( ) ?;
149153 let created_by = val. get ( "created_by" ) . get_string ( ) ?;
150154 let updated_by = val. get ( "updated_by" ) . get_string ( ) ?;
155+ let locale = val. get ( "locale" ) . get_string ( ) . unwrap_or_else ( |_| String :: from ( "en" ) ) ;
151156
152157 Ok ( Self {
153158 id,
@@ -161,6 +166,7 @@ impl TryFrom<Object> for AdminUserModel {
161166 created_by,
162167 updated_by,
163168 roles,
169+ locale,
164170 } )
165171 }
166172}
@@ -188,6 +194,9 @@ pub struct CreatableAdminUserModel {
188194
189195 /// The username of the user who is creating this admin user.
190196 pub logged_in_username : String ,
197+
198+ /// The preferred locale/language for the admin user.
199+ pub locale : String ,
191200 // pub role_ids: Vec<String>,
192201}
193202
@@ -202,7 +211,7 @@ pub struct UpdatableAdminUserModel {
202211
203212 /// The email address of the admin user.
204213 pub profile_image : String ,
205-
214+
206215 /// is the admin user has super admin privileges.
207216 pub is_super_admin : bool ,
208217
@@ -211,6 +220,9 @@ pub struct UpdatableAdminUserModel {
211220
212221 /// The roles assigned to the admin user.
213222 pub role_ids : Vec < String > ,
223+
224+ /// The preferred locale/language for the admin user.
225+ pub locale : String ,
214226}
215227
216228// /// Represents a paginated response for admin users.
0 commit comments