<?php

namespace App\Domain\Scraping\Infrastructure\ApiPlatform\Dto;

use ApiPlatform\Metadata\ApiProperty;
use ApiPlatform\Metadata\ApiResource;
use ApiPlatform\Metadata\Post;
use App\Domain\Scraping\Infrastructure\ApiPlatform\State\Processor\ScrapeChapterStateProcessor;
use Symfony\Component\Validator\Constraints as Assert;

#[ApiResource(
    shortName: 'Scraping',
    operations: [
        new Post(
            uriTemplate: '/scraping/chapters',
            status: 202,
            processor: ScrapeChapterStateProcessor::class
        ),
    ]
)]
readonly class ScrapeChapterRequest
{
    public function __construct(
        #[ApiProperty(description: 'ID du chapitre à scraper')]
        #[Assert\NotBlank]
        public string $chapterId,
    ) {
    }
}
