import client from './client'

export function getScoringPage(periodId, userId) {
  return client.get('/scores/page', { params: { periodId, userId } })
}

export function getMyResult(periodId) {
  return client.get('/scores/my', { params: { periodId } })
}

export function getSubordinates(periodId) {
  return client.get('/scores/subordinates', { params: { periodId } })
}

export function submitSelfScore(data) {
  return client.post('/scores/self', data)
}

export function submitSuperiorScore(data) {
  return client.post('/scores/superior', data)
}

export function confirmResult(periodId) {
  return client.post('/scores/confirm', { periodId })
}

export function publishResult(periodId) {
  return client.post('/scores/publish', { periodId })
}

export function correctScore(id, data) {
  return client.post(`/scores/${id}/correction`, data)
}
