import {
  listEmployees,
  inviteEmployee,
  updateEmployeeRole,
  deactivateEmployee,
  reactivateEmployee,
  removeEmployee,
} from '../../services/teamService'

export async function getMembers(companyId: string) {
  return listEmployees(companyId)
}

export async function getMemberStats(companyId: string) {
  const members = await listEmployees(companyId)
  return {
    total:    members.length,
    active:   members.filter((m) => m.isActive && m.invitationStatus === 'accepted').length,
    pending:  members.filter((m) => m.invitationStatus === 'pending').length,
    inactive: members.filter((m) => !m.isActive && m.invitationStatus === 'accepted').length,
  }
}

export { inviteEmployee, updateEmployeeRole, deactivateEmployee, reactivateEmployee, removeEmployee }
