<?php

namespace App\Modules\HR\Attendance\Support;

final class AttendanceExceptionDedupeKey
{
    public static function forRecordType(int $tenantId, int $employeeId, ?int $recordId, string $type, string $dayKey): string
    {
        return hash('sha256', $tenantId.'|'.$employeeId.'|'.($recordId ?? 0).'|'.$type.'|'.$dayKey);
    }

    public static function forOverlap(int $tenantId, int $employeeId, int $lowId, int $highId): string
    {
        return hash('sha256', $tenantId.'|'.$employeeId.'|overlap|'.$lowId.'|'.$highId);
    }

    public static function forDuplicatePunch(int $tenantId, string $fingerprintId, string $minuteSlot): string
    {
        return hash('sha256', $tenantId.'|dupfp|'.$fingerprintId.'|'.$minuteSlot);
    }
}
