import { WidgetType } from '../entities';

/**
 * DTO for creating a dashboard.
 */
export interface CreateDashboardDto {
  name: string;
  description?: string;
  slug?: string;
  icon?: string;
  layoutConfig?: Record<string, any>;
  isDefault?: boolean;
  isPublic?: boolean;
  isActive?: boolean;
  allowedRoles?: string[];
}

/**
 * DTO for updating a dashboard.
 */
export interface UpdateDashboardDto {
  name?: string;
  description?: string;
  slug?: string;
  icon?: string;
  layoutConfig?: Record<string, any>;
  isDefault?: boolean;
  isPublic?: boolean;
  isActive?: boolean;
  allowedRoles?: string[];
}

/**
 * DTO for creating a dashboard widget.
 */
export interface CreateDashboardWidgetDto {
  dashboardId: string;
  title: string;
  widgetType: WidgetType;
  positionX?: number;
  positionY?: number;
  width?: number;
  height?: number;
  config?: Record<string, any>;
  refreshIntervalSeconds?: number;
  isActive?: boolean;
  sortOrder?: number;
}

/**
 * DTO for updating a dashboard widget.
 */
export interface UpdateDashboardWidgetDto {
  title?: string;
  widgetType?: WidgetType;
  positionX?: number;
  positionY?: number;
  width?: number;
  height?: number;
  config?: Record<string, any>;
  refreshIntervalSeconds?: number;
  isActive?: boolean;
  sortOrder?: number;
}

/**
 * DTO for creating a widget query.
 */
export interface CreateWidgetQueryDto {
  widgetId: string;
  name: string;
  queryText?: string;
  queryFunction?: string;
  parameters?: Record<string, any>;
  resultMapping?: Record<string, any>;
  cacheTtlSeconds?: number;
}

/**
 * DTO for updating a widget query.
 */
export interface UpdateWidgetQueryDto {
  name?: string;
  queryText?: string;
  queryFunction?: string;
  parameters?: Record<string, any>;
  resultMapping?: Record<string, any>;
  cacheTtlSeconds?: number;
}

/**
 * DTO for bulk updating widget positions.
 */
export interface UpdateWidgetPositionsDto {
  widgets: Array<{
    id: string;
    positionX: number;
    positionY: number;
    width: number;
    height: number;
  }>;
}
