<?php
declare (strict_types=1);

namespace App\ApiResources\Utils;

use ApiPlatform\Metadata\Get;
use ApiPlatform\Metadata\ApiResource;
use ApiPlatform\Metadata\ApiProperty;
use App\ApiResources\ApiResourcesInterface;
use App\State\Provider\Utils\SiretProvider;

/**
 * Classe resource qui contient les champs de vérification d'un siret
 */
#[ApiResource(
    operations: [
        new Get(
            uriTemplate: '/siret-checking/{number}',
            provider: SiretProvider::class
        )
    ]
)]
class Siret implements ApiResourcesInterface
{
    #[ApiProperty(identifier: true)]
    private ?string $number = null;

    private bool $isCorrect = false;

    public function getNumber(): ?string
    {
        return $this->number;
    }

    public function setNumber(?string $number): self
    {
        $this->number = $number;
        return $this;
    }

    public function setIsCorrect(bool $isCorrect): self
    {
        $this->isCorrect = $isCorrect;
        return $this;
    }

    public function getIsCorrect(): bool
    {
        return $this->isCorrect;
    }
}