export interface BurstCandidate {
  pipe_id: string;
  similarity: number;
}

export interface BurstLocationResult {
  located_pipe: string;
  burst_leakage: number;
  elapsed_seconds: number;
  simulation_times: number;
  top_candidates: BurstCandidate[];
  similarity_mode: string;
  scheme_name?: string;
  username?: string;
  observed_source?: string;
  network?: string;
  data_source?: string;
  min_dpressure?: number;
  basic_pressure?: number;
  pressure_scada_ids?: string[];
  flow_scada_ids?: string[];
  create_time?: string;
  scada_window?: {
    burst_start?: string;
    burst_end?: string;
    normal_start?: string;
    normal_end?: string;
  };
  pressure_samples?: {
    burst?: number;
    normal?: number;
  };
  flow_samples?: {
    burst?: number;
    normal?: number;
  };
  simulation_scheme?: {
    name?: string;
    type?: string;
    burst_ids?: string[];
  };
}

export interface BurstLocationSchemeDetail {
  network?: string;
  pressure_scada_ids?: string[];
  flow_scada_ids?: string[];
  observed_source?: string;
  algorithm_params?: {
    burst_leakage?: number;
    min_dpressure?: number;
    basic_pressure?: number;
  };
  scada_window?: {
    burst_start?: string;
    burst_end?: string;
    normal_start?: string;
    normal_end?: string;
  };
  result_summary?: {
    located_pipe?: string;
    simulation_times?: number;
    similarity_mode?: string;
  };
  result_payload?: BurstLocationResult;
}

export interface BurstSchemeRecord {
  scheme_id: number;
  scheme_name: string;
  scheme_type?: string;
  create_time: string;
  scheme_start_time?: string;
  username?: string;
  scheme_detail?: BurstLocationSchemeDetail;
}
