<?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\RefreshTokenProcessor;

/**
 * API Platform resource for token refresh.
 *
 * The refresh token is read from the HttpOnly cookie, not from the body.
 *
 * @see Story 1.4 - T6: Refresh Token Endpoint
 */
#[ApiResource(
    operations: [
        new Post(
            uriTemplate: '/token/refresh',
            processor: RefreshTokenProcessor::class,
            output: RefreshTokenOutput::class,
            name: 'refresh_token',
            description: 'Uses the refresh token (HttpOnly cookie) to obtain a new JWT. The refresh token is automatically rotated.',
        ),
    ],
)]
final class RefreshTokenInput
{
    // No properties - the refresh token comes from the cookie
}
