import * as reportClient from "@/client/report.client";
import * as duplicateCheckClient from "@/client/duplicateCheck.client";
import type { ReportCreateRequest, ReportSaveRequest, DuplicateCheckRequest } from "@/types/report.types";

export async function get(id: number): Promise<ReportSaveRequest> {
  const resp = await reportClient.get(id);
  if (!resp.metadata) {
    resp.metadata = [];
  }
  return resp;
}

export async function create(request: ReportCreateRequest): Promise<number> {
  const id = await reportClient.create(request);
  return id;
}

export async function save(reportSaveRequest: ReportSaveRequest) {
  return reportClient.save(reportSaveRequest);
}

export async function updateStatus(id: number){
  return reportClient.updateStatus(id);
}

export async function remove(id: number) {
  return reportClient.remove(id);
}

export function duplicateCheck(duplicateCheckRequest: DuplicateCheckRequest){
  return duplicateCheckClient.duplicateCheck(duplicateCheckRequest);
}
