import env from "../index";

const organization = `${env.API_URI}/org`;
const orgPos = `${env.API_URI}/org/pos`;
const orgProfile = `${env.API_URI}/org/profile`;
const orgEmployeePos = `${env.API_URI}/org/employee/pos`;

export default {
  keycloakPosition: () => `${organization}/profile/keycloak/position`,

  /** โครงสร้างอัตรากำลัง*/
  activeOrganization: `${organization}/active`,
  orgByid: (id: string) => `${organization}/super-admin/${id}`,
  createOrganization: `${organization}/draft`,
  createOrgLevel: (type: string) => `${organization}/${type}`,
  orgLevelByid: (type: string, id: string) => `${organization}/${type}/${id}`,

  orgSetDateTime: (id: string) => `${organization}/set/publish/${id}`,
  organizationHistoryNew: `${organization}/history`,
  organizationHistoryPostNew: `${organization}/history/publish`,

  /** position*/
  orgPosPosition: `${orgPos}/position`,
  orgPosPositionById: (id: string) => `${orgPos}/position/${id}`,
  orgPosPositionExecutive: () => `${orgPos}/position/executive`,
  orgPosExecutive: `${orgPos}/executive`,
  orgPosType: `${orgPos}/type`,
  orgPosTypeId: (id: string) => `${orgPos}/type/${id}`,
  orgPosLevel: `${orgPos}/level`,
  orgPosMaster: `${orgPos}/master`,
  orgPosMasterById: (id: string) => `${orgPos}/master/${id}`,
  orgPosMasterList: `${orgPos}/admin/master/list`,
  orgPosSort: `${orgPos}/sort`,
  orgPosMove: `${orgPos}/move`,
  organizationShortName: `${organization}/sort`,
  organizationPublishGet: `${organization}/get/publish`,
  orgPosDNA: `${orgPos}/dna`, //สืบทอดตำแหน่ง

  orgPosExecutiveById: (id: string) => `${orgPos}/executive/${id}`,
  orgPosHistory: (id: string) => `${orgPos}/history/${id}`,

  orgSalaryPosition: `${orgPos}/position?keyword=&type=ALL`,

  /**ครองตำแหน่ง */
  orgSearchProfile: `${orgProfile}/search`,
  orgProfile: `${orgPos}/profile`,
  orgDeleteProfile: (id: string) => `${orgPos}/profile/delete/${id}`,
  orgSummary: `${orgPos}/summary`,

  /** report*/
  orgReport: (report: string) => `${organization}/report/${report}`,

  /** struct-chart*/
  orgStructChart: (id: string, type: string) =>
    `${organization}/struct-chart/${id}/${type}`,

  // ค้นหาคนตามเงื่อนไข
  orgSearchPersonal: () => `${organization}/profile/search-personal`,

  /** บรรจุแต่งตั้ง*/
  orgPosPlacement: `${orgPos}/placement/search`,
  orgPosPlacemenTemp: `${orgPos}/placementemp/search`,
  orgPosFind: `${organization}/find/node`,
  orgProfileProbation: `${organization}/profile/probation`,

  activeOrganizationRoot: `${organization}/active/root`,
  activeOrganizationRootById: (id: string) =>
    `${organization}/active/root/${id}`,

  /** ข้อมูลตำแหน่งลูกจ้างประจำ*/
  orgEmployeePos: `${orgEmployeePos}/position`,
  orgEmployeePosById: (id: string) => `${orgEmployeePos}/position/${id}`,
  orgEmployeeType: `${orgEmployeePos}/type`,
  orgEmployeeTypeById: (id: string) => `${orgEmployeePos}/type/${id}`,
  orgEmployeelevel: `${orgEmployeePos}/level`,
  orgEmployeelevelById: (id: string) => `${orgEmployeePos}/level/${id}`,

  /** อัตรากำลังลูกจ้างประจำ*/
  orgSummaryEmp: `${orgEmployeePos}/summary`,
  orgReportEmp: (report: string) => `${orgEmployeePos}/report/${report}`,
  orgDeleteProfileEmp: (id: string) => `${orgEmployeePos}/profile/delete/${id}`,
  orgPosMasterByIdEmp: (id: string) => `${orgEmployeePos}/master/${id}`,
  orgPosMasterListEmp: `${orgEmployeePos}/master/list`,
  orgPosMasterEmp: `${orgEmployeePos}/master`,
  orgPosSortEmp: `${orgEmployeePos}/sort`,
  orgPosPositionEmpById: (id: string) => `${orgEmployeePos}/position/${id}`,
  orgPosMoveEmp: `${orgEmployeePos}/move`,
  orgProfileEmp: `${orgEmployeePos}/profile`,
  orgSearchProfileEmp: `${orgProfile}-employee/search`,

  orgProfileById: (id: string, type: string) => `${orgProfile}${type}/${id}`,
  orgProfileAdminById: (id: string, type: string) =>
    `${orgProfile}${type}/admin/${id}`,
  profileNewGovernmentCard: (id: string, type: string) =>
    `${orgProfile}${type}/government/admin/${id}`, // noPermission

  orgDeceasedProfile: `${orgPos}/profile/search`,

  orgProfileListKeycloak: (type: string) =>
    `${orgProfile}${type}/search-personal-no-keycloak`,

  /** กำหนดสิทธิ์จัดการโครงสร้าง */
  permissionOrg: `${organization}/permission-org`,
  permissioProfileOrg: `${organization}/permission-profile`,
  permissionOrgProfile: `${organization}/permission-org/profile`, // คนที่มีสิทธิ์จัดการโครงสร้าง
  permissionProfile: `${organization}/permission-profile/profile`, // คนที่มีสิทธิ์จัดการโครงสร้าง

  /** หมอบหมาย*/
  commandSysAssign: `${organization}/commandSys/assign`,
  posAssign: `${organization}/pos/assign`,

  /** View Work Flow*/
  viewWorkflow: `${organization}/view-workflow`,

  keycloakLogSSO: `${organization}/keycloak/log/sso`,

  orgIssues: `${organization}/issues`,
};
