pub struct Employee {Show 31 fields
pub employee_id: String,
pub user_id: String,
pub display_name: String,
pub first_name: String,
pub last_name: String,
pub email: String,
pub persona: UserPersona,
pub job_level: JobLevel,
pub job_title: String,
pub department_id: Option<String>,
pub cost_center: Option<String>,
pub manager_id: Option<String>,
pub direct_reports: Vec<String>,
pub status: EmployeeStatus,
pub company_code: String,
pub working_hours: WorkingHoursPattern,
pub authorized_company_codes: Vec<String>,
pub authorized_cost_centers: Vec<String>,
pub approval_limit: Decimal,
pub can_approve_pr: bool,
pub can_approve_po: bool,
pub can_approve_invoice: bool,
pub can_approve_je: bool,
pub can_release_payment: bool,
pub system_roles: Vec<SystemRole>,
pub transaction_codes: Vec<TransactionCodeAuth>,
pub hire_date: Option<NaiveDate>,
pub termination_date: Option<NaiveDate>,
pub location: Option<String>,
pub is_shared_services: bool,
pub phone: Option<String>,
}Expand description
Employee master data with organizational hierarchy.
Fields§
§employee_id: StringEmployee ID (e.g., “E-001234”)
user_id: StringUser ID (login name, links to User)
display_name: StringDisplay name
first_name: StringFirst name
last_name: StringLast name
email: StringEmail address
persona: UserPersonaPersona classification
job_level: JobLevelJob level
job_title: StringJob title
department_id: Option<String>Department ID
cost_center: Option<String>Cost center
manager_id: Option<String>Manager’s employee ID (for hierarchy)
direct_reports: Vec<String>Direct reports (employee IDs)
status: EmployeeStatusEmployment status
company_code: StringCompany code
working_hours: WorkingHoursPatternWorking hours pattern
Authorized company codes
Authorized cost centers
approval_limit: DecimalApproval limit (monetary threshold)
can_approve_pr: boolCan approve purchase requisitions
can_approve_po: boolCan approve purchase orders
can_approve_invoice: boolCan approve invoices
can_approve_je: boolCan approve journal entries
can_release_payment: boolCan release payments
system_roles: Vec<SystemRole>System roles
transaction_codes: Vec<TransactionCodeAuth>Authorized transaction codes
hire_date: Option<NaiveDate>Hire date
termination_date: Option<NaiveDate>Termination date (if applicable)
location: Option<String>Location / plant
Is this an intercompany employee (works for multiple entities)?
phone: Option<String>Phone number
Implementations§
Source§impl Employee
impl Employee
Sourcepub fn new(
employee_id: impl Into<String>,
user_id: impl Into<String>,
first_name: impl Into<String>,
last_name: impl Into<String>,
company_code: impl Into<String>,
) -> Self
pub fn new( employee_id: impl Into<String>, user_id: impl Into<String>, first_name: impl Into<String>, last_name: impl Into<String>, company_code: impl Into<String>, ) -> Self
Create a new employee.
Sourcepub fn with_persona(self, persona: UserPersona) -> Self
pub fn with_persona(self, persona: UserPersona) -> Self
Set persona and adjust defaults accordingly.
Sourcepub fn with_job_level(self, level: JobLevel) -> Self
pub fn with_job_level(self, level: JobLevel) -> Self
Set job level.
Sourcepub fn with_job_title(self, title: impl Into<String>) -> Self
pub fn with_job_title(self, title: impl Into<String>) -> Self
Set job title.
Sourcepub fn with_manager(self, manager_id: impl Into<String>) -> Self
pub fn with_manager(self, manager_id: impl Into<String>) -> Self
Set manager.
Sourcepub fn with_department(self, department_id: impl Into<String>) -> Self
pub fn with_department(self, department_id: impl Into<String>) -> Self
Set department.
Sourcepub fn with_cost_center(self, cost_center: impl Into<String>) -> Self
pub fn with_cost_center(self, cost_center: impl Into<String>) -> Self
Set cost center.
Sourcepub fn with_approval_limit(self, limit: Decimal) -> Self
pub fn with_approval_limit(self, limit: Decimal) -> Self
Set approval limit.
Add authorized company code.
Sourcepub fn with_role(self, role: SystemRole) -> Self
pub fn with_role(self, role: SystemRole) -> Self
Add system role.
Sourcepub fn with_hire_date(self, date: NaiveDate) -> Self
pub fn with_hire_date(self, date: NaiveDate) -> Self
Set hire date.
Sourcepub fn add_direct_report(&mut self, employee_id: String)
pub fn add_direct_report(&mut self, employee_id: String)
Add a direct report.
Sourcepub fn can_approve_amount(&self, amount: Decimal) -> bool
pub fn can_approve_amount(&self, amount: Decimal) -> bool
Check if employee can approve an amount.
Sourcepub fn can_approve_in_company(&self, company_code: &str) -> bool
pub fn can_approve_in_company(&self, company_code: &str) -> bool
Check if employee can approve in a company code.
Sourcepub fn has_role(&self, role: &SystemRole) -> bool
pub fn has_role(&self, role: &SystemRole) -> bool
Check if employee has a specific role.
Sourcepub fn hierarchy_depth(&self) -> u8
pub fn hierarchy_depth(&self) -> u8
Get the depth in the org hierarchy (0 = top).