import { withHeaders } from "@/record-management/services/api/withHeaders";
import axiosInstance from "../../../shared/services/axiosInstance";
import { AxiosResponse } from "axios";

export interface OrgHeaders {
  tenantKey: string;
  unitId?: string;
}

export interface OrgType {
  id: string;
  name: {
    am: string;
    en: string;
  };
  key: string;
  createdAt: string;
  updatedAt: string;
}

export interface OrgTypeResponse {
  count: number;
  items: OrgType[];
}

export const getOrganizationTypes = async (): Promise<
  AxiosResponse<OrgTypeResponse>
> => {
  return axiosInstance.get("/organization-types", { headers: withHeaders() });
};
