#[derive(Debug, Clone, Default)]
pub struct Resume {
    pub name:       String,
    pub email:      String,
    pub phone:      String,
    pub github:     String,
    pub degree:     String,
    pub university: String,
    pub year:       String,
    pub skills:     Vec<SkillGroup>,
    pub projects:   Vec<Project>,
    pub experience: Vec<Experience>,
}

#[derive(Debug, Clone, Default)]
pub struct SkillGroup {
    pub category: String,
    pub items:    Vec<String>,
}

#[derive(Debug, Clone, Default)]
pub struct Project {
    pub title:       String,
    pub description: String,
    pub tech:        Vec<String>,
}

#[derive(Debug, Clone, Default)]
pub struct Experience {
    pub company:  String,
    pub role:     String,
    pub duration: String,
    pub details:  Vec<String>, // bullet points
}

impl Resume {
    // self means "this type" (Resume here)
    pub fn new() -> Self {//constructor
        Self::default()
    }

    // returns true if the resume has the minimum required fields
    // &self=borrowing the resume to read it{not taking ownership}
    pub fn is_valid(&self) -> bool {
        !self.name.is_empty() && !self.email.is_empty()
    }
}
