"use server"

import { getAuthHeaders } from "@/app/actions/config";
import { attendanceService } from "@/services/dashboardService";
import { withServerAction } from "@/lib/server/server-action-wrapper";
import { revalidateTag } from "next/cache";
import { CACHE_TAGS, DEFAULT_CACHE_PROFILE } from "./cache-tags";



export async function fetchUserAttendanceAction(params: any): Promise<{ data: any[], total: number }> {
  return withServerAction(async () => {
    const headers = await getAuthHeaders();
    return await attendanceService.getHistory(params, { headers });
  });
}

export async function fetchAllAttendanceAction(params: any): Promise<{ data: any[], total: number }> {
  return withServerAction(async () => {
    const headers = await getAuthHeaders();
    return await attendanceService.getAllAttendance(params, { headers });
  })
}