import { api } from './api';
import { CareerRegimeDTO } from '@/types/salary';

const BASE_URL = '/rh/career-regimes';

export const careerRegimeService = {
    getAll: async (): Promise<CareerRegimeDTO[]> => {
        return await api.get<CareerRegimeDTO[]>(BASE_URL);
    },
    create: async (data: Partial<CareerRegimeDTO>): Promise<CareerRegimeDTO> => {
        return await api.post<CareerRegimeDTO>(BASE_URL, data);
    },
    update: async (id: string, data: Partial<CareerRegimeDTO>): Promise<CareerRegimeDTO> => {
        return await api.put<CareerRegimeDTO>(`${BASE_URL}/${id}`, data);
    },
    delete: async (id: string): Promise<void> => {
        await api.delete(`${BASE_URL}/${id}`);
    }
};
