/** 檢舉／申訴列表 API 回傳：/api/report-list */

export interface ResponseReportList {
  status: number
  message: string
  data: ReportListData
}

export interface ReportListData {
  data: ReportListItem[]
  count: number
}

export interface ReportListItem {
  id: string
  reporter_id: string
  target_id: string
  task_id: string
  type: 'report' | 'complaint'
  reason_category: string
  description: string
  evidence_images: unknown
  status: string
  admin_remark: string
  created_at: string
  updated_at: string
  reporter: ReportListUserInfo
  target: ReportListUserInfo
}

/** 列表項中的 reporter / target 簡要資訊（後端可能回傳完整 user 物件，僅列常用欄位） */
export interface ReportListUserInfo {
  id: string
  name: string
  avatar_image: string
  [key: string]: unknown
}

export class ResponseReportListConvert {
  static toMap(json: string): ResponseReportList {
    return JSON.parse(json) as ResponseReportList
  }

  static toJson(obj: ResponseReportList): string {
    return JSON.stringify(obj)
  }
}
