export interface MetaInfraType {
  id?: number;
  key?: string;
  name?: string;
  createDate?: Date;
}

export enum MetaInfraTypeEnum {
  ZONE = 'ZONE',
  HOST = 'HOST',
  SERVICE = 'SERVICE',
}

export const toMetaInfraTypeEnum = (v: MetaInfraType): MetaInfraTypeEnum => {
  return MetaInfraTypeEnum[v.key];
};

export const toMetaInfraType = (v: MetaInfraTypeEnum): MetaInfraType => {
  return {
    key: v,
  };
};
