import { ResPage } from "@/api/interface/index";
import { PORT1 } from "@/api/config/servicePort";
import http from "@/api";

/**
 * @name 客户管理模块
 */

// 跟进列表返回类型
export interface ContactInfo {
  id: number;
  name: string;
  phone: string;
  wechat: string;
  position: string;
}

export interface ResFollowUpList {
  id: number;
  content: string;
  isRemind: boolean;
  nextRemindTime: string;
  createdAt: string;
  contactInfo: ContactInfo;
}

// 获取跟进列表
export const getFollowUpList = (params: any) => {
  return http.get<ResPage<ResFollowUpList>>(PORT1 + `/follow/up`, params);
};
// 新增跟进
export const addFollowUp = (params: any) => {
  return http.post<any>(PORT1 + `/follow/up`, params);
};
// 更新提醒状态
export const updateFollowUpEnable = (params: any) => {
  return http.put<any>(PORT1 + `/follow/up/enable/${params.id}`, params);
};
// 更新提醒状态
export const updateFollowUpCancel = (params: any) => {
  return http.put<any>(PORT1 + `/follow/up/cancel/${params.id}`, params);
};