import env from "../index";
const salary = `${env.API_URI}/salary`;
const salaryRate = `${env.API_URI}/salary/rate`;
const salaryPeriod = `${env.API_URI}/salary/period`;
const salaryPeriodEmp = `${env.API_URI}/salary/period-employee`;
const salaryOrg = `${env.API_URI}/org/employee`;
const salaryFormula = `${env.API_URI}/salary/formula`;

export default {
  salaryChart: salary,
  salaryChartCopy: `${salary}/copy`,
  salaryChartFile: (id: string) => `${salary}/file/${id}`,
  salaryChartDelFile: (id: string, fileName: string) =>
    `${salary}/file/${id}/${fileName}`,
  salaryChartByid: (id: string) => `${salary}/${id}`,
  salaryPosType: `${salary}/pos/type`,
  salaryPosLevel: `${salary}/pos/level`,

  /** รายการอัตราเงินเดือน*/
  salaryRateList: salaryRate,
  salaryRateListByid: (id: string) => `${salaryRate}/${id}`,
  salaryReportByid: (id: string) => `${salary}/report/${id}`,
  salaryReportemployeeByid: (id: string) => `${salary}/report/employee/${id}`,
  salaryPeriod: () => `${salary}/period`,
  salaryPeriodActive: (year: string) => `${salary}/period/active/${year}`,

  /** รายการเงินเดือน*/
  keycloakPositionByid: (id: string) =>
    `${env.API_URI}/org/profile/keycloak/position/${id}`,
  salaryListPeriodLatest: `${salaryPeriod}/latest`,
  salaryListPeriodQuota: (id: string) => `${salaryPeriod}/quota/${id}`,
  salaryListPeriodORG: (id: string) => `${salaryPeriod}/org/${id}`,
  salaryListPeriodProfileById: (id: string) => `${salaryPeriod}/profile/${id}`,
  salaryListPerson: `${env.API_URI}/org/profile/salary/gen`,
  salaryPeriodProfile: `${salary}/period/org/profile`,
  salaryReportListsByid: (type: string, rootId: string, periodId: string) =>
    `${salary}/report/${type}/${rootId}/${periodId}`,
  salaryProperty: (id: string) => `${salaryPeriod}/org/property/${id}`,
  salaryDashboard: `${salaryPeriod}/summary/all`,

  /** รายการเงินเดือนลูกจ้างประจำ*/
  salaryEmployeeChart: `${salary}/employee`,
  salaryEmployeeChartByid: (id: string) => `${salary}/employee/${id}`,
  salaryEmployeeChartCopy: `${salary}/employee/copy`,
  salaryEmployeeChartFile: (id: string) => `${salary}/file/employee/${id}`,
  salaryEmployeeChartDelFile: (id: string, fileName: string) =>
    `${salary}/file/employee/${id}/${fileName}`,

  salaryEmployeeRateList: `${salaryRate}/employee`,
  salaryEmployeeRateListByid: (id: string) => `${salaryRate}/employee/${id}`,

  salaryEmployeePosType: () => `${salaryOrg}/pos/type`,
  salaryFormula: () => `${salaryFormula}`,
  salaryFormulaById: (id: string) => `${salaryFormula}/${id}`,
  salaryEmployeePositionType: (key: string) =>
    `${salaryOrg}/pos/position?keyword=${key}&type=positionType`,
  salaryEmployeeActive: () => `${salary}/employee/active`,

  salaryPeriodStatus: (type: string, periodId: string, rootId: string) =>
    `${salaryPeriod}/${type}/approve/${periodId}/${rootId}`,
  salaryPeriodStatusComment: (type: string, periodId: string, rootId: string) =>
    `${salaryPeriod}/${type}/comment/${periodId}/${rootId}`,

  /** รายการเงินเดือนลูกจ้างประจำ*/
  salaryListPeriodLatestEmp: `${salaryPeriodEmp}/latest`,
  salaryListPeriodQuotaEmp: (id: string) => `${salaryPeriodEmp}/quota/${id}`,
  salaryListPeriodORGEmp: (id: string) => `${salaryPeriodEmp}/org/${id}`,
  salaryPeriodProfileEmp: `${salaryPeriodEmp}/org/profile`,
  salaryListPersonEmp: `${env.API_URI}/org/profile-employee/salary/gen`,
  salaryPeriodEmp: () => `${salaryPeriodEmp}`,
  salaryPropertyEmp: (id: string) => `${salaryPeriodEmp}/org/property/${id}`,
  salaryListPeriodProfileByIdEmp: (id: string) =>
    `${salaryPeriodEmp}/profile/${id}`,

  salaryDashboardEmp: `${salaryPeriodEmp}/summary/all`,

  salaryPeriodStatusEmp: (type: string, periodId: string, rootId: string) =>
    `${salaryPeriodEmp}/${type}/approve/${periodId}/${rootId}`,
  salaryPeriodStatusCommentEmp: (
    type: string,
    periodId: string,
    rootId: string
  ) => `${salaryPeriodEmp}/${type}/comment/${periodId}/${rootId}`,

  salaryFile: (name: string, group: string, id: string, subId: string) =>
    `${salary}/sub-file/${name}/${group}/${id}/${subId}`,
  salaryUploadFile: (name: string, group: string, id: string, subId: string) =>
    `${salary}/sub-file/${name}/${group}/${id}/${subId}`,
};
