import { requestClient } from '#/api/request';

const prefix = 'salesperson/';

export function getSalespersonList(params: { store_id: number; page?: number; pageSize?: number }) {
  return requestClient.get(`${prefix}list`, { params });
}

export function getCommissionList(params: Record<string, any>) {
  return requestClient.get(`${prefix}commission-list`, { params });
}

export function getCommissionOrderList(params: Record<string, any>) {
  return requestClient.get(`${prefix}commission-order-list`, { params });
}

export function getSettlementPreview(params: Record<string, any>) {
  return requestClient.get(`${prefix}settlement-preview`, { params });
}

export function confirmSettlement(data: Record<string, any>) {
  return requestClient.post(`${prefix}settlement`, data);
}

export function getSettlementList(params: Record<string, any>) {
  return requestClient.get(`${prefix}settlement-list`, { params });
}

export function getSettlementDetail(params: { id: number; store_id: number }) {
  return requestClient.get(`${prefix}settlement-detail`, { params });
}

export function getDrugCommissionList(params: Record<string, any>) {
  return requestClient.get(`${prefix}drug-commission-list`, { params });
}

export function saveDrugCommission(data: Record<string, any>) {
  return requestClient.post(`${prefix}save-drug-commission`, data);
}
