/**
 * KRA - Attachment Category Service
 * Attachment category management APIs
 */
import request from '@/utils/request';

export interface AttachmentCategory {
  ID: number;
  CreatedAt?: string;
  UpdatedAt?: string;
  name: string;
  parentId?: number;
  children?: AttachmentCategory[];
}

// Get category list
export async function getCategoryList() {
  return request.get('/attachmentCategory/getCategoryList');
}

// Add or edit category
export async function addCategory(data: Partial<AttachmentCategory>) {
  return request.post('/attachmentCategory/addCategory', data);
}

// Delete category
export async function deleteCategory(data: { ID: number }) {
  return request.post('/attachmentCategory/deleteCategory', data);
}
