import api from "src/api";

export const getContractsByStudent = async (studentId) => {
  const { data } = await api.get("/student-contract", { params: { student_id: studentId } });
  return data.payload;
};

export const getFranchisorContractSummary = async (unitIds = []) => {
  const { data } = await api.get("/student-contract/franchisor/summary", {
    params: unitIds.length ? { unit_ids: unitIds } : {},
  });
  return data.payload;
};

export const getFranchisorFrozenContracts = async (unitIds = []) => {
  const { data } = await api.get("/student-contract/franchisor/frozen", {
    params: unitIds.length ? { unit_ids: unitIds } : {},
  });
  return data.payload;
};

export const getFranchisorCancelledContracts = async (unitIds = []) => {
  const { data } = await api.get("/student-contract/franchisor/cancelled", {
    params: unitIds.length ? { unit_ids: unitIds } : {},
  });
  return data.payload;
};
