<?php

declare(strict_types=1);

namespace App\Administration\Infrastructure\Api\Resource;

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

#[ApiResource(
    shortName: 'SwitchRole',
    operations: [
        new Post(
            uriTemplate: '/me/switch-role',
            processor: SwitchRoleProcessor::class,
            output: SwitchRoleOutput::class,
            name: 'switch_role',
        ),
    ],
)]
final class SwitchRoleInput
{
    #[Assert\NotBlank(message: 'Le rôle est requis.')]
    public ?string $role = null;
}
