import request from '@/utils/http/index';
// 资产列表
export const getCreditPage = (params) => {
  return request.get('/Loan/page', params);
};
// 根据id获取资产详情
export const getCredit = (id) => {
  return request.get('/Loan/getById?id=' + id);
};
// 根据借款人查询所有的案件
export const listByBorrower = (id) => {
  return request.get('/Loan/listByBorrower?borrowerId=' + id);
};

// 根据借款人查询所有的跟进记录
export const getTrackRecordPage = (id) => {
  return request.get('/Loan/getTrackRecords?borrowerId=' + id);
};

// 根据借款人查询所有的减免记录
export const getReduces = (id) => {
  return request.get('/Loan/getReduces?borrowerId=' + id);
};

// 根据借款人查询所有的分期记录
export const getByStages = (id) => {
  return request.get('/Loan/getByStages?borrowerId=' + id);
};

// 根据借款人查询所有的还款记录
export const getRepayRecords = (id) => {
  return request.get('/Loan/getRepayRecords?borrowerId=' + id);
};

// 还款申请保存
export const saveRepayRecord = (data) => {
  return request.post('/repayRecord/save', data);
};
// 还款申请列表
export const getRepayRecordPage = (params) => {
  return request.get('/repayRecord/page', params);
};
// 还款申请批量
export const repayRecordFlowStatusByIds = (params) => {
  return request.get('/repayRecord/flowStatusByIds', params);
};

// 减免申请保存
export const saveReduce = (data) => {
  return request.post('/reduce/save', data);
};
// 减免申请列表
export const getReducePage = (params) => {
  return request.get('/reduce/page', params);
};
// 减免申请批量
export const flowStatusByIds = (params) => {
  return request.get('/reduce/flowStatusByIds', params);
};

// 分期申请保存
export const savebyStages = (data) => {
  return request.post('/byStages/save', data);
};
// 分期申请列表
export const getByStagesPage = (params) => {
  return request.get('/byStages/page', params);
};
// 分期申请批量审核
export const byStagesflowStatusByIds = (params) => {
  return request.get('/byStages/flowStatusByIds', params);
};

// 保存案件跟踪记录
export const saveTrackRecord = (data) => {
  return request.post('/TrackRecord/save', data);
};
