interface OrgTree {
  orgTreeId: string;
  orgRootId: string;
  orgLevel: number;
  orgTreeName: string;
  orgTreeShortName: string;
  orgTreeCode: string;
  orgCode: string;
  orgTreeRank: string;
  orgTreeOrder: number | null;
  orgRootCode: string;
  orgTreePhoneEx: string;
  orgTreePhoneIn: string;
  orgTreeFax: string;
  orgRevisionId: string;
  children: OrgTree[];
}

interface DataTree {
  orgTreeId: string;
  orgRootId?: string;
  orgLevel: number;
  orgName: string;
  orgTreeName: string;
  orgTreeShortName: string;
  orgTreeCode: string;
  orgCode: string;
  orgTreeRank: string;
  orgTreeOrder: number;
  orgRootCode?: string;
  orgTreePhoneEx: string;
  orgTreePhoneIn: string;
  orgTreeFax: string;
  orgRevisionId: string;
  orgRootName: string;
  totalPosition: number;
  totalPositionCurrentUse: number;
  totalPositionCurrentVacant: number;
  totalPositionNextUse: number;
  totalPositionNextVacant: number;
  totalRootPosition: number;
  totalRootPositionCurrentUse: number;
  totalRootPositionCurrentVacant: number;
  totalRootPositionNextUse: number;
  totalRootPositionNextVacant: number;

  children?: DataTree[];
}

interface PositionMain {
  fullNameCurrentHolder: string | null;
  fullNameNextHolder: string | null;
  id: string;
  isPosition: boolean;
  isSit: boolean;
  orgRootId: string;
  orgShortname: string;
  posMasterNo: number;
  posMasterNoPrefix: string;
  posMasterNoSuffix: string;
  posExecutiveId: string;
  posExecutiveName: string;
  posLevelId: string;
  posLevelName: string;
  posTypeId: string;
  posTypeName: string;
  positionArea: string;
  positionExecutiveField: string;
  positionField: string;
  positionIsSelected: boolean;
  positionName: string;
  positions: Positions[];
  node: number;
  nodeId: string;
}

interface PositionNo {
  fullNameCurrentHolder: string | null;
  fullNameNextHolder: string | null;
  id: string;
  isPosition: boolean;
  isSit: boolean;
  orgRootId: string;
  orgShortname: string;
  posMasterNo: number;
  posMasterNoPrefix: string;
  posMasterNoSuffix: string;
  positions: Positions[];
}

interface Positions {
  id: string;
  posExecutiveId: string;
  posExecutiveName: string;
  posLevelId: string;
  posLevelName: string;
  posTypeId: string;
  posTypeName: string;
  positionArea: string;
  positionExecutiveField: string;
  positionField: string;
  positionIsSelected: boolean;
  positionName: string;
}

interface DataPositionNo {
  id: string;
  isPosition: boolean;
  posMasterNo: string;
  positionName: string;
  posTypeName: string;
  posLevelName: string;
  positionIsSelected: string | null;
  isSit: boolean;
  positions: Positions[];
}

interface FormActive {
  activeId: string;
  activeName: string;
  draftId: string;
  draftName: string;
  orgPublishDate: Date | null;
  isPublic: boolean;
}

interface TreeMain {
    children: TreeMain[]; // ปรับเป็นชนิดข้อมูลที่ถูกต้องตามโครงสร้างของ children ถ้าเป็นไปได้
    orgCode: string;
    orgLevel: number;
    orgName: string;
    orgRevisionId: string;
    orgRootName: string;
    orgTreeCode: string;
    orgTreeFax: string;
    orgTreeId: string;
    orgTreeName: string;
    orgTreeOrder: number;
    orgTreePhoneEx: string;
    orgTreePhoneIn: string;
    orgTreeRank: string;
    orgTreeShortName: string;
    totalPosition: number;
    totalPositionCurrentUse: number;
    totalPositionCurrentVacant: number;
    totalPositionNextUse: number;
    totalPositionNextVacant: number;
    totalRootPosition: number;
    totalRootPositionCurrentUse: number;
    totalRootPositionCurrentVacant: number;
    totalRootPositionNextUse: number;
    totalRootPositionNextVacant: number;
  }
export type {
  OrgTree,
  DataTree,
  PositionMain,
  PositionNo,
  Positions,
  DataPositionNo,
  FormActive,
  TreeMain,
};
