import { GET, POST, Delete ,PUT} from "@/utils/request";

export const GetTicketList = (data) => {
  return POST("/ticket/page", data, true);
};

export const CreateTicket = (data) => {
  return POST("/ticket", data, true);
};

export const DeleteTicket = (id) => {
  return Delete("/ticket/delete/" + id, {});
};

export const DeleteAllTicket = (data) => {
  return POST("/ticket/delete", data, true);
};

export const GetTicketDetail = (id) => {
  return GET("/ticket/detail/" + id, {});
};

export const GetTicketVehicles = (data) => {
  return POST("/ticket/vehicle/getInfos", data, true);
};

export const UpdateTicketInfo = (data) => {
  return PUT("/ticket/des/"+data.id, {ticketDetail:data.description}, true);
};

export const UpdateTicketVin = (data) => {
  return PUT(`/ticket/vin/${data.id}`, data, true);
};

export const ChangeTicketStatus = (data) => {
  return PUT(`/ticket/${data.id}/status`, {status: data.status},true);
};
