Refactor mentor and user schemas to centralize personal data management

- Updated `seed_mentor_user.rs` to include additional fields in the `app_users` creation and removed redundant fields from `app_mentors`.
- Modified `seed_users.rs` to initialize new user fields including legal name, domicile, and professional links.
- Adjusted `mentors_dto.rs` to remove personal data fields from `MentorDetailWithUserDto` and `MentorDetailResponseDto`, now sourced from `UsersSchema`.
- Updated `mentors_repository.rs` to search for user data through `user_id` instead of mentor fields.
- Refined `mentors_schema.rs` to remove personal data fields, now managed in `UsersSchema`.
- Enhanced `mentors_service.rs` to populate mentor responses with user data from `UsersSchema`.
- Removed identity document URL and related fields from various DTOs and schemas across the codebase.
- Updated tests to reflect the removal of identity document URL and ensure compatibility with the new schema structure.
This commit is contained in:
MythEclipse
2025-08-12 18:43:30 +07:00
parent 34b6cdabfb
commit 1b9251b2dd
12 changed files with 166 additions and 637 deletions
-6
View File
@@ -29,8 +29,6 @@ pub struct UsersSchema {
#[serde(skip_serializing_if = "Option::is_none")]
pub domicile: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub identity_document_url: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub bio: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub last_education: Option<String>,
@@ -70,7 +68,6 @@ impl Default for UsersSchema {
gender: None,
birthdate: None,
domicile: None,
identity_document_url: None,
bio: None,
last_education: None,
linkedin_url: None,
@@ -108,7 +105,6 @@ impl UsersSchema {
gender: dto.gender,
birthdate: dto.birthdate,
domicile: dto.domicile,
identity_document_url: dto.identity_document_url,
bio: dto.bio,
last_education: dto.last_education,
linkedin_url: dto.linkedin_url,
@@ -134,7 +130,6 @@ impl UsersSchema {
gender: user.gender,
birthdate: user.birthdate,
domicile: user.domicile,
identity_document_url: user.identity_document_url,
bio: user.bio,
last_education: user.last_education,
linkedin_url: user.linkedin_url,
@@ -170,7 +165,6 @@ impl UsersSchema {
gender: None,
birthdate: None,
domicile: None,
identity_document_url: None,
bio: None,
last_education: None,
linkedin_url: None,