/**
 * api สรรหา - สอบแข่งขัน
 */
import env from "../index";
const recruit = `${env.API_URI}/recruit/`;
const recruit_report = `${env.API_URI}/report/recruit/`;

export default {
  getCandidates: `${recruit}candidate`,
  saveCandidates: `${recruit}candidate`,
  deleteCandidates: (id: string) => `${recruit}candidate/${id}`,
  getExamDetail: (id: string, examId: string) =>
    `${recruit}exam/${id}/${examId}`,

  saveScores: (id: string) => `${recruit}score/${id}`,

  getExamResultById: (id: string) => `${recruit}exam/${id}`,

  // จัดการรอบการสอบ
  savePeriod: `${recruit}period`,
  editPeriod: (id: string) => `${recruit}period/${id}`,
  getPeriodById: (id: string) => `${recruit}period/${id}`,
  uploadCandidates: (id: string) => `${recruit}candidate/${id}`,
  getImportHistory: (id: string) => `${recruit}history/${id}`,

  //upload
  periodRecruitDoc: (examId: string) => `${recruit}doc/${examId}`,
  periodRecruitImg: (examId: string) => `${recruit}img/${examId}`,
  periodDeleteDoc: (docId: string) => `${recruit}doc/${docId}`,
  periodDeleteImg: (docId: string) => `${recruit}img/${docId}`,

  // รายงาน
  downloadExamReport: (id: string, examId: string, type: number = 2) =>
    `${recruit_report}certificate/${type}/${id}/${examId}`,
  downloadScoreReport: (id: string, examId: string) =>
    `${recruit_report}score/${id}/${examId}`,
  exportExam: (id: string) => `${recruit}export/exam/${id}`,
  exportPassExam: (id: string) => `${recruit}export/pass-exam/${id}`,
  exportPassResultExam: (id: string) => `${recruit}export/pass/${id}`,

  exportCandidateList: (id: string) => `${recruit_report}candidate/${id}`,
  exportPassExamList: (id: string) => `${recruit_report}pass/${id}`,
  periodRecruitToPlacement: (examId: string) => `${recruit}placement/${examId}`,
};
