import { api } from 'src/boot/axios';
import type { EmployeeProfile } from 'src/modules/employee-list/models/employee-profile.models';

export const EmployeeListService = {
    getEmployeeList: async (): Promise<EmployeeProfile[]> => {
        const response = await api.get<{success: boolean, data: EmployeeProfile[], error?: string }>('/employees/employee-list')
        return response.data.data;
    },

    getEmployeeDetails: async (): Promise<EmployeeProfile> => {
        const response = await api.get<{success: boolean, data: EmployeeProfile, error?: string}>('employees/profile');
        return response.data.data;
    },

    getEmployeeDetailsWithEmployeeEmail: async (employee_email: string): Promise<EmployeeProfile> => {
        const response = await api.get<{success: boolean, data: EmployeeProfile, error?: string}>(`employees/profile?employee_email=${employee_email}`);
        return response.data.data;
    }
};