import { AccompanyingPeriodWorkEvaluationDocument } from "../../types";
import { makeFetch } from "../../../../../ChillMainBundle/Resources/public/lib/api/apiMethods";

export const duplicate = async (
  id: number,
): Promise<AccompanyingPeriodWorkEvaluationDocument> => {
  return makeFetch<null, AccompanyingPeriodWorkEvaluationDocument>(
    "POST",
    `/api/1.0/person/accompanying-course-work-evaluation-document/${id}/duplicate`,
  );
};

export const duplicateDocumentToEvaluation = async (
  document_id: number,
  evaluation_id: number,
): Promise<AccompanyingPeriodWorkEvaluationDocument> => {
  return makeFetch<null, AccompanyingPeriodWorkEvaluationDocument>(
    "POST",
    `/api/1.0/person/accompanying-course-work-evaluation-document/${document_id}/evaluation/${evaluation_id}/duplicate`,
  );
};

export const moveDocumentToEvaluation = async (
  document_id: number,
  evaluation_id: number,
): Promise<AccompanyingPeriodWorkEvaluationDocument> => {
  return makeFetch<null, AccompanyingPeriodWorkEvaluationDocument>(
    "POST",
    `/api/1.0/person/accompanying-course-work-evaluation-document/${document_id}/evaluation/${evaluation_id}/move`,
  );
};
