import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { JudgePositionRelationVO, JudgePositionRelationForm, JudgePositionRelationQuery } from '@/api/system/physical/judgePositionRelation/types';

/**
 * 查询裁判职务关联（支持待配置状态）列表
 * @param query
 * @returns {*}
 */
export const listJudgePositionRelation = (query?: JudgePositionRelationQuery): AxiosPromise<JudgePositionRelationVO[]> => {
  return request({
    url: '/physical/judgePositionRelation/list',
    method: 'get',
    params: query
  });
};

/**
 * 查询裁判职务关联（支持待配置状态）详细
 * @param id
 */
export const getJudgePositionRelation = (id: string | number): AxiosPromise<JudgePositionRelationVO> => {
  return request({
    url: '/physical/judgePositionRelation/' + id,
    method: 'get'
  });
};

/**
 * 新增裁判职务关联（支持待配置状态）
 * @param data
 */
export const addJudgePositionRelation = (data: JudgePositionRelationForm) => {
  return request({
    url: '/physical/judgePositionRelation',
    method: 'post',
    data: data
  });
};

/**
 * 修改裁判职务关联（支持待配置状态）
 * @param data
 */
export const updateJudgePositionRelation = (data: JudgePositionRelationForm) => {
  return request({
    url: '/physical/judgePositionRelation',
    method: 'put',
    data: data
  });
};

/**
 * 删除裁判职务关联（支持待配置状态）
 * @param id
 */
export const delJudgePositionRelation = (id: string | number | Array<string | number>) => {
  return request({
    url: '/physical/judgePositionRelation/' + id,
    method: 'delete'
  });
};
export const getSelectPendingJudge = (): AxiosPromise<JudgePositionRelationVO> => {
  return request({
    url: '/physical/judgePositionRelation/selectPendingJudge',
    method: 'get'
  });
};
export const getSelectUseIngByJudge = (): AxiosPromise<JudgePositionRelationVO> => {
  return request({
    url: '/physical/judgePositionRelation/selectUseIngByJudge',
    method: 'get'
  });
};
