<?php

namespace App\Contracts;

use App\Models\FingerprintMachine;

interface FingerprintLocalConnectorInterface
{
    /**
     * Check local connector server health.
     *
     * @return array{success: bool, latency_ms: int, message: string}
     */
    public function health(FingerprintMachine $machine): array;

    /**
     * Get device information from local bridge.
     *
     * @return array{success: bool, device_info: array, message: string}
     */
    public function getDevice(FingerprintMachine $machine): array;

    /**
     * Fetch attendance logs from local bridge.
     *
     * @return array{success: bool, logs: array<\App\DTO\AttendanceEventData>, message: string}
     */
    public function getAttendance(FingerprintMachine $machine): array;

    /**
     * Push personnel to local bridge.
     *
     * @param array<array{id: int, name: string, fingerprint_pin: string, is_admin: bool}> $users
     * @return array{success: bool, count: int, message: string}
     */
    public function pushUsers(FingerprintMachine $machine, array $users): array;

    /**
     * Sync time on local bridge.
     *
     * @return array{success: bool, message: string}
     */
    public function setDeviceTime(FingerprintMachine $machine): array;
}
