import type {
  StaffAttendanceRecordDto,
  StaffAttendanceSummaryDto,
} from '@/shared/types/staffAttendance';
import type {
  StaffAttendanceRecordViewModel,
  StaffAttendanceSummaryViewModel,
} from '@/business/staff-attendance/types';

export function toStaffAttendanceRecordViewModel(
  dto: StaffAttendanceRecordDto,
): StaffAttendanceRecordViewModel {
  return {
    id: dto.id,
    date: dto.date,
    status: dto.status,
    note: dto.note,
    userName: dto.user_name,
    userRole: dto.user_role,
  };
}

export function toStaffAttendanceSummaryViewModel(
  dto: StaffAttendanceSummaryDto,
): StaffAttendanceSummaryViewModel {
  return {
    staffCount: dto.staffCount,
    recordsCount: dto.recordsCount,
    present: dto.present,
    late: dto.late,
    absent: dto.absent,
  };
}
