import api from '@/core/api/axios';
const BASE = '/api/wtm/projects';
export const projectService = {
  getAll: (params?: Record<string, unknown>) => api.get(BASE, { params }),
  create: (data: unknown) => api.post(BASE, data),
  getById: (id: number) => api.get(`${BASE}/${id}`),
  update: (id: number, data: unknown) => api.put(`${BASE}/${id}`, data),
  getMy: () => api.get(`${BASE}/my`),
  getMembers: (id: number) => api.get(`${BASE}/${id}/members`),
  addMember: (id: number, data: unknown) => api.post(`${BASE}/${id}/members`, data),
  getAssignments: (id: number) => api.get(`${BASE}/${id}/assignments`),
  createAssignment: (id: number, data: unknown) => api.post(`${BASE}/${id}/assignments`, data),
  updateAssignment: (id: number, aid: number, data: unknown) => api.put(`${BASE}/${id}/assignments/${aid}`, data),
  deleteAssignment: (id: number, aid: number) => api.delete(`${BASE}/${id}/assignments/${aid}`),
  getAvailable: (id: number) => api.get(`${BASE}/${id}/assignments/available`),
};
