<?php

declare(strict_types=1);

namespace App\SuperAdmin\Infrastructure\Api\Resource;

use ApiPlatform\Metadata\ApiResource;
use ApiPlatform\Metadata\GetCollection;
use App\SuperAdmin\Infrastructure\Api\Provider\MetricsProvider;

#[ApiResource(
    shortName: 'EstablishmentMetrics',
    operations: [
        new GetCollection(
            uriTemplate: '/super-admin/metrics',
            provider: MetricsProvider::class,
            security: "is_granted('ROLE_SUPER_ADMIN')",
            name: 'super_admin_metrics',
        ),
    ],
)]
final class MetricsResource
{
    public string $establishmentId = '';
    public string $name = '';
    public string $status = '';
    public int $userCount = 0;
    public int $studentCount = 0;
    public int $teacherCount = 0;
    public ?string $lastLoginAt = null;
}
