// import { CargoType } from "@edr-freight-web/types";
import { api as client } from "../../auth/http";
import { URL_CONSTANTS } from "../../constants/URLS";

export const createCargoType = (data: any) => {
  return client.post(URL_CONSTANTS.RULE_ENGINE.CARGO_TYPES, { data });
};


export const getCargoType = () => {
  return client.get(URL_CONSTANTS.RULE_ENGINE.CARGO_TYPES);
};

export const getCargoTypeById = (id: string) => {
  return client.get(`${URL_CONSTANTS.RULE_ENGINE.CARGO_TYPES}/${id}`);
};

export const updateCargoType = (id: string, data: any) => {
  return client.put(`${URL_CONSTANTS.RULE_ENGINE.CARGO_TYPES}/${id}`, { data });
};


export const deleteCargoType = (id: string) => {
  return client.delete(`${URL_CONSTANTS.RULE_ENGINE.CARGO_TYPES}/${id}`);
};