package com.smartoffice.attendance;

import java.time.Instant;
import java.time.LocalDate;

public record AttendanceDto(
        Long id,
        LocalDate date,
        Instant checkInTime,
        Instant checkOutTime,
        double workHours,
        AttendanceStatus status,
        String location
) {
    public static AttendanceDto from(AttendanceRecord record) {
        return new AttendanceDto(
                record.getId(),
                record.getAttendanceDate(),
                record.getCheckInTime(),
                record.getCheckOutTime(),
                record.getWorkHours(),
                record.getStatus(),
                record.getLocation()
        );
    }
}
