import { api } from "src/boot/axios";
import type { TimesheetApprovalCSVReportFilters } from "src/modules/timesheet-approval/models/timesheet-approval-csv-report.models";
import type { PayPeriodOverviewResponse } from "src/modules/timesheet-approval/models/pay-period-overview.models";

export const timesheetApprovalService = {
    getPayPeriodOverviewsBySupervisorEmail: async (year: number, period_number: number, supervisor_email: string): Promise<PayPeriodOverviewResponse> => {
        const response = await api.get(`pay-periods/${year}/${period_number}/${supervisor_email}`);
        return response.data;
    },

    getPayPeriodReportByYearAndPeriodNumber: async (year: number, period_number: number, report_filters?: TimesheetApprovalCSVReportFilters) => {
        const response = await api.get(`csv/${year}/${period_number}`, { params: { report_filters, }});
        return response.data;
    },
};