Skip to main content

oxirs_embed/
enterprise_knowledge_employee.rs

1//! Employee, skill, organizational, and project types for enterprise knowledge.
2
3use crate::Vector;
4use chrono::{DateTime, Utc};
5use serde::{Deserialize, Serialize};
6use std::collections::HashMap;
7
8/// Employee embedding with professional context
9#[derive(Debug, Clone, Serialize, Deserialize)]
10pub struct EmployeeEmbedding {
11    /// Employee unique identifier
12    pub employee_id: String,
13    /// Employee name
14    pub name: String,
15    /// Job title
16    pub job_title: String,
17    /// Department
18    pub department: String,
19    /// Team
20    pub team: String,
21    /// Skills
22    pub skills: Vec<Skill>,
23    /// Experience level
24    pub experience_level: ExperienceLevel,
25    /// Performance metrics
26    pub performance_metrics: PerformanceMetrics,
27    /// Project history
28    pub project_history: Vec<ProjectParticipation>,
29    /// Collaboration network
30    pub collaborators: Vec<String>,
31    /// Employee embedding vector
32    pub embedding: Vector,
33    /// Career progression predictions
34    pub career_predictions: CareerPredictions,
35    /// Last updated
36    pub last_updated: DateTime<Utc>,
37}
38
39/// Skill information
40#[derive(Debug, Clone, Serialize, Deserialize)]
41pub struct Skill {
42    /// Skill name
43    pub skill_name: String,
44    /// Skill category
45    pub category: SkillCategory,
46    /// Proficiency level (1-10)
47    pub proficiency_level: u8,
48    /// Years of experience
49    pub years_experience: f64,
50    /// Skill importance in role
51    pub role_importance: f64,
52    /// Market demand score
53    pub market_demand: f64,
54}
55
56/// Skill categories
57#[derive(Debug, Clone, Serialize, Deserialize)]
58pub enum SkillCategory {
59    Technical,
60    Leadership,
61    Communication,
62    Analytical,
63    Creative,
64    Domain,
65    Language,
66    Tools,
67}
68
69/// Experience levels
70#[derive(Debug, Clone, Serialize, Deserialize)]
71pub enum ExperienceLevel {
72    Junior,
73    Mid,
74    Senior,
75    Lead,
76    Principal,
77    Executive,
78}
79
80/// Performance metrics for employees
81#[derive(Debug, Clone, Serialize, Deserialize)]
82pub struct PerformanceMetrics {
83    /// Overall performance score (1-10)
84    pub overall_score: f64,
85    /// Goal achievement rate
86    pub goal_achievement_rate: f64,
87    /// Project completion rate
88    pub project_completion_rate: f64,
89    /// Collaboration score
90    pub collaboration_score: f64,
91    /// Innovation score
92    pub innovation_score: f64,
93    /// Leadership score
94    pub leadership_score: f64,
95}
96
97/// Project participation information
98#[derive(Debug, Clone, Serialize, Deserialize)]
99pub struct ProjectParticipation {
100    /// Project ID
101    pub project_id: String,
102    /// Project name
103    pub project_name: String,
104    /// Role in project
105    pub role: String,
106    /// Start date
107    pub start_date: DateTime<Utc>,
108    /// End date
109    pub end_date: Option<DateTime<Utc>>,
110    /// Project outcome
111    pub outcome: ProjectOutcome,
112    /// Contribution score
113    pub contribution_score: f64,
114}
115
116/// Project outcomes
117#[derive(Debug, Clone, Serialize, Deserialize)]
118pub enum ProjectOutcome {
119    Successful,
120    PartiallySuccessful,
121    Failed,
122    Cancelled,
123    Ongoing,
124}
125
126/// Career progression predictions
127#[derive(Debug, Clone, Serialize, Deserialize)]
128pub struct CareerPredictions {
129    /// Promotion likelihood (0-1)
130    pub promotion_likelihood: f64,
131    /// Predicted next role
132    pub next_role: String,
133    /// Skills to develop
134    pub skills_to_develop: Vec<String>,
135    /// Career path recommendations
136    pub career_paths: Vec<String>,
137    /// Retention risk (0-1)
138    pub retention_risk: f64,
139}
140
141/// Organizational structure
142#[derive(Debug, Clone)]
143pub struct OrganizationalStructure {
144    /// Departments
145    pub departments: HashMap<String, Department>,
146    /// Teams within departments
147    pub teams: HashMap<String, Team>,
148    /// Reporting relationships
149    pub reporting_structure: HashMap<String, Vec<String>>,
150    /// Cross-functional projects
151    pub projects: HashMap<String, Project>,
152}
153
154/// Department information
155#[derive(Debug, Clone, Serialize, Deserialize)]
156pub struct Department {
157    /// Department ID
158    pub department_id: String,
159    /// Department name
160    pub name: String,
161    /// Department head
162    pub head: String,
163    /// Employees
164    pub employees: Vec<String>,
165    /// Teams
166    pub teams: Vec<String>,
167    /// Budget
168    pub budget: f64,
169    /// Performance metrics
170    pub performance: DepartmentPerformance,
171}
172
173/// Department performance metrics
174#[derive(Debug, Clone, Serialize, Deserialize)]
175pub struct DepartmentPerformance {
176    /// Budget utilization
177    pub budget_utilization: f64,
178    /// Goal achievement
179    pub goal_achievement: f64,
180    /// Employee satisfaction
181    pub employee_satisfaction: f64,
182    /// Productivity score
183    pub productivity_score: f64,
184    /// Innovation index
185    pub innovation_index: f64,
186}
187
188/// Team information
189#[derive(Debug, Clone, Serialize, Deserialize)]
190pub struct Team {
191    /// Team ID
192    pub team_id: String,
193    /// Team name
194    pub name: String,
195    /// Team lead
196    pub lead: String,
197    /// Team members
198    pub members: Vec<String>,
199    /// Department
200    pub department: String,
201    /// Team skills
202    pub team_skills: Vec<Skill>,
203    /// Team performance
204    pub performance: TeamPerformance,
205}
206
207/// Team performance metrics
208#[derive(Debug, Clone, Serialize, Deserialize)]
209pub struct TeamPerformance {
210    /// Collaboration score
211    pub collaboration_score: f64,
212    /// Delivery performance
213    pub delivery_performance: f64,
214    /// Quality metrics
215    pub quality_score: f64,
216    /// Innovation score
217    pub innovation_score: f64,
218    /// Team satisfaction
219    pub team_satisfaction: f64,
220}
221
222/// Project information
223#[derive(Debug, Clone, Serialize, Deserialize)]
224pub struct Project {
225    /// Project ID
226    pub project_id: String,
227    /// Project name
228    pub name: String,
229    /// Project description
230    pub description: String,
231    /// Project manager
232    pub manager: String,
233    /// Team members
234    pub team_members: Vec<String>,
235    /// Start date
236    pub start_date: DateTime<Utc>,
237    /// End date
238    pub end_date: Option<DateTime<Utc>>,
239    /// Budget
240    pub budget: f64,
241    /// Status
242    pub status: ProjectStatus,
243    /// Required skills
244    pub required_skills: Vec<String>,
245    /// Performance metrics
246    pub performance: ProjectPerformance,
247}
248
249/// Project status
250#[derive(Debug, Clone, Serialize, Deserialize)]
251pub enum ProjectStatus {
252    Planning,
253    InProgress,
254    OnHold,
255    Completed,
256    Cancelled,
257}
258
259/// Project performance metrics
260#[derive(Debug, Clone, Serialize, Deserialize)]
261pub struct ProjectPerformance {
262    /// Progress percentage
263    pub progress_percentage: f64,
264    /// Budget utilization
265    pub budget_utilization: f64,
266    /// Timeline adherence
267    pub timeline_adherence: f64,
268    /// Quality score
269    pub quality_score: f64,
270    /// Stakeholder satisfaction
271    pub stakeholder_satisfaction: f64,
272}