export interface LeakageRow {
  Area: string;
  LeakageRatioRaw: number;
  LeakageRatio: number;
  LeakageFlow_m3_per_s: number;
}

export interface LeakageSchemeRecord {
  scheme_id: number;
  scheme_name: string;
  scheme_type: string;
  username: string;
  create_time: string;
  scheme_start_time: string;
  scheme_detail: Record<string, unknown>;
}

export interface LeakageResultDetail {
  scheme_name?: string;
  network?: string;
  sensor_nodes: string[];
  rows: LeakageRow[];
  node_area_map: Record<string, string>;
  areas: Array<{
    area_id: string;
    node_count: number;
    node_ids: string[];
    sensor_nodes: string[];
  }>;
  drawing_payload: {
    type: "FeatureCollection";
    features: Array<Record<string, unknown>>;
  };
  node_visual_payload?: {
    type: "FeatureCollection";
    features: Array<Record<string, unknown>>;
  };
  scheme_detail?: {
    algorithm_params?: {
      q_sum?: number;
      q_sum_unit?: string;
      [key: string]: unknown;
    };
    result_summary?: {
      area_count?: number;
      max_leakage?: number;
    };
    [key: string]: unknown;
  };
  scheme_start_time?: string;
  create_time?: string;
  username?: string;
}
