/**
 * api ระบบจัดการข้อมูลหลัก
 *  เมนูย่อย: ข้อมูลตำแหน่งของข้าราชการกรุงเทพมหานคร
 */
import env from "../index";
const position = `${env.API_URI}/metadata/main/`;
const positionExecutiveSide = `${env.API_URI}/metadata/position-executive-side/`;
const positionLevel = `${env.API_URI}/metadata/position-level/`;
const positionPath = `${env.API_URI}/metadata/position-path/`;
const positionSide = `${env.API_URI}/metadata/position-path-side/`;
const positionType = `${env.API_URI}/metadata/position-type/`;
const positionStatus = `${env.API_URI}/metadata/position-status/`;
const positionLine = `${env.API_URI}/metadata/position-line/`;
const positionExecutive = `${env.API_URI}/metadata/position-executive/`;

const orgPosType = `${env.API_URI}/org/pos/type/`;
const orgPosLevel = `${env.API_URI}/org/pos/level/`;
export default {
  position: `${position}position`,
  /**
   * api ด้านทางการบริหาร
   */
  positionExecutiveSide,
  listPositionExecutiveSideHistory: `${positionExecutiveSide}history`,
  listPositionExecutiveSideHistoryId: (id: string) =>
    `${positionExecutiveSide}history/${id}`,
  listPositionExecutiveSidePublished: `${positionExecutiveSide}history/published`,
  listPositionExecutiveSidePublishedHistory: `${positionExecutiveSide}history/published-history`,

  /**
   * api ตำแหน่งในสายงาน
   */
  // listPositionHistory: `${position}history`,
  // listPositionHistoryId: (id: string) => `${position}history/${id}`,
  // listPositionPublished: `${position}history/published`,

  /**
   * api ระดับตำแหน่ง
   */
  positionLevel,
  listPositionLevelHistory: `${positionLevel}history`,
  listPositionLevelHistoryId: (id: string) => `${positionLevel}history/${id}`,
  listPositionLevelPublished: `${positionLevel}history/published`,
  listPositionLevelPublishedHistory: `${positionLevel}history/published-history`,

  /**
   * api ตำแหน่งในสายงาน
   */
  positionPath,
  listPositionPathHistory: `${positionPath}history`,
  listPositionPathHistoryId: (id: string) => `${positionPath}history/${id}`,
  listPositionPathPublished: `${positionPath}history/published`,
  listPositionPathPublishedHistory: `${positionPath}history/published-history`,

  /**
   * api ด้าน/สาขา
   */
  positionSide,
  listPositionSideHistory: `${positionSide}history`,
  listPositionSideHistoryId: (id: string) => `${positionSide}history/${id}`,
  listPositionSidePublished: `${positionSide}history/published`,
  listPositionSidePublishedHistory: `${positionSide}history/published-history`,

  /**
   * api ประเภทตำแหน่ง
   */
  positionType,
  listPositionTypeHistory: `${positionType}history`,
  listPositionTypeHistoryId: (id: string) => `${positionType}history/${id}`,
  listPositionTypePublished: `${positionType}history/published`,
  listPositionTypePublishedHistory: `${positionType}history/published-history`,

  /**
   * api สถานะของตำแหน่ง
   */
  positionStatus,
  listPositionStatusHistory: `${positionStatus}history`,
  listPositionStatusHistoryId: (id: string) => `${positionStatus}history/${id}`,
  listPositionStatusPublished: `${positionStatus}history/published`,
  listPositionStatusPublishedHistory: `${positionStatus}history/published-history`,

  /**
   * api สายงานของตำแหน่ง
   */
  positionLine,
  listPositionLineHistory: `${positionLine}history`,
  listPositionLineHistoryId: (id: string) => `${positionLine}history/${id}`,
  listPositionLinePublished: `${positionLine}history/published`,
  listPositionLinePublishedHistory: `${positionLine}history/published-history`,

  /**
   * api ตำแหน่งทางการบริหาร
   */
  positionExecutive,
  listPositionExecutiveHistory: `${positionExecutive}history`,
  listPositionExecutiveHistoryId: (id: string) =>
    `${positionExecutive}history/${id}`,
  listPositionExecutivePublished: `${positionExecutive}history/published`,
  listPositionExecutivePublishedHistory: `${positionExecutive}history/published-history`,

  orgPosType,
  orgPosTypeId: (id: string) => `${orgPosType}${id}`,
  orgPosLevel,
  orgPosLevelId: (id: string) => `${orgPosLevel}${id}`,
};
