import api from '@/core/api/axios';

export const tealService = {
  upload: (projectId: number, file: File, effectiveDate: string) => {
    const formData = new FormData();
    formData.append('file', file);
    formData.append('effectiveDate', effectiveDate);
    return api.post(`/api/wtm/projects/${projectId}/teal/upload`, formData, { headers: { 'Content-Type': 'multipart/form-data' } });
  },
  getVersions: (projectId: number) => api.get(`/api/wtm/projects/${projectId}/teal/versions`),
  getActive: (projectId: number) => api.get(`/api/wtm/projects/${projectId}/teal/active`),
  getByWbs: (projectId: number, wbsId: number) => api.get(`/api/wtm/projects/${projectId}/teal/by-wbs/${wbsId}`),
};
