/**
 * CRM 业务相关的 API 封装
 */

import request from './request'

// ==== 类型声明 ====

export interface LogSubmitData {
    customer_id: string
    content: string
}

// ==== 接口定义 ====

/**
 * 提交客户沟通日志
 * @param data 客户 ID 和沟通内容
 */
export const submitCustomerLog = (data: LogSubmitData): Promise<{ message: string; id: string }> => {
    return request.post('/sales-logs', data)
}

/**
 * 模糊搜索客户（用于远程选择器）
 */
export const searchCustomers = (q: string): Promise<any[]> => {
    return request.get('/customers/search', { params: { q } })
}
