// import { Prisma } from "@prisma/client";
// import { LeaveRequestViewDto } from "src/time-and-attendance/leave-requests/leave-request.dto";
// import { LeaveRequestArchiveRow } from "src/time-and-attendance/leave-requests/utils/leave-requests-archive.select";

// const toNum = (value?: Prisma.Decimal | null) => value ? Number(value) : undefined;

// export function mapArchiveRowToView(row: LeaveRequestArchiveRow, email: string, employee_full_name:string): LeaveRequestViewDto {
//     const isoDate = row.date?.toISOString().slice(0, 10);
//     if (!isoDate) {
//         throw new Error(`Leave request #${row.id} has no date set.`);
//     }
//     return {
//         id: row.id,
//         leave_type: row.leave_type,
//         date: isoDate,
//         payable_hours: toNum(row.payable_hours),
//         requested_hours: toNum(row.requested_hours),
//         comment: row.comment,
//         approval_status: row.approval_status,
//         email,
//         employee_full_name,
//     }
// }