import env from "../index";
const disciplineMain = `${env.API_URI}/discipline`;
const discipline = `${env.API_URI}/discipline/disciplinary`;
const investigate = `${env.API_URI}/discipline/investigate`;
const suspend = `${env.API_URI}/discipline/suspend`;
const appeal = `${env.API_URI}/discipline/complaint_appeal`;

export default {
  directorList: (page: number, pageSize: number, keyword: string,path?:string) =>
    `${disciplineMain}/director/${path}?page=${page}&pageSize=${pageSize}&keyword=${keyword}`,
  director: () => `${disciplineMain}/director`,
  directorbyId: (id: string) => `${disciplineMain}/director/${id}`,

  /**ช่องทางการร้องเรียน */
  complaintChannel: () => `${disciplineMain}/complaint_Channel`,

  /**ลบ ช่องทางการร้องเรียน
   * @param id type
   */
  complaintListOp: (page?:string) => `${disciplineMain}/complaint_Channel/${page}`,
  complaintChannelbyId: (id: string) =>
    `${disciplineMain}/complaint_Channel/${id}`,
  complaintAdd: () => `${disciplineMain}/complaint`,
  complaintbyId: (id: string) => `${disciplineMain}/complaint/${id}`,
  complaintReject: (id: string) => `${disciplineMain}/complaint/reject/${id}`,
  complaintResume: (id: string) => `${disciplineMain}/complaint/resume/${id}`,
  complaintList: (
    page: number,
    pageSize: number,
    keyword: string,
    status: string
  ) =>
    `${disciplineMain}/complaint?page=${page}&pageSize=${pageSize}&keyword=${keyword}&status=${status}`,
  complaintFileUpload: (id: string) => `${disciplineMain}/complaint/file/${id}`,
  complaintFileDelete: (id: string, docId: string) =>
    `${disciplineMain}/complaint/file/${id}/${docId}`,
  complaintApprove: (id: string) => `${disciplineMain}/complaint/approve/${id}`,

  /** API  สืบสวนข้อเท็จจริง*/
  investigateMain: (
    page: number,
    pageSize: number,
    keyword: string,
    status: string
  ) =>
    `${investigate}?page=${page}&pageSize=${pageSize}&keyword=${keyword}&status=${status}`,
  investigateById: (id: string) => `${investigate}/${id}`,

  investigateRelevantUploadFile: (id: string) =>
    `${investigate}/relevant/file/${id}`,
  investigateRelevantFileDelete: (id: string, docId: string) =>
    `${investigate}/relevant/file/${id}/${docId}`,

  investigateUploadFile: (id: string) => `${investigate}/file/${id}`,
  investigateFileDelete: (id: string, docId: string) =>
    `${investigate}/file/${id}/${docId}`,

  investigateReject: (id: string) => `${investigate}/reject/${id}`,
  investigateResume: (id: string) => `${investigate}/resume/${id}`,
  investigateApprove: (id: string) => `${investigate}/approve/${id}`,
  investigateCalendar: () => `${investigate}/calendar`,
  investigateReport: () => `${investigate}/report`,
  investigateEditDuty: (disciplineId: string, id: string) =>
    `${investigate}/director/${disciplineId}/${id}`,

  /** ระบบวินัยเรื่องสอบสวน */
  disciplineDisciplinary: () => `${discipline}`,
  disciplineDisciplinaryById: (id: string) => `${discipline}/${id}`,
  disciplineInvestigateById: (id: string) => `${discipline}/investigate/${id}`,
  disciplineComplaintsById: (id: string) => `${discipline}/complaint/${id}`,
  disciplineDirector: () => `${discipline}/director`,
  disciplineDoc: (type: string, id: string) =>
    `${discipline}/${type}/file/${id}`,
  disciplineByIdDoc: (type: string, id: string, docId: string) =>
    `${discipline}/${type}/file/${id}/${docId}`,
  disciplinaryReject: (id: string) => `${discipline}/reject/${id}`,
  disciplinaryResume: (id: string) => `${discipline}/resume/${id}`,
  disciplinaryApprove: (id: string) => `${discipline}/approve/${id}`,
  disciplinarySuspend: (id: string) => `${discipline}/suspend/${id}`,
  disciplinaryCalendar: () => `${discipline}/calendar`,
  disciplinaryReport: () => `${discipline}/report`,
  /** รายการสรุปผลการพิจารณาทางวินัย*/
  listResult: () => `${disciplineMain}/result`,
  listResultById: (id: string) => `${disciplineMain}/result/${id}`,
  disciplinaryEditDuty: (disciplineId: string, id: string) =>
    `${discipline}/director/${disciplineId}/${id}`,

  /** ผู้ถูกพักราชการ */
  suspendMain: (page: number, pageSize: number, keyword: string) =>
    `${suspend}?page=${page}&pageSize=${pageSize}&keyword=${keyword}`,
  suspendById: (id: string) => `${suspend}/${id}`,

  suspendReport: () => `${suspend}/report`,

  reportresult: (id: string, type: string) =>
    `${discipline}/suspend/${id}/${type}`,
  discardResult: (id: string, commandType: string) =>
    `${discipline}/discard/${id}/${commandType}`,
  upLoadFileResult: (id: string) => `${disciplineMain}/result/file/${id}`,
  deleteFileResult: (id: string, docId: string) =>
    `${disciplineMain}/result/file/${id}/${docId}`,

  appealMainList: (
    status: string,
    type: string,
    year: number,
    page: number,
    pageSize: number,
    keyword: string
  ) =>
    `${appeal}/admin?status=${status}&type=${type}&year=${year}&page=${page}&pageSize=${pageSize}&keyword=${keyword}`,
  appealAdd: () => `${appeal}`,
  appealByID: (id: string) => `${appeal}/${id}`,
  appealByIDGet: (id: string) => `${appeal}/admin/${id}`,
  appealUpLoadFile: (id: string) => `${appeal}/file/${id}`,
  appealDeleteFile: (id: string, docId: string) =>
    `${appeal}/file/${id}/${docId}`,

  historyDirectorbyId: (id: string, type: string) =>
    `${disciplineMain}/director/${type}/${id}`,
  historyOrderById: (id: string) =>
    `${env.API_URI}/order/history/discipline/${id}`,

  complaintbyGetId: (id: string,page?:string) => `${disciplineMain}/complaint/${page}/${id}`,
  investigateByGetId: (id: string,page?:string) => `${investigate}/${page}/${id}`,
  disciplineDisciplinaryByGetId: (id: string,page?:string) => `${discipline}/${page}/${id}`,
};
