import request from '@/config/axios'

export interface EmployeeYearLeaderOutputVO {
  id?: number
  employeeId: number
  employeeName?: string
  outputYear: number
  leaderOutputAmount: number
  remark?: string
  sortNo?: number
  enabledFlag?: boolean
  createTime?: string
}

export interface EmployeeYearLeaderOutputPageReqVO extends PageParam {
  employeeId?: number
  employeeName?: string
  outputYear?: number
  enabledFlag?: boolean
}

export interface EmployeeYearLeaderOutputGenerateReqVO {
  outputYear: number
  leaderOutputAmount?: number
}

export interface EmployeeYearLeaderOutputGenerateRespVO {
  outputYear: number
  totalEnabledLeaderCount: number
  createdCount: number
  skippedCount: number
}

export const getEmployeeYearLeaderOutputPage = (params: EmployeeYearLeaderOutputPageReqVO) => {
  return request.get({ url: '/tjt/employee-year-leader-output/page', params })
}

export const getEmployeeYearLeaderOutput = (id: number) => {
  return request.get({ url: '/tjt/employee-year-leader-output/get', params: { id } })
}

export const createEmployeeYearLeaderOutput = (data: EmployeeYearLeaderOutputVO) => {
  return request.post({ url: '/tjt/employee-year-leader-output/create', data })
}

export const generateEmployeeYearLeaderOutput = (data: EmployeeYearLeaderOutputGenerateReqVO) => {
  return request.post({ url: '/tjt/employee-year-leader-output/generate', data })
}

export const updateEmployeeYearLeaderOutput = (data: EmployeeYearLeaderOutputVO) => {
  return request.put({ url: '/tjt/employee-year-leader-output/update', data })
}

export const deleteEmployeeYearLeaderOutput = (id: number) => {
  return request.delete({ url: '/tjt/employee-year-leader-output/delete', params: { id } })
}
