Merge pull request 'develop' (#14) from develop into main
testing/ogcore-api/pipeline/head This commit looks good Details

Reviewed-on: #14
pull/16/head^2 0.6.1
Manuel Aranda Rosales 2024-11-21 14:57:10 +01:00
commit d11e6e0873
7 changed files with 44 additions and 17 deletions

View File

@ -0,0 +1,31 @@
<?php
declare(strict_types=1);
namespace DoctrineMigrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
/**
* Auto-generated Migration: Please modify to your needs!
*/
final class Version20241121135118 extends AbstractMigration
{
public function getDescription(): string
{
return '';
}
public function up(Schema $schema): void
{
// this up() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE subnet CHANGE next_server next_server VARCHAR(255) DEFAULT NULL, CHANGE boot_file_name boot_file_name VARCHAR(255) DEFAULT NULL');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE subnet CHANGE next_server next_server VARCHAR(255) NOT NULL, CHANGE boot_file_name boot_file_name VARCHAR(255) NOT NULL');
}
}

View File

@ -17,21 +17,21 @@ final class SubnetInput
public ?string $name = null;
#[Assert\NotBlank(message: 'validators.subnet.netmask.not_blank')]
#[Assert\Ip(message: 'validators.subnet.netmask.invalid')]
#[Groups(['subnet:write'])]
#[ApiProperty(description: 'The netmask of the subnet', example: "")]
public ?string $netmask = null;
#[Assert\NotBlank(message: 'validators.subnet.ip_address.not_blank')]
#[Assert\Ip(message: 'validators.subnet.ip_address.invalid')]
#[Groups(['subnet:write'])]
#[ApiProperty(description: 'The ip address of the subnet', example: "")]
public ?string $ipAddress = null;
#[Assert\NotBlank(message: 'validators.subnet.next_server.not_blank')]
#[Groups(['subnet:write'])]
#[ApiProperty(description: 'The next server of the subnet', example: "")]
public ?string $nextServer = null;
#[Assert\NotBlank(message: 'validators.subnet.boot_file_name.not_blank')]
#[Groups(['subnet:write'])]
#[ApiProperty(description: 'The boot file name of the subnet', example: "")]
public ?string $bootFileName = null;

View File

@ -66,7 +66,7 @@ final class ClientOutput extends AbstractOutput
#[Groups(['client:read', 'organizational-unit:read'])]
public ?array $position = ['x' => 0, 'y' => 0];
#[Groups(['client:read'])]
#[Groups(['client:read', 'organizational-unit:read', 'pxe-template:read', 'trace:read', 'subnet:read'])]
public ?string $status = '';
#[Groups(['client:read'])]

View File

@ -22,10 +22,10 @@ final class SubnetOutput extends AbstractOutput
public string $ipAddress;
#[Groups(['subnet:read'])]
public string $nextServer;
public ?string $nextServer = null;
#[Groups(['subnet:read'])]
public string $bootFileName;
public ?string $bootFileName = null;
#[Groups(['subnet:read'])]
public array $clients;

View File

@ -19,10 +19,10 @@ class Subnet extends AbstractEntity
#[ORM\Column(length: 255)]
private ?string $ipAddress = null;
#[ORM\Column(length: 255)]
#[ORM\Column(length: 255, nullable: true)]
private ?string $nextServer = null;
#[ORM\Column(length: 255)]
#[ORM\Column(length: 255, nullable: true)]
private ?string $bootFileName = null;
/**
@ -76,7 +76,7 @@ class Subnet extends AbstractEntity
return $this->nextServer;
}
public function setNextServer(string $nextServer): static
public function setNextServer(?string $nextServer): static
{
$this->nextServer = $nextServer;
@ -88,7 +88,7 @@ class Subnet extends AbstractEntity
return $this->bootFileName;
}
public function setBootFileName(string $bootFileName): static
public function setBootFileName(?string $bootFileName): static
{
$this->bootFileName = $bootFileName;

View File

@ -61,9 +61,7 @@ validators:
not_blank: 'The name should not be blank.'
ip_address:
not_blank: 'The IP should not be blank.'
invalid: 'The IP address {{ value }} is not valid.'
netmask:
not_blank: 'The netmask should not be blank.'
boot_file_name:
not_blank: 'The boot file name should not be blank.'
next_server:
not_blank: 'The next server should not be blank.'
invalid: 'The netmask {{ value }} is not valid.'

View File

@ -56,9 +56,7 @@ validators:
not_blank: 'El nombre no debería estar vacío.'
ip_address:
not_blank: 'La dirección IP no debería estar vacía.'
invalid: 'La dirección IP {{ value }} no es válida.'
netmask:
not_blank: 'La máscara de red no debería estar vacía.'
boot_file_name:
not_blank: 'El nombre del archivo de arranque no debería estar vacío.'
next_server:
not_blank: 'El servidor no debería estar vacío.'
invalid: 'La máscara de red {{ value }} no es válida.'