import { PaginationRequest, PaginationResponse } from "@/types/common/type";

export enum CameraGroupStatus {
  /*开启 */
  OPEN = 0,
  /*关闭 */
  CLOSE = 1,
}

interface GroupDetailListItem {
  /*相机id */
  cameraId: number;
  /*设备ID */
  cameraCode: string;
  /*位置 */
  location: string;
  /*联合检测算法id */
  algoId: number;
  /*是否为主相机 */
  isMainCamera: number;
}

export type CameraGroupItem = {
  cameraDetectionGroupId: number;
  /*联合检测相机分组状态 */
  status: number;
  /*分组详情 */
  groupDetailList: GroupDetailListItem[];
}

export type CameraPreviewRequest = PaginationRequest;

export type CameraGroupResponse = PaginationResponse<CameraGroupItem>;

export type CameraGroupTableItem = Pick<CameraGroupItem, 'cameraDetectionGroupId' | 'status'> & GroupDetailListItem

export type CameraTreeRequest = {
  queryString: string,
  isEnableAlgo: boolean,
  isEnableRender: boolean
}

export interface GropAlgoProps {
  id: number;
  /*算法名称 */
  name: string;
  /*算法提供编码 */
  code: string;
  /*前端显示名称 */
  showName: string;
  /*描述 */
  remark: string;
  /*展示视频的地址 */
  url: string;
  /*推送语句 */
  pushStatement: string;
  /*推送链接提示 */
  pushLinkPrompt: string;
  /*图标的地址 */
  iconUrl: string;
  /*状态: 0-启用, 1-禁用 */
  status: number;
  /*创建时间 */
  createdAt: Record<string, unknown>;
  /*更新时间 */
  updatedAt: Record<string, unknown>;
  /*0-未删除，大于0(时间戳)-已删除 */
  isDeleted: number;
  /*扩展数据 */
  extra: string;
  /*算法类型 0-单算法 1-组算法 */
  type: number;
}

export interface saveDetectionGroupRequest {
  cameraId?: number;
  /*算法id */
  algoId?: number;
  /*是否为主相机 */
  isMainCamera?: number;
}

export interface SelectOption {
  code: number;
  name: string;
  isMainCamera: number;
  algoName: string;
  algoCode: string;
  isActive: boolean;
}

export interface updateGroupStatusRequest {
  cameraDetectionGroupId: number;
  /*联合检测相机分组状态 */
  status: number;
}

export enum IsMainCamera {
  /*主相机 */
  YES = 0,
  /*副相机 */
  NO = 1,
}