import { api } from './api';
import { EconomicClassificationDTO } from '@/types/budget';

export const economicService = {
    getEconomicClassifications: async (
        type?: 'REVENUE' | 'EXPENSE'
    ): Promise<EconomicClassificationDTO[]> => {
        const params = new URLSearchParams();
        if (type) {
            params.append('type', type);
        }
        const response = await api.get<EconomicClassificationDTO[]>(
            `/budget/economic-classifications?${params.toString()}`
        );
        return response;
    },
};
