import { DefineComponent } from 'vue';

export type DialogSelectAssetNameFilter = {
  category?: string[];
};

export type DialogSelectAssetNameFilterQueryParams = Partial<
  Record<keyof DialogSelectAssetNameFilter, string>
>;

export type FetchResponse = {
  data: Data[];
  totalRecords: number;
};

export interface AssetName {
  _id: string;
  name: string;
  code: string;
  aliasCode: string;
  category: Category;
  addOn: AddOn;
  tagType: string;
  brands: Category[];
  models: Model[];
  measurement: string;
  totalAssets: number;
  hasPairedAsset: boolean;
  brandsLength: number;
  modelsLength: number;
  depreciationGroupsLength: number;
  accountCode?: string;
  updatedAt: string;
}

export type AssetNamePayload = Pick<AssetName, '_id' | 'name'>;

interface Model {
  _id: string;
  name: string;
  brand: string;
  category: string;
}

interface AddOn {
  maintenance: boolean;
  repairTicketing: boolean;
  tracking: boolean;
  assetControl: boolean;
  audit: boolean;
  map: boolean;
}

interface Category {
  _id: string;
  name: string;
}

export interface DialogSelectAssetNameProps {
  visible?: boolean;
  selectedAssetNames?: AssetNamePayload[];
  // This prop is used only for CustomField
  customFieldType?: 'General Information' | 'Purchase' | 'Accounting';
}

export type DialogSelectAssetNameEmit = {
  select: [payload: AssetNamePayload[]];
};

declare const DialogSelectAssetName: DefineComponent<
  DialogSelectAssetNameProps,
  DialogSelectAssetNameEmit
>;

export default DialogSelectAssetName;
