chore: cleaning code

This commit is contained in:
Maulana Sodiqin
2025-05-20 01:49:50 +07:00
parent d97095a38d
commit 1e5ed26f76
19 changed files with 274 additions and 236 deletions
+22 -2
View File
@@ -139,10 +139,10 @@ pub struct UsersListQueryDto {
}
impl UsersListQueryDto {
pub fn from(&self, role: String) -> UsersListItemDto {
pub fn from(&self) -> UsersListItemDto {
UsersListItemDto {
id: self.id.id.to_raw(),
role,
role: self.role.name.clone(),
fullname: self.fullname.clone(),
email: self.email.clone(),
avatar: self.avatar.clone(),
@@ -170,3 +170,23 @@ pub struct UsersDetailQueryDto {
pub created_at: String,
pub updated_at: String,
}
impl UsersDetailQueryDto {
pub fn from(&self) -> Self {
Self {
id: self.id.clone(),
role: RolesDetailQueryDto::from(self.role.clone()),
fullname: self.fullname.clone(),
email: self.email.clone(),
avatar: self.avatar.clone(),
phone_number: self.phone_number.clone(),
is_active: self.is_active,
gender: self.gender.clone(),
is_deleted: self.is_deleted,
password: self.password.clone(),
birthdate: self.birthdate.clone(),
created_at: self.created_at.clone(),
updated_at: self.updated_at.clone(),
}
}
}