// 组织管理模块类型定义

// 部门
export interface Department {
  id: number
  name: string
  parentId: number
  sort: number
  status: string
  children?: Department[]
}

// 员工
export interface Staff {
  id: number
  name: string
  phone: string
  email?: string
  deptId: number
  deptName: string
  roleId: number
  roleName: string
  status: string
  createTime: string
}

// 角色
export interface Role {
  id: number
  name: string
  code: string
  description?: string
  status: string
  permissions?: string[]
}

// 审批流程
export interface ApprovalFlow {
  id: number
  name: string
  type: string
  description?: string
  nodes: ApprovalNode[]
  status: string
  createTime: string
}

// 审批节点
export interface ApprovalNode {
  id: number
  name: string
  type: 'start' | 'approval' | 'condition' | 'end'
  approverType: 'user' | 'role' | 'dept'
  approverId: number
  approverName: string
  nextNodeId?: number
}

// 关联企业
export interface RelatedEnterprise {
  id: number
  companyName: string
  contact: string
  phone: string
  monthLimit: number
  yearLimit: number
  creditLimit: number
  remainLimit: number
  purchaseStatus: string
}
