import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { FlfViolationForm, FlfViolationQuery, FlfViolationVO } from './types';

/**
 * 新增违规记录
 */
export const addViolation = (data: FlfViolationForm) => {
  return request({
    url: '/fulfiller/violation/add',
    method: 'post',
    data: data
  });
};

/**
 * 根据履约者查询违规记录（分页）
 */
export const listViolationByFulfiller = (query: FlfViolationQuery): AxiosPromise<FlfViolationVO[]> => {
  return request({
    url: '/fulfiller/violation/pageByFulfiller',
    method: 'get',
    params: query
  });
};
