use serde::{Deserialize, Serialize};
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct Employee {
pub employee_id: Option<String>,
pub employee_no: Option<String>,
pub name: Option<String>,
pub en_name: Option<String>,
pub email: Option<String>,
pub mobile: Option<String>,
pub department_ids: Option<Vec<String>>,
pub status: Option<EmployeeStatus>,
pub join_time: Option<String>,
pub leave_time: Option<String>,
pub work_location: Option<String>,
pub job_level: Option<String>,
pub job_title: Option<String>,
pub leader_id: Option<String>,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "snake_case")]
pub enum EmployeeStatus {
Active,
Inactive,
ToBeResigned,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct Department {
pub department_id: Option<String>,
pub name: Option<String>,
pub en_name: Option<String>,
pub parent_department_id: Option<String>,
pub leader_id: Option<String>,
pub status: Option<DepartmentStatus>,
pub create_time: Option<String>,
pub update_time: Option<String>,
pub order: Option<i32>,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "snake_case")]
pub enum DepartmentStatus {
Normal,
Deleted,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "snake_case")]
pub enum UserIdType {
OpenId,
UnionId,
UserId,
}
impl std::fmt::Display for UserIdType {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match self {
UserIdType::OpenId => write!(f, "open_id"),
UserIdType::UnionId => write!(f, "union_id"),
UserIdType::UserId => write!(f, "user_id"),
}
}
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "snake_case")]
pub enum DepartmentIdType {
OpenDepartmentId,
DepartmentId,
}
impl std::fmt::Display for DepartmentIdType {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match self {
DepartmentIdType::OpenDepartmentId => write!(f, "open_department_id"),
DepartmentIdType::DepartmentId => write!(f, "department_id"),
}
}
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct Pagination {
pub page_size: Option<i32>,
pub page_token: Option<String>,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct SearchQuery {
pub query: String,
pub scope: Option<String>,
}