import { apiClient } from '@/lib/api-client';
import type {
  EmployeeImportResponse,
  MasterReviewActionPayload,
  MasterReviewResponse
} from './types';

export async function importEmployees(file: File) {
  const formData = new FormData();
  formData.append('file', file);

  return apiClient<EmployeeImportResponse>('/import-employees', {
    method: 'POST',
    body: formData
  });
}

export async function getMasterReviewItems() {
  return apiClient<MasterReviewResponse>('/master-review');
}

export async function reviewMasterItem(payload: MasterReviewActionPayload) {
  return apiClient<{ success: boolean; message: string }>('/master-review', {
    method: 'PATCH',
    body: JSON.stringify(payload)
  });
}
