- Enforce axum best practices across all 13 workspace crates (max 200 LOC/file, no comments, no unwrap, clean architecture) - Fix domain→infrastructure dependency inversions in imphnen-iam and imphnen-dimentorin - Extract imphnen-storage (MinIO) and imphnen-email (Lettre) as standalone crates - Centralize all config in ENV struct: CDN_URL, CORS_ALLOWED_ORIGINS - Centralize SMTP through imphnen-email; remove dead HackathonConfig - Centralize database: QR crate now shares main DB pool (single DATABASE_URL) - Rename QR users table to qr_users to avoid collision with main users table - Merge imphnen-qr into imphnen-cms/src/qr (13 crates, down from 14) - Restructure imphnen-hackathon flat modules into clean architecture - Remove all stale env vars from .env.example (SurrealDB, QR_JWT, Hackathon infra) - Fix Dockerfile to include all current workspace crates - Bump all crate versions 0.2.0 → 0.3.0 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
119 lines
3.1 KiB
Rust
119 lines
3.1 KiB
Rust
use crate::mentors::domain::{MentorDetail, MentorListItem, MentorRegistered};
|
|
use serde::{Deserialize, Serialize};
|
|
use utoipa::ToSchema;
|
|
|
|
#[derive(Clone, Debug, Serialize, Deserialize, ToSchema)]
|
|
pub struct MentorListResponseDto {
|
|
pub id: String,
|
|
pub user_id: String,
|
|
pub fullname: Option<String>,
|
|
pub email: Option<String>,
|
|
pub status: String,
|
|
pub created_at: String,
|
|
pub updated_at: String,
|
|
}
|
|
|
|
impl From<MentorListItem> for MentorListResponseDto {
|
|
fn from(item: MentorListItem) -> Self {
|
|
Self {
|
|
id: item.id,
|
|
user_id: item.user_id,
|
|
fullname: item.fullname,
|
|
email: item.email,
|
|
status: item.status,
|
|
created_at: item.created_at,
|
|
updated_at: item.updated_at,
|
|
}
|
|
}
|
|
}
|
|
|
|
#[derive(Clone, Debug, Serialize, Deserialize, ToSchema)]
|
|
pub struct MentorDetailResponseDto {
|
|
pub id: String,
|
|
pub user_id: String,
|
|
pub fullname: Option<String>,
|
|
pub email: Option<String>,
|
|
pub legal_name: Option<String>,
|
|
pub gender: Option<String>,
|
|
pub domicile: Option<String>,
|
|
pub phone_for_verification: Option<String>,
|
|
pub bio: Option<String>,
|
|
pub last_education: Option<String>,
|
|
pub linkedin_url: Option<String>,
|
|
pub github_url: Option<String>,
|
|
pub cv_url: Option<String>,
|
|
pub portfolio_url: Option<String>,
|
|
pub industries: Vec<String>,
|
|
pub expertise: Vec<String>,
|
|
pub languages: Vec<String>,
|
|
pub current_company: String,
|
|
pub current_role: String,
|
|
pub years_of_experience: i32,
|
|
pub topics_of_interest: Vec<String>,
|
|
pub preferred_mentee_level: Vec<String>,
|
|
pub preferred_mentoring_formats: Vec<String>,
|
|
pub availability_commitment: String,
|
|
pub mentoring_rate: f64,
|
|
pub status: String,
|
|
pub created_at: String,
|
|
pub updated_at: String,
|
|
}
|
|
|
|
impl From<MentorDetail> for MentorDetailResponseDto {
|
|
fn from(d: MentorDetail) -> Self {
|
|
Self {
|
|
id: d.id,
|
|
user_id: d.user_id,
|
|
fullname: d.fullname,
|
|
email: d.email,
|
|
legal_name: d.legal_name,
|
|
gender: d.gender,
|
|
domicile: d.domicile,
|
|
phone_for_verification: d.phone_for_verification,
|
|
bio: d.bio,
|
|
last_education: d.last_education,
|
|
linkedin_url: d.linkedin_url,
|
|
github_url: d.github_url,
|
|
cv_url: d.cv_url,
|
|
portfolio_url: d.portfolio_url,
|
|
industries: d.industries,
|
|
expertise: d.expertise,
|
|
languages: d.languages,
|
|
current_company: d.current_company,
|
|
current_role: d.current_role,
|
|
years_of_experience: d.years_of_experience,
|
|
topics_of_interest: d.topics_of_interest,
|
|
preferred_mentee_level: d.preferred_mentee_level,
|
|
preferred_mentoring_formats: d.preferred_mentoring_formats,
|
|
availability_commitment: d.availability_commitment,
|
|
mentoring_rate: d.mentoring_rate,
|
|
status: d.status,
|
|
created_at: d.created_at,
|
|
updated_at: d.updated_at,
|
|
}
|
|
}
|
|
}
|
|
|
|
#[derive(Clone, Debug, Serialize, Deserialize, ToSchema)]
|
|
pub struct MentorRegisterResponseDto {
|
|
pub id: String,
|
|
pub user_id: String,
|
|
pub email: Option<String>,
|
|
pub status: String,
|
|
pub created_at: String,
|
|
pub updated_at: String,
|
|
}
|
|
|
|
impl From<MentorRegistered> for MentorRegisterResponseDto {
|
|
fn from(r: MentorRegistered) -> Self {
|
|
Self {
|
|
id: r.id,
|
|
user_id: r.user_id,
|
|
email: r.email,
|
|
status: r.status,
|
|
created_at: r.created_at,
|
|
updated_at: r.updated_at,
|
|
}
|
|
}
|
|
}
|