import api from '@/core/api/axios';
const BASE = '/api/wtm/approvals';
export const approvalService = {
  getPending: () => api.get(`${BASE}/pending`),
  approve: (id: number, comment?: string) => api.post(`${BASE}/${id}/approve`, { comment }),
  reject: (id: number, comment: string) => api.post(`${BASE}/${id}/reject`, { comment }),
  batchApprove: (ids: number[]) => api.post(`${BASE}/batch-approve`, { ids }),
  addComment: (id: number, comment: string) => api.post(`${BASE}/${id}/comments`, { comment }),
  getById: (id: number) => api.get(`${BASE}/${id}`),
  getHistory: (p?: Record<string, unknown>) => api.get(`${BASE}/history`, { params: p }),
  getOverdue: () => api.get(`${BASE}/overdue`),
};
