import {CreateMedicalPackageValues} from "@/components/forms/medical-packages/new/CreateMedicalPackageForm";
import privateApi from "../http/privateCall.axios";
import { UpdateMedicalPackageFormValues } from "@/components/forms/medical-packages/edit/UpdateMedicalPackageForm";

export async function getAllMedicalPackages(lang: string) {
  return await privateApi
    .get(`/medical-packages/${lang}/get/all`)
    .then((res) => res.data);
}
export async function getAllMedicalPackagesParent(lang: string) {
  return await privateApi
    .get(`/medical-packages/${lang}/get/all/parent`)
    .then((res) => res.data);
}
export async function getSingleMedicalPackage(id: string,lang:string) {
  return await privateApi
    .get(`/medical-packages/${lang}/get/single/${id}`)
    .then((res) => res.data);
}

export async function createMedicalPackage(data: CreateMedicalPackageValues) {
  return await privateApi
    .post("/medical-packages/create", data)
    .then((res) => res.data);
}

export async function updateMedicalPackage(id: string, data:UpdateMedicalPackageFormValues) {
  return await privateApi
    .put(`/medical-packages/update/${id}`, data)
    .then((res) => res.data);
}

export async function deleteMedicalPackage(id: string) {
  return await privateApi
    .delete(`/medical-packages/delete/${id}`)
    .then((res) => res.data);
}
