import request from './request'
import type { GroupCourse } from './groupCourse'

export interface CoachInfo {
  id: number
  username: string
  nickname: string
  email: string
  phone: string
  avatar: string | null
  status: number
  createdAt: string
  updatedAt: string
}

/** 获取所有教练用户列表（店长/管理员用） */
export function getCoachList(): Promise<CoachInfo[]> {
  return request.get('/api/users/role/coach')
}

/** 获取当前登录教练自己教授的团课（教练自用） */
export function getCoachCourses(): Promise<GroupCourse[]> {
  return request.get('/api/coach/courses')
}

/** 根据教练ID查询该教练教授的所有团课（店长/管理员用） */
export function getCoachCoursesById(coachId: number): Promise<GroupCourse[]> {
  return request.get(`/api/coach/${coachId}/courses`)
}
