<?php

declare(strict_types=1);

namespace App\SuperAdmin\Infrastructure\Api\Resource;

use ApiPlatform\Metadata\ApiResource;
use ApiPlatform\Metadata\Post;
use App\SuperAdmin\Infrastructure\Api\Processor\SwitchTenantProcessor;
use Symfony\Component\Validator\Constraints as Assert;

#[ApiResource(
    shortName: 'SwitchTenant',
    operations: [
        new Post(
            uriTemplate: '/super-admin/switch-tenant',
            processor: SwitchTenantProcessor::class,
            security: "is_granted('ROLE_SUPER_ADMIN')",
            output: false,
            status: 204,
            name: 'super_admin_switch_tenant',
        ),
    ],
)]
final class SwitchTenantInput
{
    #[Assert\NotBlank]
    #[Assert\Uuid]
    public string $tenantId = '';
}
