<?php

declare(strict_types=1);

namespace WorkforceOS\Services;

final class DashboardService
{
    public function superAdmin(): array
    {
        return [
            'clients' => [
                'total' => 18,
                'active' => 16,
                'suspended' => 1,
                'trial' => 3,
            ],
            'subscriptions' => [
                'monthly_recurring_revenue' => 1285000,
                'due_invoices' => 4,
                'renewals_next_7_days' => 6,
            ],
            'devices' => [
                'online' => 94,
                'offline' => 8,
            ],
            'live_attendance' => [
                'logs_today' => 18452,
                'present_employees' => 8124,
                'late_today' => 317,
            ],
            'modules' => [
                'payroll' => true,
                'attendance' => true,
                'leave' => true,
                'finance' => true,
                'face_recognition' => true,
                'gps_attendance' => true,
            ],
        ];
    }

    public function client(array $tenant): array
    {
        return [
            'tenant' => $tenant,
            'summary' => [
                'total_employees' => 842,
                'present_today' => 731,
                'absent_today' => 46,
                'leave_today' => 38,
                'holiday_today' => 0,
                'working_on_holiday' => 0,
                'late_in_today' => 27,
                'early_out_today' => 9,
                'late_penalty_today' => 5200,
                'overtime_hours_today' => 186.5,
                'salary_pending' => 74,
                'active_devices' => 14,
            ],
            'tomorrow_holidays' => [
                ['name' => 'Factory Weekly Off', 'branch' => 'Gazipur Plant'],
            ],
            'branch_statistics' => [
                ['branch' => 'Head Office', 'employees' => 164, 'present' => 151, 'late' => 4],
                ['branch' => 'Gazipur Plant', 'employees' => 528, 'present' => 455, 'late' => 19],
                ['branch' => 'Chattogram Depot', 'employees' => 150, 'present' => 125, 'late' => 4],
            ],
            'live_logs' => [
                ['time' => '08:56', 'employee' => 'EMP-1001', 'mode' => 'fingerprint', 'device' => 'F22-HQ-01'],
                ['time' => '09:01', 'employee' => 'EMP-1007', 'mode' => 'face', 'device' => 'UFACE-GZ-02'],
                ['time' => '09:04', 'employee' => 'EMP-1022', 'mode' => 'rfid', 'device' => 'K40-CTG-01'],
            ],
        ];
    }
}
