Files
Mangarr/src/Domain/Setting/Infrastructure/ApiPlatform/Resource/GetContentSourceResource.php
ext.jeremy.guillot@maxicoffee.domains 734dea569c feat(setting): étendre ContentSource avec champs de test et domain model
- Ajouter testSlug, testChapterNumber, baseUrl sur ContentSource (entité, domain model, migration)
- Exposer ces champs dans les Resources, Processors, Providers et Mapper
- Mettre à jour store Pinia, repository API et composants Vue (form, card, liste)
2026-03-16 00:09:19 +01:00

41 lines
1.4 KiB
PHP

<?php
namespace App\Domain\Setting\Infrastructure\ApiPlatform\Resource;
use ApiPlatform\Metadata\ApiResource;
use ApiPlatform\Metadata\Get;
use App\Domain\Setting\Infrastructure\ApiPlatform\State\Provider\GetContentSourceStateProvider;
use Symfony\Component\Validator\Constraints as Assert;
#[ApiResource(
shortName: 'ContentSource',
operations: [
new Get(
uriTemplate: '/content-sources/{id}',
provider: GetContentSourceStateProvider::class,
description: 'Récupère une source de contenu par son identifiant'
)
]
)]
class GetContentSourceResource
{
public function __construct(
#[Assert\NotBlank]
#[Assert\Type('integer')]
public readonly int $id,
public readonly string $baseUrl,
public readonly string $chapterUrlFormat,
public readonly string $scrapingType,
public readonly ?string $imageSelector,
public readonly ?string $nextPageSelector,
public readonly ?string $chapterSelector,
public readonly string $cleanBaseUrl,
public readonly ?string $testSlug = null,
public readonly ?float $testChapterNumber = null,
public readonly string $healthStatus = 'unknown',
public readonly ?\DateTimeImmutable $healthLastTestedAt = null,
public readonly ?string $healthLastError = null,
) {
}
}