/*
 * @Author: zc
 * @description 话务管理 - 通话记录
 */
import request from '@/utils/request';
/**
 * @description 分页通话记录列表
 * @param {object} params
 * @return {*}
 */
export const callLogPaged = (params?: object) => {
	return request({
		url: `/api/v1/IPPbx/calls/call-list`,
		method: 'get',
		params,
	});
};
/**
 * @description 分页通话记录列表导出
 * @param {object} data
 * @return {*}
 */
export const callLogPagedExport = (data: object) => {
	return request({
		url: `/api/v1/IPPbx/calls/call-list/export`,
		method: 'post',
		data,
		responseType: 'blob',
	}, {
		reduce_data_format: false
	});
};
/**
 * @description 分页通话记录基础信息
 * @return {*}
 */
export const callBaseData = () => {
	return request({
		url: `/api/v1/IPPbx/calls/basedata`,
		method: 'get',
	});
};
/**
 * @description 查询可关联工单
 * @param {object} params
 * @return {*}
 */
export const callLogOrder = (params?: object) => {
	return request({
		url: `/api/v1/IPPbx/canlink-order`,
		method: 'get',
		params,
	});
};
/**
 * @description 查询可关联回访
 * @param {object} params
 * @return {*}
 */
export const callLogVisit = (params?: object) => {
	return request({
		url: `/api/v1/IPPbx/canlink-ordervisit`,
		method: 'get',
		params,
	});
};
/**
 * @description 提交关联
 * @param {object} data
 * @return {*}
 */
export const callLogLink = (data: object) => {
	return request({
		url: `/api/v1/IPPbx/link-callrecord`,
		method: 'post',
		data,
	});
};
/**
 * @description 通话记录转写工单 智能应答
 * @param {object} data
 * @return {*}
 */
export const callLogTranscription = (data: object) => {
	return request({
		url: `/api/v1/Call/calls/transliteration`,
		method: 'post',
		data,
	});
};
/**
 * @description 通过通话记录ID获取通话记录详情
 * @param {string} callId
 * @return {*}
 */
export const callLogDetail = (callId: string|number|null|undefined) => {
	return request({
		url: `/api/v1/Call/${callId}`,
		method: 'get',
	});
};
