feat(users): Add optional fields to user schemas and update user avatar functionality
This commit is contained in:
@@ -47,13 +47,23 @@ mod auth_login_tests {
|
||||
id: crate::make_thing("app_users", &uuid::Uuid::new_v4().to_string()),
|
||||
email: email.to_string(),
|
||||
fullname: "Test User".to_string(),
|
||||
legal_name: None,
|
||||
password: hash_password(password).unwrap(),
|
||||
is_deleted: false,
|
||||
avatar: None,
|
||||
phone_number: "081234567890".to_string(),
|
||||
phone_for_verification: None,
|
||||
is_active,
|
||||
gender: None,
|
||||
birthdate: None,
|
||||
domicile: None,
|
||||
identity_document_url: None,
|
||||
bio: None,
|
||||
last_education: None,
|
||||
linkedin_url: None,
|
||||
github_url: None,
|
||||
cv_url: None,
|
||||
portfolio_url: None,
|
||||
role: crate::make_thing("app_roles", &role.id),
|
||||
mentor_id: None,
|
||||
created_at: imphnen_utils::get_iso_date(),
|
||||
|
||||
@@ -21,13 +21,23 @@ mod auth_repository_test {
|
||||
id: make_thing("app_users", &Uuid::new_v4().to_string()),
|
||||
email: email.to_string(),
|
||||
fullname: "Test User".to_string(),
|
||||
legal_name: None,
|
||||
password: "password".to_string(),
|
||||
is_deleted: false,
|
||||
avatar: None,
|
||||
phone_number: "081234567890".to_string(),
|
||||
phone_for_verification: None,
|
||||
is_active: true,
|
||||
gender: None,
|
||||
birthdate: None,
|
||||
domicile: None,
|
||||
identity_document_url: None,
|
||||
bio: None,
|
||||
last_education: None,
|
||||
linkedin_url: None,
|
||||
github_url: None,
|
||||
cv_url: None,
|
||||
portfolio_url: None,
|
||||
role: make_thing("app_roles", &get_role_id(state).await),
|
||||
mentor_id: None,
|
||||
created_at: get_iso_date(),
|
||||
@@ -71,12 +81,22 @@ mod auth_repository_test {
|
||||
let mock_user = UsersDetailQueryDto {
|
||||
id: make_thing(&ResourceEnum::UsersCache.to_string(), &email),
|
||||
fullname: "Test User".into(),
|
||||
legal_name: None,
|
||||
email: email.clone(),
|
||||
avatar: None,
|
||||
phone_number: "08123456789".into(),
|
||||
phone_for_verification: None,
|
||||
is_active: true,
|
||||
gender: None,
|
||||
birthdate: None,
|
||||
domicile: None,
|
||||
identity_document_url: None,
|
||||
bio: None,
|
||||
last_education: None,
|
||||
linkedin_url: None,
|
||||
github_url: None,
|
||||
cv_url: None,
|
||||
portfolio_url: None,
|
||||
role: RolesDetailQueryDto {
|
||||
id: make_thing("app_roles", &Uuid::new_v4().to_string()),
|
||||
name: "Dummy Role".into(),
|
||||
|
||||
@@ -21,13 +21,23 @@ pub fn create_test_user(
|
||||
id: make_thing("app_users", &Uuid::new_v4().to_string()),
|
||||
email: email.to_string(),
|
||||
fullname: format!("Randomize {} {}", fullname, rand::random::<u32>()),
|
||||
legal_name: None,
|
||||
password: hash_password("secret").unwrap(),
|
||||
is_deleted: false,
|
||||
avatar: None,
|
||||
phone_number: "081234567890".to_string(),
|
||||
phone_for_verification: None,
|
||||
is_active,
|
||||
gender: None,
|
||||
birthdate: None,
|
||||
domicile: None,
|
||||
identity_document_url: None,
|
||||
bio: None,
|
||||
last_education: None,
|
||||
linkedin_url: None,
|
||||
github_url: None,
|
||||
cv_url: None,
|
||||
portfolio_url: None,
|
||||
role: make_thing("app_roles", role_id),
|
||||
created_at: get_iso_date(),
|
||||
updated_at: get_iso_date(),
|
||||
|
||||
@@ -149,15 +149,25 @@ pub async fn seed_users_for_test(
|
||||
let user = UsersSchema {
|
||||
id: Thing::from(("app_users", id)),
|
||||
fullname: fullname.into(),
|
||||
legal_name: None,
|
||||
email: email.into(),
|
||||
password: hash_password("password").unwrap(),
|
||||
avatar: None,
|
||||
phone_number: "081234567890".into(),
|
||||
phone_for_verification: None,
|
||||
is_active: true,
|
||||
is_deleted: false,
|
||||
mentor_id: None,
|
||||
gender: None,
|
||||
birthdate: None,
|
||||
domicile: None,
|
||||
identity_document_url: None,
|
||||
bio: None,
|
||||
last_education: None,
|
||||
linkedin_url: None,
|
||||
github_url: None,
|
||||
cv_url: None,
|
||||
portfolio_url: None,
|
||||
role: Thing::from(("app_roles", role_id)),
|
||||
created_at: get_iso_date(),
|
||||
updated_at: get_iso_date(),
|
||||
|
||||
Reference in New Issue
Block a user