<?php

declare(strict_types=1);

namespace App\Dto\Input;

use ApiPlatform\Metadata\ApiProperty;
use App\Dto\Output\ClientOutput;
use App\Validator\Constraints\ClientsHaveSamePartitionSize;
use Symfony\Component\Serializer\Annotation\Groups;

#[ClientsHaveSamePartitionSize]
class DeployGitImageInput
{
    #[Groups(['git-repository:write'])]
    #[ApiProperty(description: 'The type of the image deployment', example: "")]
    public ?string $type = 'git';

    /**
     * @var ClientOutput[]
     */
    #[Groups(['git-repository:write'])]
    #[ApiProperty(description: 'The clients to deploy the Git image to')]
    public ?array $clients = [];

    #[Groups(['git-repository:write'])]
    #[ApiProperty(description: 'The disk number to deploy to', example: 1)]
    public ?int $diskNumber = null;

    #[Groups(['git-repository:write'])]
    #[ApiProperty(description: 'The partition number to deploy to', example: 1)]
    public ?int $partitionNumber = null;

    #[Groups(['git-repository:write'])]
    #[ApiProperty(description: 'The name of the Git repository', example: "my-git-repo")]
    public ?string $repositoryName = null;

    #[Groups(['git-repository:write'])]
    #[ApiProperty(description: 'The Git branch to deploy', example: "main")]
    public ?string $branch = null;

    #[Groups(['git-repository:write'])]
    #[ApiProperty(description: 'The Git commit hash (hexsha) to deploy', example: "a1b2c3d4e5f6")]
    public ?string $hexsha = null;

    #[Groups(['git-repository:write'])]
    #[ApiProperty(description: 'Whether to queue the deployment', example: false)]
    public bool $queue = false;
} 