<?php

declare(strict_types=1);

namespace WorkforceOS\Services;

final class TenantRepository
{
    public function resolve(string $slug): array
    {
        $tenants = $this->tenants();
        return $tenants[$slug] ?? $tenants['acme-industries'];
    }

    public function enabledModules(int $tenantId): array
    {
        return [
            'attendance',
            'payroll',
            'leave',
            'loan',
            'advance_salary',
            'task_management',
            'contract_management',
            'finance',
            'api_access',
            'multi_branch',
            'shift_management',
            'holiday_ot',
        ];
    }

    private function tenants(): array
    {
        return [
            'acme-industries' => [
                'id' => 1,
                'slug' => 'acme-industries',
                'name' => 'Acme Industries Ltd.',
                'status' => 'active',
                'timezone' => 'Asia/Dhaka',
                'currency' => 'BDT',
                'package' => 'Enterprise',
                'limits' => [
                    'branches' => 25,
                    'employees' => 5000,
                    'devices' => 150,
                ],
            ],
        ];
    }
}
