import env from "../index";

const url = `${env.API_URI}/salary`;
const kpiPeriod = `${env.API_URI}/kpi/period`;
const kpiEvaluation = `${env.API_URI}/kpi/user/evaluation`;
const kpiPlan = `${env.API_URI}/kpi/plan`;
const kpiRole = `${env.API_URI}/kpi/role`;
const kpiSpecial = `${env.API_URI}/kpi/special`;
const KpiCapacity = `${env.API_URI}/kpi/capacity`;
const KpiFile = `${env.API_URI}/salary/file`;
const KpiEvaluationInfo = `${env.API_URI}/kpi/evaluation`;
const Kpiorg = `${env.API_URI}/org/profile/commander`;

const developmentOrg = `${env.API_URI}/org`;
const Kpi = `${env.API_URI}/kpi`;
const KpiUser = `${env.API_URI}/kpi/user`;
const kpiAchievement = `${env.API_URI}/kpi/user/achievement`;
const kpiReason = `${env.API_URI}/kpi/reason`;
const development = `${env.API_URI}/development`;
// const placementKeycloak = `${env.API_URI}/placement/officer/keycloak`;
const placementKeycloak = `${env.API_URI}/placement/officer/profileId`;
// const orgPosition  = `${env.API_URI}/org/profile/keycloak/position `;
const orgPosition = `${env.API_URI}/org/profile/profileid/position`;
export default {
  kpiPeriod,
  kpiEvaluation,
  kpiPlan,
  kpiRole,
  kpiSpecial,
  KpiCapacity,
  file: KpiFile,

  kpiAchievement: (type: string) => `${kpiAchievement}/${type}`,
  kpiAchievementPoint: (type: string) => `${kpiAchievement}/${type}/point`,

  kpiScoreTotal: () => `${kpiEvaluation}/point`,

  /** ผลสัมฤทธิ์ของงาน*/
  fileByFile: (name: string, group: string, id: string, fileName: string) =>
    `${url}/file/${name}/${group}/${id}/${fileName}`,
  fileByFileUser: (name: string, group: string, id: string) =>
    `${url}/file/${name}/${group}/${id}`,
  kpiUserCapacity: `${KpiUser}/capacity`,
  KpiEvaluationInfo,
  Kpiorg,
  kpiEvaluationCheck: `${kpiEvaluation}/check`,
  kpiSendToStatus: (id: string) => `${kpiEvaluation}/status/${id}`,
  kpiSendToSummary: (id: string) => `${kpiEvaluation}/summary/${id}`,
  kpiSendToGet: (id: string) => `${kpiEvaluation}/reason/${id}`,
  kpiSendToReason: (id: string, type: string) =>
    `${kpiEvaluation}/reason/${type}/${id}`,
  kpiSendToReasonreject: (id: string) =>
    `${kpiEvaluation}/reject-result/${id}`,


  kpiReqEdit: (id: string) => `${kpiEvaluation}/edit/${id}`,
  /**ประเมิน*/
  kpiAchievementDevelop: `${kpiAchievement}/development`,

  kpiCommentP: (typP: string, type: string, role: string, id: string) =>
    `${kpiReason}/${typP}/${type}/${role}/${id}`,

  placementKeycloak,
  orgPosition,
  sendToCommander: `${KpiUser}/evaluation/admin/change-status`,
  sendToSummary: (id: string) => `${kpiEvaluation}/summary/${id}`,
  updatePoint: (id: string) => `${kpiEvaluation}/point/${id}`,
  openPoint: (id: string) => `${kpiEvaluation}/open/${id}`,
  kpiReport: (id: string) => `${Kpi}/report/kpi-user/${id}`,

  developmentMain: `${development}/main`,

  developmentReQuestIDP: (id: string) => `${developmentOrg}/profile/development/registry/USER/${id}`,
  developmentIDP: (id: string) => `${development}/main/registry/USER/${id}`,

  kpiReject:(id:string)=>`${kpiEvaluation}/reject-agreement/${id}`,

  kpiReportList:(id:string)=>`${Kpi}/report/list/${id}`
};

