import request from '@/utils/request'
import { PageType, StrAnyObj } from '@/typings'

// 合同分页
export function getPageApi(params: StrAnyObj): Promise<PageType<StrAnyObj>> {
  return request.get('/contractInfo/getPage', params)
}

// 合同明细
export function getDetailApi(params: StrAnyObj): Promise<StrAnyObj> {
  return request.get('/contractInfo/getDetail', params)
}

// 根据资金流水id合同明细
export function getDetailByCapitalTransactionsIdApi(params: StrAnyObj): Promise<StrAnyObj> {
  return request.get('/contractInfo/getDetailByCapitalTransactionsId', params)
}

// 合同新增
export function addApi(data: StrAnyObj): Promise<void> {
  return request.post('/contractInfo/add', data)
}

// 合同编辑
export function editApi(data: StrAnyObj): Promise<void> {
  return request.post('/contractInfo/edit', data)
}

// 合同删除
export function deleteApi(data: StrAnyObj): Promise<void> {
  return request.post('/contractInfo/delete', data)
}