/**
 * 排队叫号
 */
import request from "@/utils/request.js";

/**
 * 记录获取
 * @param {*} params
 * @returns
 */
export function callRecord(params) {
  return request({
    method: "get",
    url: "/callTable/callRecord",
    params,
  });
}

/**
 * 桌型列表
 * @param {*} params
 * @returns
 */
export function callTable(params) {
  return request({
    method: "get",
    url: "/callTable",
    params,
  });
}

/**
 * 添加桌型
 * @param {*} data
 * @returns
 */
export function addCallTable(data) {
  return request({
    method: data.id ? "put" : "post",
    url: "/callTable",
    data,
  });
}

/**
 * 删除桌型
 * @param {*} data
 * @returns
 */
export function delCallTable(data) {
  return request({
    method: "delete",
    url: "/callTable",
    data,
  });
}

/**
 * 配置信息 获取
 * @param {*} params
 * @returns
 */
export function callTableConfig(params) {
  return request({
    method: "get",
    url: "/callTable/config",
    params,
  });
}

/**
 * 配置信息 修改
 * @param {*} params
 * @returns
 */
export function callTableConfigPut(data) {
  return request({
    method: "put",
    url: "/callTable/config",
    data,
  });
}

/**
 * 取号 排队列表获取
 * @param {*} params
 * @returns
 */
export function callTableQueue(params) {
  return request({
    method: "GET",
    url: "/callTable/queue",
    params,
  });
}

/**
 * 取号 手动取号
 * @param {*} params
 * @returns
 */
export function takeNumber(data) {
  return request({
    method: "post",
    url: "/callTable/takeNumber",
    data,
  });
}

/**
 * 取号 修改叫号状态
 * @param {*} params
 * @returns
 */
export function updateState(data) {
  return request({
    method: "put",
    url: "/callTable/updateState",
    data,
  });
}

/**
 * 通知叫号
 * @param {*} params
 * @returns
 */
export function callTableCall(data) {
  return request({
    method: "post",
    url: "/callTable/call",
    data,
  });
}